From 6afc7951f6d441b6a61cca1b4de09d7783b2bd3e Mon Sep 17 00:00:00 2001 From: hui <770260999@qq.com> Date: Mon, 6 May 2024 16:03:38 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=8C=E5=96=84=E6=83=85=E6=8A=A5=E6=9D=BF?= =?UTF-8?q?=E8=AE=B0=E5=BD=95=E5=92=8C=E5=AE=9A=E6=97=B6=E7=AE=A1=E6=8E=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ruoyi-ui/src/App.vue | 7 +++- ruoyi-ui/src/store/modules/menu.js | 17 ++++---- .../components/RecentPages/index.vue | 17 ++++++-- ruoyi-ui/src/views/JiHeExpressway/index.vue | 1 + .../device/strategy/components/TaskItem.vue | 4 +- .../strategy/components/taskEditDialog.vue | 6 ++- .../pages/service/boardRecord/index.vue | 42 ++++++++++--------- ruoyi-ui/vue.config.js | 4 +- 8 files changed, 59 insertions(+), 39 deletions(-) diff --git a/ruoyi-ui/src/App.vue b/ruoyi-ui/src/App.vue index 93f035b3..cc8374da 100644 --- a/ruoyi-ui/src/App.vue +++ b/ruoyi-ui/src/App.vue @@ -21,16 +21,19 @@ export default { name: "App", data() { return { - path: this.$route.path, + // path: this.$route.path, }; }, + mounted(){ + this.$store.commit("menu/resetRecent"); + }, components: { websocket, // websocket_phone }, watch: { $route(to, from) { - this.path = this.$route.path; + // this.path = this.$route.path; }, }, metaInfo() { diff --git a/ruoyi-ui/src/store/modules/menu.js b/ruoyi-ui/src/store/modules/menu.js index c8d81166..bd024a7c 100644 --- a/ruoyi-ui/src/store/modules/menu.js +++ b/ruoyi-ui/src/store/modules/menu.js @@ -1,3 +1,4 @@ +import Vue from "vue" const state = { recentPages: [], isRecentOpen:"", @@ -5,12 +6,12 @@ const state = { const mutations = { saveRecent(state){ - sessionStorage.setItem("recentPages", JSON.stringify(state.recentPages)); + localStorage.setItem("recentPages", JSON.stringify(state.recentPages)); }, addRecent(state, item) { if(state.recentPages.length == 0 ){ - state.recentPages = JSON.parse(sessionStorage.getItem("recentPages") || "[]"); + state.recentPages = JSON.parse(localStorage.getItem("recentPages") || "[]"); } let temp; state.recentPages.forEach((unit,index)=>{ @@ -32,18 +33,19 @@ const state = { pinRecent(state, item){ state.recentPages.forEach((unit, index) => { if (unit.path == item.path) { - unit.isPinned = !unit.isPinned; + // unit.isPinned = !unit.isPinned; + Vue.prototype.$set(unit, "isPinned", !unit.isPinned); } }); mutations.saveRecent(state); }, openRecent(state){ state.isRecentOpen = true; - sessionStorage.setItem("isRecentOpen", true); + localStorage.setItem("isRecentOpen", true); }, closeRecent(state){ state.isRecentOpen = false; - sessionStorage.setItem("isRecentOpen", false); + localStorage.setItem("isRecentOpen", false); }, removeRecent(state, item) { let i = state.recentPages.findIndex(unit => unit.path == item.path); @@ -51,13 +53,14 @@ const state = { mutations.saveRecent(state); }, resetRecent(state, para){ - temp = JSON.parse(sessionStorage.getItem("recentPages") || "[]"); + let temp = JSON.parse(localStorage.getItem("recentPages") || "[]"); state.recentPages = []; temp.forEach((unit, index) => { if (unit.isPinned) { state.recentPages.push(unit); } }); + localStorage.setItem("recentPages", JSON.stringify(state.recentPages)); state.isRecentOpen = true; } @@ -66,7 +69,7 @@ const state = { const getters = { isRecentOpen(state){ if (state.isRecentOpen === ""){ - state.isRecentOpen = JSON.parse(sessionStorage.getItem("isRecentOpen")) || false; + state.isRecentOpen = JSON.parse(localStorage.getItem("isRecentOpen")) || false; } return state.isRecentOpen; } diff --git a/ruoyi-ui/src/views/JiHeExpressway/components/RecentPages/index.vue b/ruoyi-ui/src/views/JiHeExpressway/components/RecentPages/index.vue index eede637f..0562463e 100644 --- a/ruoyi-ui/src/views/JiHeExpressway/components/RecentPages/index.vue +++ b/ruoyi-ui/src/views/JiHeExpressway/components/RecentPages/index.vue @@ -15,8 +15,13 @@ :style="{width:item.title.length*14+'px'}"> {{item.title}}

-

- + +

+ +

+
+ + @@ -241,11 +246,15 @@ export default{ width:16px; height: 10px; display: flex; align-items: center; justify-content: center; i{ - display: block; + display: none; width:6px; height: 6px; border-radius: 3px; } - &.active i{ background-color: #FA0;} + &.active i{ display: block; background-color: #FA0; } } + &:hover .btn_pin.unactive i { + display: block; + background-color: #999; + } .btn_close { position: absolute; right: 6px; diff --git a/ruoyi-ui/src/views/JiHeExpressway/index.vue b/ruoyi-ui/src/views/JiHeExpressway/index.vue index 1573d659..c1f020dc 100644 --- a/ruoyi-ui/src/views/JiHeExpressway/index.vue +++ b/ruoyi-ui/src/views/JiHeExpressway/index.vue @@ -57,6 +57,7 @@ export default { } }, mounted(){ + // this.$store.commit("menu/resetRecent"); getBoardBaseData().then(res => { this.isShowContent = true; }); 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 index 3a88af8e..1f26af2f 100644 --- 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 @@ -107,7 +107,7 @@ export default { // temp.functions[1].params.CONTENT = temp.functions[1].params.CONTENT.replaceAll(/\\n/g, '\\\\n').replaceAll(/=/g, '\\=').replaceAll(/,/g, '\\,').replaceAll(/ /g, ' '); let params = {}; if (temp.deviceType == '2'){ - params = temp.functions[1].params + params = temp.functions[1].params.parameters[0] } else if (temp.deviceType == '5'){ params = temp.functions[0].params } else if (temp.deviceType == '10') { @@ -202,7 +202,7 @@ export default { .text{ flex: 1; display: flex; align-items: center; justify-content: center; word-break: break-all;} .center{ flex: 1; display: flex; flex-direction: column; justify-content: center; align-items: center;} } - .button{ width:140px; margin-left: 10px; display: flex; align-items: center;} + .button{ width:120px; margin-left: 10px; display: flex; align-items: center; justify-content: flex-end;} } } 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 index e2d45106..39254f5b 100644 --- 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 @@ -6,7 +6,8 @@ --> - + @@ -196,8 +197,8 @@ export default { handler(bool) { if (!bool) return; this.propData?.id ? this.mode = 'edit' : this.mode = 'add'; - this.transformData(); this.initBasicData(); + this.transformData(); }, }, }, @@ -220,6 +221,7 @@ export default { this.editData.devices = _.map(this.propData.devices, "id"); // { "STAY": 90, "ACTION": "1", "SPEED": "0", "COLOR": "ffff00", "FONT": "3", "FONT_SIZE": "24", "CONTENT": "长清收费站\\\\n出入口封闭", "width": "160", "height": "80", "formatStyle": "2" } if (this.propData.deviceType == "2"){ + console.log(this.propData.params , "++========"); this.editData.type2 = BoardUtils.contentToDeviceItem(this.propData.params); } else if (["5","10","13"].includes(this.propData.deviceType)){ this.editData["type" + this.propData.deviceType] = { ...this.propData.params}; 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 17a99026..3c45b286 100644 --- a/ruoyi-ui/src/views/JiHeExpressway/pages/service/boardRecord/index.vue +++ b/ruoyi-ui/src/views/JiHeExpressway/pages/service/boardRecord/index.vue @@ -22,36 +22,36 @@
- - - + + + + + + + - - - + - - - - -
@@ -74,6 +74,7 @@ import BoardRecordPreview from '@screen/components/infoBoard/BoardRecordPreview. import {DirectionTypes} from '@screen/utils/enum.js'; import InputSearch from "@screen/components/InputSearch/index.vue"; import { searchFormList } from "./data"; +import moment from "moment"; export default { name: 'boardRecord', @@ -86,6 +87,7 @@ export default { }, data() { return { + moment, testData : {"STAY":"30","ACTION":"1","SPEED":"0","COLOR":"ffff00","FONT":"3","FONT_SIZE":"32","CONTENT":"因改扩建施工 平阴南、梁山收费站出入口封闭","width":"768","height":"64","formatStyle":"2"}, tableData: [], searchFormList, diff --git a/ruoyi-ui/vue.config.js b/ruoyi-ui/vue.config.js index 35bf9094..77f27227 100644 --- a/ruoyi-ui/vue.config.js +++ b/ruoyi-ui/vue.config.js @@ -52,9 +52,9 @@ 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.72.174:8087`, //赵祥龙 + // target: `http://10.168.72.174:8087`, //赵祥龙 // target: `http://10.168.65.156:8097`, //孟 // target: `http://10.168.56.165:8087`, //王家宝 // target: `http://10.168.77.128:8087`, //王兴琳