diff --git a/ruoyi-ui/src/views/JiHeExpressway/pages/control/event/plan/addAndEditDialog/index.vue b/ruoyi-ui/src/views/JiHeExpressway/pages/control/event/plan/addAndEditDialog/index.vue index 3e3a8593..f70a2249 100644 --- a/ruoyi-ui/src/views/JiHeExpressway/pages/control/event/plan/addAndEditDialog/index.vue +++ b/ruoyi-ui/src/views/JiHeExpressway/pages/control/event/plan/addAndEditDialog/index.vue @@ -27,25 +27,6 @@ :value="item.value"> - @@ -355,6 +336,81 @@ const optionsMap = { 7: [], } }; +const typeMap = { + 1: [{ + value: 1, + label: '交通事故' + }, + { + value: 2, + label: '车辆故障' + }, + { + value: 3, + label: '交通管制' + }, + { + value: 4, + label: '交通拥堵' + }, + { + value: 5, + label: '非法上路' + }, + { + value: 6, + label: '路障清除' + }, + { + value: 7, + label: '施工建设' + }, + { + value: 8, + label: '服务区异常' + }, + { + value: 9, + label: '设施设备隐患' + }, + { + value: 10, + label: '异常天气' + }, + { + value: 11, + label: '其他事件' + }], + 2: [{ + value: 1, + label: '异常天气' + }, + { + value: 2, + label: '拥堵' + }, + { + value: 3, + label: '非机动车' + }, + { + value: 4, + label: '行人' + }, + { + value: 5, + label: '烟火' + }, + { + value: 6, + label: '抛洒物' + }, + { + value: 7, + label: '逆行' + }, + ] +} export default { name: 'addAndEditDialog', @@ -490,6 +546,8 @@ export default { if (Object.keys(this.detail).length > 0) { this.title = '修改预案'; this.dialogType = 2; + this.eventOptions = typeMap[this.detail.eventCategory]; + this.mechanismOptions = optionsMap[this.detail.eventCategory || 1][this.detail.eventType]; this.initData(this.detail.id); } else { this.title = '新增预案'; @@ -538,16 +596,21 @@ export default { this.secondFormData = []; this.thirdFormData = []; dcExecuteAction.forEach(it => { + let action = {}; + if (it.otherConfig) { + let config = JSON.parse(it.otherConfig); + action = { ...it, ...config, qbb: (config?.dcInfoBoardTemplate?.content || '') }; + } if (it.deviceList) { - it.deviceList = it.deviceList.split(','); + action.deviceList = it.deviceList.split(',').map(str => Number(str)); } if (it.actionType == 1) { - this.secondFormData.push(it); + this.secondFormData.push(action); } else if (it.actionType == 2) { - this.thirdFormData.push(it); + this.thirdFormData.push(action); } }) - + console.log('secondFormData', this.secondFormData) }).catch((err) => { console.log(err) Message.error("查询事件预案列表失败", err); @@ -561,7 +624,6 @@ export default { method: "get", }) if (result.code != 200) return Message.error(result?.msg); - console.log('123'); this.deviceData = result.data; // return result.data; } @@ -571,81 +633,15 @@ export default { this.mechanismOptions = optionsMap[this.formData.eventCategory || 1][value]; }, changeRadio(value = 1) { - const optionsMap = { - 1: [{ - value: 1, - label: '异常天气' - }, - { - value: 2, - label: '交通事故' - }, - { - value: 3, - label: '非法上路' - }, - { - value: 4, - label: '车辆故障' - }, - { - value: 5, - label: '交通拥堵' - }, - { - value: 6, - label: '交通管制' - }, - { - value: 7, - label: '服务区异常' - }, - { - value: 8, - label: '施工建设' - }, - { - value: 9, - label: '路障清除' - }], - 2: [{ - value: 1, - label: '异常天气' - }, - { - value: 2, - label: '拥堵' - }, - { - value: 3, - label: '非机动车' - }, - { - value: 4, - label: '行人' - }, - { - value: 5, - label: '烟火' - }, - { - value: 6, - label: '抛洒物' - }, - { - value: 7, - label: '逆行' - }, - ] - } - this.eventOptions = optionsMap[value]; + this.formData.triggerMechanism = ''; + this.eventOptions = typeMap[value]; this.changeEventType(); }, handleChange() { }, - formatData(it, value = 1) { - let data = { ...it, actionType: value } + formatData(it, value = 1, id = '') { + let data = { ...it, actionType: value, emergencyPlansId: id } if (it.deviceList && typeof it.deviceList !== 'string' && it.deviceList.length > 0) { data.deviceList = it.deviceList.join(','); } else { @@ -682,19 +678,22 @@ export default { if (valid) { // this.submitting = false; let secondFormTable = this.$refs['secondFormTable'].tableData || []; + // console.log('12', secondFormTable); let thirdFormTable = this.$refs['thirdFormTable'].tableData || []; let dcArr = []; + let id = ''; + if (this.dialogType == 2) id = this.planId; secondFormTable.forEach(it => { - dcArr.push(this.formatData(it, 1)); + dcArr.push(this.formatData(it, 1, id)); }) thirdFormTable.forEach(it => { - dcArr.push(this.formatData(it, 2)); + dcArr.push(this.formatData(it, 2, id)); }) - console.log({ - ...this.formData, - dcExecuteAction: dcArr - }) + // console.log({ + // ...this.formData, + // dcExecuteAction: dcArr + // }) // return; if (this.dialogType == 1) {//新增 request({ diff --git a/ruoyi-ui/src/views/JiHeExpressway/pages/control/event/plan/formTable/index.vue b/ruoyi-ui/src/views/JiHeExpressway/pages/control/event/plan/formTable/index.vue index 789661f9..dae791e5 100644 --- a/ruoyi-ui/src/views/JiHeExpressway/pages/control/event/plan/formTable/index.vue +++ b/ruoyi-ui/src/views/JiHeExpressway/pages/control/event/plan/formTable/index.vue @@ -20,13 +20,13 @@ - -

+ +

- -

公里

+

公里

@@ -41,19 +41,19 @@ :value="item.id"> - - + - -
+
@@ -68,7 +68,7 @@
-
@@ -87,7 +87,7 @@ - + @@ -269,6 +269,7 @@ export default { label: "自定义模式3", } ], + qbbData: {}, sbOptions: [], deviceType: 1, index: 1 @@ -320,6 +321,7 @@ export default { }, clickQbb(index) { this.index = index; + this.qbbData = this.tableData[index].dcInfoBoardTemplate; this.isShowDialog = true; }, onCloseDialog() { diff --git a/ruoyi-ui/src/views/JiHeExpressway/pages/control/event/plan/index.vue b/ruoyi-ui/src/views/JiHeExpressway/pages/control/event/plan/index.vue index d9153625..c1ec7f7f 100644 --- a/ruoyi-ui/src/views/JiHeExpressway/pages/control/event/plan/index.vue +++ b/ruoyi-ui/src/views/JiHeExpressway/pages/control/event/plan/index.vue @@ -28,8 +28,8 @@ - - + +