Browse Source

事件预案

wangqin
zhoule 1 year ago
parent
commit
c5d4cf57bb
  1. 491
      ruoyi-ui/src/views/JiHeExpressway/pages/control/event/plan/addAndEditDialog/index.vue
  2. 199
      ruoyi-ui/src/views/JiHeExpressway/pages/control/event/plan/formTable/index.vue
  3. 276
      ruoyi-ui/src/views/JiHeExpressway/pages/control/event/plan/qbbDialog/index.vue

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

@ -4,65 +4,35 @@
<ElForm :model="formData" inline :rules="rules" ref="ruleForm">
<div class="first">
<el-form-item prop="eventCategory">
<el-radio-group
v-model="formData.eventCategory"
@input="changeRadio"
>
<el-radio-group v-model="formData.eventCategory" @input="changeRadio">
<el-radio-button :label="1">交通事件</el-radio-button>
<el-radio-button :label="2">感知事件</el-radio-button>
</el-radio-group>
</el-form-item>
<el-form-item required label="预案名称:" prop="planName">
<el-input
v-model="formData.planName"
placeholder="请输入预案名称"
></el-input>
<el-input v-model="formData.planName" placeholder="请输入预案名称"></el-input>
</el-form-item>
<el-form-item required label="事件类型:" prop="eventType">
<el-select
v-model="formData.eventType"
placeholder="请选择事件类型"
@change="changeEventType"
>
<el-option
v-for="item in eventOptions"
:key="item.value"
:label="item.label"
:value="item.value"
>
<el-select v-model="formData.eventType" placeholder="请选择事件类型" @change="changeEventType">
<el-option v-for="item in eventOptions" :key="item.value" :label="item.label"
:value="item.value">
</el-option>
</el-select>
</el-form-item>
<el-form-item
v-if="
(formData.eventCategory == 1 && formData.eventType !== 8) ||
formData.eventCategory == 2
"
label="触发类型:"
prop="triggerMechanism"
>
v-if="(formData.eventCategory == 1 && formData.eventType !== 8) || formData.eventCategory == 2"
label="触发类型:" prop="triggerMechanism">
<el-select
v-if="
(formData.eventCategory == 1 && formData.eventType !== 6) ||
formData.eventCategory == 2
"
v-model="formData.triggerMechanism"
placeholder="请选择触发类型"
>
<el-option
v-for="item in mechanismOptions"
:key="item.value"
:label="item.label"
:value="item.value"
>
v-if="(formData.eventCategory == 1 && formData.eventType !== 6) || formData.eventCategory == 2"
v-model="formData.triggerMechanism" placeholder="请选择触发类型">
<el-option v-for="item in mechanismOptions" :key="item.value" :label="item.label"
:value="item.value">
</el-option>
</el-select>
<el-select
v-if="formData.eventCategory == 1 && formData.eventType == 6"
v-model="formData.triggerMechanism"
placeholder="请选择触发类型"
>
<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>
@ -80,6 +50,7 @@
<el-option label="服务区限行" value="8"></el-option>
</el-option-group>
</el-select>
</el-form-item>
</div>
@ -89,10 +60,7 @@
<div class="text">执行操作:</div>
</el-col>
<el-col :span="22">
<FormTable
ref="secondFormTable"
:tableData="secondFormData"
></FormTable>
<FormTable ref="secondFormTable" :tableData="secondFormData"></FormTable>
</el-col>
</el-row>
</div>
@ -102,10 +70,7 @@
<div class="text">恢复操作:</div>
</el-col>
<el-col :span="22">
<FormTable
ref="thirdFormTable"
:tableData="thirdFormData"
></FormTable>
<FormTable ref="thirdFormTable" :tableData="thirdFormData"></FormTable>
</el-col>
</el-row>
</div>
@ -113,27 +78,19 @@
</div>
<template #footer>
<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
>
<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>
</template>
</Dialog>
</template>
<script>
import Dialog from "@screen/components/Dialog/index";
import Form from "@screen/components/FormConfig";
import FormTable from "../formTable/index";
import Button from "@screen/components/Buttons/Button.vue";
import request from "@/utils/request";
import Form from '@screen/components/FormConfig';
import FormTable from '../formTable/index';
import Button from '@screen/components/Buttons/Button.vue';
import request from '@/utils/request';
import { Message } from "element-ui";
const optionsMap = {
@ -141,296 +98,290 @@ const optionsMap = {
1: [
{
value: 1,
label: "雨",
label: '雨'
},
{
value: 2,
label: "雪",
label: '雪'
},
{
value: 3,
label: "雾",
label: '雾'
},
{
value: 4,
label: "大风",
label: '大风'
},
{
value: 5,
label: "低温寒潮",
label: '低温寒潮'
},
{
value: 6,
label: "路面积雪",
label: '路面积雪'
},
{
value: 7,
label: "路面结冰",
label: '路面结冰'
},
{
value: 8,
label: "路面积水",
label: '路面积水'
},
{
value: 9,
label: "其他",
},
label: '其他'
}
],
2: [
{
value: 1,
label: "侧翻",
label: '侧翻'
},
{
value: 2,
label: "撞障碍物",
label: '撞障碍物'
},
{
value: 3,
label: "货物洒落",
label: '货物洒落'
},
{
value: 4,
label: "撞护栏",
label: '撞护栏'
},
{
value: 5,
label: "自燃",
label: '自燃'
},
{
value: 6,
label: "追尾",
},
label: '追尾'
}
],
3: [
{
value: 1,
label: "行人",
label: '行人'
},
{
value: 2,
label: "非机动车",
label: '非机动车'
},
{
value: 3,
label: "摩托车",
label: '摩托车'
},
{
value: 4,
label: "其他",
},
label: '其他'
}
],
4: [
{
value: 1,
label: "高速主线",
label: '高速主线'
},
{
value: 2,
label: "服务区",
label: '服务区'
},
{
value: 3,
label: "立交桥",
label: '立交桥'
},
{
value: 4,
label: "收费站",
},
label: '收费站'
}
],
5: [
{
value: 1,
label: "道路拥堵",
label: '道路拥堵'
},
{
value: 2,
label: "立交拥堵",
label: '立交拥堵'
},
{
value: 3,
label: "收费站拥堵",
label: '收费站拥堵'
},
{
value: 4,
label: "收费站服务区拥堵",
},
label: '收费站服务区拥堵'
}
],
6: [
],
6: [],
7: [
{
value: 1,
label: "封闭、暂停营业",
label: '封闭、暂停营业'
},
{
value: 2,
label: "重要设施停用",
label: '重要设施停用'
},
{
value: 3,
label: "其他异常",
},
label: '其他异常'
}
],
8: [],
9: [
{
value: 1,
label: "烟雾",
label: '烟雾'
},
{
value: 2,
label: "倒伏树木",
label: '倒伏树木'
},
{
value: 3,
label: "洒落物",
label: '洒落物'
},
{
value: 4,
label: "动物",
label: '动物'
},
{
value: 5,
label: "其他",
},
],
label: '其他'
}
]
},
2: {
1: [
{
1: [{
value: 1,
label: "雾",
},
],
label: '雾'
}],
2: [],
3: [],
4: [],
5: [],
6: [],
7: [],
},
}
};
export default {
name: "addAndEditDialog",
name: 'addAndEditDialog',
components: {
Dialog,
Form,
Button,
FormTable,
FormTable
},
model: {
prop: "visible",
event: "close",
prop: 'visible',
event: 'close'
},
props: {
visible: Boolean,
detail: {
type: Object,
default: () => {},
},
default: () => { }
}
},
data() {
return {
title: "新增预案",
title: '新增预案',
dialogType: 1,
planId: 0,
submitting: false,
formData: {
eventCategory: 1,
eventType: 1,
triggerMechanism: 1,
triggerMechanism: 1
},
secondFormData: [
{
secondFormData: [{
deviceType: 1,
searchRule: 1,
qbb: "安全行驶",
},
],
thirdFormData: [
{
qbb: ''
}],
thirdFormData: [{
deviceType: 1,
searchRule: 1,
qbb: "安全行驶",
},
],
qbb: ''
}],
eventOptions: [
{
value: 1,
label: "异常天气",
label: '异常天气'
},
{
value: 2,
label: "交通事故",
label: '交通事故'
},
{
value: 3,
label: "非法上路",
label: '非法上路'
},
{
value: 4,
label: "车辆故障",
label: '车辆故障'
},
{
value: 5,
label: "交通拥堵",
label: '交通拥堵'
},
{
value: 6,
label: "交通管制",
label: '交通管制'
},
{
value: 7,
label: "服务区异常",
label: '服务区异常'
},
{
value: 8,
label: "施工建设",
label: '施工建设'
},
{
value: 9,
label: "路障清除",
},
label: '路障清除'
}
],
mechanismOptions: [
{
mechanismOptions: [{
value: 1,
label: "雨",
label: '雨'
},
{
value: 2,
label: "雪",
label: '雪'
},
{
value: 3,
label: "雾",
label: '雾'
},
{
value: 4,
label: "大风",
label: '大风'
},
{
value: 5,
label: "低温寒潮",
label: '低温寒潮'
},
{
value: 6,
label: "路面积雪",
label: '路面积雪'
},
{
value: 7,
label: "路面结冰",
label: '路面结冰'
},
{
value: 8,
label: "路面积水",
label: '路面积水'
},
{
value: 9,
label: "其他",
},
],
label: '其他'
}],
conditionOptions: [
// {
// value: 1,
@ -438,43 +389,47 @@ export default {
// },
{
value: 1,
label: "小于(<)",
label: '小于(<)'
},
],
rules: {
planName: [
{ required: true, message: "请输入预案名称", trigger: "blur" },
{ required: true, message: '请输入预案名称', trigger: 'blur' },
],
eventType: [
{ required: true, message: "请选择事件类型", trigger: "change" },
{ required: true, message: '请选择事件类型', trigger: 'change' }
],
}
}
},
};
mounted() {
},
mounted() {},
computed: {
modelVisible: {
get() {
if (this.visible) {
if (Object.keys(this.detail).length > 0) {
this.title = "修改预案";
this.title = '修改预案';
this.dialogType = 2;
this.initData(this.detail.id);
} else {
this.title = "新增预案";
this.title = '新增预案';
this.dialogType = 1;
this.formData = {
eventCategory: 1,
eventType: 1,
triggerMechanism: 0,
};
triggerMechanism: 1
}
}
}
return this.visible;
},
set(val) {
this.$emit("close", val);
},
this.$emit('close', val)
}
},
},
methods: {
@ -482,8 +437,7 @@ export default {
request({
url: `/business/plans/list/${id}`,
method: "get",
})
.then((result) => {
}).then((result) => {
if (result.code != 200) return Message.error(result?.msg);
let data = result.data;
let dcExecuteAction = result.data.dcExecuteAction;
@ -494,198 +448,209 @@ export default {
planName: data.planName,
eventType: data.eventType,
triggerMechanism: data.triggerMechanism,
};
}
this.secondFormData = [];
this.thirdFormData = [];
dcExecuteAction.forEach((it) => {
dcExecuteAction.forEach(it => {
if (it.deviceList) {
it.deviceList = it.deviceList.split(",");
it.deviceList = it.deviceList.split(',');
}
if (it.actionType == 1) {
this.secondFormData.push(it);
} else if (it.actionType == 2) {
this.thirdFormData.push(it);
}
});
})
.catch((err) => {
console.log(err);
}).catch((err) => {
console.log(err)
Message.error("查询事件预案列表失败", err);
});
})
},
changeEventType(value = 1) {
this.mechanismOptions =
optionsMap[this.formData.eventCategory || 1][value];
this.mechanismOptions = optionsMap[this.formData.eventCategory || 1][value];
},
changeRadio(value = 1) {
const optionsMap = {
1: [
{
1: [{
value: 1,
label: "异常天气",
label: '异常天气'
},
{
value: 2,
label: "交通事故",
label: '交通事故'
},
{
value: 3,
label: "非法上路",
label: '非法上路'
},
{
value: 4,
label: "车辆故障",
label: '车辆故障'
},
{
value: 5,
label: "交通拥堵",
label: '交通拥堵'
},
{
value: 6,
label: "交通管制",
label: '交通管制'
},
{
value: 7,
label: "服务区异常",
label: '服务区异常'
},
{
value: 8,
label: "施工建设",
label: '施工建设'
},
{
value: 9,
label: "路障清除",
},
],
2: [
{
label: '路障清除'
}],
2: [{
value: 1,
label: "异常天气",
label: '异常天气'
},
{
value: 2,
label: "拥堵",
label: '拥堵'
},
{
value: 3,
label: "非机动车",
label: '非机动车'
},
{
value: 4,
label: "行人",
label: '行人'
},
{
value: 5,
label: "烟火",
label: '烟火'
},
{
value: 6,
label: "抛洒物",
label: '抛洒物'
},
{
value: 7,
label: "逆行",
label: '逆行'
},
],
};
]
}
this.eventOptions = optionsMap[value];
this.changeEventType();
},
handleChange() {},
handleChange() {
},
formatData(it, value = 1) {
let data = { ...it, actionType: value }
if (it.deviceList && typeof it.deviceList !== 'string' && it.deviceList.length > 0) {
data.deviceList = it.deviceList.join(',');
} else {
data.deviceList = '';
}
if (it.content) {
data.otherConfig = JSON.stringify({ content: it.content })
}
if (it.controlModel) {
let other = {
controlModel: it.controlModel,
state: it.state,
}
if (it.time && it?.time[0]) {
other = {
controlModel: it.controlModel,
state: it.state,
startTime: it.time[0],
endTime: it.time[1]
}
}
data.otherConfig = JSON.stringify(other)
}
if (it.gzms) {
data.otherConfig = JSON.stringify({
state: it.gzms,
operationDuration: it.operationDuration,
})
}
return data;
},
handleSubmit() {
this.$refs["ruleForm"].validate((valid) => {
this.$refs['ruleForm'].validate((valid) => {
if (valid) {
// this.submitting = false;
let secondFormTable = this.$refs["secondFormTable"].tableData || [];
let thirdFormTable = this.$refs["thirdFormTable"].tableData || [];
let secondFormTable = this.$refs['secondFormTable'].tableData || [];
let thirdFormTable = this.$refs['thirdFormTable'].tableData || [];
let dcArr = [];
secondFormTable.forEach((it) => {
if (
it.deviceList &&
typeof it.deviceList !== "string" &&
it.deviceList.length > 0
) {
it.deviceList = it.deviceList.join(",");
} else {
it.deviceList = "";
}
dcArr.push({ ...it, actionType: 1 });
});
thirdFormTable.forEach((it) => {
if (
it.deviceList &&
typeof it.deviceList !== "string" &&
it.deviceList.length > 0
) {
it.deviceList = it.deviceList.join(",");
} else {
it.deviceList = "";
}
dcArr.push({ ...it, actionType: 2 });
});
secondFormTable.forEach(it => {
dcArr.push(this.formatData(it, 1));
})
thirdFormTable.forEach(it => {
dcArr.push(this.formatData(it, 2));
})
console.log({
...this.formData,
dcExecuteAction: dcArr,
});
dcExecuteAction: dcArr
})
// return;
if (this.dialogType == 1) {
//
if (this.dialogType == 1) {//
request({
url: `/business/plans`,
method: "post",
data: {
...this.formData,
dcExecuteAction: dcArr,
},
})
.then((result) => {
dcExecuteAction: dcArr
}
}).then((result) => {
if (result.code != 200) return Message.error(result?.msg);
Message.success("提交成功");
this.modelVisible = false;
})
.catch(() => {
}).catch(() => {
Message.error("提交失败");
})
.finally(() => {
}).finally(() => {
this.submitting = false;
this.$emit("reInitData", true);
});
} else if (this.dialogType == 2) {
//
this.$emit('reInitData', true);
})
} else if (this.dialogType == 2) {//
request({
url: `/business/plans`,
method: "put",
data: {
...this.formData,
id: this.planId,
dcExecuteAction: dcArr,
},
})
.then((result) => {
dcExecuteAction: dcArr
}
}).then((result) => {
if (result.code != 200) return Message.error(result?.msg);
Message.success("提交成功");
this.modelVisible = false;
})
.catch(() => {
}).catch(() => {
Message.error("提交失败");
})
.finally(() => {
}).finally(() => {
this.submitting = false;
this.$emit("reInitData", true);
});
this.$emit('reInitData', true);
})
}
}
})
}
}
}
});
},
},
};
</script>
<style lang="scss" scoped>
.fade-enter-active,
.fade-leave-active {
transition: opacity 0.24s;
transition: opacity .24s;
}
.fade-enter,

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

@ -13,30 +13,20 @@
<ElTableColumn prop="searchRule" width="260">
<template slot-scope="scope">
<el-select v-if="scope.row.deviceType == 1" v-model="scope.row.searchRule" placeholder="检索规则条件">
<el-option v-for="item in zyOptions" :key="item.value" :label="item.label" :value="item.value">
</el-option>
</el-select>
<div v-if="scope.row.deviceType == 2" class="plhx">
<el-select v-model="scope.row.searchRule" placeholder="">
<div class="plhx">
<el-select v-model="scope.row.searchRule" placeholder="检索规则条件">
<el-option v-for="item in zyOptions" :key="item.value" :label="item.label"
:value="item.value">
</el-option>
</el-select>
<el-input-number v-model="scope.row.number" :min="0" :max="9999"
style="width: 130px;"></el-input-number>
</div>
<div v-if="scope.row.deviceType == 3 || scope.row.deviceType == 4" class="plhx">
<el-select v-model="scope.row.searchRule" placeholder="">
<el-option v-for="item in zyOptions" :key="item.value" :label="item.label"
:value="item.value">
</el-option>
</el-select>
<el-input-number v-model="scope.row.number" :min="0" :max="9999"
style="width: 130px;"></el-input-number>
<p style="width: 56px;">公里</p>
<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 == 3" 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>
</div>
</template>
@ -44,42 +34,44 @@
<ElTableColumn prop="deviceList" width="370">
<template slot-scope="scope">
<div v-if="scope.row.deviceType == 1" class="mjs">
<el-select v-model="scope.row.deviceList" placeholder="" multiple collapse-tags>
<el-option v-for="item in options" :key="item.value" :label="item.label"
:value="item.value">
<div class="mjs">
<el-select v-if="scope.row.searchRule == 1" v-model="scope.row.deviceList" placeholder="请选择设备"
multiple collapse-tags>
<el-option v-for="item in sbOptions" :key="item.id" :label="item.deviceName"
:value="item.id">
</el-option>
</el-select>
<el-input placeholder="请选择" v-model="scope.row.qbb" readonly>
<el-input @click.native="clickQbb(scope.$index)" v-if="scope.row.deviceType == 1"
placeholder="请选择" v-model="scope.row.qbb" readonly>
<i slot="suffix" class="el-input__icon el-icon-search"></i>
</el-input>
</div>
<div v-if="scope.row.deviceType == 2" class="mjs">
<el-select v-model="scope.row.gzms" placeholder="">
<el-option label="工作模式" :value="1"></el-option>
</el-select>
<el-select v-model="scope.row.czsc" placeholder="">
<el-option label="操作时长" :value="1"></el-option>
<el-select v-if="scope.row.deviceType == 2" 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>
</div>
<el-input-number v-if="scope.row.deviceType == 2" placeholder="操作时长(分钟)"
v-model="scope.row.operationDuration" :min="0" :max="999"></el-input-number>
<div v-if="scope.row.deviceType == 3" class="mjs">
<el-select v-model="scope.row.kzms" placeholder="">
<el-option label="控制模式" :value="1"></el-option>
</el-select>
<el-select v-model="scope.row.sj" placeholder="">
<el-option label="选择时间" :value="1"></el-option>
<el-select v-model="scope.row.controlModel" placeholder="请选择控制模式">
<el-option label="手动模式" :value="1"></el-option>
<el-option label="自动模式" :value="2"></el-option>
<el-option label="万年历" :value="3"></el-option>
</el-select>
<el-select v-model="scope.row.gzzt" placeholder="">
<el-option label="工作状态" :value="1"></el-option>
<el-time-picker v-if="scope.row.controlModel == 2" v-model="scope.row.time" is-range
style="" range-separator="-" placeholder="选择时间" value-format="HH:mm" format="HH:mm">
</el-time-picker>
<el-select v-model="scope.row.state" placeholder="工作状态">
<el-option v-for="item in gzztOptions" :key="item.value" :label="item.label"
:value="item.value"></el-option>
</el-select>
</div>
<div v-if="scope.row.deviceType == 4" class="mjs">
<el-input v-model="scope.row.fbnr" placeholder="请输入发布内容"></el-input>
</div>
<el-input v-if="scope.row.deviceType == 4" v-model="scope.row.content"
placeholder="请输入发布内容"></el-input>
</div>
</template>
</ElTableColumn>
@ -93,6 +85,9 @@
</template>
</ElTableColumn>
</Table>
<!-- 情报板弹窗 -->
<QbbDialog :visible="isShowDialog" @close="onCloseDialog" @dialogSubmit="dialogSubmit" />
</div>
</template>
@ -100,6 +95,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 { Message } from 'element-ui'
@ -108,6 +104,7 @@ export default {
components: {
Button,
Table,
QbbDialog
},
model: {
prop: 'visible',
@ -121,7 +118,7 @@ export default {
default: () => [{
deviceType: 1,
searchRule: 1,
qbb: '安全行驶'
qbb: ''
}]
}
},
@ -134,10 +131,11 @@ export default {
// qbb: ''
// }
// ],
isShowDialog: false,
deviceOptions: [
{
value: 1,
label: '门架式可变信息标志'
label: '可变信息标志'
},
{
value: 2,
@ -166,64 +164,106 @@ export default {
label: '最近公里数'
},
],
options: [
gzztOptions: [
{
value: 1,
label: '交通事故'
value: "01",
label: "常亮"
},
{
value: 2,
label: '车辆故障'
value: "02",
label: "流水"
},
{
value: 3,
label: '交通管制'
value: "03",
label: "闪烁"
},
{
value: 4,
label: '交通拥堵'
value: "04",
label: "关闭",
}
],
gzmsOptions: [
{
value: "SETMD0",
label: "激光关闭"
},
{
value: "SETMD1",
label: "常亮模式"
},
{
value: 5,
label: '非法上路'
value: "SETMD2",
label: "间隔100ms闪烁模式"
},
{
value: 6,
label: '路障清除'
value: "SETMD3",
label: "间隔200ms闪烁模式",
},
{
value: 7,
label: '施工建设'
value: "SETMD4",
label: "间隔500ms闪烁模式",
},
{
value: 8,
label: '服务区异常'
value: "SETMD5",
label: "2次闪烁模式"
},
{
value: 9,
label: '设施设备隐患'
value: "SETMD6",
label: "SOS模式"
},
{
value: 10,
label: '异常天气'
value: "SETMD7",
label: "自定义模式1",
},
{
value: 11,
label: '其他事件'
value: "SETMD8",
label: "自定义模式2",
},
{
value: "SETMD9",
label: "自定义模式3",
}
],
sbOptions: [],
deviceType: 1,
index: 1
}
},
created() {
this.initData();
},
methods: {
initData() {
request({
url: `business/device/query?deviceType=2`,
method: "get",
}).then((result) => {
if (result.code != 200) return Message.error(result?.msg);
this.sbOptions = result.data;
}).catch(() => {
Message.error("查询可变信息标识失败");
})
},
changeDeviceType(value) {
this.deviceType = value;
// if(value == 1){
// this.searchRule = 1
// }else if(value == 2){
// this.searchRule = 1
// }else if(value == 3){
// this.searchRule = 1
// }else if(value == 4){
// this.searchRule = 1
// }
},
onAdd(id) {
this.tableData.push({
deviceType: 1,
// searchRule: 1,
// qbb: ''
searchRule: 1,
qbb: ''
})
},
onDel(index) {
@ -232,6 +272,17 @@ export default {
}
this.tableData.splice(index, 1)
},
clickQbb(index) {
this.index = index;
this.isShowDialog = true;
},
onCloseDialog() {
this.isShowDialog = false;
},
dialogSubmit(data) {
this.tableData[this.index].qbb = data.content;
this.tableData[this.index].otherConfig = JSON.stringify({ dcInfoBoardTemplate: data });
}
}
}
</script>
@ -264,6 +315,16 @@ export default {
display: flex;
}
::v-deep {
.el-tag.el-tag--info {
max-width: 100px;
}
.el-range-editor--medium .el-range__icon,
.el-range-editor--medium .el-range__close-icon {
display: none;
}
}
}

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

@ -0,0 +1,276 @@
<template>
<Dialog v-model="modelVisible" title="选择情报板">
<div class="EventAddPlanDialog">
<vuescroll :ops="scrollOptions" class="listBox">
<div v-for="(item) in templateAvailable" :key="item.dictValue">
<!-- 原来是<el-collapse v-model="activeNames"> -->
<h3>{{ item.dictLabel }}</h3>
<div v-for="(itm, indx) in item.list" :key="indx" class="tplItem">
<!-- 模板内容 -->
<BoardTplPreview class="boardPreview" boardWH="1400*200" :tpl="itm"></BoardTplPreview>
<!-- 操作按钮 -->
<div class="infoBtnBox infoBtnBoxSm">
<p class="btn">
<el-radio v-model="radio1" :label="itm.id" @input="changeRadio(itm)" />
</p>
</div>
</div>
</div>
</vuescroll>
</div>
<template #footer>
<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>
</template>
</Dialog>
</template>
<script>
import vuescroll from "vuescroll";
import scrollOptions from "@/common/scrollbar.js";
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";
export default {
name: 'qbbDialog',
components: {
Dialog,
Button,
vuescroll,
BoardTplPreview
},
model: {
prop: 'visible',
event: 'close'
},
props: {
visible: Boolean,
detail: {
type: Object,
default: () => { }
}
},
data() {
return {
submitting: false,
selectedSize: "",
scrollOptions,
templateAvailable: null,
tplCategory: [],
templateAll: [],
radio1: '',
itmData: {}
}
},
mounted() {
this.initData();
},
computed: {
modelVisible: {
get() {
return this.visible;
},
set(val) {
this.$emit('close', val)
}
},
},
methods: {
initData() {
if (this.tplCategory.length && this.templateAll.length) {
this.____setAvailableTemplate();
} else {
Promise.all([
this.____getTemplateCategory(),
this.____getAllTemplate(),
]).then((res) => {
this.____setAvailableTemplate();
});
}
},
//
____getTemplateCategory() {
return this.getDicts("iot_template_category").then((res) => {
this.tplCategory = res.data;
});
},
//
____getAllTemplate() {
return getTemplateList().then((res) => {
this.templateAll = res.data;
});
},
//
____setAvailableTemplate() {
this.templateAvailable = [];
this.tplCategory.forEach((item, index) => {
let arr = this.templateAll["" + index];
if (arr.length > 0) {
let temp = [];
arr.forEach((tpl) => {
if (tpl.screenSize) {
temp.push(tpl);
}
});
if (temp.length > 0) {
this.templateAvailable.push({
...item,
list: temp,
});
}
}
});
},
changeRadio(data) {
this.itmData = data;
},
handleSubmit() {
this.modelVisible = false;
this.$emit('dialogSubmit', this.itmData);
}
}
}
</script>
<style lang="scss" scoped>
.listBox {
padding: 20px;
.tplItem {
margin-right: 14px;
display: flex;
align-items: stretch;
padding-bottom: 10px;
.boardPreview {
border: 1px solid rgba(61, 232, 255, 0.5);
// width: 560px;
// height:80px;
flex: 1;
}
.infoBtnBox {
&.infoBtnBoxSm {
width: 60px;
}
width: 110px;
height: 80px;
display: flex;
margin-left: 10px;
/* // border: solid 1px #05afe3; */
border: 1px solid rgba(61, 232, 255, 0.5);
display: flex;
justify-content: space-around;
align-items: center;
.btn {
background-repeat: no-repeat;
background-size: 100% 100%;
width: 15px;
height: 30px;
&.btnApply {
background-image: url(~@/assets/jihe/images/button/toLeft.svg);
}
&.btnEdit {
background-image: url(~@/assets/jihe/images/button/edit.svg);
}
&.btnDelete {
background-image: url(~@/assets/jihe/images/button/delete.svg);
}
}
i {
font-size: 24px;
color: #666;
padding-left: 4px;
cursor: pointer;
caret-color: rgba(0, 0, 0, 0);
user-select: none;
}
i:hover {
color: #05afe3;
}
.disabledClass {
pointer-events: none;
cursor: auto !important;
color: #ccc;
}
}
}
.controlBox {
margin-top: 10px;
margin-bottom: 10px;
display: flex;
justify-content: center;
}
.el-collapse {
max-height: 100% !important;
overflow: auto;
border-bottom: none;
border-top: none;
padding: 0 0.5vw;
}
}
.fade-enter-active,
.fade-leave-active {
transition: opacity .24s;
}
.fade-enter,
.fade-leave-to {
opacity: 0;
}
.EventAddPlanDialog {
gap: 9px;
width: 650px;
height: 510px;
display: flex;
flex-direction: column;
.first,
.second,
.third {
padding: 5px 10px 8px;
background-color: #296887;
margin-bottom: 15px;
.text {
margin-top: 12px;
}
}
::v-deep {
.el-radio__label {
display: none;
}
}
.form {
flex: 1;
overflow-y: auto;
}
.footer {
display: flex;
justify-content: end;
gap: 15px;
}
}
</style>
Loading…
Cancel
Save