diff --git a/ruoyi-ui/src/views/JiHeExpressway/components/WarningNotify.vue b/ruoyi-ui/src/views/JiHeExpressway/components/WarningNotify.vue index 8a2b97a6..4579bd8e 100644 --- a/ruoyi-ui/src/views/JiHeExpressway/components/WarningNotify.vue +++ b/ruoyi-ui/src/views/JiHeExpressway/components/WarningNotify.vue @@ -18,7 +18,7 @@ import Cookies from 'js-cookie' import request from "@/utils/request"; import { WarningType as warningTypeMapping, DirectionTypes as gzDirectionMapping, warningSourceMapping, warningStateMapping } from "@screen/utils/enum.js" import { param } from "../../../utils"; - +import store from '@/store' import { checkPermi } from "@/utils/permission.js"; import { checkRole } from '@/utils/permission' export default { @@ -80,13 +80,50 @@ export default { duration: 0 } } else if(checkPermi(["home:notice:warningEvent"]) && para.subEvent === '1'){ - obj = { - content: para.content.content, - time:para.content.event.warningTime, - type: "signal", - level: "info", - duration: 4000 + + //非机预警 + if (para.content.event.warningSource == '6'){ + let roles = [] + if (para.content.event.stakeMark == 'K059+289'){ + roles = ['101'] + } else if (para.content.event.stakeMark == 'K072+847'){ + roles = ['102'] + } else if (para.content.event.stakeMark == 'K086+499'){ + roles = ['103'] + } else if (para.content.event.stakeMark == 'K099+750'){ + roles = ['104'] + } else if (para.content.event.stakeMark == 'K105+904'){ + roles = ['105'] + } else if (para.content.event.stakeMark == 'K126+233'){ + roles = ['106'] + } else if (para.content.event.stakeMark == 'K145+933'){ + roles = ['107'] + } else if (para.content.event.stakeMark == 'K173+950'){ + roles = ['108'] + } else if (para.content.event.stakeMark == 'K179+396'){ + roles = ['109'] + } else if (para.content.event.stakeMark == 'K190+495'){ + roles = ['110'] + } + if(roles.length > 0 && checkRole(roles)){ + obj = { + content: para.content.content, + time:para.content.event.warningTime, + type: "signal", + level: "info", + duration: 4000 + } + } + } else { + obj = { + content: para.content.content, + time:para.content.event.warningTime, + type: "signal", + level: "info", + duration: 4000 + } } + } else if(checkPermi(["home:notice:event"]) && para.subEvent === 'trafficFlowDataEarlyWarning'){ //预警事件 obj = { content: para.content.content, diff --git a/ruoyi-ui/src/views/JiHeExpressway/pages/control/manual/events/data.js b/ruoyi-ui/src/views/JiHeExpressway/pages/control/manual/events/data.js index 61bad433..f5bef710 100644 --- a/ruoyi-ui/src/views/JiHeExpressway/pages/control/manual/events/data.js +++ b/ruoyi-ui/src/views/JiHeExpressway/pages/control/manual/events/data.js @@ -1,8 +1,37 @@ import * as PresetFormItems from "@screen/pages/control/event/event/FormEvent/PresetFormItems.js"; import { warningType } from "@screen/utils/enum.js"; +import { checkRole } from '@/utils/permission' + +export function checkFacility() { + if(checkRole(['101','102','103','104','105','106','107','108','109','110',]) && !checkRole(["admin"])){ + if (checkRole(["101"])){ + return "大学城收费站" + } else if (checkRole(["102"])){ + return "长清收费站" + } else if (checkRole(["103"])){ + return "孝里收费站" + } else if (checkRole(["104"])){ + return "平阴北收费站" + } else if (checkRole(["105"])){ + return "平阴收费站" + } else if (checkRole(["106"])){ + return "平阴南收费站" + } else if (checkRole(["107"])){ + return "东平收费站" + } else if (checkRole(["108"])){ + return "梁山东收费站" + } else if (checkRole(["109"])){ + return "梁山收费站" + } else if (checkRole(["110"])){ + return "嘉祥西收费站" + } else { + return "" + } + } +} export const searchFormList = [ - + { label: "类型:", key: "warningType", @@ -56,10 +85,12 @@ export const searchFormList = [ label: "收费站:", key: "facilityName", type: "select", + default: checkFacility(), options: { clearable: true, + disabled: checkRole(['101','102','103','104','105','106','107','108','109','110',]) && !checkRole(["admin"]), options: [ - + ], }, }, { diff --git a/ruoyi-ui/src/views/JiHeExpressway/pages/control/manual/events/index.vue b/ruoyi-ui/src/views/JiHeExpressway/pages/control/manual/events/index.vue index 0e0a0e8c..f4cc2229 100644 --- a/ruoyi-ui/src/views/JiHeExpressway/pages/control/manual/events/index.vue +++ b/ruoyi-ui/src/views/JiHeExpressway/pages/control/manual/events/index.vue @@ -68,6 +68,7 @@ import { searchFormList } from "./data"; import request from "@/utils/request"; import { exportFile } from "@screen/utils/common"; import { WarningType, WarningSubclass } from "@screen/utils/enum.js"; +import { checkRole } from '@/utils/permission' const directionMapping = { 1: "菏泽方向", @@ -131,11 +132,12 @@ export default { }, // 刷新 onRefresh() { + this.checkFacility() this.searchData.pageNum = 1; this.$refs.searchComp.handleResetForm(); }, initData() { - + this.checkFacility() perceivedEventsList(this.searchData, this.pageNum, this.pageSize).then( (res) => { if (res.code != 200) return Message.error(res?.msg); @@ -158,6 +160,31 @@ export default { } ); }, + checkFacility(){ + if(checkRole(['101','102','103','104','105','106','107','108','109','110',]) && !checkRole(["admin"])){ + if (checkRole(["101"])){ + this.searchData.facilityName = "大学城收费站" + } else if (checkRole(["102"])){ + this.searchData.facilityName = "长清收费站" + } else if (checkRole(["103"])){ + this.searchData.facilityName = "孝里收费站" + } else if (checkRole(["104"])){ + this.searchData.facilityName = "平阴北收费站" + } else if (checkRole(["105"])){ + this.searchData.facilityName = "平阴收费站" + } else if (checkRole(["106"])){ + this.searchData.facilityName = "平阴南收费站" + } else if (checkRole(["107"])){ + this.searchData.facilityName = "东平收费站" + } else if (checkRole(["108"])){ + this.searchData.facilityName = "梁山东收费站" + } else if (checkRole(["109"])){ + this.searchData.facilityName = "梁山收费站" + } else if (checkRole(["110"])){ + this.searchData.facilityName = "嘉祥西收费站" + } + } + }, onSizeChange(pageSize) { this.pageSize = pageSize; this.initData(); @@ -172,12 +199,12 @@ export default { if(data.warningType){ this.searchData.warningType = data.warningType } else { - delete this.searchData.warningType; + delete this.searchData.warningType; } if(data.direction){ this.searchData.direction = data.direction } else { - delete this.searchData.direction; + delete this.searchData.direction; } this.initData(); },