diff --git a/api/app/lib/controllers/report/index.js b/api/app/lib/controllers/report/index.js
index 59d87750..33344585 100644
--- a/api/app/lib/controllers/report/index.js
+++ b/api/app/lib/controllers/report/index.js
@@ -1,7 +1,7 @@
'use strict';
const { QueryTypes } = require('sequelize');
-async function reportList (ctx) {
+async function reportList(ctx) {
try {
const models = ctx.fs.dc.models;
const { limit, page, startTime, endTime, keyword, userId, reportType, isTop, asc, projectType, handleState = '', performerId = '' } = ctx.query
@@ -43,7 +43,7 @@ async function reportList (ctx) {
where: {
},
- attributes: ['id', 'road', 'time', 'projectType', 'roadSectionStart', 'roadSectionEnd', 'reportType', 'content', 'longitude', 'latitude', 'projectName', 'handleState'],
+ attributes: ['id', 'road', 'time', 'projectType', 'roadSectionStart', 'performerId', 'roadSectionEnd', 'reportType', 'content', 'longitude', 'latitude', 'projectName', 'handleState'],
include: [{
model: models.User,
attributes: ['name']
@@ -114,7 +114,7 @@ async function reportList (ctx) {
}
}
-async function reportPosition (ctx) {
+async function reportPosition(ctx) {
try {
const models = ctx.fs.dc.models;
const { startTime, endTime, userId, reportType } = ctx.query
@@ -164,7 +164,7 @@ async function reportPosition (ctx) {
}
}
-async function reportDetail (ctx) {
+async function reportDetail(ctx) {
try {
const models = ctx.fs.dc.models;
const { reportId } = ctx.params
@@ -186,7 +186,7 @@ async function reportDetail (ctx) {
}
}
-async function reportHandle (ctx) {
+async function reportHandle(ctx) {
try {
const { models } = ctx.fs.dc;
@@ -216,7 +216,7 @@ async function reportHandle (ctx) {
}
}
-async function createReport (ctx) {
+async function createReport(ctx) {
try {
const { userId } = ctx.fs.api
const models = ctx.fs.dc.models;
@@ -238,7 +238,7 @@ async function createReport (ctx) {
}
}
-async function deleteReport (ctx) {
+async function deleteReport(ctx) {
try {
const models = ctx.fs.dc.models;
const { reportId } = ctx.params;
diff --git a/api/app/lib/routes/data/index.js b/api/app/lib/routes/data/index.js
index 27b41684..913ade65 100644
--- a/api/app/lib/routes/data/index.js
+++ b/api/app/lib/routes/data/index.js
@@ -11,7 +11,7 @@ const dataIndex = require('../../controllers/data/index');
const task = require('../../controllers/data/task')
const assess = require('../../controllers/data/assess')
const videoCenter = require('../../controllers/data/videoCenter')
-
+const appointTask = require('../../controllers/data/appointed')
module.exports = function (app, router, opts) {
// 数据导出
@@ -24,7 +24,7 @@ module.exports = function (app, router, opts) {
// 运政
//货运
- async function setFreightType (ctx, next) {
+ async function setFreightType(ctx, next) {
ctx.request.body = {
...(ctx.request.body || {}),
type: 'freight'
@@ -41,7 +41,7 @@ module.exports = function (app, router, opts) {
router.del('/vehicle/freight/:id', setFreightType, vehicle.del);
//客运车
- async function setVehicleType (ctx, next) {
+ async function setVehicleType(ctx, next) {
ctx.request.body = {
...(ctx.request.body || {}),
type: 'vehicle'
@@ -58,7 +58,7 @@ module.exports = function (app, router, opts) {
router.del('/vehicle/:id', setVehicleType, vehicle.del);
// 路政
- async function setRoadManageType (ctx, next) {
+ async function setRoadManageType(ctx, next) {
ctx.request.body = {
...(ctx.request.body || {}),
type: 'road_manage'
@@ -202,4 +202,8 @@ module.exports = function (app, router, opts) {
app.fs.api.logAttr['GET/videoCenter/list'] = { content: '获取萤石设备列表', visible: true };
router.get('/videoCenter/list', videoCenter.videoList(opts));
// 视频中心 END
+ // 指派任务
+ app.fs.api.logAttr['PUT/appointTask'] = { content: '指派任务', visible: true };
+ router.put('/appointTask', appointTask.appoint);
+ // 指派任务 END
};
diff --git a/api/sequelize-automate.config.js b/api/sequelize-automate.config.js
index 4d844600..bc1e2bec 100644
--- a/api/sequelize-automate.config.js
+++ b/api/sequelize-automate.config.js
@@ -27,7 +27,7 @@ module.exports = {
dir: './app/lib/models', // 指定输出 models 文件的目录
typesDir: 'models', // 指定输出 TypeScript 类型定义的文件目录,只有 TypeScript / Midway 等会有类型定义
emptyDir: false, // !!! 谨慎操作 生成 models 之前是否清空 `dir` 以及 `typesDir`
- tables: ['assess'], // 指定生成哪些表的 models,如 ['user', 'user_post'];如果为 null,则忽略改属性
+ tables: ['user_resource'], // 指定生成哪些表的 models,如 ['user', 'user_post'];如果为 null,则忽略改属性
skipTables: [], // 指定跳过哪些表的 models,如 ['user'];如果为 null,则忽略改属性
tsNoCheck: false, // 是否添加 `@ts-nocheck` 注释到 models 文件中
ignorePrefix: [], // 生成的模型名称忽略的前缀,因为 项目中有以下表名是以 t_ 开头的,在实际模型中不需要, 可以添加多个 [ 't_data_', 't_',] ,长度较长的 前缀放前面
diff --git a/scripts/1.2.3/schema/5.alter_resource.sql b/scripts/1.2.3/schema/5.alter_resource.sql
new file mode 100644
index 00000000..7582ee5a
--- /dev/null
+++ b/scripts/1.2.3/schema/5.alter_resource.sql
@@ -0,0 +1,7 @@
+INSERT INTO resource (code, name, parent_resource) VALUES ('VIDEOCENTER', '视频中心', 'ALLSELECT')
+
+INSERT INTO resource (code, name, parent_resource) VALUES ('ASSESSMANAGE', '考核评分', 'ALLSELECT')
+
+INSERT INTO resource (code, name, parent_resource) VALUES ('BUILDINGPROJECT', '在建项目', 'ALLSELECT')
+
+INSERT INTO resource (code, name, parent_resource) VALUES ('WXTODOLIST', '小程序待办事项', 'ALLSELECT')
\ No newline at end of file
diff --git a/weapp/src/packages/patrol/index.jsx b/weapp/src/packages/patrol/index.jsx
index 859da3ab..afefeb99 100644
--- a/weapp/src/packages/patrol/index.jsx
+++ b/weapp/src/packages/patrol/index.jsx
@@ -19,9 +19,8 @@ const Index = () => {
const isSuperAdmin = userInfo && userInfo.username === 'SuperAdmin' ? true : false
const router = useRouter()
- const { params: { type, kind, wait } } = router
+ const { params: { type, kind, wait, handle } } = router
const isView = type === 'view' ? true : false
-
const isPatrol = kind === 'patrol' || kind == 'conserve' ? true : false
const isRoad = kind === 'road' ? true : false
const isAnomaly = kind === 'anomaly' ? true : false
@@ -57,6 +56,7 @@ const Index = () => {
const [handleCenter, setHandleCenter] = useState('')
const [handlePic, setHandlePic] = useState([])
const [handlePicPn, setHandlePicPn] = useState([])
+ const [handleId, setHandleId] = useState([])
const prjType =
isAnomaly ?
@@ -101,11 +101,10 @@ const Index = () => {
checked: false
}
])
-
useEffect(() => {
if (isRoad) {
Taro.setNavigationBarTitle({ title: '在建项目' })
- } else if (wait == 'wait') {
+ } else if (wait == 'wait' || handle == 'handle') {
Taro.setNavigationBarTitle({ title: '待办事项' })
} else if (isAnomaly) {
Taro.setNavigationBarTitle({ title: '异常反馈' })
@@ -141,6 +140,13 @@ const Index = () => {
setConserveBeforePic(data.conserveBeforePic ? data.conserveBeforePic.map(item => ({ url: imgUrl + item })) : [])
setConserveUnderwayPic(data.conserveUnderwayPic ? data.conserveUnderwayPic.map(item => ({ url: imgUrl + item })) : [])
setConserveAfterPic(data.conserveAfterPic ? data.conserveAfterPic.map(item => ({ url: imgUrl + item })) : [])
+ setHandleId(data.id)
+ if (data.handleContent) {
+ setHandleCenter(data.handleContent)
+ }
+ if (data.handlePic.length) {
+ setHandlePic(data.handlePic)
+ }
} else {
Taro.showToast({ title: res.data.message || '请求出错', icon: 'none' })
}
@@ -483,6 +489,11 @@ const Index = () => {
urls: [file.url] // 需要预览的图片http链接列表
})
}
+ function handleImgClicks(index, file) {
+ Taro.previewImage({
+ urls: [file] // 需要预览的图片http链接列表
+ })
+ }
useEffect(() => {
if (!isView) {
let newRoadList = roadList.filter(e => e.routeName.match(road))
@@ -512,15 +523,15 @@ const Index = () => {
return
}
let handlePicList = []
- if(handlePic.length){
- handlePic.forEach(e=>{
+ if (handlePic.length) {
+ handlePic.forEach(e => {
handlePicList.push(e.url)
})
}
let data = {
handleContent: str,
handlePic: handlePicList,
- handleState:'已处理'
+ handleState: '已处理'
}
Taro.showModal({
title: '提示',
@@ -534,7 +545,7 @@ const Index = () => {
Taro.showLoading({
title: '提交中'
})
- request.post(postHandle(userInfo.id), data).then(res => {
+ request.post(postHandle(handleId), data).then(res => {
Taro.hideLoading()
if (res.statusCode == 200 || res.statusCode == 204) {
Taro.showToast({ title: '提交成功', icon: 'none', duration: 1500 })
@@ -545,8 +556,7 @@ const Index = () => {
Taro.showToast({ title: res.data.message || '请求出错', icon: 'none' })
}
}, err => {
- console.log(err);
- Taro.showToast({ title: err.message || '请求出错123', icon: 'none' })
+ Taro.showToast({ title: err.message || '请求出错', icon: 'none' })
})
}
}
@@ -856,36 +866,35 @@ const Index = () => {