From 2518f4322fee8d75403ea1e08c61cf984bdbb8ad Mon Sep 17 00:00:00 2001 From: hui <770260999@qq.com> Date: Tue, 16 Apr 2024 16:56:09 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=9A=E6=97=B6=E4=BB=BB=E5=8A=A1=E5=81=9A?= =?UTF-8?q?=E4=BA=8660%?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ruoyi-ui/src/api/board/board.js | 53 ++- .../src/assets/styles/JiHeExpressway.scss | 2 + ruoyi-ui/src/common/getBoardBaseData.js | 55 ++- ruoyi-ui/src/common/menuData.js | 14 + ruoyi-ui/src/store/modules/menu.js | 15 +- .../JiHeExpressway/components/Card1/index.vue | 8 +- .../components/Dialog/index.vue | 2 +- .../views/JiHeExpressway/mixins/InfoBoard.js | 8 +- .../strategy/components/AddNEditDialog.vue | 224 ++++++++++++ .../device/strategy/components/TaskItem.vue | 84 +++++ .../strategy/components/taskEditDialog.vue | 338 ++++++++++++++++++ .../pages/control/device/strategy/data.js | 38 ++ .../pages/control/device/strategy/index.vue | 281 +++++++++++++++ .../pages/service/board/index.vue | 2 +- .../pages/service/boardRecord/index.vue | 1 + .../views/JiHeExpressway/utils/api/device.js | 11 + .../src/views/JiHeExpressway/utils/enum.js | 70 ++++ ruoyi-ui/src/views/login.vue | 1 + ruoyi-ui/vue.config.js | 2 +- 19 files changed, 1170 insertions(+), 39 deletions(-) create mode 100644 ruoyi-ui/src/views/JiHeExpressway/pages/control/device/strategy/components/AddNEditDialog.vue create mode 100644 ruoyi-ui/src/views/JiHeExpressway/pages/control/device/strategy/components/TaskItem.vue create mode 100644 ruoyi-ui/src/views/JiHeExpressway/pages/control/device/strategy/components/taskEditDialog.vue create mode 100644 ruoyi-ui/src/views/JiHeExpressway/pages/control/device/strategy/data.js create mode 100644 ruoyi-ui/src/views/JiHeExpressway/pages/control/device/strategy/index.vue create mode 100644 ruoyi-ui/src/views/JiHeExpressway/utils/api/device.js diff --git a/ruoyi-ui/src/api/board/board.js b/ruoyi-ui/src/api/board/board.js index 4378d3cc..95397b90 100644 --- a/ruoyi-ui/src/api/board/board.js +++ b/ruoyi-ui/src/api/board/board.js @@ -15,8 +15,11 @@ export function getBoardList(query) { // 查询设备列表 export function getBoardDeviceInfo(deviceId) { return request({ - url: `/business/board/realtimeProperty/${deviceId}`, - method: 'get' + // url: `/business/board/realtimeProperty/${deviceId}`, + url: `/business/device/properties/realtime/${deviceId}/3A`, + // url: `/business/device/batchFunctions`, + method: 'GET', + params: {} }) } @@ -40,11 +43,49 @@ export function saveBoardReleaseLog(data) { }) } - export function publishToBoard(data) { + let devices = [] + data.deviceList.map(item=>{ + devices.push( + { + id: item.id, + iotDeviceId: item.iotDeviceId, + deviceType: "2" + } + ) + }) + return request({ - url: '/business/board/batch/publish', + // url: '/business/board/batch/publish', + url: `/business/device/batchFunctions`, method: 'post', - data: data + // data: data + data: { + devices, + "functions": [ + { + "functionId": "11", + "params": { + "size": "65535", + "fileName": "play010.lst" + } + }, + { + "functionId": "13", + "params": { + parameters : data.content + } + }, + { + "functionId": "1B", + "params": { + "fileId": "10" + } + } + + ] + } }) -} \ No newline at end of file +} + + diff --git a/ruoyi-ui/src/assets/styles/JiHeExpressway.scss b/ruoyi-ui/src/assets/styles/JiHeExpressway.scss index f68d1c59..acc3b11b 100644 --- a/ruoyi-ui/src/assets/styles/JiHeExpressway.scss +++ b/ruoyi-ui/src/assets/styles/JiHeExpressway.scss @@ -1,4 +1,6 @@ +.flex{ display: flex;} .fl-col{ display: flex; flex-direction: column;} +.fl-around{display: flex; justify-content: space-between;} .fl-1{ flex: 1;} .theme-jihe { $lightBlue: #3de8ff; diff --git a/ruoyi-ui/src/common/getBoardBaseData.js b/ruoyi-ui/src/common/getBoardBaseData.js index 221d4b83..7aec0b3d 100644 --- a/ruoyi-ui/src/common/getBoardBaseData.js +++ b/ruoyi-ui/src/common/getBoardBaseData.js @@ -1,25 +1,42 @@ import Vue from "vue"; import { getDicts } from "@/api/system/dict/data"; -export default function(){ - - - return Promise.all([ - getDicts('iot_device_font_type'), - // getDicts('iot_devices_font_color'), - // getDicts('iot_device_font_inScreen_mode'), - // getDicts('iot_template_category'), - // getDicts('iot_device_font_size'), - ]).then(resArr=>{ - initFontType(resArr[0]); +export default function () { - function initFontType(res){ - let dic = {}; - res.data.forEach(item => { - dic[item.dictValue] = item.cssClass; + + return Promise.all([ + getDicts('iot_device_font_type'), + getDicts('iot_board_pixel'), + // getDicts('iot_devices_font_color'), + // getDicts('iot_device_font_inScreen_mode'), + // getDicts('iot_template_category'), + // getDicts('iot_device_font_size'), + ]).then(resArr => { + initFontType(resArr[0]); + initListAndDic(1, "boardPixel", "dictLabel"); + + function initFontType(res) { //历史原因,情报板字体类型单独一个方法 + let dic = {}; + res.data.forEach(item => { + dic[item.dictValue] = item.cssClass; + }); + Vue.prototype.fontTypeDic = dic; + Vue.prototype.fontTypeList = res.data; + } + + function initListAndDic(idx, namePrefix, labelField) { + let dic = {}; + let list = []; + resArr[idx].data.forEach(item => { + dic[item.dictValue] = item[labelField]; + list.push({ + label: item[labelField], + value: item.dictValue }); - Vue.prototype.fontTypeDic = dic; - Vue.prototype.fontTypeList = res.data; - } - }); + }); + Vue.prototype[namePrefix + "Dic"] = dic; + Vue.prototype[namePrefix + "Options"] = list; + } + + }); } \ No newline at end of file diff --git a/ruoyi-ui/src/common/menuData.js b/ruoyi-ui/src/common/menuData.js index 9a1cbf94..f715bde9 100644 --- a/ruoyi-ui/src/common/menuData.js +++ b/ruoyi-ui/src/common/menuData.js @@ -102,6 +102,20 @@ export default [ }, ], }, + { + title: "设备管控", + name: "controlDevice", + path: "/control/device", + redirect: "controlDeviceStrategy", + children: [ + { + title: "管控策略", + path: "/control/device/strategy", + name: "controlDeviceStrategy", + component: "control/device/strategy/index.vue", + } + ], + }, { title: "扫码报警", name: "controlQR", diff --git a/ruoyi-ui/src/store/modules/menu.js b/ruoyi-ui/src/store/modules/menu.js index 750b9d83..6f0103f4 100644 --- a/ruoyi-ui/src/store/modules/menu.js +++ b/ruoyi-ui/src/store/modules/menu.js @@ -5,12 +5,12 @@ const state = { const mutations = { saveRecent(state){ - localStorage.setItem("recentPages", JSON.stringify(state.recentPages)); + sessionStorage.setItem("recentPages", JSON.stringify(state.recentPages)); }, addRecent(state, item) { if(state.recentPages.length == 0 ){ - state.recentPages = JSON.parse(localStorage.getItem("recentPages") || "[]"); + state.recentPages = JSON.parse(sessionStorage.getItem("recentPages") || "[]"); } let temp; state.recentPages.forEach((unit,index)=>{ @@ -31,16 +31,21 @@ const state = { }, openRecent(state){ state.isRecentOpen = true; - localStorage.setItem("isRecentOpen", true); + sessionStorage.setItem("isRecentOpen", true); }, closeRecent(state){ state.isRecentOpen = false; - localStorage.setItem("isRecentOpen", false); + sessionStorage.setItem("isRecentOpen", false); }, removeRecent(state, item) { let i = state.recentPages.findIndex(unit => unit.path == item.path); state.recentPages.splice(i, 1); mutations.saveRecent(state); + }, + resetRecent(state, para){ + state.isRecentOpen = false; + sessionStorage.setItem("isRecentOpen", false); + sessionStorage.removeItem("recentPages") } } @@ -48,7 +53,7 @@ const state = { const getters = { isRecentOpen(state){ if (state.isRecentOpen === ""){ - state.isRecentOpen = JSON.parse(localStorage.getItem("isRecentOpen")) || false; + state.isRecentOpen = JSON.parse(sessionStorage.getItem("isRecentOpen")) || false; } return state.isRecentOpen; } diff --git a/ruoyi-ui/src/views/JiHeExpressway/components/Card1/index.vue b/ruoyi-ui/src/views/JiHeExpressway/components/Card1/index.vue index f218b3fc..41bde987 100644 --- a/ruoyi-ui/src/views/JiHeExpressway/components/Card1/index.vue +++ b/ruoyi-ui/src/views/JiHeExpressway/components/Card1/index.vue @@ -8,7 +8,7 @@ >

- {{ item.label }}: + {{ item.label }}: {{ getValue(item.key) }}{{ item.suffix }} @@ -94,6 +94,10 @@ export default { type: Boolean, default: true, }, + labelWidth:{ + type: [String,Number], + default:70 + } }, data() { return { @@ -147,7 +151,7 @@ export default { & > :first-child { margin-right: 6px; - flex: 1; + // flex: 1; } & > :last-child { diff --git a/ruoyi-ui/src/views/JiHeExpressway/components/Dialog/index.vue b/ruoyi-ui/src/views/JiHeExpressway/components/Dialog/index.vue index 6291baa9..6cbe424a 100644 --- a/ruoyi-ui/src/views/JiHeExpressway/components/Dialog/index.vue +++ b/ruoyi-ui/src/views/JiHeExpressway/components/Dialog/index.vue @@ -113,7 +113,7 @@ export default { height: 100%; background: rgba(0, 0, 0, 0.36); border-radius: 0px 0px 0px 0px; - z-index: 2100; + z-index: 1999; // display: flex; // align-items: center; // justify-content: center; diff --git a/ruoyi-ui/src/views/JiHeExpressway/mixins/InfoBoard.js b/ruoyi-ui/src/views/JiHeExpressway/mixins/InfoBoard.js index 22b3556f..54776453 100644 --- a/ruoyi-ui/src/views/JiHeExpressway/mixins/InfoBoard.js +++ b/ruoyi-ui/src/views/JiHeExpressway/mixins/InfoBoard.js @@ -48,11 +48,11 @@ export default{ }, // 发布信息 ____publishInfo() { - let deviceIdList = []; + let deviceList = []; if (this.selectedDevice){ - deviceIdList = [this.selectedDevice.iotDeviceId]; + deviceList = [this.selectedDevice]; }else{ - deviceIdList = this.checkedDeviceIds; + deviceList = this.selectedDevices; } this.$confirm('是否确定发布情报板?', '提示', { confirmButtonText: '确定', @@ -84,7 +84,7 @@ export default{ }) }) - let data = { content: content, deviceIdList } + let data = { content: content, deviceList } if (IS_TESTING) { // this.saveLog(content); diff --git a/ruoyi-ui/src/views/JiHeExpressway/pages/control/device/strategy/components/AddNEditDialog.vue b/ruoyi-ui/src/views/JiHeExpressway/pages/control/device/strategy/components/AddNEditDialog.vue new file mode 100644 index 00000000..a42214a6 --- /dev/null +++ b/ruoyi-ui/src/views/JiHeExpressway/pages/control/device/strategy/components/AddNEditDialog.vue @@ -0,0 +1,224 @@ + + + + + diff --git a/ruoyi-ui/src/views/JiHeExpressway/pages/control/device/strategy/components/TaskItem.vue b/ruoyi-ui/src/views/JiHeExpressway/pages/control/device/strategy/components/TaskItem.vue new file mode 100644 index 00000000..c3d2379f --- /dev/null +++ b/ruoyi-ui/src/views/JiHeExpressway/pages/control/device/strategy/components/TaskItem.vue @@ -0,0 +1,84 @@ + + + + + diff --git a/ruoyi-ui/src/views/JiHeExpressway/pages/control/device/strategy/components/taskEditDialog.vue b/ruoyi-ui/src/views/JiHeExpressway/pages/control/device/strategy/components/taskEditDialog.vue new file mode 100644 index 00000000..480d89dd --- /dev/null +++ b/ruoyi-ui/src/views/JiHeExpressway/pages/control/device/strategy/components/taskEditDialog.vue @@ -0,0 +1,338 @@ + + + + + diff --git a/ruoyi-ui/src/views/JiHeExpressway/pages/control/device/strategy/data.js b/ruoyi-ui/src/views/JiHeExpressway/pages/control/device/strategy/data.js new file mode 100644 index 00000000..f48c073f --- /dev/null +++ b/ruoyi-ui/src/views/JiHeExpressway/pages/control/device/strategy/data.js @@ -0,0 +1,38 @@ +import { cloneDeep, merge } from "lodash"; +import * as PresetFormItems from "@screen/pages/control/event/event/FormEvent/PresetFormItems.js"; + +export const searchFormList = [ + { + label: "关键词:", + key: "word", + } +]; + +export const addEditFormList = [ + { + label: "关键词:", + key: "word", + required: true, + isAlone:true, + options: { + type: "text", + autosize: true, + // maxlength: 50, + autosize: { minRows: 1, maxRows: 20 }, + showWordLimit: true, + } + }, + { + label: "关键词2:", + key: "word2", + isAlone: false, + required: true, + options: { + type: "textarea", + autosize: true, + // maxlength: 50, + autosize: { minRows: 2, maxRows: 20 }, + showWordLimit: true, + } + } +]; diff --git a/ruoyi-ui/src/views/JiHeExpressway/pages/control/device/strategy/index.vue b/ruoyi-ui/src/views/JiHeExpressway/pages/control/device/strategy/index.vue new file mode 100644 index 00000000..307520fc --- /dev/null +++ b/ruoyi-ui/src/views/JiHeExpressway/pages/control/device/strategy/index.vue @@ -0,0 +1,281 @@ + + + + + diff --git a/ruoyi-ui/src/views/JiHeExpressway/pages/service/board/index.vue b/ruoyi-ui/src/views/JiHeExpressway/pages/service/board/index.vue index 0bd82fde..b4f2d1bb 100644 --- a/ruoyi-ui/src/views/JiHeExpressway/pages/service/board/index.vue +++ b/ruoyi-ui/src/views/JiHeExpressway/pages/service/board/index.vue @@ -513,7 +513,7 @@ export default { return; } this.selectedBdMsg = []; - getBoardDeviceInfo(deviceFrom.iotDeviceId) + getBoardDeviceInfo(deviceFrom.iotDeviceId, deviceFrom.id) .then((res) => { this.selectedBdMsg = res.data["3A"].content; this.isHideCtt = true; diff --git a/ruoyi-ui/src/views/JiHeExpressway/pages/service/boardRecord/index.vue b/ruoyi-ui/src/views/JiHeExpressway/pages/service/boardRecord/index.vue index d9f8f51e..bf8de810 100644 --- a/ruoyi-ui/src/views/JiHeExpressway/pages/service/boardRecord/index.vue +++ b/ruoyi-ui/src/views/JiHeExpressway/pages/service/boardRecord/index.vue @@ -203,6 +203,7 @@ export default { .body { flex: 1; + height: 0; } .footer { diff --git a/ruoyi-ui/src/views/JiHeExpressway/utils/api/device.js b/ruoyi-ui/src/views/JiHeExpressway/utils/api/device.js new file mode 100644 index 00000000..f3e377b5 --- /dev/null +++ b/ruoyi-ui/src/views/JiHeExpressway/utils/api/device.js @@ -0,0 +1,11 @@ + +import request from '@/utils/request' + +// 查询设备列表 +export function getDeviceList(query){ + return request({ + url: '/business/device/query', + method: 'get', + params: query + }) +} \ No newline at end of file diff --git a/ruoyi-ui/src/views/JiHeExpressway/utils/enum.js b/ruoyi-ui/src/views/JiHeExpressway/utils/enum.js index c96bd6bb..d644c516 100644 --- a/ruoyi-ui/src/views/JiHeExpressway/utils/enum.js +++ b/ruoyi-ui/src/views/JiHeExpressway/utils/enum.js @@ -178,6 +178,71 @@ export const trafficType = { 11: "其他事件", }; +//设备Options +export const deviceTypeOptions = [ + { + value: 1, + label: "摄像机", + }, + { + value: 2, + label: "可变信息标志", + timingControl: true + }, + { + value: 3, + label: "气象监测器", + }, + { + value: 4, + label: "出口诱导灯", + }, + { + value: 5, + label: "路段语音广播", + timingControl: true + }, + { + value: 6, + label: "护栏碰撞", + }, + { + value: 7, + label: "毫米波雷达", + }, + { + value: 8, + label: "合流区预警", + }, + { + value: 9, + label: "智慧锥桶", + }, + { + value: 10, + label: "激光疲劳唤醒", + timingControl: true + }, + { + value: 11, + label: "一类交通量调查站", + }, + { + value: 12, + label: "行车诱导", + timingControl: true + }, + { + value: 13, + label: "智能设备箱", + timingControl: true + }, + { + value: 14, + label: "光线在线监测", + }, +]; + export const WarningTypeList = Object.keys(WarningType).map((key) => { return { value: key * 1, @@ -1007,6 +1072,11 @@ export const DirectionTypes = { 3: "济南方向", 2: "双向", }; +export const directionOptions = [ + {value : "1", label : "菏泽方向"}, + {value : "3", label : "济南方向"}, + {value : "2", label : "双向"} +]; //行车诱导相关 diff --git a/ruoyi-ui/src/views/login.vue b/ruoyi-ui/src/views/login.vue index 473c5d7d..cb7e7aed 100644 --- a/ruoyi-ui/src/views/login.vue +++ b/ruoyi-ui/src/views/login.vue @@ -207,6 +207,7 @@ export default { this.$store .dispatch("Login", this.loginForm) .then(() => { + this.$store.commit("menu/resetRecent"); this.$router.push({ path: this.redirect || "/" }).catch(() => {}); // this.getManageStation(); }) diff --git a/ruoyi-ui/vue.config.js b/ruoyi-ui/vue.config.js index 69be49da..2f263ff2 100644 --- a/ruoyi-ui/vue.config.js +++ b/ruoyi-ui/vue.config.js @@ -52,7 +52,7 @@ module.exports = { // target: `http://10.0.81.204:8087`, //现场后台 刘文阁 // target: `http://10.168.69.255:8087`, //正晨后台 连现场物联 刘文阁 // target: `http://10.168.78.135:8087`, //王钦 - target: `http://10.168.66.196:8087`, //正晨后台 连现场物联 刘文阁2 + target: `http://10.168.66.196:8087`, //正晨后台 连现场物联 刘文阁2 // target: `http://10.168.68.42:8087`, //王思祥 // target: `http://10.168.65.194:8087`, //赵祥龙 // target: `http://10.168.65.156:8097`, //孟