From 47ae677dfa44ea3350cf801b2f4337d3269c37b0 Mon Sep 17 00:00:00 2001 From: zhoule Date: Tue, 20 Feb 2024 18:02:37 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BA=8B=E4=BB=B6=E5=BD=95=E5=85=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../event/event/FormEvent/PresetFormItems.js | 73 ++++- .../control/event/event/FormEvent/data.js | 272 +++++++++++++++++- .../control/event/event/FormEvent/index.vue | 14 +- 3 files changed, 343 insertions(+), 16 deletions(-) diff --git a/ruoyi-ui/src/views/JiHeExpressway/pages/control/event/event/FormEvent/PresetFormItems.js b/ruoyi-ui/src/views/JiHeExpressway/pages/control/event/event/FormEvent/PresetFormItems.js index 56f21616..80c6e030 100644 --- a/ruoyi-ui/src/views/JiHeExpressway/pages/control/event/event/FormEvent/PresetFormItems.js +++ b/ruoyi-ui/src/views/JiHeExpressway/pages/control/event/event/FormEvent/PresetFormItems.js @@ -97,6 +97,12 @@ export const station = { }, ], }, + visible: (data) => { + if (data?.dcEventAccident?.locationType != 1) { + return false; + } + return true; + }, }; export const startEndStation = { @@ -234,7 +240,7 @@ export const eventLevel = { export const laneOccupancy = { label: "车道占用:", - key: "dcEventAccident.laneOccupancy", + key: "lang", type: "CheckboxGroup", isAlone: true, default: [], @@ -655,23 +661,23 @@ export const trafficAccidentType = { options: { options: [ { - value: "1-1", + value: "1", label: "追尾", }, { - value: "1-2", + value: "2", label: "侧翻", }, { - value: "1-3", + value: "3", label: "撞护栏", }, { - value: "1-4", + value: "4", label: "自然", }, { - value: "1-5", + value: "5", label: "其他事故", }, ], @@ -698,6 +704,7 @@ export const locationMode = { key: "dcEventAccident.locationType", required: true, type: "select", + default: "1", options: { options: [ { key: "1", label: "高速主线" }, @@ -1083,4 +1090,58 @@ export const congestionCause = { }, ], }, + ons: { + input(value, ...args) { + console.log(value); + const { formList } = args.slice(-1)[0]; + const config = formList.find((it) => it.key == "xxyy"); + let ad = { + 1: [ + { + key: "1", + label: "收费站广场拥堵导致出口压车", + }, + { + key: "2", + label: "收费站设备故障", + }, + { + key: "3", + label: "地方道路原因", + }, + { + key: "4", + label: "省内非集团所辖高速原因", + }, + { + key: "5", + label: "集团所辖道路拥堵", + }, + { + key: "6", + label: "集团所辖枢纽立交异常导致主线压车", + }, + { + key: "7", + label: "路侧起火", + }, + { + key: "8", + label: "备注项添加", + }, + ], + 2 : [ + { + key: "1", + label: "主线车流量大", + }, + { + key: "2", + label: "收费站出口车流量大导致主线压车", + }, + ] + } + config.options.options = (value != 1 ? ad[1] : ad[2]); + }, + }, }; diff --git a/ruoyi-ui/src/views/JiHeExpressway/pages/control/event/event/FormEvent/data.js b/ruoyi-ui/src/views/JiHeExpressway/pages/control/event/event/FormEvent/data.js index 929d287b..1342fd92 100644 --- a/ruoyi-ui/src/views/JiHeExpressway/pages/control/event/event/FormEvent/data.js +++ b/ruoyi-ui/src/views/JiHeExpressway/pages/control/event/event/FormEvent/data.js @@ -12,6 +12,114 @@ export const tabConfigList = [ PresetFormItems.eventLevel, { ...PresetFormItems.locationMode, key: 'dcEventAccident.locationType' }, PresetFormItems.freeway, + { + label: "服务区:", + key: "dcEventAccident.facilityId", + type: "select", + isAlone: false, + required: true, + options: { + options: [ + { + value: "选项1", + label: "黄金糕", + }, + ], + }, + visible:(data) => { + if(data?.dcEventAccident?.locationType == 2){ + return true; + } + return false; + } + }, + { + label: "地点:", + key: "dcEventAccident.dd", + isAlone: false, + required: true, + options: { + placeholder: "服务区地点", + }, + visible:(data) => { + if(data?.dcEventAccident?.locationType == 2){ + return true; + } + return false; + } + }, + { + label: "立交桥:", + key: "dcEventAccident.facilityId", + type: "select", + isAlone: false, + required: true, + options: { + options: [ + { + value: "选项1", + label: "黄金糕", + }, + ], + }, + visible:(data) => { + if(data?.dcEventAccident?.locationType == 3){ + return true; + } + return false; + } + }, + { + label: "匝道:", + key: "dcEventAccident.dd", + isAlone: false, + required: true, + options: { + placeholder: "服务区地点", + }, + visible:(data) => { + if(data?.dcEventAccident?.locationType == 3){ + return true; + } + return false; + } + }, + { + label: "收费站:", + key: "dcEventAccident.facilityId", + type: "select", + isAlone: false, + required: true, + options: { + options: [ + { + value: "选项1", + label: "黄金糕", + }, + ], + }, + visible:(data) => { + if(data?.dcEventAccident?.locationType == 4){ + return true; + } + return false; + } + }, + { + label: "地点:", + key: "dcEventAccident.dd", + isAlone: false, + required: true, + options: { + placeholder: "服务区地点", + }, + visible:(data) => { + if(data?.dcEventAccident?.locationType == 4){ + return true; + } + return false; + } + }, PresetFormItems.direction, PresetFormItems.station, PresetFormItems.eventHappenTime, @@ -29,7 +137,7 @@ export const tabConfigList = [ { ...PresetFormItems.isInTunnel, key: 'dcEventAccident.inTunnel' }, { ...PresetFormItems.spillName, key: 'dcEventAccident.spillageItem' }, { ...PresetFormItems.ownerPhone, key: 'dcEventAccident.vehicleOwnerPhone' }, - { ...PresetFormItems.laneOccupancy, key: 'dcEventAccident.laneOccupancy' }, + PresetFormItems.laneOccupancy, PresetFormItems.vehicleCondition('dcEventAccident'), PresetFormItems.casualties('dcEventAccident'), PresetFormItems.eventTitle, @@ -60,7 +168,7 @@ export const tabConfigList = [ { ...PresetFormItems.isForkRoad, key: 'dcEventVehicleAccident.atIntersection' }, { ...PresetFormItems.isCurveRoad, key: 'dcEventVehicleAccident.onCurve' }, { ...PresetFormItems.isInTunnel, key: 'dcEventVehicleAccident.inTunnel' }, - { ...PresetFormItems.laneOccupancy, key: 'dcEventVehicleAccident.laneOccupancy' }, + PresetFormItems.laneOccupancy, PresetFormItems.vehicleCondition('dcEventVehicleAccident'), PresetFormItems.casualties('dcEventVehicleAccident'), PresetFormItems.eventTitle, @@ -304,6 +412,7 @@ export const tabConfigList = [ type: "RadioGroup", isAlone: true, required: true, + default: "4-1", options: { activeColor: "linear-gradient(180deg, #37E7FF 0%, #009BCC 100%)", options: [ @@ -327,7 +436,166 @@ export const tabConfigList = [ }, }, { ...PresetFormItems.congestionCause, key: 'dcEventTrafficCongestion.congestionCause' }, + { + label: "详细原因:", + key: "xxyy", + type: "RadioGroup", + isAlone: true, + required: true, + // default: "1", + options: { + activeColor: "linear-gradient(180deg, #37E7FF 0%, #009BCC 100%)", + options: [ + { + key: "1", + label: "收费站广场拥堵导致出口压车", + }, + { + key: "2", + label: "收费站设备故障", + }, + { + key: "3", + label: "地方道路原因", + }, + { + key: "4", + label: "省内非集团所辖高速原因", + }, + { + key: "5", + label: "集团所辖道路拥堵", + }, + { + key: "6", + label: "集团所辖枢纽立交异常导致主线压车", + }, + { + key: "7", + label: "路侧起火", + }, + { + key: "8", + label: "备注项添加", + }, + ], + }, + visible:(data) => { + if(data?.dcEventTrafficCongestion?.congestionCause == 1 || data?.dcEventTrafficCongestion?.congestionCause == 6){ + return true; + } + return false; + }, + }, { ...PresetFormItems.isInTunnel, isAlone: true }, + { + label: "地点类型:", + key: "locationType", + type: "RadioGroup", + isAlone: true, + required: true, + default: "1", + options: { + activeColor: "linear-gradient(180deg, #37E7FF 0%, #009BCC 100%)", + options: [ + { + key: "1", + label: "单点", + }, + { + key: "2", + label: "多点", + }, + ], + }, + }, + { + label: "桩号:", + key: "stakeMark", + required: true, + type: "MultipleLabelItem", + options: { + options: [ + { + prefix: { + text: "K", + style: { + color: "#3DE8FF", + }, + }, + key: "stakeMark[0]", + }, + { + prefix: { + text: "+", + style: { + color: "#3DE8FF", + }, + }, + key: "stakeMark[1]", + }, + ], + }, + visible:(data) => { + if(data?.locationType != 1){ + return false; + } + return true; + } + }, + { + label: "起止桩号:", + key: "stakeMark", + required: true, + isAlone: true, + type: "MultipleLabelItem", + options: { + options: [ + { + prefix: { + text: "K", + style: { + color: "#3DE8FF", + }, + }, + key: "stakeMark[0]", + }, + { + prefix: { + text: "+", + style: { + color: "#3DE8FF", + }, + }, + key: "stakeMark[1]", + }, + { + prefix: { + text: "至K", + style: { + color: "#3DE8FF", + }, + }, + key: "endStakeMark[0]", + }, + { + prefix: { + text: "+", + style: { + color: "#3DE8FF", + }, + }, + key: "endStakeMark[1]", + }, + ], + }, + visible:(data) => { + if(data?.locationType == 2){ + return true; + } + return false; + } + }, { label: "拥堵里程:", key: "dcEventTrafficCongestion.congestionMileage", diff --git a/ruoyi-ui/src/views/JiHeExpressway/pages/control/event/event/FormEvent/index.vue b/ruoyi-ui/src/views/JiHeExpressway/pages/control/event/event/FormEvent/index.vue index 5038ce60..8176fa4f 100644 --- a/ruoyi-ui/src/views/JiHeExpressway/pages/control/event/event/FormEvent/index.vue +++ b/ruoyi-ui/src/views/JiHeExpressway/pages/control/event/event/FormEvent/index.vue @@ -108,7 +108,7 @@ export default { this.index = index; let formConfig = tabConfigList[index].formConfig; - if (index == 7) { + if (index == 0 || index == 1 || index == 7) { let fwq = []; request({ @@ -125,7 +125,7 @@ export default { }); formConfig.list.forEach(it => { - if (it.key === 'dcEventServiceArea.facilityId') { + if (it.key === 'dcEventServiceArea.facilityId' || it.key === 'dcEventAccident.facilityId') { it.options.options = fwq; } }) @@ -148,15 +148,13 @@ export default { this.$refs.FormConfigRef.validate().then((formData) => { this.submitting = true; - if (this.index == 0) { - formData.dcEventAccident.laneOccupancy = formData.dcEventAccident.laneOccupancy.join(',') + if (this.index == 0 || this.index == 1) { + formData.lang = formData.lang.join(',') } - if (this.index == 1) { - formData.dcEventVehicleAccident.laneOccupancy = formData.dcEventVehicleAccident.laneOccupancy.join(',') - } - if (this.index == 8) { + if (this.index == 9) { let endStakeMark = formData.endStakeMark; formData.dcEventAbnormalWeather.endStakeMark = (endStakeMark && endStakeMark.length > 0) ? ('K' + endStakeMark[0] + '+' + endStakeMark[1]) : ''; + formData.endStakeMark = ''; } // console.log('formData',formData) // return;