Browse Source

feat:历史bug修改加几个菜单冲洗你渲染

dev
zhaobing 1 year ago
parent
commit
0b3ccbe579
  1. 57
      api/app/lib/controllers/report/index.js
  2. 922
      api/app/lib/models/report.js
  3. 5
      api/app/lib/routes/report/index.js
  4. 1
      scripts/1.3.0/schema/4.insert_resource .sql
  5. 5
      scripts/1.3.0/schema/5.update_statistic.sql
  6. 42
      web/client/src/sections/fillion/actions/extract.js
  7. 5
      web/client/src/sections/fillion/actions/index.js
  8. 42
      web/client/src/sections/fillion/components/feedback/nominateModal.js
  9. 131
      web/client/src/sections/fillion/components/feedback/nominateModalcopy.js
  10. 4
      web/client/src/sections/fillion/components/highwaysTable.js
  11. 233
      web/client/src/sections/fillion/components/maintenanceTable.js
  12. 259
      web/client/src/sections/fillion/components/patrolTable.js
  13. 3
      web/client/src/sections/fillion/containers/index.js
  14. 499
      web/client/src/sections/fillion/containers/maintenanceSpotCheck.js
  15. 7
      web/client/src/sections/fillion/nav-item.js
  16. 11
      web/client/src/sections/fillion/routes.js
  17. 2
      web/client/src/sections/organization/containers/authority.js
  18. 3
      web/client/src/utils/webapi.js

57
api/app/lib/controllers/report/index.js

@ -1,7 +1,8 @@
'use strict'; 'use strict';
const { QueryTypes } = require('sequelize'); const { QueryTypes } = require('sequelize');
const moment = require('moment') const moment = require('moment');
async function reportList (ctx) {
async function reportList(ctx) {
try { try {
const models = ctx.fs.dc.models; const models = ctx.fs.dc.models;
const { limit, page, startTime, endTime, keyword, userId, reportType, isTop, asc, projectType, handleState = '', performerId = '', codeRoad } = ctx.query const { limit, page, startTime, endTime, keyword, userId, reportType, isTop, asc, projectType, handleState = '', performerId = '', codeRoad } = ctx.query
@ -43,7 +44,7 @@ async function reportList (ctx) {
where: { where: {
}, },
attributes: ['id', 'road', 'time', 'projectType', 'roadSectionStart', 'performerId', 'roadSectionEnd', 'reportType', attributes: ['id', 'road', 'time', 'projectType', 'roadSectionStart', 'performerId', 'roadSectionEnd', 'reportType', 'address',
'content', 'longitude', 'latitude', 'projectName', 'handleState', 'codeRoad', 'handleContent', 'handlePic', 'videoUrl'], 'content', 'longitude', 'latitude', 'projectName', 'handleState', 'codeRoad', 'handleContent', 'handlePic', 'videoUrl'],
include: [{ include: [{
model: models.User, model: models.User,
@ -78,7 +79,7 @@ async function reportList (ctx) {
} }
} }
if (userId) { if (userId) {
findOption.where.userId = userId findOption.where.userId = { $in: userId.split(',').map(Number) }
} }
if (findUsers.length) { if (findUsers.length) {
findOption.where.userId = { $in: findUsers } findOption.where.userId = { $in: findUsers }
@ -145,7 +146,7 @@ async function reportList (ctx) {
} }
} }
async function reportPosition (ctx) { async function reportPosition(ctx) {
try { try {
const models = ctx.fs.dc.models; const models = ctx.fs.dc.models;
const { startTime, endTime, userId, reportType } = ctx.query const { startTime, endTime, userId, reportType } = ctx.query
@ -195,7 +196,7 @@ async function reportPosition (ctx) {
} }
} }
async function reportDetail (ctx) { async function reportDetail(ctx) {
try { try {
const models = ctx.fs.dc.models; const models = ctx.fs.dc.models;
const { reportId } = ctx.params const { reportId } = ctx.params
@ -217,7 +218,7 @@ async function reportDetail (ctx) {
} }
} }
async function reportHandle (ctx) { async function reportHandle(ctx) {
try { try {
const { models } = ctx.fs.dc; const { models } = ctx.fs.dc;
@ -247,7 +248,7 @@ async function reportHandle (ctx) {
} }
} }
async function createReport (ctx) { async function createReport(ctx) {
try { try {
const { userId } = ctx.fs.api const { userId } = ctx.fs.api
const models = ctx.fs.dc.models; const models = ctx.fs.dc.models;
@ -269,7 +270,7 @@ async function createReport (ctx) {
} }
} }
async function deleteReport (ctx) { async function deleteReport(ctx) {
try { try {
const models = ctx.fs.dc.models; const models = ctx.fs.dc.models;
const { reportId } = ctx.params; const { reportId } = ctx.params;
@ -292,12 +293,11 @@ async function deleteReport (ctx) {
// TODO 小程序填写道路名称的时候的道路筛选 是一起都返回 还是不断传关键字搜索返回 // TODO 小程序填写道路名称的时候的道路筛选 是一起都返回 还是不断传关键字搜索返回
async function spotPrepare (ctx) { async function spotPrepare(ctx) {
try { try {
const { models } = ctx.fs.dc; const { models } = ctx.fs.dc;
const sequelize = ctx.fs.dc.orm; const sequelize = ctx.fs.dc.orm;
const { percentage } = ctx.request.body; const { percentage } = ctx.request.body;
const departmentIdRes = await models.Department.findAll({ const departmentIdRes = await models.Department.findAll({
attributes: ['id', 'name'], attributes: ['id', 'name'],
where: { where: {
@ -365,7 +365,7 @@ async function spotPrepare (ctx) {
} }
} }
async function spotCheck (ctx) { async function spotCheck(ctx) {
const transaction = await ctx.fs.dc.orm.transaction(); const transaction = await ctx.fs.dc.orm.transaction();
try { try {
const { models } = ctx.fs.dc; const { models } = ctx.fs.dc;
@ -442,10 +442,41 @@ async function spotCheck (ctx) {
} }
} }
} }
async function spotCheckDetail(ctx) {
const { models } = ctx.fs.dc
console.log('txc1', ctx.query)
const { startTime, endTime } = ctx.query
try {
const res = await models.ReportSpotCheck.findAll({
include: [{
model: models.Report,
where: { reportType: 'conserve' },//只查养护数据
include: [{
model: models.User,
attributes: ['name']
}]
}],
// offset: pageSize * currentIndex,
// limit: Number(pageSize),
where: { spotDate: { $between: [moment(startTime).format('YYYY-MM-DD'), moment(endTime).format('YYYY-MM-DD')] } },
order: [['id', 'DESC']]
})
ctx.body = res
ctx.status = 200
} catch (error) {
ctx.fs.logger.error(`path: ${ctx.path}, error: error`)
ctx.status = 400
ctx.body = {
message: typeof error == 'string' ? error : undefined
}
}
}
module.exports = { module.exports = {
reportList, reportList,
reportPosition, reportPosition,
reportDetail, createReport, deleteReport, reportHandle, reportDetail, createReport, deleteReport, reportHandle,
spotPrepare, spotCheck, spotPrepare, spotCheck, spotCheckDetail
}; };

922
api/app/lib/models/report.js

@ -3,465 +3,465 @@
'use strict'; 'use strict';
module.exports = dc => { module.exports = dc => {
const DataTypes = dc.ORM; const DataTypes = dc.ORM;
const sequelize = dc.orm; const sequelize = dc.orm;
const Report = sequelize.define("report", { const Report = sequelize.define("report", {
id: { id: {
index: 1, index: 1,
type: DataTypes.INTEGER, type: DataTypes.INTEGER,
allowNull: false, allowNull: false,
defaultValue: null, defaultValue: null,
comment: null, comment: null,
primaryKey: true, primaryKey: true,
field: "id", field: "id",
autoIncrement: true, autoIncrement: true,
unique: "report_id_uindex" unique: "report_id_uindex"
}, },
reportType: { reportType: {
index: 2, index: 2,
type: DataTypes.STRING, type: DataTypes.STRING,
allowNull: false, allowNull: false,
defaultValue: null, defaultValue: null,
comment: "上报类型", comment: "上报类型",
primaryKey: false, primaryKey: false,
field: "report_type", field: "report_type",
autoIncrement: false autoIncrement: false
}, },
projectType: { projectType: {
index: 3, index: 3,
type: DataTypes.STRING, type: DataTypes.STRING,
allowNull: false, allowNull: false,
defaultValue: null, defaultValue: null,
comment: "工程类型", comment: "工程类型",
primaryKey: false, primaryKey: false,
field: "project_type", field: "project_type",
autoIncrement: false autoIncrement: false
}, },
road: { road: {
index: 4, index: 4,
type: DataTypes.STRING, type: DataTypes.STRING,
allowNull: true, allowNull: true,
defaultValue: null, defaultValue: null,
comment: '所属道路', comment: '所属道路',
primaryKey: false, primaryKey: false,
field: "road", field: "road",
autoIncrement: false autoIncrement: false
}, },
roadSectionStart: { roadSectionStart: {
index: 5, index: 5,
type: DataTypes.STRING, type: DataTypes.STRING,
allowNull: true, allowNull: true,
defaultValue: null, defaultValue: null,
comment: '开始路段', comment: '开始路段',
primaryKey: false, primaryKey: false,
field: "road_section_start", field: "road_section_start",
autoIncrement: false autoIncrement: false
}, },
roadSectionEnd: { roadSectionEnd: {
index: 6, index: 6,
type: DataTypes.STRING, type: DataTypes.STRING,
allowNull: true, allowNull: true,
defaultValue: null, defaultValue: null,
comment: '结束路段', comment: '结束路段',
primaryKey: false, primaryKey: false,
field: "road_section_end", field: "road_section_end",
autoIncrement: false autoIncrement: false
}, },
longitude: { longitude: {
index: 7, index: 7,
type: DataTypes.DOUBLE, type: DataTypes.DOUBLE,
allowNull: true, allowNull: true,
defaultValue: null, defaultValue: null,
comment: '经度', comment: '经度',
primaryKey: false, primaryKey: false,
field: "longitude", field: "longitude",
autoIncrement: false autoIncrement: false
}, },
latitude: { latitude: {
index: 8, index: 8,
type: DataTypes.DOUBLE, type: DataTypes.DOUBLE,
allowNull: true, allowNull: true,
defaultValue: null, defaultValue: null,
comment: '纬度', comment: '纬度',
primaryKey: false, primaryKey: false,
field: "latitude", field: "latitude",
autoIncrement: false autoIncrement: false
}, },
content: { content: {
index: 9, index: 9,
type: DataTypes.STRING, type: DataTypes.STRING,
allowNull: true, allowNull: true,
defaultValue: null, defaultValue: null,
comment: '具体内容', comment: '具体内容',
primaryKey: false, primaryKey: false,
field: "content", field: "content",
autoIncrement: false autoIncrement: false
}, },
scenePic: { scenePic: {
index: 10, index: 10,
type: DataTypes.ARRAY(DataTypes.STRING), type: DataTypes.ARRAY(DataTypes.STRING),
allowNull: true, allowNull: true,
defaultValue: null, defaultValue: null,
comment: null, comment: null,
primaryKey: false, primaryKey: false,
field: "scene_pic", field: "scene_pic",
autoIncrement: false autoIncrement: false
}, },
conserveBeforePic: { conserveBeforePic: {
index: 11, index: 11,
type: DataTypes.ARRAY(DataTypes.STRING), type: DataTypes.ARRAY(DataTypes.STRING),
allowNull: true, allowNull: true,
defaultValue: null, defaultValue: null,
comment: null, comment: null,
primaryKey: false, primaryKey: false,
field: "conserve_before_pic", field: "conserve_before_pic",
autoIncrement: false autoIncrement: false
}, },
conserveUnderwayPic: { conserveUnderwayPic: {
index: 12, index: 12,
type: DataTypes.ARRAY(DataTypes.STRING), type: DataTypes.ARRAY(DataTypes.STRING),
allowNull: true, allowNull: true,
defaultValue: null, defaultValue: null,
comment: null, comment: null,
primaryKey: false, primaryKey: false,
field: "conserve_underway_pic", field: "conserve_underway_pic",
autoIncrement: false autoIncrement: false
}, },
conserveAfterPic: { conserveAfterPic: {
index: 13, index: 13,
type: DataTypes.ARRAY(DataTypes.STRING), type: DataTypes.ARRAY(DataTypes.STRING),
allowNull: true, allowNull: true,
defaultValue: null, defaultValue: null,
comment: null, comment: null,
primaryKey: false, primaryKey: false,
field: "conserve_after_pic", field: "conserve_after_pic",
autoIncrement: false autoIncrement: false
}, },
userId: { userId: {
index: 14, index: 14,
type: DataTypes.INTEGER, type: DataTypes.INTEGER,
allowNull: true, allowNull: true,
defaultValue: null, defaultValue: null,
comment: null, comment: null,
primaryKey: false, primaryKey: false,
field: "user_id", field: "user_id",
autoIncrement: false autoIncrement: false
}, },
time: { time: {
index: 15, index: 15,
type: DataTypes.DATE, type: DataTypes.DATE,
allowNull: false, allowNull: false,
defaultValue: null, defaultValue: null,
comment: '创建日期', comment: '创建日期',
primaryKey: false, primaryKey: false,
field: "time", field: "time",
autoIncrement: false autoIncrement: false
}, },
address: { address: {
index: 16, index: 16,
type: DataTypes.STRING, type: DataTypes.STRING,
allowNull: true, allowNull: true,
defaultValue: null, defaultValue: null,
comment: '具体位置', comment: '具体位置',
primaryKey: false, primaryKey: false,
field: "address", field: "address",
autoIncrement: false autoIncrement: false
}, },
projectName: { projectName: {
index: 17, index: 17,
type: DataTypes.STRING, type: DataTypes.STRING,
allowNull: true, allowNull: true,
defaultValue: null, defaultValue: null,
comment: "工程名称", comment: "工程名称",
primaryKey: false, primaryKey: false,
field: "project_name", field: "project_name",
autoIncrement: false autoIncrement: false
}, },
handleState: { handleState: {
index: 18, index: 18,
type: DataTypes.STRING, type: DataTypes.STRING,
allowNull: false, allowNull: false,
defaultValue: "已处理", defaultValue: "已处理",
// comment: "处理状态", // comment: "处理状态",
primaryKey: false, primaryKey: false,
field: "handle_state", field: "handle_state",
autoIncrement: false autoIncrement: false
}, },
codeRoad: { codeRoad: {
type: DataTypes.STRING, type: DataTypes.STRING,
allowNull: true, allowNull: true,
defaultValue: null, defaultValue: null,
comment: null, comment: null,
primaryKey: false, primaryKey: false,
field: "code_road", field: "code_road",
autoIncrement: false autoIncrement: false
}, },
performerId: { performerId: {
type: DataTypes.INTEGER, type: DataTypes.INTEGER,
allowNull: true, allowNull: true,
defaultValue: null, defaultValue: null,
comment: "执行者", comment: "执行者",
primaryKey: false, primaryKey: false,
field: "performer_id", field: "performer_id",
autoIncrement: false autoIncrement: false
}, },
handleContent: { handleContent: {
type: DataTypes.STRING, type: DataTypes.STRING,
allowNull: true, allowNull: true,
defaultValue: null, defaultValue: null,
comment: "", comment: "",
primaryKey: false, primaryKey: false,
field: "handle_content", field: "handle_content",
autoIncrement: false autoIncrement: false
}, },
handlePic: { handlePic: {
type: DataTypes.ARRAY(DataTypes.STRING), type: DataTypes.ARRAY(DataTypes.STRING),
allowNull: true, allowNull: true,
defaultValue: null, defaultValue: null,
comment: null, comment: null,
primaryKey: false, primaryKey: false,
field: "handle_pic", field: "handle_pic",
autoIncrement: false autoIncrement: false
}, },
videoUrl: { videoUrl: {
type: DataTypes.ARRAY(DataTypes.STRING), type: DataTypes.ARRAY(DataTypes.STRING),
allowNull: true, allowNull: true,
defaultValue: null, defaultValue: null,
comment: null, comment: null,
primaryKey: false, primaryKey: false,
field: "video_url", field: "video_url",
autoIncrement: false autoIncrement: false
}, },
roadType: { roadType: {
type: DataTypes.STRING, type: DataTypes.STRING,
allowNull: true, allowNull: true,
defaultValue: null, defaultValue: null,
comment: "路面类型", comment: "路面类型",
primaryKey: false, primaryKey: false,
field: "road_type", field: "road_type",
autoIncrement: false autoIncrement: false
}, },
roadWidth: { roadWidth: {
type: DataTypes.DOUBLE, type: DataTypes.DOUBLE,
allowNull: true, allowNull: true,
defaultValue: null, defaultValue: null,
comment: "路面宽度", comment: "路面宽度",
primaryKey: false, primaryKey: false,
field: "road_width", field: "road_width",
autoIncrement: false autoIncrement: false
}, },
wrongLane: { wrongLane: {
type: DataTypes.DOUBLE, type: DataTypes.DOUBLE,
allowNull: true, allowNull: true,
defaultValue: null, defaultValue: null,
comment: "错车道", comment: "错车道",
primaryKey: false, primaryKey: false,
field: "wrong_lane", field: "wrong_lane",
autoIncrement: false autoIncrement: false
}, },
roadsideTrees: { roadsideTrees: {
type: DataTypes.DOUBLE, type: DataTypes.DOUBLE,
allowNull: true, allowNull: true,
defaultValue: null, defaultValue: null,
comment: "行道树", comment: "行道树",
primaryKey: false, primaryKey: false,
field: "roadside_trees", field: "roadside_trees",
autoIncrement: false autoIncrement: false
}, },
roadsideDitch: { roadsideDitch: {
type: DataTypes.DOUBLE, type: DataTypes.DOUBLE,
allowNull: true, allowNull: true,
defaultValue: null, defaultValue: null,
comment: "边沟", comment: "边沟",
primaryKey: false, primaryKey: false,
field: "roadside_ditch", field: "roadside_ditch",
autoIncrement: false autoIncrement: false
}, },
guardrail: { guardrail: {
type: DataTypes.DOUBLE, type: DataTypes.DOUBLE,
allowNull: true, allowNull: true,
defaultValue: null, defaultValue: null,
comment: "护栏", comment: "护栏",
primaryKey: false, primaryKey: false,
field: "guardrail", field: "guardrail",
autoIncrement: false autoIncrement: false
}, },
roadMarking: { roadMarking: {
type: DataTypes.DOUBLE, type: DataTypes.DOUBLE,
allowNull: true, allowNull: true,
defaultValue: null, defaultValue: null,
comment: "标线", comment: "标线",
primaryKey: false, primaryKey: false,
field: "road_marking", field: "road_marking",
autoIncrement: false autoIncrement: false
}, },
maintenanceStaffCount: { maintenanceStaffCount: {
type: DataTypes.INTEGER, type: DataTypes.INTEGER,
allowNull: true, allowNull: true,
defaultValue: null, defaultValue: null,
comment: "养护人员人数", comment: "养护人员人数",
primaryKey: false, primaryKey: false,
field: "maintenance_staff_count", field: "maintenance_staff_count",
autoIncrement: false autoIncrement: false
}, },
shoulderRepair: { shoulderRepair: {
type: DataTypes.DOUBLE, type: DataTypes.DOUBLE,
allowNull: true, allowNull: true,
defaultValue: null, defaultValue: null,
comment: "修整路肩", comment: "修整路肩",
primaryKey: false, primaryKey: false,
field: "shoulder_repair", field: "shoulder_repair",
autoIncrement: false autoIncrement: false
}, },
ditchCleaning: { ditchCleaning: {
type: DataTypes.DOUBLE, type: DataTypes.DOUBLE,
allowNull: true, allowNull: true,
defaultValue: null, defaultValue: null,
comment: "清理边沟", comment: "清理边沟",
primaryKey: false, primaryKey: false,
field: "ditch_cleaning", field: "ditch_cleaning",
autoIncrement: false autoIncrement: false
}, },
asphaltRepair: { asphaltRepair: {
type: DataTypes.DOUBLE, type: DataTypes.DOUBLE,
allowNull: true, allowNull: true,
defaultValue: null, defaultValue: null,
comment: "修补沥青路面", comment: "修补沥青路面",
primaryKey: false, primaryKey: false,
field: "asphalt_repair", field: "asphalt_repair",
autoIncrement: false autoIncrement: false
}, },
concreteRepair: { concreteRepair: {
type: DataTypes.DOUBLE, type: DataTypes.DOUBLE,
allowNull: true, allowNull: true,
defaultValue: null, defaultValue: null,
comment: "修补水泥路面", comment: "修补水泥路面",
primaryKey: false, primaryKey: false,
field: "concrete_repair", field: "concrete_repair",
autoIncrement: false autoIncrement: false
}, },
grassMowing: { grassMowing: {
type: DataTypes.DOUBLE, type: DataTypes.DOUBLE,
allowNull: true, allowNull: true,
defaultValue: null, defaultValue: null,
comment: "除草", comment: "除草",
primaryKey: false, primaryKey: false,
field: "grass_mowing", field: "grass_mowing",
autoIncrement: false autoIncrement: false
}, },
treeWhitening: { treeWhitening: {
type: DataTypes.DOUBLE, type: DataTypes.DOUBLE,
allowNull: true, allowNull: true,
defaultValue: null, defaultValue: null,
comment: "树刷白", comment: "树刷白",
primaryKey: false, primaryKey: false,
field: "tree_whitening", field: "tree_whitening",
autoIncrement: false autoIncrement: false
}, },
pileWhitening: { pileWhitening: {
type: DataTypes.DOUBLE, type: DataTypes.DOUBLE,
allowNull: true, allowNull: true,
defaultValue: null, defaultValue: null,
comment: "桩刷白", comment: "桩刷白",
primaryKey: false, primaryKey: false,
field: "pile_whitening", field: "pile_whitening",
autoIncrement: false autoIncrement: false
}, },
guardrailMaintenance: { guardrailMaintenance: {
type: DataTypes.DOUBLE, type: DataTypes.DOUBLE,
allowNull: true, allowNull: true,
defaultValue: null, defaultValue: null,
comment: "维护护栏", comment: "维护护栏",
primaryKey: false, primaryKey: false,
field: "guardrail_maintenance", field: "guardrail_maintenance",
autoIncrement: false autoIncrement: false
}, },
endHeadRepair: { endHeadRepair: {
type: DataTypes.DOUBLE, type: DataTypes.DOUBLE,
allowNull: true, allowNull: true,
defaultValue: null, defaultValue: null,
comment: "修复端头", comment: "修复端头",
primaryKey: false, primaryKey: false,
field: "end_head_repair", field: "end_head_repair",
autoIncrement: false autoIncrement: false
}, },
inspectionNoException: { inspectionNoException: {
type: DataTypes.BOOLEAN, type: DataTypes.BOOLEAN,
allowNull: true, allowNull: true,
defaultValue: null, defaultValue: null,
comment: "巡查无异常", comment: "巡查无异常",
primaryKey: false, primaryKey: false,
field: "inspection_no_exception", field: "inspection_no_exception",
autoIncrement: false autoIncrement: false
}, },
roadDamage: { roadDamage: {
type: DataTypes.STRING, type: DataTypes.STRING,
allowNull: true, allowNull: true,
defaultValue: null, defaultValue: null,
comment: "路面损坏", comment: "路面损坏",
primaryKey: false, primaryKey: false,
field: "road_damage", field: "road_damage",
autoIncrement: false autoIncrement: false
}, },
securityDamage: { securityDamage: {
type: DataTypes.STRING, type: DataTypes.STRING,
allowNull: true, allowNull: true,
defaultValue: null, defaultValue: null,
comment: "安防损坏", comment: "安防损坏",
primaryKey: false, primaryKey: false,
field: "security_damage", field: "security_damage",
autoIncrement: false autoIncrement: false
}, },
bridgeDamage: { bridgeDamage: {
type: DataTypes.STRING, type: DataTypes.STRING,
allowNull: true, allowNull: true,
defaultValue: null, defaultValue: null,
comment: "桥梁损坏", comment: "桥梁损坏",
primaryKey: false, primaryKey: false,
field: "bridge_damage", field: "bridge_damage",
autoIncrement: false autoIncrement: false
}, },
culvertDamage: { culvertDamage: {
type: DataTypes.STRING, type: DataTypes.STRING,
allowNull: true, allowNull: true,
defaultValue: null, defaultValue: null,
comment: "涵洞损坏", comment: "涵洞损坏",
primaryKey: false, primaryKey: false,
field: "culvert_damage", field: "culvert_damage",
autoIncrement: false autoIncrement: false
}, },
securityDeficiency: { securityDeficiency: {
type: DataTypes.STRING, type: DataTypes.STRING,
allowNull: true, allowNull: true,
defaultValue: null, defaultValue: null,
comment: "安防缺失", comment: "安防缺失",
primaryKey: false, primaryKey: false,
field: "security_deficiency", field: "security_deficiency",
autoIncrement: false autoIncrement: false
}, },
encounteredEnvironment: { encounteredEnvironment: {
type: DataTypes.STRING, type: DataTypes.STRING,
allowNull: true, allowNull: true,
defaultValue: null, defaultValue: null,
comment: "路遇环境", comment: "路遇环境",
primaryKey: false, primaryKey: false,
field: "encountered_environment", field: "encountered_environment",
autoIncrement: false autoIncrement: false
}, },
otherDescription: { otherDescription: {
type: DataTypes.STRING, type: DataTypes.STRING,
allowNull: true, allowNull: true,
defaultValue: null, defaultValue: null,
comment: "其他描述", comment: "其他描述",
primaryKey: false, primaryKey: false,
field: "other_description", field: "other_description",
autoIncrement: false autoIncrement: false
} }
}, { }, {
tableName: "report", tableName: "report",
comment: "", comment: "",
indexes: [] indexes: []
}); });
dc.models.Report = Report; dc.models.Report = Report;
return Report; return Report;
}; };

5
api/app/lib/routes/report/index.js

@ -29,5 +29,8 @@ module.exports = function (app, router, opts) {
router.post('report/spot/prepare', report.spotPrepare); router.post('report/spot/prepare', report.spotPrepare);
app.fs.api.logAttr['GET/report/spot/check'] = { content: '抽查', visible: false }; app.fs.api.logAttr['GET/report/spot/check'] = { content: '抽查', visible: false };
router.get('report/spot/check', report.spotCheck); router.get('report/spot/check', report.spotCheck)
app.fs.api.logAttr['GET/report/spot/check/detail'] = { content: '抽查明细', visible: false };
router.get('report/spot/check/detail', report.spotCheckDetail)
} }

1
scripts/1.3.0/schema/4.insert_resource .sql

@ -0,0 +1 @@
INSERT INTO resource (code, name, parent_resource) VALUES ('MAINTENANCESPOTCHECK', '养护抽查', 'ALLSELECT')

5
scripts/1.3.0/schema/5.update_statistic.sql

@ -0,0 +1,5 @@
UPDATE statistic SET name = '边沟' WHERE id = 3
UPDATE statistic SET name = '行道树' WHERE id = 6
UPDATE statistic SET name = '错车道' WHERE id = 7

42
web/client/src/sections/fillion/actions/extract.js

@ -0,0 +1,42 @@
'use strict';
import { basicAction } from '@peace/utils'
import { ApiTable } from '$utils'
export function getReportSpotPrepare(data) {
return dispatch => basicAction({
type: 'post',
dispatch: dispatch,
data,
actionType: 'GET_REPORT_SPOT_PREPARE',
url: `${ApiTable.getReportSpotPrepare}`,
msg: { error: '查询随机乡镇失败' },
});
}
export function getSpotCheck(data) {
return dispatch => basicAction({
type: 'get',
query: data,
dispatch: dispatch,
actionType: 'GET_SPOT_CHECK',
url: `${ApiTable.getSpotCheck}`,
msg: { error: '随机抽查失败' },
});
}
export function getSpotCheckDetail(data) {
return dispatch => basicAction({
type: 'get',
query: data,
dispatch: dispatch,
actionType: 'GET_SPOT_CHECK_Detail',
url: `${ApiTable.getSpotCheckDetail}`,
reducer: { name: 'spotCheckDetail' },
msg: { error: '查询随机抽查明细失败' },
});
}

5
web/client/src/sections/fillion/actions/index.js

@ -5,11 +5,12 @@ import * as patrol from './patrol'
import * as file from './file' import * as file from './file'
import * as assess from './assess' import * as assess from './assess'
import * as allDepUsers from './allDepUsers' import * as allDepUsers from './allDepUsers'
import * as getReportSpotPrepare from './extract'
export default { export default {
...infor, ...infor,
...patrol, ...patrol,
...file, ...file,
...assess, ...assess,
...allDepUsers ...allDepUsers,
...getReportSpotPrepare
} }

42
web/client/src/sections/fillion/components/feedback/nominateModal.js

@ -14,28 +14,23 @@ const NominateModal = (props) => {
const { queryData, recordId, visible, user, onCancel, depMessage, loading, depUser, clientHeight, depData, onVisibleChange, dispatch } = props const { queryData, recordId, visible, user, onCancel, depMessage, loading, depUser, clientHeight, depData, onVisibleChange, dispatch } = props
const [depId, setDepId] = useState(null) const [depId, setDepId] = useState(null)
const [depUsers, setDepUsers] = useState() const [depUsers, setDepUsers] = useState()
const selectRef = useRef(null);
const formRef = useRef();
const [selectKey, setSelectKey] = useState(0);
const handleTreeSelectChange = async (value) => { const handleTreeSelectChange = async (value) => {
//console.log('recordId', recordId) //console.log('recordId', recordId)
setDepId(value) setDepId(value)
// 根据选择的部门ID获取对应的用户数据 // 根据选择的部门ID获取对应的用户数据
setDepUsers(null) setDepUsers([])
const res = await dispatch(getDepUser(value)); const res = await dispatch(getDepUser(value));
setDepUsers(res?.payload.data); setDepUsers(res?.payload.data);
//setSelectKey(selectKey + 1) //setSelectKey(selectKey + 1)
// 清空第二个输入框的值 // 清空第二个输入框的值
if (selectRef.current) {
selectRef.current.reset();
}
} }
useEffect(() => { // useEffect(() => {
setSelectKey(selectKey + 1) // setSelectKey(selectKey + 1)
}, [depUsers]) // }, [depUsers])
const handleFinish = async (values) => { const handleFinish = async (values) => {
const { name } = values; const { name } = values;
// 在这里使用第二个框的值进行网络请求或其他操作 // 在这里使用第二个框的值进行网络请求或其他操作
@ -60,13 +55,14 @@ const NominateModal = (props) => {
return ( return (
<Spin spinning={false}> <Spin spinning={false}>
<ModalForm <ModalForm
ref={formRef}
title='指派' title='指派'
visible={visible} visible={visible}
onVisibleChange={onVisibleChange} onVisibleChange={onVisibleChange}
onFinish={handleFinish} onFinish={handleFinish}
destroyOnClose modalProps={{
initialValues={{ departmentId: null, name: null }} destroyOnClose: true,
}}
//initialValues={{ departmentId: null, name: null }}
> >
<ProForm.Group> <ProForm.Group>
<ProFormTreeSelect <ProFormTreeSelect
@ -103,10 +99,10 @@ const NominateModal = (props) => {
}} }}
expandedKeys={["title"]} expandedKeys={["title"]}
/> />
{depUsers && depUsers.length ? <ProFormSelect {depUsers && depUsers.length && depUsers.some(item => item.isAdmin === true) ? <ProFormSelect
key={selectKey} // 改变 key 值 // key={selectKey} // 改变 key 值
ref={selectRef} // ref={selectRef}
value={null} // 设置输入框的值为null // value={null} // 设置输入框的值为null
//onValuesChange={(values) => { console.log('values1', values) }} //onValuesChange={(values) => { console.log('values1', values) }}
name={'name'} name={'name'}
label="指派人" label="指派人"
@ -115,21 +111,17 @@ const NominateModal = (props) => {
const res = await dispatch(getDepUser(depId)); const res = await dispatch(getDepUser(depId));
const copy = res?.payload.data.filter((user) => { const copy = res?.payload.data.filter((user) => {
if (user.isAdmin) { if (user.isAdmin) {
return { return user
label: user.name, // 使用用户的名字作为选项的显示文本
value: user.id, // 使用用户的id作为选项的值
}
} }
} }
) )
let processedUsers = copy.map((item) => { let processedUsers = copy.map((item) => {
return { return {
label: item.name, // 使用用户的名字作为选项的显示文本 label: item.name,
value: item.id, // 使用用户的id作为选项的值 value: item.id,
} }
}) })
console.log('processedUsers', copy)
console.log('processedUsers', processedUsers)
return Promise.resolve(processedUsers) return Promise.resolve(processedUsers)
} }

131
web/client/src/sections/fillion/components/feedback/nominateModalcopy.js

@ -0,0 +1,131 @@
'use strict';
import React, { useState, useEffect, useCallback, useRef } from 'react';
import { connect } from 'react-redux';
import { Spin, TreeSelect, Modal, Form, Select } from 'antd';
import ProForm, { ProFormText, ModalForm, ProFormSwitch, ProFormTreeSelect, ProFormSelect } from '@ant-design/pro-form';
import { getDepUser } from '../../../organization/actions/user'
import { appointTask } from '../../actions/appointTask'
import moment from 'moment';
import { v4 as uuidv4 } from 'uuid';
const NominateModal = (props) => {
const { queryData, recordId, visible, user, onCancel, depMessage, loading, depUser, clientHeight, depData, onVisibleChange, dispatch } = props
const [depId, setDepId] = useState(0)
const [depUsers, setDepUsers] = useState()
// const [value, setValue] = useState(undefined);
const [selectedUserId, setSelectedUserId] = useState(null);
const [form] = Form.useForm();
const handleTreeSelectChange = async (value) => {
setSelectedUserId(null)
setDepId(value)
// 根据选择的部门ID获取对应的用户数据
//setDepUsers([])
const res = await dispatch(getDepUser(value))
const copy = res.payload.data.filter(user => {
if (user.isAdmin) {
return user
}
})
let processedUsers = copy.map((item) => {
return {
label: item.name,
value: item.id,
}
})
setDepUsers(processedUsers)
}
const handleFinish = () => {
form.validateFields().then(values => {
dispatch(appointTask({ recordId: recordId, performerId: values.nameId })).then((res) => {
if (res.success) {
setSelectedUserId(null)
queryData()
onCancel()
setDepUsers([])
form.resetFields()
}
})
})
}
const cancelHandler = () => {
// form.resetFields()
// setDepUsers([])
onCancel()
}
return (
<Spin spinning={false}>
<Modal
title='指派'
visible={visible}
onVisibleChange={onVisibleChange}
onCancel={cancelHandler}
destroyOnClose onOk={handleFinish}>
<Form form={form}>
<div style={{ display: 'flex' }}>
<div style={{ marginRight: 30 }}>
<Form.Item label='部门:' name='departmentId' rules={[{ required: true, message: '请选择部门' }]}>
<TreeSelect
style={{ width: '160px' }}
// value={value}
dropdownStyle={{
maxHeight: 400,
overflow: 'auto',
}}
placeholder="选择部门"
//allowClear
treeDefaultExpandAll={false}
treeData={depData}
onSelect={handleTreeSelectChange}
/>
</Form.Item>
</div>
<div>
<Form.Item label='指派人:' name='nameId' rules={[{ required: true, message: '选择指派人' }]}>
<Select placeholder="请选择指派人" style={{
width: '160px',
}} options={depUsers}
onChange={(value) => setSelectedUserId(value)}
>
</Select>
</Form.Item>
</div>
</div>
</Form>
</Modal>
</Spin>
)
}
function mapStateToProps(state) {
const { auth, depMessage, depUser, global } = state
const pakData = (dep) => {
// console.log(dep);
return dep.map((d) => {
return {
title: d.name,
value: d.id,
// key: d.id,
children: pakData(d.subordinate)
}
})
}
let depData = pakData(depMessage.data || [])
// return {
// loading: depMessage.isRequesting,
// depData,
// };
return {
user: auth.user,
clientHeight: global.clientHeight,
loading: depMessage.isRequesting,
//depMessage: depMessage.data || [],
depUser: depUser.data || [],
depData
}
}
export default connect(mapStateToProps)(NominateModal);

4
web/client/src/sections/fillion/components/highwaysTable.js

@ -316,9 +316,7 @@ const TransporTationTable = (props) => {
} }
setRowSelected([]); setRowSelected([]);
const res = await dispatch(getHighways(query)); const res = await dispatch(getHighways(query));
// console.log(res) setCounts(res.payload.data.filter(item => item.name !== '路牌名'))
setCounts(res.payload.data)
return { return {
...res, ...res,
total: res.payload.data ? res.payload.data.count : 0 total: res.payload.data ? res.payload.data.count : 0

233
web/client/src/sections/fillion/components/maintenanceTable.js

@ -18,6 +18,35 @@ const DetailForm = (props) => {
const { visible, data, handleClose, loading } = props; const { visible, data, handleClose, loading } = props;
const [qndmn] = useState(localStorage.getItem('qndmn')); const [qndmn] = useState(localStorage.getItem('qndmn'));
const keyList = [ const keyList = [
{ key: '道路类型', name: 'reportType' },
{ key: '其他', name: 'projectType' },
{ key: '路线名称', name: 'road' },
{ key: '养护路段', name: 'roadSectionStart' },
{ key: '具体位置', name: 'address' },
{ key: '路面类型', name: 'roadType' },
{ key: '路面宽度', name: 'roadWidth' },
{ key: '错车道', name: 'wrongLane' },
{ key: '行道树', name: 'roadsideTrees' },
{ key: '边沟', name: 'roadsideDitch' },
{ key: '护栏', name: 'guardrail' },
{ key: '标线', name: 'roadMarking' },
{ key: '养护人员人数', name: 'maintenanceStaffCount' },
{ key: '修整路肩', name: 'shoulderRepair' },
{ key: '清理边沟', name: 'ditchCleaning' },
{ key: '修补沥青路面', name: 'asphaltRepair' },
{ key: '修补水泥路面', name: 'concreteRepair' },
{ key: '除草', name: 'grassMowing' },
{ key: '树刷白', name: 'treeWhitening' },
{ key: '桩刷白', name: 'pileWhitening' },
{ key: '维护护栏', name: 'guardrailMaintenance' },
{ key: '修复端头', name: 'endHeadRepair' },
{ key: '其他养护内容', name: 'otherDescription' },
{ key: '养护前图片', name: 'conserveBeforePic' },
{ key: '养护后图片', name: 'conserveAfterPic' },
{ key: '上报视频', name: 'videoUrl' },
];
const keyListOld = [
// { key: '编号', name: 'id' }, // { key: '编号', name: 'id' },
{ key: '工程类型', name: 'projectType' }, { key: '工程类型', name: 'projectType' },
{ key: '所在路段', name: 'road' }, { key: '所在路段', name: 'road' },
@ -30,40 +59,87 @@ const DetailForm = (props) => {
{ key: '养护后', name: 'conserveAfterPic' }, { key: '养护后', name: 'conserveAfterPic' },
]; ];
const renderContent = (data) => { const renderContent = (data) => {
if (data) { if (data) {
return keyList.map(obj => { if (new Date(data.time) > new Date('2023-08-01')) {
return <div style={{ display: 'flex', width: '100%', justifyContent: 'space-between', margin: '12px 0' }}> return keyList.map(obj => {
<span style={{ fontSize: 16, color: 'gray', minWidth: '26%' }}>{obj.key}</span> return <div style={{ display: 'flex', width: '100%', justifyContent: 'space-between', margin: '12px 0' }}>
{ <span style={{ fontSize: 16, color: 'gray', minWidth: '26%' }}>{obj.key}</span>
obj.name != 'scenePic' && obj.name.indexOf('conserve') == -1 ? {
<Input obj.name != 'conserveBeforePic' && obj.name != 'conserveAfterPic' && obj.name != 'roadSectionStart' && obj.name != 'videoUrl' && obj.name.indexOf('conserve') == -1 ?
style={{ width: '70%' }} <Input
value={ style={{ width: '70%' }}
obj.name == 'id' ? value={
moment(data.time).format("YYYYMMDD") * 10000 + data.id obj.name == 'id' ?
: moment(data.time).format("YYYYMMDD") * 10000 + data.id
obj.name == 'projectType' ? :
reportTypeText(data[obj.name]) : obj.name == 'projectType' || obj.name == 'reportType' ?
data[obj.name] reportTypeText(data[obj.name]) : obj.name == 'inspectionNoException' ? changeBoolean(data[obj.name]) :
} data[obj.name]
disabled }
/> disabled
: />
<div style={{ width: '70%', display: 'flex', position: 'relative', flexWrap: 'wrap' }}> : obj.name != 'roadSectionStart' && obj.name != 'videoUrl' ?
{ <div style={{ width: '70%', display: 'flex', position: 'relative', flexWrap: 'wrap' }}>
data[obj.name] && data[obj.name] instanceof Array ? data[obj.name].map(imgSrc => { {
return <div style={{ width: '44%', margin: 6 }}> data[obj.name] && data[obj.name] instanceof Array ? data[obj.name].map(imgSrc => {
<Image src={qndmn + '/' + imgSrc} width={'100%'} style={{ marginBottom: 4 }} /> return <div style={{ width: '44%', margin: 6 }}>
</div> <Image src={qndmn + '/' + imgSrc} width={'100%'} style={{ marginBottom: 4 }} />
}) : '暂无图片' </div>
} }) : '暂无图片'
</div> }
</div> : obj.name != 'videoUrl' ? <div style={{ width: '70%', display: 'flex', position: 'relative', flexWrap: 'wrap' }}>
<Input style={{ width: '100%' }} disabled value={data[obj.name] + '-' + data['roadSectionEnd']} />
</div> : <div style={{ width: '70%', display: 'flex', position: 'relative', flexWrap: 'wrap' }}>
{
data[obj.name] && data[obj.name] instanceof Array ? data[obj.name].map(videoUrl => {
return <div style={{ width: '44%', margin: 6 }}>
<video src={qndmn + '/' + videoUrl} width={'100%'} style={{ marginBottom: 4 }} />
</div>
}) : '暂无视频'
}
</div>
}
</div>
})
} else {
return keyListOld.map(obj => {
return <div style={{ display: 'flex', width: '100%', justifyContent: 'space-between', margin: '12px 0' }}>
<span style={{ fontSize: 16, color: 'gray', minWidth: '26%' }}>{obj.key}</span>
{
obj.name != 'scenePic' && obj.name.indexOf('conserve') == -1 ?
<Input
style={{ width: '70%' }}
value={
obj.name == 'id' ?
moment(data.time).format("YYYYMMDD") * 10000 + data.id
:
obj.name == 'projectType' ?
reportTypeText(data[obj.name]) :
data[obj.name]
}
disabled
/>
:
<div style={{ width: '70%', display: 'flex', position: 'relative', flexWrap: 'wrap' }}>
{
data[obj.name] && data[obj.name] instanceof Array ? data[obj.name].map(imgSrc => {
return <div style={{ width: '44%', margin: 6 }}>
<Image src={qndmn + '/' + imgSrc} width={'100%'} style={{ marginBottom: 4 }} />
</div>
}) : '暂无图片'
}
</div>
}
</div>
})
}
}
</div>
})
} else { } else {
return '暂无数据' return '暂无数据'
} }
@ -113,25 +189,26 @@ const DetailList = (props) => {
let counter = 0; let counter = 0;
const columns = [ const columns = [
// {
// title: '编号',
// key: 'id',
// dataIndex: 'id',
// align: 'center',
// render: (text, record) => {
// let day = moment(record.time).format("YYYYMMDD")
// if (!basicDate) {
// basicDate = day;
// counter += 1;
// } else if (basicDate == day) {
// counter += 1;
// } else if (basicDate != day) {
// basicDate = day;
// counter = 1;
// }
// return moment(record.time).format("YYYYMMDD") * 10000 + counter;
// }
// },
{ {
title: '编号',
key: 'id',
dataIndex: 'id',
align: 'center',
render: (text, record) => {
let day = moment(record.time).format("YYYYMMDD")
if (!basicDate) {
basicDate = day;
counter += 1;
} else if (basicDate == day) {
counter += 1;
} else if (basicDate != day) {
basicDate = day;
counter = 1;
}
return moment(record.time).format("YYYYMMDD") * 10000 + counter;
}
}, {
title: '工程类型', title: '工程类型',
key: 'projectType', key: 'projectType',
dataIndex: 'projectType', dataIndex: 'projectType',
@ -154,9 +231,9 @@ const DetailList = (props) => {
} }
}, },
{ {
title: '具体内容', title: '具体位置',
key: 'content', key: 'address',
dataIndex: 'content', dataIndex: 'address',
align: 'center' align: 'center'
}, },
{ {
@ -457,13 +534,13 @@ const PatrolNameList = (props) => {
const MaintenanceTable = (props) => { const MaintenanceTable = (props) => {
const { userList, user, reportList, dispatch, reportListLoading, reportDetail, reportDetailLoading, userLoading, exports, depMessage, depUser, clientHeight } = props; const { userList, user, reportList, dispatch, allDepUsers, reportListLoading, reportDetail, reportDetailLoading, userLoading, exports, depMessage, depUser, clientHeight } = props;
const [record, setRecord] = useState(1); const [record, setRecord] = useState(1);
const [dateRange, setDateRange] = useState(); const [dateRange, setDateRange] = useState();
const [detailVisible, setDetailVisible] = useState(false) const [detailVisible, setDetailVisible] = useState(false)
const { RangePicker } = DatePicker; const { RangePicker } = DatePicker;
// console.log('allDepUsers', allDepUsers)
useEffect(() => { useEffect(() => {
queryData() queryData()
}, []) }, [])
@ -479,30 +556,33 @@ const MaintenanceTable = (props) => {
// if (record) { // if (record) {
queryData() queryData()
// } // }
}, [record, dateRange]) }, [record, dateRange, allDepUsers, user])
const queryData = () => { const queryData = () => {
let userId = null if (allDepUsers && allDepUsers.length && user) {
if (user?.username === 'SuperAdmin' && record === 1) { //console.log('ssssss',)
userId = undefined const userL = allDepUsers.find(item => item.depId === user.departmentId)?.users?.map(child => { return child.id })
} else if (user?.username === 'SuperAdmin' && record !== 1) { let userId = null
userId = record if (user?.username === 'SuperAdmin' && record === 1) {
} else if (user?.username !== 'SuperAdmin' && record === 1) { userId = undefined
userId = user?.id } else if (user?.username !== 'SuperAdmin' && record === 1) {
} else if (user?.username !== 'SuperAdmin' && record !== 1) { userId = userL && userL.length ? userL + '' : undefined
userId = record } else {
} userId = record
//: user?.username === 'SuperAdmin' && record === 1 ? record?.id : record ? record : user?.id }
let query = {
userId, //: user?.username === 'SuperAdmin' && record === 1 ? record?.id : record ? record : user?.id
reportType: 'conserve', let query = {
asc: true userId,
} reportType: 'conserve',
if ((dateRange && dateRange instanceof Array && dateRange[0] != '')) { asc: true
query.startTime = moment(dateRange[0]).startOf('day').format('YYYY-MM-DD HH:mm:ss') }
query.endTime = moment(dateRange[1]).endOf('day').format('YYYY-MM-DD HH:mm:ss') if ((dateRange && dateRange instanceof Array && dateRange[0] != '')) {
query.startTime = moment(dateRange[0]).startOf('day').format('YYYY-MM-DD HH:mm:ss')
query.endTime = moment(dateRange[1]).endOf('day').format('YYYY-MM-DD HH:mm:ss')
}
dispatch(getReportList(query))
} }
dispatch(getReportList(query));
} }
const handleClose = () => { const handleClose = () => {
@ -560,7 +640,7 @@ const MaintenanceTable = (props) => {
}; };
function mapStateToProps(state) { function mapStateToProps(state) {
const { auth, depMessage, userList, reportList, reportDetail, depUser, global } = state; const { auth, depMessage, userList, reportList, reportDetail, depUser, global, allDepUsers } = state;
const pakData = (dep) => { const pakData = (dep) => {
return dep.map((d) => { return dep.map((d) => {
return { return {
@ -584,6 +664,7 @@ function mapStateToProps(state) {
reportDetail: reportDetail.data, reportDetail: reportDetail.data,
reportDetailLoading: reportDetail.isRequesting, reportDetailLoading: reportDetail.isRequesting,
depUser: depUser.data || [], depUser: depUser.data || [],
allDepUsers: allDepUsers.data || []
}; };
} }

259
web/client/src/sections/fillion/components/patrolTable.js

@ -13,6 +13,7 @@ import NominateModal from '../components/feedback/nominateModal' //指派的模
// @ts-ignore // @ts-ignore
import styles from './protable.less'; import styles from './protable.less';
import moment from 'moment'; import moment from 'moment';
import NominateModalcopy from './feedback/nominateModalcopy';//指派的模块
export const reportTypeText = (text) => { export const reportTypeText = (text) => {
switch (text) { switch (text) {
@ -39,6 +40,39 @@ const DetailForm = (props) => {
const [qndmn] = useState(localStorage.getItem('qndmn')); const [qndmn] = useState(localStorage.getItem('qndmn'));
const keyList = [ const keyList = [
// { key: '编号', name: 'id' },
// isPatrol ?'巡查管理详情' :isRoad ? '建设上报详情' : '异常反馈详情'
{ key: '工程类型', name: 'projectType', skip: isPatrol },
{ key: '反馈类型', name: 'projectType', skip: !isAnomaly },
{ key: '工程名称', name: 'projectName', skip: !isRoad },
{ key: '所在路段', name: 'road', skip: isPatrol },
{ key: '具体位置', name: 'address', skip: isPatrol },
{ key: '巡查内容', name: 'content', skip: isPatrol },
{ key: '路线代码', name: 'codeRoad', skip: !isAnomaly && isPatrol },
{ key: '现场照片', name: 'scenePic', skip: isPatrol },
{ key: '处理详情', name: 'handleContent', skip: !isAnomaly },
{ key: '处理图片', name: 'handlePic', skip: !isAnomaly },
{ key: '处理人', name: 'performerName', skip: !isAnomaly },
{ key: '道路类型', name: 'reportType', skip: !isPatrol },
{ key: '其他', name: 'projectType', skip: !isPatrol },
{ key: '路线名称', name: 'road', skip: !isPatrol },
{ key: '巡查路段', name: 'roadSectionStart', skip: !isPatrol },
{ key: '具体位置', name: 'address', skip: !isPatrol },
{ key: '是否有异常', name: 'inspectionNoException', skip: !isPatrol },
// insectionNoException
{ key: '路面损坏', name: 'roadDamage', skip: !isPatrol },
{ key: '安防损坏', name: 'securityDamage', skip: !isPatrol },
{ key: '桥梁损坏', name: 'bridgeDamage', skip: !isPatrol },
{ key: '涵洞损坏', name: 'culvertDamage', skip: !isPatrol },
{ key: '安防缺失', name: 'ecurityDeficiency', skip: !isPatrol },
{ key: '路域环境', name: 'encounteredEnvironment', skip: !isPatrol },
{ key: '其他内容', name: 'otherDescription', skip: !isPatrol },
//{ key: '路线代码', name: 'codeRoad', skip: !isPatrol },
{ key: '上报图片', name: 'scenePic', skip: !isPatrol },
{ key: '上报视频', name: 'videoUrl', skip: !isPatrol },
];
const keyListOld = [
// { key: '编号', name: 'id' }, // { key: '编号', name: 'id' },
// isPatrol ?'巡查管理详情' :isRoad ? '建设上报详情' : '异常反馈详情' // isPatrol ?'巡查管理详情' :isRoad ? '建设上报详情' : '异常反馈详情'
{ key: '工程类型', name: 'projectType', skip: !isPatrol }, { key: '工程类型', name: 'projectType', skip: !isPatrol },
@ -54,47 +88,103 @@ const DetailForm = (props) => {
{ key: '处理人', name: 'performerName', skip: !isAnomaly } { key: '处理人', name: 'performerName', skip: !isAnomaly }
]; ];
const changeBoolean = (bool) => {
//console.log('bool', bool)
return bool ? '无异常' : '有异常'
}
const renderContent = (data) => { const renderContent = (data) => {
if (data) { if (data) {
// Object.keys(data).map(key => { // Object.keys(data).map(key => {
// }) // })
return keyList.map(obj => { if ((new Date(data.time + '') > new Date('2023-8-1'))) {
return (
obj.skip ? null : return keyList.map(obj => {
<div style={{ display: 'flex', width: '100%', justifyContent: 'space-between', margin: '12px 0' }}> return (
<span style={{ fontSize: 16, color: 'gray', minWidth: '26%' }}>{obj.key}</span> obj.skip ? null :
{ <div style={{ display: 'flex', width: '100%', justifyContent: 'space-between', margin: '12px 0' }}>
obj.name != 'scenePic' && obj.name != 'handlePic' ? <span style={{ fontSize: 16, color: 'gray', minWidth: '26%' }}>{obj.key}</span>
<Input {
style={{ width: '70%' }} obj.name != 'scenePic' && obj.name != 'roadSectionStart' && obj.name != 'videoUrl' && obj.name.indexOf('conserve') == -1 ?
value={ <Input
obj.name == 'id' ? style={{ width: '70%' }}
moment(data.time).format("YYYYMMDD") * 10000 + data.id value={
: obj.name == 'id' ?
obj.name == 'projectType' ? moment(data.time).format("YYYYMMDD") * 10000 + data.id
reportTypeText(data[obj.name]) : :
data[obj.name] || null obj.name == 'projectType' || obj.name == 'reportType' ?
} reportTypeText(data[obj.name]) : obj.name == 'inspectionNoException' ? changeBoolean(data[obj.name]) :
disabled data[obj.name]
/> }
: disabled
<div style={{ width: '70%', display: 'flex', position: 'relative', flexWrap: 'wrap' }}> />
{ : obj.name != 'roadSectionStart' && obj.name != 'videoUrl' ?
data[obj.name] && data[obj.name] instanceof Array ? data[obj.name].map(imgSrc => { <div style={{ width: '70%', display: 'flex', position: 'relative', flexWrap: 'wrap' }}>
return <div style={{ width: '44%', margin: 6 }}> {
<Image src={qndmn + '/' + imgSrc} width={'100%'} style={{ marginBottom: 4 }} /> data[obj.name] && data[obj.name] instanceof Array ? data[obj.name].map(imgSrc => {
</div> return <div style={{ width: '44%', margin: 6 }}>
}) <Image src={qndmn + '/' + imgSrc} width={'100%'} style={{ marginBottom: 4 }} />
: '暂无图片' </div>
} }) : '暂无图片'
</div> }
</div> : obj.name != 'videoUrl' ? <div style={{ width: '70%', display: 'flex', position: 'relative', flexWrap: 'wrap' }}>
<Input style={{ width: '100%' }} disabled value={data[obj.name] + '-' + data['roadSectionEnd']} />
</div> : <div style={{ width: '70%', display: 'flex', position: 'relative', flexWrap: 'wrap' }}>
{
data[obj.name] && data[obj.name] instanceof Array ? data[obj.name].map(videoUrl => {
return <div style={{ width: '44%', margin: 6 }}>
<video src={qndmn + '/' + videoUrl} width={'100%'} style={{ marginBottom: 4 }} />
</div>
}) : '暂无视频'
}
</div>
}
</div>
)
})
} else {
return keyListOld.map(obj => {
return (
obj.skip ? null :
<div style={{ display: 'flex', width: '100%', justifyContent: 'space-between', margin: '12px 0' }}>
<span style={{ fontSize: 16, color: 'gray', minWidth: '26%' }}>{obj.key}</span>
{
obj.name != 'scenePic' && obj.name != 'handlePic' ?
<Input
style={{ width: '70%' }}
value={
obj.name == 'id' ?
moment(data.time).format("YYYYMMDD") * 10000 + data.id
:
obj.name == 'projectType' ?
reportTypeText(data[obj.name]) :
data[obj.name] || null
}
disabled
/>
:
<div style={{ width: '70%', display: 'flex', position: 'relative', flexWrap: 'wrap' }}>
{
data[obj.name] && data[obj.name] instanceof Array ? data[obj.name].map(imgSrc => {
return <div style={{ width: '44%', margin: 6 }}>
<Image src={qndmn + '/' + imgSrc} width={'100%'} style={{ marginBottom: 4 }} />
</div>
})
: '暂无图片'
}
</div>
}
</div>
)
})
}
}
</div>
)
})
} else { } else {
return '暂无数据' return '暂无数据'
} }
} }
@ -151,27 +241,26 @@ const DetailList = (props) => {
let basicDate = null; let basicDate = null;
let counter = 0; let counter = 0;
//指派任务 //指派任务
console.log('vis', vis)
const columns = [ const columns = [
isPatrol ? { // isPatrol ? {
title: '编号', // title: '编号1',
key: 'id', // key: 'id',
dataIndex: 'id', // dataIndex: 'id',
align: 'center', // align: 'center',
render: (text, record) => { // render: (text, record) => {
let day = moment(record.time).format("YYYYMMDD") // let day = moment(record.time).format("YYYYMMDD")
if (!basicDate) { // if (!basicDate) {
basicDate = day; // basicDate = day;
counter += 1; // counter += 1;
} else if (basicDate == day) { // } else if (basicDate == day) {
counter += 1; // counter += 1;
} else if (basicDate != day) { // } else if (basicDate != day) {
basicDate = day; // basicDate = day;
counter = 1; // counter = 1;
} // }
return moment(record.time).format("YYYYMMDD") * 10000 + counter; // return moment(record.time).format("YYYYMMDD") * 10000 + counter;
} // }
} : '', // } : '',
isPatrol || isAnomaly ? isPatrol || isAnomaly ?
{ {
title: isPatrol ? '工程类型' : '反馈类型', title: isPatrol ? '工程类型' : '反馈类型',
@ -222,9 +311,9 @@ const DetailList = (props) => {
} }
} : '', } : '',
{ {
title: '具体内容', title: '具体位置',
key: 'content', key: 'address',
dataIndex: 'content', dataIndex: 'address',
align: 'center' align: 'center'
}, },
{ {
@ -314,7 +403,8 @@ const DetailList = (props) => {
toolBarRender={false} toolBarRender={false}
search={false} search={false}
/> />
<NominateModal queryData={queryData} hanldeChange={setBtnVis} recordId={recordId} dispatch={dispatch} visible={vis} onCancel={onCancel} onVisibleChange={setVis}></NominateModal> {/* <NominateModal queryData={queryData} hanldeChange={setBtnVis} recordId={recordId} dispatch={dispatch} visible={vis} onCancel={onCancel} onVisibleChange={setVis}></NominateModal> */}
<NominateModalcopy queryData={queryData} hanldeChange={setBtnVis} recordId={recordId} dispatch={dispatch} visible={vis} onCancel={onCancel} onVisibleChange={setVis}></NominateModalcopy>
</div> </div>
) )
}; };
@ -498,7 +588,6 @@ const PatrolNameList = (props) => {
if (selected) { if (selected) {
if (selectedKeys[0].split("-").length - 1 >= 2) { if (selectedKeys[0].split("-").length - 1 >= 2) {
let id = selectedKeys[0].split('-')[selectedKeys[0].split('-').length - 1] let id = selectedKeys[0].split('-')[selectedKeys[0].split('-').length - 1]
console.log('id1', id)
onChange(id); onChange(id);
} }
@ -587,7 +676,7 @@ const PatrolNameList = (props) => {
const PatrolTable = (props) => { const PatrolTable = (props) => {
const { clientHeight, user, userList, reportList, dispatch, reportListLoading, reportDetail, reportDetailLoading, userLoading, exports, pathname } = props; const { allDepUsers, clientHeight, user, userList, reportList, dispatch, reportListLoading, reportDetail, reportDetailLoading, userLoading, exports, pathname } = props;
const [record, setRecord] = useState(1); const [record, setRecord] = useState(1);
const [dateRange, setDateRange] = useState(); const [dateRange, setDateRange] = useState();
const [selectProjectType, setSelectProjectType] = useState(''); const [selectProjectType, setSelectProjectType] = useState('');
@ -599,11 +688,9 @@ const PatrolTable = (props) => {
const isAnomaly = pathname.includes('anomaly') const isAnomaly = pathname.includes('anomaly')
const isPatrol = !isRoad && !isAnomaly const isPatrol = !isRoad && !isAnomaly
const reportType = isRoad ? 'road' : isAnomaly ? 'anomaly' : 'patrol'; const reportType = isRoad ? 'road' : isAnomaly ? 'anomaly' : 'patrol';
useEffect(() => { useEffect(() => {
queryData(); queryData();
}, []) }, [])
useEffect(() => { useEffect(() => {
if (userList && userList instanceof Array && reportDetail && reportDetail instanceof Object) { if (userList && userList instanceof Array && reportDetail && reportDetail instanceof Object) {
setReportDetailCopy(Object.assign(reportDetail, { performerName: userList.find(item => item.id === reportDetail.performerId)?.name })) setReportDetailCopy(Object.assign(reportDetail, { performerName: userList.find(item => item.id === reportDetail.performerId)?.name }))
@ -611,32 +698,31 @@ const PatrolTable = (props) => {
}, [userList, reportDetail]) }, [userList, reportDetail])
useEffect(() => { useEffect(() => {
queryData(); queryData()
}, [record, dateRange, selectProjectType]) }, [dateRange, selectProjectType, allDepUsers, user, record])
const queryData = () => { const queryData = () => {
//console.log(record, 'idididid') if (allDepUsers && allDepUsers.length && user) {
let userId = null const userL = allDepUsers.find(item => item.depId === user.departmentId)?.users?.map(child => { return child.id })
if (user?.username === 'SuperAdmin' && record === 1) { let userId = null
userId = undefined if (user?.username === 'SuperAdmin' && record === 1) {
} else if (user?.username === 'SuperAdmin' && record !== 1) { userId = undefined
userId = record } else if (user?.username !== 'SuperAdmin' && record === 1) {
} else if (user?.username !== 'SuperAdmin' && record === 1) { userId = userL && userL.length ? userL + '' : undefined
userId = user?.id } else {
} else if (user?.username !== 'SuperAdmin' && record !== 1) { userId = record
userId = record }
} let query = {
// user?.username === 'SuperAdmin' && record === 1 ? record?.id : record ? record : user?.id, userId,
let query = { reportType: reportType, projectType: selectProjectType, asc: true
userId, }
reportType: reportType, projectType: selectProjectType, asc: true if ((dateRange && dateRange instanceof Array && dateRange[0] != '')) {
} query.startTime = moment(dateRange[0]).startOf('day').format('YYYY-MM-DD HH:mm:ss')
//console.log(query, 'query1') query.endTime = moment(dateRange[1]).endOf('day').format('YYYY-MM-DD HH:mm:ss')
if ((dateRange && dateRange instanceof Array && dateRange[0] != '')) { }
query.startTime = moment(dateRange[0]).startOf('day').format('YYYY-MM-DD HH:mm:ss') dispatch(getReportList(query))
query.endTime = moment(dateRange[1]).endOf('day').format('YYYY-MM-DD HH:mm:ss')
} }
dispatch(getReportList(query));
} }
useEffect(() => { useEffect(() => {
@ -764,7 +850,7 @@ const PatrolTable = (props) => {
}; };
function mapStateToProps(state) { function mapStateToProps(state) {
const { auth, depMessage, userList, reportList, reportDetail, global } = state; const { auth, depMessage, userList, reportList, reportDetail, global, allDepUsers } = state;
const pakData = (dep) => { const pakData = (dep) => {
return dep.map((d) => { return dep.map((d) => {
return { return {
@ -776,6 +862,7 @@ function mapStateToProps(state) {
} }
let depData = pakData(depMessage.data || []) let depData = pakData(depMessage.data || [])
return { return {
allDepUsers: allDepUsers.data || [],
user: auth.user, user: auth.user,
depMessage: depMessage.data || [], depMessage: depMessage.data || [],
depLoading: depMessage.isRequesting, depLoading: depMessage.isRequesting,

3
web/client/src/sections/fillion/containers/index.js

@ -17,9 +17,10 @@ import Task from './task'
import Assess from './assess' import Assess from './assess'
import VideoCenter from './videoCenter'; import VideoCenter from './videoCenter';
import Building from './building' import Building from './building'
import MaintenanceSpotCheck from './maintenanceSpotCheck'
export { export {
Infor, transportation, BridgeTable, HigHways, Infor, transportation, BridgeTable, HigHways,
OperaTional, Enforce, Public, Videois, PromoTional, OperaTional, Enforce, Public, Videois, PromoTional,
Maintenance, Patrol, File, Jiekouguanli, Maintenance, Patrol, File, Jiekouguanli,
Task, Building, Assess, VideoCenter Task, Building, Assess, VideoCenter, MaintenanceSpotCheck
}; };

499
web/client/src/sections/fillion/containers/maintenanceSpotCheck.js

@ -0,0 +1,499 @@
import { connect } from 'react-redux';
import React, { useEffect, useState } from 'react';
import { Button, Modal, Form, Input, Divider, Spin, Image, DatePicker } from 'antd'
import ProTable from '@ant-design/pro-table';
import { getReportSpotPrepare, getSpotCheck, getSpotCheckDetail } from '../actions/extract'
import { getReportDetail } from '../actions/patrol';
import moment from 'moment'
const DetailForm = (props) => {
const { visible, data, handleClose, loading } = props
//console.log('data1', data)
const [qndmn] = useState(localStorage.getItem('qndmn'))
const changeBoolean = (bool) => {
// console.log('bool', bool)
return bool ? '无异常' : '有异常'
}
const reportTypeText = (text) => {
switch (text) {
case 'road': return '道路';
//
case 'countyRoad': return '县道';
case 'villageRoad': return '乡道';
case 'rusticRoad': return '村道';
//
case 'bridge': return '桥梁';
case 'culvert': return '涵洞';
case 'other': return '其他';
//
case 'conserve': return '养护';
case 'patrol': return '巡查';
case 'construction': return '在建';
default: return text;
}
}
const keyList = [
{ key: '道路类型', name: 'reportType' },
{ key: '其他', name: 'projectType' },
{ key: '路线名称', name: 'road' },
{ key: '养护路段', name: 'roadSectionStart' },
{ key: '具体位置', name: 'address' },
{ key: '路面类型', name: 'roadType' },
{ key: '路面宽度', name: 'roadWidth' },
{ key: '错车道', name: 'wrongLane' },
{ key: '行道树', name: 'roadsideTrees' },
{ key: '边沟', name: 'roadsideDitch' },
{ key: '护栏', name: 'guardrail' },
{ key: '标线', name: 'roadMarking' },
{ key: '养护人员人数', name: 'maintenanceStaffCount' },
{ key: '修整路肩', name: 'shoulderRepair' },
{ key: '清理边沟', name: 'ditchCleaning' },
{ key: '修补沥青路面', name: 'asphaltRepair' },
{ key: '修补水泥路面', name: 'concreteRepair' },
{ key: '除草', name: 'grassMowing' },
{ key: '树刷白', name: 'treeWhitening' },
{ key: '桩刷白', name: 'pileWhitening' },
{ key: '维护护栏', name: 'guardrailMaintenance' },
{ key: '修复端头', name: 'endHeadRepair' },
{ key: '其他养护内容', name: 'otherDescription' },
{ key: '养护前图片', name: 'conserveBeforePic' },
{ key: '养护后图片', name: 'conserveAfterPic' },
{ key: '上报视频', name: 'videoUrl' },
];
const keyListOld = [
// { key: '编号', name: 'id' },
{ key: '工程类型', name: 'projectType' },
{ key: '所在路段', name: 'road' },
{ key: '具体位置', name: 'address' },
{ key: '巡查内容', name: 'content' },
{ key: '路线代码', name: 'codeRoad' },
// { key: '病害照片', name: 'scenePic' },
{ key: '养护前', name: 'conserveBeforePic' },
{ key: '养护中', name: 'conserveUnderwayPic' },
{ key: '养护后', name: 'conserveAfterPic' },
];
const renderContent = (data) => {
if (data) {
if (new Date(data.time) > new Date('2023-08-01')) {
return keyList.map(obj => {
return <div style={{ display: 'flex', width: '100%', justifyContent: 'space-between', margin: '12px 0' }}>
<span style={{ fontSize: 16, color: 'gray', minWidth: '26%' }}>{obj.key}</span>
{
obj.name != 'conserveBeforePic' && obj.name != 'conserveAfterPic' && obj.name != 'roadSectionStart' && obj.name != 'videoUrl' && obj.name.indexOf('conserve') == -1 ?
<Input
style={{ width: '70%' }}
value={
obj.name == 'id' ?
moment(data.time).format("YYYYMMDD") * 10000 + data.id
:
obj.name == 'projectType' || obj.name == 'reportType' ?
reportTypeText(data[obj.name]) : obj.name == 'inspectionNoException' ? changeBoolean(data[obj.name]) :
data[obj.name]
}
disabled
/>
: obj.name != 'roadSectionStart' && obj.name != 'videoUrl' ?
<div style={{ width: '70%', display: 'flex', position: 'relative', flexWrap: 'wrap' }}>
{
data[obj.name] && data[obj.name] instanceof Array ? data[obj.name].map(imgSrc => {
return <div style={{ width: '44%', margin: 6 }}>
<Image src={qndmn + '/' + imgSrc} width={'100%'} style={{ marginBottom: 4 }} />
</div>
}) : '暂无图片'
}
</div> : obj.name != 'videoUrl' ? <div style={{ width: '70%', display: 'flex', position: 'relative', flexWrap: 'wrap' }}>
<Input style={{ width: '100%' }} disabled value={data[obj.name] + '-' + data['roadSectionEnd']} />
</div> : <div style={{ width: '70%', display: 'flex', position: 'relative', flexWrap: 'wrap' }}>
{
data[obj.name] && data[obj.name] instanceof Array ? data[obj.name].map(videoUrl => {
return <div style={{ width: '44%', margin: 6 }}>
<video src={qndmn + '/' + videoUrl} width={'100%'} style={{ marginBottom: 4 }} />
</div>
}) : '暂无视频'
}
</div>
}
</div>
})
} else {
return keyListOld.map(obj => {
return <div style={{ display: 'flex', width: '100%', justifyContent: 'space-between', margin: '12px 0' }}>
<span style={{ fontSize: 16, color: 'gray', minWidth: '26%' }}>{obj.key}</span>
{
obj.name != 'scenePic' && obj.name.indexOf('conserve') == -1 ?
<Input
style={{ width: '70%' }}
value={
obj.name == 'id' ?
moment(data.time).format("YYYYMMDD") * 10000 + data.id
:
obj.name == 'projectType' ?
reportTypeText(data[obj.name]) :
data[obj.name]
}
disabled
/>
:
<div style={{ width: '70%', display: 'flex', position: 'relative', flexWrap: 'wrap' }}>
{
data[obj.name] && data[obj.name] instanceof Array ? data[obj.name].map(imgSrc => {
return <div style={{ width: '44%', margin: 6 }}>
<Image src={qndmn + '/' + imgSrc} width={'100%'} style={{ marginBottom: 4 }} />
</div>
}) : '暂无图片'
}
</div>
}
</div>
})
}
} else {
return '暂无数据'
}
}
// const renderContent = (data) => {
// if (data) {
// if (data['inspectionNoException']) {
// // 当'无异常'字段为true时,显示'无异常'和其他非异常相关字段
// return keyList.map(obj => {
// if (obj.name === 'inspectionNoException' || obj.name === 'reportType' || obj.name === 'projectType' || obj.name === 'road' || obj.name === 'roadSectionStart' || obj.name === 'address' || obj.name === 'codeRoad' || obj.name === 'scenePic' || obj.name === 'videoUrl') {
// return (
// <div style={{ display: 'flex', width: '100%', justifyContent: 'space-between', margin: '12px 0' }}>
// <span style={{ fontSize: 16, color: 'gray', minWidth: '26%' }}>{obj.key}</span>
// {
// obj.name === 'scenePic' && data[obj.name] instanceof Array ?
// <div style={{ width: '70%', display: 'flex', position: 'relative', flexWrap: 'wrap' }}>
// {
// data[obj.name].map(imgSrc => {
// return <div style={{ width: '44%', margin: 6 }}>
// <Image src={qndmn + '/' + imgSrc} width={'100%'} style={{ marginBottom: 4 }} />
// </div>
// })
// }
// </div>
// : obj.name === 'roadSectionStart' ?
// <div style={{ width: '70%', display: 'flex', position: 'relative', flexWrap: 'wrap' }}>
// <Input style={{ width: '100%' }} disabled value={data[obj.name] + '-' + data['roadSectionEnd']} />
// </div>
// :
// <Input
// style={{ width: '70%' }}
// value={
// obj.name === 'inspectionNoException' ?
// '无异常'
// :
// obj.name === 'id'
// ? moment(data.time).format("YYYYMMDD") * 10000 + data.id
// : obj.name === 'projectType' || obj.name === 'reportType'
// ? reportTypeText(data[obj.name])
// : data[obj.name]
// }
// disabled
// />
// }
// </div>
// );
// } else {
// return null; // 不渲染异常相关字段
// }
// });
// } else {
// // 当'无异常'字段为false或未定义时,显示其他异常相关字段
// return keyList.map(obj => {
// if (obj.name !== 'inspectionNoException') {
// return (
// <div style={{ display: 'flex', width: '100%', justifyContent: 'space-between', margin: '12px 0' }}>
// <span style={{ fontSize: 16, color: 'gray', minWidth: '26%' }}>{obj.key}</span>
// {
// obj.name !== 'scenePic' && obj.name !== 'roadSectionStart' && obj.name.indexOf('conserve') === -1 ?
// <Input
// style={{ width: '70%' }}
// value={
// obj.name === 'id'
// ? moment(data.time).format("YYYYMMDD") * 10000 + data.id
// : obj.name === 'projectType' || obj.name === 'reportType'
// ? reportTypeText(data[obj.name])
// : data[obj.name]
// }
// disabled
// />
// : obj.name !== 'roadSectionStart' ?
// <div style={{ width: '70%', display: 'flex', position: 'relative', flexWrap: 'wrap' }}>
// {
// data[obj.name] && data[obj.name] instanceof Array ? data[obj.name].map(imgSrc => {
// return <div style={{ width: '44%', margin: 6 }}>
// <Image src={qndmn + '/' + imgSrc} width={'100%'} style={{ marginBottom: 4 }} />
// </div>
// }) : '暂无图片'
// }
// </div>
// : <div style={{ width: '70%', display: 'flex', position: 'relative', flexWrap: 'wrap' }}>
// <Input style={{ width: '100%' }} disabled value={data[obj.name] + '-' + data['roadSectionEnd']} />
// </div>
// }
// </div>
// );
// } else {
// return null; // 不渲染其他异常字段
// }
// });
// }
// } else {
// return '暂无数据';
// }
// }
return (
<Modal
visible={visible}
footer={null}
onCancel={handleClose}
title={'养护管理详情'}
>
<Spin spinning={loading}>
{renderContent(data)}
</Spin>
</Modal>
)
}
const MaintenanceSpotCheck = (props) => {
const { dispatch, user, loading, reportDetail, reportDetailLoading } = props
const [data, setData] = useState()
const [vis, setVis] = useState(false)//模态框的显示与隐藏变量
const [count, setCount] = useState(0)
const [depId, setDepId] = useState(0)
const [depName, setDepName] = useState('')
const [total, setTotal] = useState(0)
const [previewId, setPreviewId] = useState(0)
const [reportData, setReportData] = useState([])
const [detailVisible, setDetailVisible] = useState(false)
const [dateRange, setDateRange] = useState();
const { RangePicker } = DatePicker
//console.log('reportData', reportData)
const checkDetail = (record) => {
dispatch(getReportDetail(record.report?.id))
}
const handleOpen = () => {
setDetailVisible(true)
}
const handleClose = () => {
setDetailVisible(false)
}
const columns = [
{
title: '编号',
key: 'spotDate',
dataIndex: 'spotDate',
align: 'center',
// render: (_, record) => {
// return
// }
}, ,
{
title: '工程类型',
key: 'projectType',
dataIndex: 'projectType',
align: 'center',
render: (_, record) => {
return '养护'
}
},
{
title: '所属道路',
key: 'road',
dataIndex: 'road',
align: 'center',
render: (_, record) => {
return record?.report?.road
}
},
{
title: '所在路段',
key: 'address',
dataIndex: 'address',
align: 'center',
render: (_, record) => {
return `${record?.report?.roadSectionStart || ''}-${record?.report?.roadSectionEnd || ''}`
}
},
{
title: '具体位置',
key: 'address',
dataIndex: 'address',
align: 'center',
render: (_, record) => {
return record?.report?.address
}
},
{
title: '上报人',
width: 100,
key: 'userName',
dataIndex: 'userName',
align: 'center',
render: (text, record) => {
return record?.report?.user?.name || ''
}
}, {
title: '上报时间',
key: 'time',
dataIndex: 'time',
valueType: 'dateTime',
align: 'center',
render: (_, record) => {
return moment(record?.report?.time).format('YYYY-MM-DD HH:mm:ss')
}
},
{
title: '操作',
key: 'caozuo',
align: 'center',
render: (_, record) => {
return <Button
onClick={() => { checkDetail(record); handleOpen() }}
style={{ marginRight: 10 }}>查看</Button>
}
}
]
const queryData = (query = { startTime: '1970-1-1', endTime: '2099-12-31' }) => {
dispatch(getSpotCheckDetail(query)).then(res => {
if (res.success) {
const data = res.payload.data?.map(item => {
return { report: item.report, spotDate: item.spotDate }
}
)
setReportData(data)
}
})
}
useEffect(() => {
queryData()
}, [])
const [form] = Form.useForm()
const addHanler = () => {
setVis(true)
}
const extractHandler = () => {
form.validateFields(['percentValue']).then(async (values) => {
if (Number(values.percentValue) > 0) {
const res = await dispatch(getReportSpotPrepare({ percentage: Number(values.percentValue) }))
setCount(res?.payload.data?.reportCount)
setDepId(res?.payload.data?.lukyDepartment?.id)
setDepName(res?.payload.data?.lukyDepartment?.name)
setPreviewId(res?.payload.data?.previewId)
setTotal(((res?.payload.data?.reportCount) * Number(values.percentValue)) / 100)
form.setFieldsValue({ 'result': count, 'village': depName, 'total': total })
}
})
}
const cancelHandler = () => {
setVis(false)
form.resetFields()
}
const okHandler = async () => {
if (previewId !== 0) {
const res = await dispatch(getSpotCheck({ previewId }))
form.resetFields()
setVis(false)
}
}
const lookhandler = () => {
if ((dateRange && dateRange instanceof Array && dateRange[0] != '')) {
queryData({ startTime: moment(dateRange[0]).startOf('day').format('YYYY-MM-DD HH:mm:ss'), endTime: moment(dateRange[1]).startOf('day').format('YYYY-MM-DD HH:mm:ss') })
}
}
return (
<div>
<Button onClick={addHanler} type='primary' style={{ marginRight: '50px' }}> 新增 </Button>
<RangePicker onChange={(date, dateString) => { setDateRange(dateString) }} style={{ marginRight: '50px' }} />
<Button onClick={lookhandler} > 查询 </Button>
<Divider />
<ProTable
columns={columns}
dataSource={reportData}
loading={loading}
pagination={{
pageSize: 10,
defaultPageSize: 10,
showSizeChanger: false,
}}
rowKey="key"
toolBarRender={false}
search={false}
/>
<Modal visible={vis} onCancel={cancelHandler} title='养护抽查' onOk={okHandler}>
<Form form={form}>
<Form.Item
label="抽取比例"
// name="percent"
rules={[{ required: true, message: '请填写抽取比例' }]}
>
<Input.Group compact>
<Form.Item
name="percentValue"
noStyle
rules={[
{ required: true, message: '请填写抽取比例' },
{
pattern: /^(100|\d{1,2})(\.\d{1,2})?$/,
message: '请输入有效的比例',
},
]}
>
<Input style={{ width: '80%' }} placeholder="请输入抽取比例" />
</Form.Item>
<Form.Item
// name="percentSign"
noStyle
style={{ width: '20%', textAlign: 'center' }}
>
%
</Form.Item>
</Input.Group>
</Form.Item>
<Form.Item className="ant-row" >
<div style={{ display: 'flex', justifyContent: 'center' }}>
<Button type='primary' onClick={extractHandler}>开始抽取</Button>
</div>
</Form.Item>
<Form.Item label='抽查结果' name='result'>
<Input disabled />
</Form.Item>
<Form.Item label='抽查乡镇' name='village'>
<Input disabled />
</Form.Item>
<Form.Item label='抽查条数' name='total'>
<Input disabled />
</Form.Item>
</Form>
</Modal>
<DetailForm visible={detailVisible}
handleClose={handleClose}
data={reportDetail}
loading={reportDetailLoading} />
</div>
)
}
function mapStateToProps(state) {
const { auth, spotCheckDetail, reportDetail } = state
//('state1', state)
return {
user: auth.user,
loading: spotCheckDetail?.isRequesting,
reportDetailLoading: reportDetail.isRequesting,
reportDetail: reportDetail.data,
}
}
export default connect(mapStateToProps)(MaintenanceSpotCheck);

7
web/client/src/sections/fillion/nav-item.js

@ -19,7 +19,8 @@ export function getNavItem(user, dispatch) {
i.resourceId === 'PATROLMANAGE' || i.resourceId === 'PATROLMANAGE' ||
i.resourceId === 'ASSESSMANAGE' || i.resourceId === 'ASSESSMANAGE' ||
i.resourceId === 'VIDEOCENTER' || i.resourceId === 'VIDEOCENTER' ||
i.resourceId === 'BUILDINGPROJECT' i.resourceId === 'BUILDINGPROJECT' ||
i.resourceId === 'MAINTENANCESPOTCHECK'
) )
return ( return (
@ -99,6 +100,10 @@ export function getNavItem(user, dispatch) {
<Menu.Item key="fillionvideoCenter"> <Menu.Item key="fillionvideoCenter">
<Link to="/fillion/videoCenter">视频中心</Link> <Link to="/fillion/videoCenter">视频中心</Link>
</Menu.Item> : ''} </Menu.Item> : ''}
{user?.username == 'SuperAdmin' || user?.userResources?.some(i => i.resourceId === 'MAINTENANCESPOTCHECK') ?
<Menu.Item key="maintenanceSpotCheck">
<Link to="/fillion/maintenanceSpotCheck">养护抽查</Link>
</Menu.Item> : ''}
</SubMenu> : null </SubMenu> : null
); );
} }

11
web/client/src/sections/fillion/routes.js

@ -14,7 +14,7 @@ import { File } from './containers';
import { Jiekouguanli } from './containers' import { Jiekouguanli } from './containers'
import { Task, Assess, VideoCenter, } from './containers' import { Task, Assess, VideoCenter, } from './containers'
import { Building } from './containers' import { Building } from './containers'
import { MaintenanceSpotCheck } from './containers'
export default [{ export default [{
type: 'inner', type: 'inner',
route: { route: {
@ -172,6 +172,15 @@ export default [{
breadcrumb: '视频中心', breadcrumb: '视频中心',
authCode: 'VIDEOCENTER' authCode: 'VIDEOCENTER'
},
{
path: '/maintenanceSpotCheck',
key: 'maintenanceSpotCheck',
menuSelectKeys: ['maintenanceSpotCheck'],
component: MaintenanceSpotCheck,
breadcrumb: '养护抽查',
authCode: 'MAINTENANCESPOTCHECK'
} }
] ]
} }

2
web/client/src/sections/organization/containers/authority.js

@ -14,7 +14,7 @@ const Authority = (props) => {
const r1 = ['USERMANAGE', 'AUTHORIMANAGE', 'OVERLOADMANAGE', 'ROADMANAGE', 'BRIDGEMANAGE', 'MAINTENANCEMANAGE', 'TRANSPORTATIONMANAGE', const r1 = ['USERMANAGE', 'AUTHORIMANAGE', 'OVERLOADMANAGE', 'ROADMANAGE', 'BRIDGEMANAGE', 'MAINTENANCEMANAGE', 'TRANSPORTATIONMANAGE',
'CONSERVATIONMANAGE', 'PATROLMANAGE', 'PUBLICTRANSPORTMANAGE', 'FILEMANAGE', 'PUBLICITYVIDEO', 'FEEDBACKMANAGE', 'REPORTMANAGE', 'CONSERVATIONMANAGE', 'PATROLMANAGE', 'PUBLICTRANSPORTMANAGE', 'FILEMANAGE', 'PUBLICITYVIDEO', 'FEEDBACKMANAGE', 'REPORTMANAGE',
'ASSESSMANAGE', 'VIDEOCENTER', 'BUILDINGPROJECT', 'WXPATROLREPORT', 'WXMAINTENANCEREPORT', 'WXFEEDBACKMANAGE', 'WXBUILDINGROAD', 'ASSESSMANAGE', 'VIDEOCENTER', 'BUILDINGPROJECT', 'WXPATROLREPORT', 'WXMAINTENANCEREPORT', 'WXFEEDBACKMANAGE', 'WXBUILDINGROAD',
'WXTODOANDONE' 'WXTODOANDONE', 'MAINTENANCESPOTCHECK'
] ]
const [depUserCopy, setDepUserCopy] = useState([])//用于存放除了自己的管理的数组,即自己不能调整自己是否为管理员 const [depUserCopy, setDepUserCopy] = useState([])//用于存放除了自己的管理的数组,即自己不能调整自己是否为管理员
const [depSelectedKeys, setDepSelectedKeys] = useState([]) const [depSelectedKeys, setDepSelectedKeys] = useState([])

3
web/client/src/utils/webapi.js

@ -151,6 +151,9 @@ export const ApiTable = {
getReportList: 'report/list', getReportList: 'report/list',
getReportDetail: 'report/{reportId}/detail', getReportDetail: 'report/{reportId}/detail',
handleReport: 'report/{reportId}/handle', handleReport: 'report/{reportId}/handle',
getReportSpotPrepare: 'report/spot/prepare',
getSpotCheck: '/report/spot/check',
getSpotCheckDetail: '/report/spot/check/detail',
getUsers: 'user', getUsers: 'user',

Loading…
Cancel
Save