Browse Source

事件确认

wangqin
zhoule 11 months ago
parent
commit
d70cc699b8
  1. 94
      ruoyi-ui/src/views/JiHeExpressway/pages/control/event/event/EventDetailDialog/eventPlanDialog/index.vue
  2. 16
      ruoyi-ui/src/views/JiHeExpressway/pages/control/event/event/EventDetailDialog/formTable/index.vue
  3. 60
      ruoyi-ui/src/views/JiHeExpressway/pages/control/event/event/EventDetailDialog/qbbDialog/index.vue

94
ruoyi-ui/src/views/JiHeExpressway/pages/control/event/event/EventDetailDialog/eventPlanDialog/index.vue

@ -62,7 +62,9 @@ export default {
},
provide() {
return {
loadData: throttle(this.loadData, 1000)
loadData: throttle(this.loadData, 1000),
getAutomatic: this.getTemplateAutomatic,
getOriginal: this.getBoardOriginal
}
},
props: {
@ -99,6 +101,8 @@ export default {
automaticInfo: {},
dcExecuteAction: [],
deviceData: [],
automaticData: {},
boardOriginalData: {},
eventOptions: [
{
value: 1,
@ -233,7 +237,7 @@ export default {
if (it.actionType == 1) {
secondFormData.push(action);
} else if (it.actionType == 2) {
thirdFormData.push(action);
thirdFormData.push({ ...action, qbb: '默认恢复该情报板上次常态化信息' });
}
})
this.secondFormData = secondFormData;
@ -255,30 +259,76 @@ export default {
async getTemplateAutomatic() {
let url = '';
let data = {};
let otherConfig = {};
let plan = this.info.find(it => it.planName == this.planName);
if (this.activeName == '-1') {//
url = '/business/plans/warning/confirm';
data = {
dcEmergencyPlans: plan,
dcWarning: this.eventFormData
}
} else {//
url = '/business/plans/event/automatic';
data = {
dcEmergencyPlans: plan,
dcEvent: this.eventFormData
console.log('plan', plan)
let action = plan.dcExecuteAction.find(it => it.actionType == 1 && it.deviceType == 2);
if (action) {
otherConfig = JSON.parse(action.otherConfig);
if (this.activeName == '-1') {//
url = '/business/plans/warning/confirm';
data = {
dcInfoBoardTemplate: otherConfig,
dcWarning: this.eventFormData
}
} else {//
url = '/business/plans/event/automatic';
data = {
dcInfoBoardTemplate: otherConfig,
dcEvent: this.eventFormData
}
}
const result = await request({
url: url,
method: "post",
data: data
})
if (result.code != 200) return Message.error(result?.msg);
this.automaticData = result.data;
} else {
console.log('没有情报板,不调用接口');
this.automaticData = {};
}
const result = await request({
url: url,
method: "post",
data: data
})
if (result.code != 200) {
Message.error(result?.msg);
return {};
return this.automaticData;
},
async getBoardOriginal() {
let url = '';
let data = {};
let plan = this.info.find(it => it.planName == this.planName);
console.log('plan1', plan)
let action = plan.dcExecuteAction.find(it => it.actionType == 1 && it.deviceType == 2);
if (action) {
if (this.activeName == '-1') {//
url = '/business/plans/warning/board/confirm';
data = {
dcEmergencyPlans: {
...plan,
executeAction: action
},
dcWarning: this.eventFormData
}
} else {//
url = '/business/plans/event/board/confirm';
data = {
dcEmergencyPlans: {
...plan,
executeAction: action
},
dcEvent: this.eventFormData
}
}
const result = await request({
url: url,
method: "post",
data: data
})
if (result.code != 200) return Message.error(result?.msg);
this.boardOriginalData = result.data;
} else {
console.log('没有情报板,不调用接口');
this.boardOriginalData = {};
}
return result.data;
return this.boardOriginalData;
},
changeRadio(value) {
let plan = this.info.find(it => it.planName == value);

16
ruoyi-ui/src/views/JiHeExpressway/pages/control/event/event/EventDetailDialog/formTable/index.vue

@ -41,6 +41,7 @@
:value="item.id">
</el-option>
</el-select>
<!-- 情报板 -->
<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>
@ -87,8 +88,8 @@
</Table>
<!-- 情报板弹窗 -->
<!-- <QbbDialog :visible="isShowDialog" :info="qbbData" :type="type" @close="onCloseDialog"
@dialogSubmit="dialogSubmit" /> -->
<QbbDialog :visible="isShowDialog" :info="qbbData" :type="type" @close="onCloseDialog"
@dialogSubmit="dialogSubmit" />
</div>
</template>
@ -96,7 +97,7 @@
import Table from '@screen/components/Table.vue';
import Button from '@screen/components/Buttons/Button.vue';
import request from "@/utils/request";
// import QbbDialog from "../qbbDialog/index.vue";
import QbbDialog from "../qbbDialog/index.vue";
import { Message } from 'element-ui'
import { planDeviceOptions } from "@screen/utils/enum.js";
@ -106,7 +107,7 @@ export default {
components: {
Button,
Table,
// QbbDialog
QbbDialog
},
// model: {
// prop: 'visible',
@ -259,10 +260,9 @@ export default {
},
clickQbb(index) {
this.index = index;
this.qbbData = this.tableData[index].dcInfoBoardTemplate;
if (this.type == 1) {
this.isShowDialog = true;
}
// this.qbbData = this.tableData[index].dcInfoBoardTemplate;
console.log('this.type', this.type)
this.isShowDialog = true;
},
onCloseDialog() {
this.isShowDialog = false;

60
ruoyi-ui/src/views/JiHeExpressway/pages/control/event/event/EventDetailDialog/qbbDialog/index.vue

@ -4,9 +4,7 @@
<h4>预案内容</h4>
<dev class="listBox disPid">
<div class="tplItem">
<!-- 模板内容 -->
<!-- <BoardTplPreview class="boardPreview" boardWH="1400*200" :tpl="{}"></BoardTplPreview> -->
<!-- 操作按钮 -->
<BoardTplPreview class="boardPreview" boardWH="1400*200" :tpl="automaticData"></BoardTplPreview>
<div class="infoBtnBox infoBtnBoxSm">
<p class="btn">
<!-- <el-radio v-model="radio1" :label="1" @input="changeRadio(1)" /> -->
@ -17,9 +15,7 @@
<h4>自动生成</h4>
<dev class="listBox disPid">
<div class="tplItem">
<!-- 模板内容 -->
<!-- <BoardTplPreview class="boardPreview" boardWH="1400*200" :tpl="{}"></BoardTplPreview> -->
<!-- 操作按钮 -->
<BoardTplPreview class="boardPreview" boardWH="1400*200" :tpl="automaticData"></BoardTplPreview>
<div class="infoBtnBox infoBtnBoxSm">
<p class="btn">
<!-- <el-radio v-model="radio1" :label="2" @input="changeRadio(2)" /> -->
@ -28,7 +24,7 @@
</div>
</dev>
<h4>情报板模版</h4>
<!-- <vuescroll :ops="scrollOptions" class="listBox">
<vuescroll :ops="scrollOptions" class="listBox">
<div v-for="(item) in templateAvailable" :key="item.dictValue">
<h5>{{ item.dictLabel }}</h5>
<div v-for="(itm, indx) in item.list" :key="indx" class="tplItem">
@ -40,9 +36,20 @@
</div>
</div>
</div>
</vuescroll> -->
</vuescroll>
</div>
<template #footer>
<div v-if="type == 2" class="EventAddPlanDialog">
<div v-for="(item, index) in Object.keys(originalData)" :key="index">
<h4>{{ item }}</h4>
<dev class="listBox disPid">
<div v-for="(it, idx) in originalData[item]" :key="idx" class="tplItem">
<BoardTplPreview class="boardPreview" boardWH="1400*200" :tpl="it"></BoardTplPreview>
</div>
</dev>
</div>
</div>
<template #footer v-if="type == 1">
<Button style="background: #C9C9C9;padding:0 24px;"
@click.native="modelVisible = false, submitting = false">取消</Button>
<Button style="padding:0 24px;" @click.native="handleSubmit" :loading="submitting">确认</Button>
@ -57,7 +64,6 @@ import BoardTplPreview from "@screen/components/infoBoard/BoardTplPreview.vue";
import Dialog from "@screen/components/Dialog/index";
import Button from '@screen/components/Buttons/Button.vue';
import { getTemplateList } from "@/api/board/template";
import DeviceControlDialog from '../../../../../Home/components/Dialogs/DrivingGuidance/components/DeviceControlDialog.vue';
export default {
name: 'qbbDialog',
@ -66,13 +72,12 @@ export default {
Button,
vuescroll,
BoardTplPreview,
DeviceControlDialog
},
model: {
prop: 'visible',
event: 'close'
},
// inject: ['getTemplateAutomatic'],
inject: ['getAutomatic', 'getOriginal'],
props: {
visible: Boolean,
type: {
@ -93,23 +98,27 @@ export default {
tplCategory: [],
templateAll: [],
radio1: '',
itmData: {}
itmData: {},
automaticData: {},
originalData: {},
}
},
mounted() {
if (this.type == 1) {
this.initData();
} else if (this.type == 2) {
this.getBoardOriginal();
}
},
computed: {
modelVisible: {
async get() {
if (this.visible) {
if (this.info && this.info.id) {
this.radio1 = Number(this.info.id);
}
// console.log('123', this.getTemplateAutomatic());
}
get() {
// if (this.visible2) {
// if (this.info && this.info.id) {
// this.radio1 = Number(this.info.id);
// }
// console.log('123', this.getTemplateAutomatic());
// }
return this.visible;
},
set(val) {
@ -128,6 +137,7 @@ export default {
]).then((res) => {
this.____setAvailableTemplate();
});
this.getTemplateAutomatic();
}
},
@ -164,6 +174,16 @@ export default {
}
});
},
async getTemplateAutomatic() {
let data = await this.getAutomatic();
console.log('dataaaa', data);
this.automaticData = data;
},
async getBoardOriginal() {
let data = await this.getOriginal();
console.log('datbbbbb', data);
this.originalData = data;
},
changeRadio(data) {
this.itmData = data;
},

Loading…
Cancel
Save