Browse Source

Merge branch 'develop' of http://39.106.31.193:9211/mengff/jihe-hs into develop

wangqin
hui 11 months ago
parent
commit
bfaf7afd9d
  1. 3
      ruoyi-ui/package.json
  2. 14664
      ruoyi-ui/pnpm-lock.yaml
  3. 3
      ruoyi-ui/src/main.js
  4. 41
      ruoyi-ui/src/views/JiHeExpressway/components/Dialog/index.vue
  5. 32
      ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/Dialogs/FatigueWakesUp/components/DeviceControlDialog.vue
  6. 1
      ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/Dialogs/Intermodulation/components/LineChartForTraffic/index.vue
  7. 6
      ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/Dialogs/PerceiveEvent/components/LineChart/index.vue
  8. 27
      ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/Dialogs/PerceiveEvent/index.vue
  9. 13
      ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/HomeVector/index.vue
  10. 25
      ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/RoadAndEvents/utils/buttonEvent.js
  11. 146
      ruoyi-ui/src/views/JiHeExpressway/pages/control/event/event/EventDetailDialog/eventPlanDialog/index.vue
  12. 16
      ruoyi-ui/src/views/JiHeExpressway/pages/control/event/event/EventDetailDialog/formTable/index.vue
  13. 10
      ruoyi-ui/src/views/JiHeExpressway/pages/control/event/event/EventDetailDialog/index.vue
  14. 60
      ruoyi-ui/src/views/JiHeExpressway/pages/control/event/event/EventDetailDialog/qbbDialog/index.vue
  15. 358
      ruoyi-ui/src/views/JiHeExpressway/pages/control/event/plan/addAndEditDialog/index.vue
  16. 22
      ruoyi-ui/src/views/JiHeExpressway/pages/control/event/plan/formTable/index.vue
  17. 2
      ruoyi-ui/src/views/JiHeExpressway/pages/perception/eventDetection/components/eventQuery/assets/charts.js
  18. 2
      ruoyi-ui/src/views/JiHeExpressway/pages/perception/trafficFlow/components/heightway/index.vue

3
ruoyi-ui/package.json

@ -107,7 +107,8 @@
"vuedraggable": "2.24.3",
"vuescroll": "^4.18.1",
"vuex": "3.6.0",
"zrender": "^5.4.4"
"zrender": "^5.4.4",
"mitt": "^3.0.1"
},
"devDependencies": {
"@vue/cli-plugin-babel": "4.4.6",

14664
ruoyi-ui/pnpm-lock.yaml

File diff suppressed because it is too large

3
ruoyi-ui/src/main.js

@ -54,6 +54,8 @@ import eventDialog from "@/components/eventDialogTable/eventDialog.vue";
import eventDialogTable from "@/components/eventDialogTable";
import evtDialogOneThing from "@/components/eventDialogTable/evtDialogOneThing.vue";
import evtDialogVideo from "@/components/eventDialogTable/video.vue";
import mitt from "mitt";
const emitter = mitt();
// 大屏适配
import dataV from "@jiaminghi/data-view";
@ -103,6 +105,7 @@ Vue.prototype.selectDictLabels = selectDictLabels;
Vue.prototype.handleTree = handleTree;
Vue.prototype.socket = Socket;
Vue.prototype.numberMul = numberMul;
Vue.prototype.emitter = emitter;
// gis
Vue.prototype.$GlobalConfig = config.GlobalConfig;

41
ruoyi-ui/src/views/JiHeExpressway/components/Dialog/index.vue

@ -1,38 +1,23 @@
<template>
<Teleport>
<Transition name="fade">
<div
:class="['mask-layer', { 'none-mask': noneMask }]"
v-if="modelVisible"
>
<BackgroundClip
class="dialog"
<div :class="['mask-layer', { 'none-mask': noneMask }]" v-if="modelVisible">
<BackgroundClip class="dialog"
clipPath="polygon(calc(100% - var(--clip-width)) 0, 100% var(--clip-width), 100% 100%, var(--clip-width) 100%, 0 calc(100% - var(--clip-width)), 0 0)"
borderColor="linear-gradient(180deg, rgba(78, 174, 204, .9), rgba(78, 174, 204, 0))"
bgColor="linear-gradient(180deg, rgba(14, 69, 92, 0.9) 0%, rgba(20, 89, 119, 0.9) 100%)"
ref="DialogContentRef"
>
ref="DialogContentRef">
<div class="dialog-title">
<img
class="title-icon"
src="@screen/images/dialog/title-icon.svg"
/>
<img class="title-icon" src="@screen/images/dialog/title-icon.svg" />
<span>{{ title }}</span>
<img
class="icon-close"
@click.stop="modelVisible = false"
src="@screen/images/dialog/icon-close.svg"
/>
<img class="icon-close" @click.stop="modelVisible = false" src="@screen/images/dialog/icon-close.svg" />
</div>
<div class="dialog-content">
<slot />
</div>
<img
class="bottom-right"
src="@screen/images/dialog/right-bottom.svg"
/>
<img class="bottom-right" src="@screen/images/dialog/right-bottom.svg" />
<div class="footer" v-if="$slots.footer">
<slot name="footer"></slot>
@ -88,18 +73,30 @@ export default {
},
},
},
methods: {
updateDialogVisible(bool) {
this.modelVisible = bool;
console.log("modelVisible", this.modelVisible);
},
},
mounted() {
this.emitter.on("updateDialogVisible", this.updateDialogVisible);
},
computed: {
modelVisible: {
get() {
return this.visible;
},
set(val) {
console.log("val", "val")
this.$emit("update:value", val);
},
},
},
beforeDestroy() {
console.log("beforeDestory111")
this.modelVisible = false;
this.emitter.off("updateDialogVisible", this.updateDialogVisible);
},
};
</script>
@ -203,7 +200,7 @@ export default {
padding: 0 27px;
::v-deep {
> div {
>div {
min-width: 96px;
}
}

32
ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/Dialogs/FatigueWakesUp/components/DeviceControlDialog.vue

@ -16,60 +16,67 @@
<ElTableColumn prop="ds" label="段数"></ElTableColumn>
<ElTableColumn prop="time" width="120" label="时间">
<ElTableColumn prop="time" width="120" label="时间(豪秒)">
<template slot-scope="scope">
<div style="display: flex;">
<el-input-number style="width: 120px;" v-model="scope.row.time" :min="0"></el-input-number>
<p>豪秒</p>
</div>
</template>
</ElTableColumn>
<ElTableColumn prop="A" label="线路A">
<template slot-scope="scope">
<el-switch active-value="1" inactive-value="0" v-model="scope.row.A" active-color="#13ce66" inactive-color="#C9C9C9">
<el-switch active-value="1" inactive-value="0" v-model="scope.row.A" active-color="#13ce66"
inactive-color="#C9C9C9">
</el-switch>
</template>
</ElTableColumn>
<ElTableColumn prop="B" label="线路B">
<template slot-scope="scope">
<el-switch active-value="1" inactive-value="0" v-model="scope.row.B" active-color="#13ce66" inactive-color="#C9C9C9">
<el-switch active-value="1" inactive-value="0" v-model="scope.row.B" active-color="#13ce66"
inactive-color="#C9C9C9">
</el-switch>
</template>
</ElTableColumn>
<ElTableColumn prop="C" label="线路C">
<template slot-scope="scope">
<el-switch active-value="1" inactive-value="0" v-model="scope.row.C" active-color="#13ce66" inactive-color="#C9C9C9">
<el-switch active-value="1" inactive-value="0" v-model="scope.row.C" active-color="#13ce66"
inactive-color="#C9C9C9">
</el-switch>
</template>
</ElTableColumn>
<ElTableColumn prop="D" label="线路D">
<template slot-scope="scope">
<el-switch active-value="1" inactive-value="0" v-model="scope.row.D" active-color="#13ce66" inactive-color="#C9C9C9">
<el-switch active-value="1" inactive-value="0" v-model="scope.row.D" active-color="#13ce66"
inactive-color="#C9C9C9">
</el-switch>
</template>
</ElTableColumn>
<ElTableColumn prop="E" label="线路E">
<template slot-scope="scope">
<el-switch active-value="1" inactive-value="0" v-model="scope.row.E" active-color="#13ce66" inactive-color="#C9C9C9">
<el-switch active-value="1" inactive-value="0" v-model="scope.row.E" active-color="#13ce66"
inactive-color="#C9C9C9">
</el-switch>
</template>
</ElTableColumn>
<ElTableColumn prop="F" label="线路F">
<template slot-scope="scope">
<el-switch active-value="1" inactive-value="0" v-model="scope.row.F" active-color="#13ce66" inactive-color="#C9C9C9">
<el-switch active-value="1" inactive-value="0" v-model="scope.row.F" active-color="#13ce66"
inactive-color="#C9C9C9">
</el-switch>
</template>
</ElTableColumn>
<ElTableColumn prop="G" label="线路G">
<template slot-scope="scope">
<el-switch active-value="1" inactive-value="0" v-model="scope.row.G" active-color="#13ce66" inactive-color="#C9C9C9">
<el-switch active-value="1" inactive-value="0" v-model="scope.row.G" active-color="#13ce66"
inactive-color="#C9C9C9">
</el-switch>
</template>
</ElTableColumn>
<ElTableColumn prop="H" label="线路H">
<template slot-scope="scope">
<el-switch active-value="1" inactive-value="0" v-model="scope.row.H" active-color="#13ce66" inactive-color="#C9C9C9">
<el-switch active-value="1" inactive-value="0" v-model="scope.row.H" active-color="#13ce66"
inactive-color="#C9C9C9">
</el-switch>
</template>
</ElTableColumn>
@ -374,8 +381,9 @@ export default {
<style lang='scss' scoped>
.DeviceControlDialog {
width: 850px;
min-height: 410px;
width: 860px;
max-height: 78vh;
height: 410px;
display: flex;
flex-direction: column;
gap: 15px;

1
ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/Dialogs/Intermodulation/components/LineChartForTraffic/index.vue

@ -24,6 +24,7 @@ export default {
options.yAxis.axisLabel.fontSize = 11;
options.xAxis.data = this.xData;
options.series[0].data = this.yData;
options.tooltip.formatter = "{b}:{c}辆";
chartIns.setOption(options);
},
}

6
ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/Dialogs/PerceiveEvent/components/LineChart/index.vue

@ -14,12 +14,14 @@
<script>
import * as echarts from "echarts";
import { lineChartOption } from "./chart"
import { cloneDeep } from "lodash";
export default {
name: 'LineChart',
mounted() {
const chartIns = echarts.init(this.$refs.LineChartRef);
chartIns.setOption(lineChartOption);
const options = cloneDeep(lineChartOption);
options.tooltip.formatter = "{b}:{c}(辆)";
chartIns.setOption(options);
},
}
</script>

27
ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/Dialogs/PerceiveEvent/index.vue

@ -12,7 +12,7 @@
</div>
<template #footer>
<Button>误报</Button>
<Button @click.native="onDelete">误报</Button>
<Button style="background-color: rgba(0, 179, 204, 0.3)" @click.native="obverseVisible = false">取消</Button>
<Button @click.native="updateEvent" :loading="btnLoading">确定</Button>
</template>
@ -34,6 +34,8 @@ import Carousel from "@screen/pages/control/event/event/EventDetailDialog/Carous
import { WarningTypeList, WarningSubclassList, LaneOccupancyList, DirectionTypes } from "@screen/utils/enum.js";
// import { getRoadInfoByStakeMark, getProduct } from "@screen/pages/Home/components/RoadAndEvents/utils/httpList.js"
import { dialogDelayVisible } from "./../mixin";
import { markerClusterIns } from "@screen/pages/Home/components/RoadAndEvents/utils/map.js"
import { eventMap } from "@screen/pages/Home/components/RoadAndEvents/utils/buttonEvent";
let vehicleTypeList = [];
@ -184,6 +186,29 @@ export default {
clearInterval(this.interval);
},
methods: {
onDelete() {
const id = this.dialogData.id;
id && this.$confirm('确定误报吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
request({
url: `/business/warning/delete`,
method: 'post',
data: { id }
}).then(result => {
if (result.code == 200) Message.success('成功!');
else Message.error(result?.msg);
const item = { title: "感知事件" };
eventMap[`事件专题/${item.title}_close`]?.call(this, item, (item) => { return item?.extData?.id == id }, "special");
// markerClusterIns.setData();
});
})
},
getVehicleTypeList() {
if (vehicleTypeList.length) return;

13
ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/HomeVector/index.vue

@ -1,10 +1,10 @@
<template>
<div class="HomeVector">
<el-tooltip effect="light" content="桩号显隐" placement="left">
<Button :class="['btn', { 'btn-active': activeIcon }]" @click.native="handleClick('Vector')">
<img src="@screen/images/home-Vector/Vector.svg" />
</Button>
</el-tooltip>
<el-tooltip effect="light" content="桩号显隐" placement="left">
<Button :class="['btn', { 'btn-active': activeIcon }]" @click.native="handleClick('Vector')">
<img src="@screen/images/home-Vector/Vector.svg" />
</Button>
</el-tooltip>
</div>
</template>
@ -25,6 +25,9 @@ export default {
activeIcon: null,
};
},
created() {
this.activeIcon = window.showStakeText ? 'Vector' : null;
},
methods: {
handleClick(type) {
this.activeIcon = this.activeIcon === type ? null : type;

25
ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/RoadAndEvents/utils/buttonEvent.js

@ -6,7 +6,7 @@ import {
import { delay } from "@screen/utils/common";
import { Message } from "element-ui";
import { EventTopics } from "@screen/utils/enum.js";
import { debounce, cloneDeep } from "lodash";
import { debounce, cloneDeep, find } from "lodash";
import Vue from "vue";
import { markerClusterIns, getContent, getLatAndLng } from "./map";
@ -146,7 +146,7 @@ export const eventMap = {
if (!data) return;
if (!data.length && !isDefault)
return Message.warning(`没有${item.title}事件数据!`);
return Message.warning(`未查询到${item.title}设备!`);
eventMap[`地图路测设备/map_close`](item);
const cbCall = () =>
@ -278,14 +278,23 @@ export const eventMap = {
loadingMessage?.close();
cacheRemoveFunc[`事件专题/${item.title}`] = () => {
cbCall();
removeDataPreHandle(removeData);
markerClusterIns.removeData(removeData);
cacheRemoveFunc[`事件专题/${item.title}`] = (filter, type) => {
//type为special才重新赋值removeData
let handleData = removeData;
if (filter && type == "special") {
//走误报删除处理 只删除一个
const findItem = find(removeData, filter);
handleData = [findItem];
window.infoWindow.close();
this.emitter.emit("updateDialogVisible", false);
} else cbCall(); //非误报执行,需更新选中事件集合
removeDataPreHandle(handleData);
markerClusterIns.removeData(handleData);
};
},
"事件专题/感知事件_close"(item) {
cacheRemoveFunc[`事件专题/${item.title}`]?.();
"事件专题/感知事件_close"(item, filter, type) {
//感知事件 误报删除兼容
cacheRemoveFunc[`事件专题/${item.title}`]?.(filter, type);
},
};

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

@ -30,10 +30,10 @@
</div>
<template #footer>
<Button v-if="isDisBtn" style="padding:0 24px; pointer-events: none; background-color: #C9C9C9;"
@click.native="handleRestore" :loading="submitting">强制恢复</Button>
<Button v-else style="padding:0 24px;" @click.native="handleRestore" :loading="submitting">强制恢复</Button>
<Button style="padding:0 24px;" @click.native="handleSubmit" :loading="submitting">确认</Button>
<!-- <Button v-if="isDisBtn" style="padding:0 24px; pointer-events: none; background-color: #C9C9C9;"
@click.native="handleRestore" :loading="submitting">强制恢复</Button> -->
<Button style="padding:0 24px;" @click.native="handleSubmit(2)" :loading="submitting">强制恢复</Button>
<Button style="padding:0 24px;" @click.native="handleSubmit(1)" :loading="submitting">确认</Button>
<Button style="background: #C9C9C9;padding:0 24px;"
@click.native="modelVisible = false, submitting = false">取消</Button>
</template>
@ -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);
@ -323,37 +373,27 @@ export default {
}
return data;
},
handleSubmit() {
handleSubmit(value = 1) {
// this.submitting = false;
// let secondFormTable = this.$refs['secondFormTable'].tableData || [];
// let thirdFormTable = this.$refs['thirdFormTable'].tableData || [];
// console.log('12', thirdFormTable);
// let dcArr = [];
// let id = '';
// if (this.dialogType == 2) id = this.planId;
// secondFormTable.forEach(it => {
// dcArr.push(this.formatData(it, 1, id));
// })
// thirdFormTable.forEach(it => {
// dcArr.push(this.formatData(it, 2, id));
// })
let plan = { ...this.planInfo };
let actions = plan.dcExecuteAction.filter(it => it.actionType == value);
plan.dcExecuteAction = actions;
let reqData = {
operationType: 1,//1- 2-
dcEmergencyPlans: this.planInfo,
operationType: value,//1- 2-
dcEmergencyPlans: plan,
dcEvent: this.eventFormData
};
// let url = '';
// if (this.activeName == '-1') {//
// url = '/business/plans/event/confirm';
// reqData = { ...reqData, dcWarning: { ...reqData.dcEvent } }
// } else {//
// url = '/business/plans/event/confirm';
// }
let url = '';
if (this.activeName == '-1') {//
url = '/business/plans/warning/confirm';
reqData = { ...reqData, dcWarning: { ...reqData.dcEvent } }
} else {//
url = '/business/plans/event/confirm';
}
console.log('reqData', reqData)
return;
// return;
request({
url: url,
method: "post",
@ -361,12 +401,14 @@ export default {
}).then((result) => {
if (result.code != 200) return Message.error(result?.msg);
Message.success("提交成功");
this.modelVisible = false;
this.$emit('close', false);
setTimeout(() => {
this.$emit('reInitData', true);
}, 100)
}).catch(() => {
Message.error("提交失败");
}).finally(() => {
this.submitting = false;
// this.$emit('reInitData', true);
})

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;

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

@ -19,10 +19,11 @@
<!-- 确认弹窗 -->
<EventPlanDialog :visible="isShowDialog" :info="info" :eventFormData="formData" :activeName="activeName"
@close="onCloseAddNew" />
@reInitData="() => { this.$emit('update:value', false); this.$emit('queryData', true); }" @close="onCloseAddNew" />
<template #footer>
<Button style="padding: 0 24px;" @click.native="onDelete">误报</Button>
<Button v-if="activeName == '-1' || activeName == '0'" style="padding: 0 24px;"
@click.native="onDelete">误报</Button>
<Button :style="{ backgroundColor: '#C9C9C9', padding: '0 24px' }"
@click.native="modelVisible = false">取消</Button>
<Button v-if="activeName == '-1' || activeName == '0'" style="padding: 0 24px;"
@ -216,6 +217,11 @@ export default {
this.isShowDialog = true;
})
},
reInitData() {
console.log('reInitData')
this.$emit('update:value', false)
this.$emit('queryData', true);
}
}
}

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;
},

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

@ -20,32 +20,30 @@
</el-form-item>
<el-form-item label="触发类型:" prop="triggerMechanism">
<el-select 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-form-item>
</div>
<div class="second">
<el-row>
<el-col :span="2">
<div class="text"><i style="color: red;">*</i>执行操作:</div>
<div class="text"><i style="color: red">*</i>执行操作:</div>
</el-col>
<el-col :span="22">
<FormTable ref="secondFormTable" :tableData="secondFormData"></FormTable>
<FormTable ref="secondFormTable" :tableData="secondFormData" :type="1"></FormTable>
</el-col>
</el-row>
</div>
<div class="third">
<el-row>
<el-col :span="2">
<div class="text"><i style="color: red;">*</i>恢复操作:</div>
<div class="text"><i style="color: red">*</i>恢复操作:</div>
</el-col>
<el-col :span="22">
<FormTable ref="thirdFormTable" :tableData="thirdFormData"></FormTable>
<FormTable ref="thirdFormTable" :tableData="thirdFormData" :type="2"></FormTable>
</el-col>
</el-row>
</div>
@ -53,22 +51,29 @@
</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";
import { throttle } from "lodash"
import { controlModelMap, gzztMap, gzmsMap, eventSubClassMap, trafficKV, perceptionKV } from "@screen/utils/enum.js";
import { throttle } from "lodash";
import {
controlModelMap,
gzztMap,
gzmsMap,
eventSubClassMap,
trafficKV,
perceptionKV,
} from "@screen/utils/enum.js";
const typeMap = {
1: trafficKV,
@ -76,50 +81,55 @@ const typeMap = {
};
export default {
name: 'addAndEditDialog',
name: "addAndEditDialog",
components: {
Dialog,
Form,
Button,
FormTable
FormTable,
},
model: {
prop: 'visible',
event: 'close'
prop: "visible",
event: "close",
},
provide() {
return {
loadData: throttle(this.loadData, 1000)
// loadData: throttle(this.loadData, 100)
loadData: this.loadData
}
},
props: {
visible: Boolean,
detail: {
type: Object,
default: () => { }
}
default: () => { },
},
},
data() {
return {
title: '新增预案',
title: "新增预案",
dialogType: 1,
planId: 0,
submitting: false,
formData: {
eventCategory: 1,
eventType: 1,
triggerMechanism: ''
triggerMechanism: "",
},
secondFormData: [{
deviceType: 1,
searchRule: 1,
qbb: ''
}],
thirdFormData: [{
deviceType: 1,
searchRule: 1,
qbb: ''
}],
secondFormData: [
{
deviceType: 1,
searchRule: 1,
qbb: "",
},
],
thirdFormData: [
{
deviceType: 1,
searchRule: 1,
qbb: "",
},
],
deviceData: [],
eventOptions: trafficKV,
mechanismOptions: [
@ -145,55 +155,56 @@ export default {
},
],
rules: {
planName: [
{ required: true, message: '请输入预案名称', trigger: 'blur' },
],
planName: [{ required: true, message: "请输入预案名称" }],
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.eventOptions = typeMap[this.detail.eventCategory];
this.mechanismOptions = eventSubClassMap[this.detail.eventCategory || 1][this.detail.eventType];
this.mechanismOptions =
eventSubClassMap[this.detail.eventCategory || 1][
this.detail.eventType
];
this.initData(this.detail.id);
} else {
this.title = '新增预案';
this.title = "新增预案";
this.dialogType = 1;
this.formData = {
eventCategory: 1,
eventType: 1,
triggerMechanism: ''
}
this.secondFormData = [{
deviceType: 1,
searchRule: 1,
qbb: ''
}];
this.thirdFormData = [{
deviceType: 1,
searchRule: 1,
qbb: ''
}];
triggerMechanism: "",
};
this.secondFormData = [
{
deviceType: 1,
searchRule: 1,
qbb: "",
},
];
this.thirdFormData = [
{
deviceType: 1,
searchRule: 1,
qbb: "",
},
];
}
}
return this.visible;
},
set(val) {
this.$emit('close', val)
}
this.$emit("close", val);
},
},
},
methods: {
@ -201,92 +212,104 @@ export default {
request({
url: `/business/plans/list/${id}`,
method: "get",
}).then((result) => {
if (result.code != 200) return Message.error(result?.msg);
let data = result.data;
let dcExecuteAction = result.data.dcExecuteAction;
})
.then((result) => {
if (result.code != 200) return Message.error(result?.msg);
let data = result.data;
let dcExecuteAction = result.data.dcExecuteAction;
this.planId = data.id;
this.formData = {
eventCategory: data.eventCategory,
planName: data.planName,
eventType: data.eventType,
triggerMechanism: data.triggerMechanism,
}
this.secondFormData = [];
this.thirdFormData = [];
dcExecuteAction.forEach(it => {
let action = {};
if (it.otherConfig) {
let config = JSON.parse(it.otherConfig);
let qbb = ''
if (config.id) {
qbb = config.content;
config = { dcInfoBoardTemplate: config };
this.planId = data.id;
this.formData = {
eventCategory: data.eventCategory,
planName: data.planName,
eventType: data.eventType,
triggerMechanism: data.triggerMechanism,
};
this.secondFormData = [];
this.thirdFormData = [];
dcExecuteAction.forEach((it) => {
let action = {};
if (it.otherConfig) {
let config = JSON.parse(it.otherConfig);
let qbb = "";
if (config.id) {
qbb = config.content;
config = { dcInfoBoardTemplate: config };
}
// if (config.state) {
// config.gzms = config.state
// }
action = { ...it, ...config, qbb: qbb };
}
// if (config.state) {
// config.gzms = config.state
// }
action = { ...it, ...config, qbb: qbb };
}
if (it.deviceList) {
action.deviceList = it.deviceList.split(',').map(str => Number(str));
}
if (it.actionType == 1) {
this.secondFormData.push(action);
} else if (it.actionType == 2) {
this.thirdFormData.push(action);
}
if (it.deviceList) {
action.deviceList = it.deviceList
.split(",")
.map((str) => Number(str));
}
if (it.actionType == 1) {
this.secondFormData.push(action);
} else if (it.actionType == 2) {
this.thirdFormData.push(action);
}
});
console.log("secondFormData", this.secondFormData);
})
console.log('secondFormData', this.secondFormData)
}).catch((err) => {
console.log(err)
Message.error("查询事件预案列表失败", err);
})
// console.log('secondFormData', this.secondFormData)
// }).catch((err) => {
// console.log(err)
// Message.error("", err);
// })
.catch((err) => {
console.log(err);
Message.error("查询事件预案列表失败", err);
});
},
async loadData(deviceType = 1) {
this.deviceData = [];
let result = await request({
url: `business/device/query?deviceType=${deviceType}`,
method: "get",
})
});
if (result.code != 200) return Message.error(result?.msg);
if (deviceType == 1) {
this.deviceData = result.data.filter(it => it.childType !== '1-1')
this.deviceData = result.data.filter((it) => it.childType !== "1-1");
} else {
this.deviceData = result.data;
}
return this.deviceData;
},
changeEventType(value = 1) {
this.mechanismOptions = eventSubClassMap[this.formData.eventCategory || 1][value];
this.mechanismOptions =
eventSubClassMap[this.formData.eventCategory || 1][value];
},
changeRadio(value = 1) {
this.formData.triggerMechanism = '';
this.formData.triggerMechanism = "";
this.eventOptions = typeMap[value];
this.changeEventType(1);
},
handleChange() {
},
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(',');
handleChange() { },
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 {
data.deviceList = '';
data.deviceList = "";
}
if (it.content) {
data.otherConfig = JSON.stringify({ content: it.content })
data.otherConfig = JSON.stringify({ content: it.content });
}
if (it.controlModel) {
let other = {
controlModel: it.controlModel,
controlModelName: controlModelMap[it.controlModel],
state: it.state,
name: gzztMap[it.state]
}
name: gzztMap[it.state],
};
if (it.time && it?.time[0]) {
other = {
controlModel: it.controlModel,
@ -294,26 +317,26 @@ export default {
state: it.state,
name: gzztMap[it.state],
startTime: it.time[0],
endTime: it.time[1]
}
endTime: it.time[1],
};
}
data.otherConfig = JSON.stringify(other)
data.otherConfig = JSON.stringify(other);
}
if (it.gzms) {
data.otherConfig = JSON.stringify({
state: it.gzms,
name: gzmsMap[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 flg = false;
// for (let item of secondFormTable) {
// if (this.areAllValuesEmpty(item)) { flg = true; break };
@ -326,86 +349,89 @@ export default {
// console.log('12', secondFormTable);
// console.log('34', thirdFormTable);
let dcArr = [];
let id = '';
let id = "";
if (this.dialogType == 2) id = this.planId;
secondFormTable.forEach(it => {
secondFormTable.forEach((it) => {
dcArr.push(this.formatData(it, 1, id));
})
thirdFormTable.forEach(it => {
});
thirdFormTable.forEach((it) => {
dcArr.push(this.formatData(it, 2, id));
})
});
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) => {
if (result.code != 200) return Message.error(result?.msg);
Message.success("提交成功");
this.modelVisible = false;
}).catch(() => {
Message.error("提交失败");
}).finally(() => {
this.submitting = false;
this.$emit('reInitData', true);
dcExecuteAction: dcArr,
},
})
} else if (this.dialogType == 2) {//
.then((result) => {
if (result.code != 200) return Message.error(result?.msg);
Message.success("提交成功");
this.modelVisible = false;
})
.catch(() => {
Message.error("提交失败");
})
.finally(() => {
this.submitting = false;
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) => {
if (result.code != 200) return Message.error(result?.msg);
Message.success("提交成功");
this.modelVisible = false;
}).catch(() => {
Message.error("提交失败");
}).finally(() => {
this.submitting = false;
this.$emit('reInitData', true);
dcExecuteAction: dcArr,
},
})
.then((result) => {
if (result.code != 200) return Message.error(result?.msg);
Message.success("提交成功");
this.modelVisible = false;
})
.catch(() => {
Message.error("提交失败");
})
.finally(() => {
this.submitting = false;
this.$emit("reInitData", true);
});
}
}
})
});
},
areAllValuesEmpty(obj) {
console.log('ass', obj)
console.log("ass", obj);
return Object.keys(obj).every(function (key) {
const value = obj[key];
return (
value == null ||
value === '' ||
value === "" ||
(Array.isArray(value) && value.length === 0) ||
(value instanceof Object && Object.keys(value).length === 0)
);
});
}
}
}
},
},
};
</script>
<style lang="scss" scoped>
.fade-enter-active,
.fade-leave-active {
transition: opacity .24s;
transition: opacity 0.24s;
}
.fade-enter,

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

@ -41,7 +41,7 @@
:value="item.id">
</el-option>
</el-select>
<el-input @click.native="clickQbb(scope.$index)" v-if="scope.row.deviceType == 2"
<el-input @click.native="clickQbb(scope.$index)" v-if="type == 1 && scope.row.deviceType == 2"
placeholder="请选择" v-model="scope.row.qbb" readonly>
<i slot="suffix" class="el-input__icon el-icon-search"></i>
</el-input>
@ -115,6 +115,7 @@ export default {
props: {
visible: Boolean,
eventType: Number,
type: Number,
tableData: {
type: Array,
default: () => [{
@ -219,10 +220,21 @@ export default {
index: 1
}
},
async created() {
let loadData = await this.loadData(1);
// console.log('aa',loadData)
this.sbOptions = loadData;
watch: {
async tableData(newValue) {
console.log('newValue', newValue)
if (newValue) {
const item = this.tableData.find(it => it.searchRule == 1);
console.log('item', item);
if (item && item.deviceType) {
let loadData = await this.loadData(item.deviceType);
console.log('aa', loadData)
this.sbOptions = loadData;
}
}
}
},
mounted() {
},
methods: {
initData() {

2
ruoyi-ui/src/views/JiHeExpressway/pages/perception/eventDetection/components/eventQuery/assets/charts.js

@ -61,7 +61,7 @@ nameList.map((item, index) => {
var options = {
grid: {
top: "15%", //上边距
right: "0", //右边距
right: "5px", //右边距
left: "0", //左边距
bottom: "2%", //下边距
containLabel: true,

2
ruoyi-ui/src/views/JiHeExpressway/pages/perception/trafficFlow/components/heightway/index.vue

@ -255,7 +255,7 @@ export default {
.btnSearch {
background-color: #00b3cc;
// margin-left: 10px;
padding: 6px 15px;
padding: 6px 13px;
font-size: 13px;
}
.btnReset {

Loading…
Cancel
Save