From 2426fab172477dbc653a4e3dc51d8dfe96896ea9 Mon Sep 17 00:00:00 2001 From: zhaobing Date: Fri, 4 Aug 2023 17:06:19 +0800 Subject: [PATCH] =?UTF-8?q?feat:0804=E7=AC=AC=E4=B8=80=E6=AC=A1=E6=8F=90?= =?UTF-8?q?=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/app/lib/controllers/data/appointed.js | 4 +- api/app/lib/controllers/data/vehicle.js | 36 ++- api/app/lib/models/report.js | 73 +++-- .../fillion/components/bridgeTable.js | 60 +++-- .../fillion/components/enforceTable.js | 254 +++++++++--------- .../components/feedback/nominateModalcopy.js | 11 +- .../fillion/components/highwaysTable.js | 14 +- .../fillion/components/maintenanceTable.js | 57 ++-- .../fillion/components/patrolTable.js | 10 +- .../fillion/components/transportationTable.js | 21 +- .../containers/maintenanceSpotCheck.js | 1 + .../containers/footer/build/Leftbottom.js | 138 +++++----- .../containers/footer/build/Rightbottom.js | 35 +-- .../quanju/containers/footer/build/index.js | 1 + .../footer/leadership/centerleft/daolu.js | 12 +- .../footer/leadership/centerleft/top.js | 8 +- 16 files changed, 399 insertions(+), 336 deletions(-) diff --git a/api/app/lib/controllers/data/appointed.js b/api/app/lib/controllers/data/appointed.js index b24e0c0b..937e8154 100644 --- a/api/app/lib/controllers/data/appointed.js +++ b/api/app/lib/controllers/data/appointed.js @@ -4,9 +4,9 @@ const moment = require('moment') async function appoint(ctx) { try { const models = ctx.fs.dc.models - const { recordId, performerId } = ctx.request.body + const { recordId, performerId, handleOpinions } = ctx.request.body await models.Report.update({ - performerId + performerId, handleOpinions }, { where: { id: recordId } }) ctx.status = 204; } catch (error) { diff --git a/api/app/lib/controllers/data/vehicle.js b/api/app/lib/controllers/data/vehicle.js index b3ad5dfb..554e4e5a 100644 --- a/api/app/lib/controllers/data/vehicle.js +++ b/api/app/lib/controllers/data/vehicle.js @@ -1,11 +1,20 @@ 'use strict'; +const { QueryTypes } = require('sequelize'); -async function get (ctx) { +async function get(ctx) { try { const models = ctx.fs.dc.models; const { type } = ctx.request.body; const { name } = ctx.query; - + const sequelize = ctx.fs.dc.orm + const sqlStr = `select count(p.road_marking) 标线,count(p.roadside_ditch) 边沟, + count(p.guardrail) 护栏, count(p.roadside_trees) 行道树,count(p.wrong_lane) 错车道 + from ( + select t.*,row_number() over (partition by t.luduan order by t.time desc ) rn from ( + select code_road||'-'||road_section_start||'-'||road_section_end luduan, + road_marking,roadside_ditch,guardrail,roadside_trees,wrong_lane,time from report + where report_type='conserve') t ) p where p.rn=1` + const conserveData = await sequelize.query(sqlStr, { type: QueryTypes.SELECT }) let findOption = { where: { type @@ -17,9 +26,12 @@ async function get (ctx) { } } const vehicleRes = await models.Statistic.findAll(findOption) - + console.log('vehicleRes', vehicleRes) ctx.status = 200; - ctx.body = vehicleRes + ctx.body = { + vehicleRes: vehicleRes.filter(item => item.dataValues.name === '标志牌' || item.dataValues.name === '养护责任牌') + , conserveData + } } catch (error) { ctx.fs.logger.error(`path: ${ctx.path}, error: ${error}`); ctx.status = 400; @@ -29,7 +41,7 @@ async function get (ctx) { } } -async function edit (ctx) { +async function edit(ctx) { try { const models = ctx.fs.dc.models; const { id, name, count, type } = ctx.request.body; @@ -58,7 +70,7 @@ async function edit (ctx) { } } -async function del (ctx) { +async function del(ctx) { try { const models = ctx.fs.dc.models; const { id } = ctx.params; @@ -79,7 +91,7 @@ async function del (ctx) { } } -async function specificGet (ctx) { +async function specificGet(ctx) { try { const models = ctx.fs.dc.models; const { type } = ctx.query; @@ -109,7 +121,7 @@ async function specificGet (ctx) { } } -async function specificEdit (ctx) { +async function specificEdit(ctx) { try { const models = ctx.fs.dc.models; const data = ctx.request.body; @@ -134,7 +146,7 @@ async function specificEdit (ctx) { } } -async function specificDel (ctx) { +async function specificDel(ctx) { try { const models = ctx.fs.dc.models; const { vehicleId } = ctx.params; @@ -155,7 +167,7 @@ async function specificDel (ctx) { } } -async function businessGet (ctx) { +async function businessGet(ctx) { try { const models = ctx.fs.dc.models; const { nameOfBusinessOwner } = ctx.query; @@ -183,7 +195,7 @@ async function businessGet (ctx) { } } -async function businessEdit (ctx) { +async function businessEdit(ctx) { try { const models = ctx.fs.dc.models; const data = ctx.request.body; @@ -208,7 +220,7 @@ async function businessEdit (ctx) { } } -async function businessDel (ctx) { +async function businessDel(ctx) { try { const models = ctx.fs.dc.models; const { businessId } = ctx.params; diff --git a/api/app/lib/models/report.js b/api/app/lib/models/report.js index eb532b72..0e6b827d 100644 --- a/api/app/lib/models/report.js +++ b/api/app/lib/models/report.js @@ -7,7 +7,6 @@ module.exports = dc => { const sequelize = dc.orm; const Report = sequelize.define("report", { id: { - index: 1, type: DataTypes.INTEGER, allowNull: false, defaultValue: null, @@ -18,87 +17,78 @@ module.exports = dc => { unique: "report_id_uindex" }, reportType: { - index: 2, type: DataTypes.STRING, allowNull: false, defaultValue: null, - comment: "上报类型", + comment: "上报类型 巡查:patrol / 养护:conserve", primaryKey: false, field: "report_type", autoIncrement: false }, projectType: { - index: 3, type: DataTypes.STRING, - allowNull: false, + allowNull: true, defaultValue: null, - comment: "工程类型", + comment: "工程类型 道路:road / 桥梁:birdge / 涵洞:culvert", primaryKey: false, field: "project_type", autoIncrement: false }, road: { - index: 4, type: DataTypes.STRING, allowNull: true, defaultValue: null, - comment: '所属道路', + comment: null, primaryKey: false, field: "road", autoIncrement: false }, roadSectionStart: { - index: 5, type: DataTypes.STRING, allowNull: true, defaultValue: null, - comment: '开始路段', + comment: null, primaryKey: false, field: "road_section_start", autoIncrement: false }, roadSectionEnd: { - index: 6, type: DataTypes.STRING, allowNull: true, defaultValue: null, - comment: '结束路段', + comment: null, primaryKey: false, field: "road_section_end", autoIncrement: false }, longitude: { - index: 7, type: DataTypes.DOUBLE, allowNull: true, defaultValue: null, - comment: '经度', + comment: null, primaryKey: false, field: "longitude", autoIncrement: false }, latitude: { - index: 8, type: DataTypes.DOUBLE, allowNull: true, defaultValue: null, - comment: '纬度', + comment: null, primaryKey: false, field: "latitude", autoIncrement: false }, content: { - index: 9, type: DataTypes.STRING, allowNull: true, defaultValue: null, - comment: '具体内容', + comment: null, primaryKey: false, field: "content", autoIncrement: false }, scenePic: { - index: 10, type: DataTypes.ARRAY(DataTypes.STRING), allowNull: true, defaultValue: null, @@ -108,7 +98,6 @@ module.exports = dc => { autoIncrement: false }, conserveBeforePic: { - index: 11, type: DataTypes.ARRAY(DataTypes.STRING), allowNull: true, defaultValue: null, @@ -118,7 +107,6 @@ module.exports = dc => { autoIncrement: false }, conserveUnderwayPic: { - index: 12, type: DataTypes.ARRAY(DataTypes.STRING), allowNull: true, defaultValue: null, @@ -128,7 +116,6 @@ module.exports = dc => { autoIncrement: false }, conserveAfterPic: { - index: 13, type: DataTypes.ARRAY(DataTypes.STRING), allowNull: true, defaultValue: null, @@ -138,7 +125,6 @@ module.exports = dc => { autoIncrement: false }, userId: { - index: 14, type: DataTypes.INTEGER, allowNull: true, defaultValue: null, @@ -148,52 +134,39 @@ module.exports = dc => { autoIncrement: false }, time: { - index: 15, type: DataTypes.DATE, allowNull: false, defaultValue: null, - comment: '创建日期', + comment: null, primaryKey: false, field: "time", autoIncrement: false }, address: { - index: 16, type: DataTypes.STRING, allowNull: true, defaultValue: null, - comment: '具体位置', + comment: null, primaryKey: false, field: "address", autoIncrement: false }, projectName: { - index: 17, type: DataTypes.STRING, allowNull: true, defaultValue: null, - comment: "工程名称", + comment: null, primaryKey: false, field: "project_name", autoIncrement: false }, handleState: { - index: 18, - type: DataTypes.STRING, - allowNull: false, - defaultValue: "已处理", - // comment: "处理状态", - primaryKey: false, - field: "handle_state", - autoIncrement: false - }, - codeRoad: { type: DataTypes.STRING, allowNull: true, defaultValue: null, comment: null, primaryKey: false, - field: "code_road", + field: "handle_state", autoIncrement: false }, performerId: { @@ -209,7 +182,7 @@ module.exports = dc => { type: DataTypes.STRING, allowNull: true, defaultValue: null, - comment: "", + comment: "执行内容描述", primaryKey: false, field: "handle_content", autoIncrement: false @@ -223,6 +196,15 @@ module.exports = dc => { field: "handle_pic", autoIncrement: false }, + codeRoad: { + type: DataTypes.STRING, + allowNull: true, + defaultValue: null, + comment: null, + primaryKey: false, + field: "code_road", + autoIncrement: false + }, videoUrl: { type: DataTypes.ARRAY(DataTypes.STRING), allowNull: true, @@ -456,6 +438,15 @@ module.exports = dc => { primaryKey: false, field: "other_description", autoIncrement: false + }, + handleOpinions: { + type: DataTypes.STRING, + allowNull: true, + defaultValue: null, + comment: "处理意见", + primaryKey: false, + field: "handle_opinions", + autoIncrement: false } }, { tableName: "report", diff --git a/web/client/src/sections/fillion/components/bridgeTable.js b/web/client/src/sections/fillion/components/bridgeTable.js index 23d74b38..f32c0e89 100644 --- a/web/client/src/sections/fillion/components/bridgeTable.js +++ b/web/client/src/sections/fillion/components/bridgeTable.js @@ -25,6 +25,9 @@ const BrideTable = (props) => { const [whichofits, setWhichofits] = useState('qiaoliang') const [delet, setDelet] = useState() const [differentiate, setDifferentiate] = useState('bridge') + const [smallBridge, setSmallBridge] = useState([]) + const [middleBridge, setMiddleBridge] = useState([]) + const [bigBridge, setBigBridge] = useState([]) const [editAble, setEditAble] = useState(user?.username !== 'SuperAdmin' && user?.userResources?.filter(i => i.resourceId === 'BRIDGEMANAGE')[0].isshow === "true" ? true : '') const ref = useRef() useEffect(() => { ref.current.reload() }, [whichofits, delet]) @@ -161,7 +164,7 @@ const BrideTable = (props) => { getPopupContainer: (triggerNode) => triggerNode.parentNode, } }, { - title: '跨越地物类型1', + title: '跨越地物类型', search: false, dataIndex: 'time8', valueType: 'dateRange', @@ -175,7 +178,7 @@ const BrideTable = (props) => { getPopupContainer: (triggerNode) => triggerNode.parentNode, } }, { - title: '跨越地物名称1', + title: '跨越地物名称', search: false, dataIndex: 'time9', valueType: 'dateRange', @@ -1810,7 +1813,9 @@ const BrideTable = (props) => { setRowSelected([]); const res = await dispatch(getBridge(query)); // console.log(res) - + setSmallBridge(res.payload.data?.filter(item => item.bridgeClassification === '小桥')) + setMiddleBridge(res.payload.data?.filter(item => item.bridgeClassification === '中桥')) + setBigBridge(res.payload.data?.filter(item => item.bridgeClassification === '大桥')) setCounts(res.payload.data) return { ...res, @@ -1833,6 +1838,7 @@ const BrideTable = (props) => { search={{ defaultCollapsed: false, optionRender: (searchConfig, formProps, dom) => [ + {`共有小桥${smallBridge.length}座,中桥${middleBridge.length}座,大桥${bigBridge.length}座`}, ...dom.reverse(), { props.exports(rowSelected, differentiate) }} disabled={editAble}> } @@ -1520,7 +1520,7 @@ const openModal = (type, record) => { hideInTable: true, dataIndex: "direction", order: 6, - renderFormItem: (item, { type, defaultRender, ...rest }, form,record) => { + renderFormItem: (item, { type, defaultRender, ...rest }, form, record) => { return (
- { const { queryData, recordId, visible, user, onCancel, depMessage, loading, depUser, clientHeight, depData, onVisibleChange, dispatch } = props @@ -38,7 +39,7 @@ const NominateModal = (props) => { } const handleFinish = () => { form.validateFields().then(values => { - dispatch(appointTask({ recordId: recordId, performerId: values.nameId })).then((res) => { + dispatch(appointTask({ recordId: recordId, performerId: values.nameId, handleOpinions: values.handleOpinions })).then((res) => { if (res.success) { setSelectedUserId(null) queryData() @@ -92,9 +93,13 @@ const NominateModal = (props) => { onChange={(value) => setSelectedUserId(value)} > + + +