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() { provide() {
return { return {
loadData: throttle(this.loadData, 1000) loadData: throttle(this.loadData, 1000),
getAutomatic: this.getTemplateAutomatic,
getOriginal: this.getBoardOriginal
} }
}, },
props: { props: {
@ -99,6 +101,8 @@ export default {
automaticInfo: {}, automaticInfo: {},
dcExecuteAction: [], dcExecuteAction: [],
deviceData: [], deviceData: [],
automaticData: {},
boardOriginalData: {},
eventOptions: [ eventOptions: [
{ {
value: 1, value: 1,
@ -233,7 +237,7 @@ export default {
if (it.actionType == 1) { if (it.actionType == 1) {
secondFormData.push(action); secondFormData.push(action);
} else if (it.actionType == 2) { } else if (it.actionType == 2) {
thirdFormData.push(action); thirdFormData.push({ ...action, qbb: '默认恢复该情报板上次常态化信息' });
} }
}) })
this.secondFormData = secondFormData; this.secondFormData = secondFormData;
@ -255,30 +259,76 @@ export default {
async getTemplateAutomatic() { async getTemplateAutomatic() {
let url = ''; let url = '';
let data = {}; let data = {};
let otherConfig = {};
let plan = this.info.find(it => it.planName == this.planName); let plan = this.info.find(it => it.planName == this.planName);
if (this.activeName == '-1') {// console.log('plan', plan)
url = '/business/plans/warning/confirm'; let action = plan.dcExecuteAction.find(it => it.actionType == 1 && it.deviceType == 2);
data = { if (action) {
dcEmergencyPlans: plan, otherConfig = JSON.parse(action.otherConfig);
dcWarning: this.eventFormData if (this.activeName == '-1') {//
} url = '/business/plans/warning/confirm';
} else {// data = {
url = '/business/plans/event/automatic'; dcInfoBoardTemplate: otherConfig,
data = { dcWarning: this.eventFormData
dcEmergencyPlans: plan, }
dcEvent: 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({ return this.automaticData;
url: url, },
method: "post", async getBoardOriginal() {
data: data let url = '';
}) let data = {};
if (result.code != 200) { let plan = this.info.find(it => it.planName == this.planName);
Message.error(result?.msg); console.log('plan1', plan)
return {}; 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) { changeRadio(value) {
let plan = this.info.find(it => it.planName == 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"> :value="item.id">
</el-option> </el-option>
</el-select> </el-select>
<!-- 情报板 -->
<el-input @click.native="clickQbb(scope.$index)" v-if="scope.row.deviceType == 2" <el-input @click.native="clickQbb(scope.$index)" v-if="scope.row.deviceType == 2"
placeholder="请选择" v-model="scope.row.qbb" readonly> placeholder="请选择" v-model="scope.row.qbb" readonly>
<i slot="suffix" class="el-input__icon el-icon-search"></i> <i slot="suffix" class="el-input__icon el-icon-search"></i>
@ -87,8 +88,8 @@
</Table> </Table>
<!-- 情报板弹窗 --> <!-- 情报板弹窗 -->
<!-- <QbbDialog :visible="isShowDialog" :info="qbbData" :type="type" @close="onCloseDialog" <QbbDialog :visible="isShowDialog" :info="qbbData" :type="type" @close="onCloseDialog"
@dialogSubmit="dialogSubmit" /> --> @dialogSubmit="dialogSubmit" />
</div> </div>
</template> </template>
@ -96,7 +97,7 @@
import Table from '@screen/components/Table.vue'; import Table from '@screen/components/Table.vue';
import Button from '@screen/components/Buttons/Button.vue'; import Button from '@screen/components/Buttons/Button.vue';
import request from "@/utils/request"; import request from "@/utils/request";
// import QbbDialog from "../qbbDialog/index.vue"; import QbbDialog from "../qbbDialog/index.vue";
import { Message } from 'element-ui' import { Message } from 'element-ui'
import { planDeviceOptions } from "@screen/utils/enum.js"; import { planDeviceOptions } from "@screen/utils/enum.js";
@ -106,7 +107,7 @@ export default {
components: { components: {
Button, Button,
Table, Table,
// QbbDialog QbbDialog
}, },
// model: { // model: {
// prop: 'visible', // prop: 'visible',
@ -259,10 +260,9 @@ export default {
}, },
clickQbb(index) { clickQbb(index) {
this.index = index; this.index = index;
this.qbbData = this.tableData[index].dcInfoBoardTemplate; // this.qbbData = this.tableData[index].dcInfoBoardTemplate;
if (this.type == 1) { console.log('this.type', this.type)
this.isShowDialog = true; this.isShowDialog = true;
}
}, },
onCloseDialog() { onCloseDialog() {
this.isShowDialog = false; this.isShowDialog = false;

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

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

Loading…
Cancel
Save