Browse Source

预案bug

wangqin
zhoule 8 months ago
parent
commit
1a69bd33ba
  1. 199
      ruoyi-ui/src/views/JiHeExpressway/pages/control/event/plan/addAndEditDialog/index.vue
  2. 24
      ruoyi-ui/src/views/JiHeExpressway/pages/control/event/plan/formTable/index.vue
  3. 33
      ruoyi-ui/src/views/JiHeExpressway/pages/control/event/plan/index.vue
  4. 7
      ruoyi-ui/src/views/JiHeExpressway/pages/control/event/plan/qbbDialog/index.vue

199
ruoyi-ui/src/views/JiHeExpressway/pages/control/event/plan/addAndEditDialog/index.vue

@ -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({

24
ruoyi-ui/src/views/JiHeExpressway/pages/control/event/plan/formTable/index.vue

@ -20,13 +20,13 @@
</el-option>
</el-select>
<el-input-number v-if="scope.row.searchRule == 2" v-model="scope.row.number" :min="0"
:max="9999" style="width: 130px;"></el-input-number>
<p v-if="scope.row.searchRule == 2"></p>
<el-input-number v-if="scope.row.searchRule == 2 || scope.row.searchRule == 3"
v-model="scope.row.number" :min="0" :max="9999" style="width: 130px;"></el-input-number>
<p v-if="scope.row.searchRule == 2 || scope.row.searchRule == 3"></p>
<el-input-number v-if="scope.row.searchRule == 3" v-model="scope.row.number" :min="0"
<el-input-number v-if="scope.row.searchRule == 4" v-model="scope.row.number" :min="0"
:max="9999" style="width: 130px;"></el-input-number>
<p v-if="scope.row.searchRule == 3" style="width: 56px;">公里</p>
<p v-if="scope.row.searchRule == 4" style="width: 56px;">公里</p>
</div>
</template>
@ -41,19 +41,19 @@
:value="item.id">
</el-option>
</el-select>
<el-input @click.native="clickQbb(scope.$index)" v-if="scope.row.deviceType == 1"
<el-input @click.native="clickQbb(scope.$index)" v-if="scope.row.deviceType == 2"
placeholder="请选择" v-model="scope.row.qbb" readonly>
<i slot="suffix" class="el-input__icon el-icon-search"></i>
</el-input>
<el-select v-if="scope.row.deviceType == 2" v-model="scope.row.gzms" placeholder="工作模式">
<el-select v-if="scope.row.deviceType == 10" v-model="scope.row.gzms" placeholder="工作模式">
<el-option v-for="item in gzmsOptions" :key="item.value" :label="item.label"
:value="item.value"></el-option>
</el-select>
<el-input-number v-if="scope.row.deviceType == 2" placeholder="操作时长(分钟)"
<el-input-number v-if="scope.row.deviceType == 10" placeholder="操作时长(分钟)"
v-model="scope.row.operationDuration" :min="0" :max="999"></el-input-number>
<div v-if="scope.row.deviceType == 3" class="mjs">
<div v-if="scope.row.deviceType == 12" class="mjs">
<el-select v-model="scope.row.controlModel" placeholder="请选择控制模式">
<el-option label="手动模式" :value="1"></el-option>
<el-option label="自动模式" :value="2"></el-option>
@ -68,7 +68,7 @@
</el-select>
</div>
<el-input v-if="scope.row.deviceType == 4" v-model="scope.row.content"
<el-input v-if="scope.row.deviceType == 5" v-model="scope.row.content"
placeholder="请输入发布内容"></el-input>
</div>
@ -87,7 +87,7 @@
</Table>
<!-- 情报板弹窗 -->
<QbbDialog :visible="isShowDialog" @close="onCloseDialog" @dialogSubmit="dialogSubmit" />
<QbbDialog :visible="isShowDialog" :info="qbbData" @close="onCloseDialog" @dialogSubmit="dialogSubmit" />
</div>
</template>
@ -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() {

33
ruoyi-ui/src/views/JiHeExpressway/pages/control/event/plan/index.vue

@ -28,8 +28,8 @@
<ElTableColumn prop="strEventType" label="事件类型" width="100" align="center" />
<ElTableColumn prop="planName" label="预案名称" width="140" align="center" />
<ElTableColumn prop="triggeringCondition" label="检索条件" width="140" />
<ElTableColumn prop="deviceType" label="设备类型" width="140" />
<ElTableColumn prop="controllableDevice" label="可控设备" width="200" />
<ElTableColumn prop="strDeviceType" label="设备类型" width="140" />
<ElTableColumn prop="controllableDeviceName" label="可控设备"/>
<ElTableColumn prop="controlCommand" label="控制指令" />
<ElTableColumn label="操作" width="210" align="center">
<template slot-scope="scope">
@ -65,7 +65,8 @@ import { Message } from 'element-ui'
import { searchFormList } from './data';
const eventTypeMap = {
0: {
0: {},
1: {
1: '交通事故',
2: '车辆故障',
3: '交通管制',
@ -78,7 +79,7 @@ const eventTypeMap = {
10: '异常天气',
11: '其他事件',
},
1: {
2: {
1: '异常天气',
2: '拥堵',
3: '非机动车',
@ -87,10 +88,25 @@ const eventTypeMap = {
6: '抛洒物',
7: '逆行',
},
2: {}
3: {}
}
const deviceMap = {
1: '摄像机',
2: '可变信息标志',
3: '气象监测器',
4: '出口诱导灯',
5: '路段语音广播',
6: '护栏碰撞',
7: '毫米波雷达',
8: '合流区预警',
9: '智慧锥桶',
10: '激光疲劳唤醒',
11: '类交通量调查站',
12: '行车诱导',
13: '智能设备箱',
14: '光线在线监测',
}
export default {
name: 'controlEventPlan',
@ -128,8 +144,9 @@ export default {
}).then((result) => {
if (result.code != 200) return Message.error(result?.msg);
result.rows.forEach(it => {
it.strEventCategory = it.eventCategory == 0 ? '交通事件' : '感知事件';
it.strEventCategory = it.eventCategory == 1 ? '交通事件' : '感知事件';
it.strEventType = eventTypeMap[it.eventCategory || 0][it.eventType];
it.strDeviceType = deviceMap[it.deviceType];
})
this.tableData = result.rows;
this.total = result.total;
@ -154,7 +171,7 @@ export default {
this.isShowDialog = true;
},
handleSearch(data) {
console.log(data);
// console.log(data);
this.searchData = { ...this.searchData, ...data }
this.initData();
},

7
ruoyi-ui/src/views/JiHeExpressway/pages/control/event/plan/qbbDialog/index.vue

@ -49,7 +49,7 @@ export default {
},
props: {
visible: Boolean,
detail: {
info: {
type: Object,
default: () => { }
}
@ -72,6 +72,11 @@ export default {
computed: {
modelVisible: {
get() {
if (this.visible) {
if (this.info && this.info.id) {
this.radio1 = Number(this.info.id);
}
}
return this.visible;
},
set(val) {

Loading…
Cancel
Save