|
|
@ -27,25 +27,6 @@ |
|
|
|
:value="item.value"> |
|
|
|
</el-option> |
|
|
|
</el-select> |
|
|
|
<!-- <el-select v-if="formData.eventCategory == 1 && formData.eventType == 6" |
|
|
|
v-model="formData.triggerMechanism" placeholder="请选择触发类型"> |
|
|
|
<el-option-group label="主线"> |
|
|
|
<el-option label="主线封闭" value="1"></el-option> |
|
|
|
<el-option label="主线限行" value="2"></el-option> |
|
|
|
</el-option-group> |
|
|
|
<el-option-group label="收费站"> |
|
|
|
<el-option label="收费站封闭" value="3"></el-option> |
|
|
|
<el-option label="收费站限行" value="4"></el-option> |
|
|
|
</el-option-group> |
|
|
|
<el-option-group label="匝道立交"> |
|
|
|
<el-option label="匝道立交封闭" value="5"></el-option> |
|
|
|
<el-option label="匝道立交限行" value="6"></el-option> |
|
|
|
</el-option-group> |
|
|
|
<el-option-group label="服务区"> |
|
|
|
<el-option label="服务区封闭" value="7"></el-option> |
|
|
|
<el-option label="服务区限行" value="8"></el-option> |
|
|
|
</el-option-group> |
|
|
|
</el-select> --> |
|
|
|
|
|
|
|
</el-form-item> |
|
|
|
</div> |
|
|
@ -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({ |
|
|
|