From 7126c6b2761a4ffa28148cc605127139fa4411f4 Mon Sep 17 00:00:00 2001 From: "luoJunYong.123" Date: Tue, 4 Jan 2022 18:32:45 +0800 Subject: [PATCH] update --- src/App.vue | 4 ++++ src/api/api.js | 4 ++-- src/pages/counter/list/index.vue | 17 +++++++++++++---- src/store/modules/system.js | 13 +++++++++---- src/utils/utilFunction.js | 3 ++- 5 files changed, 30 insertions(+), 11 deletions(-) diff --git a/src/App.vue b/src/App.vue index 6b78272..f4c17e1 100644 --- a/src/App.vue +++ b/src/App.vue @@ -17,11 +17,15 @@ //在页面加载时读取localStorage里的状态信息 if (util.local.get(Setting.storeKey) ) { this.$store.replaceState(Object.assign({}, this.$store.state,util.local.get(Setting.storeKey))) + this.$store.system.replaceState(Object.assign({}, sessionStorage.getItem('systemData'))) } //在页面刷新时将vuex里的信息保存到localStorage里 window.addEventListener("beforeunload",()=>{ util.local.get(Setting.tokenKey) && util.local.set(Setting.storeKey,this.$store.state) + sessionStorage.setItem('systemData', this.$store.system.state) + console.log('????/') + console.log(sessionStorage.getItem('systemData')) }) } } diff --git a/src/api/api.js b/src/api/api.js index 60da40a..4a88966 100644 --- a/src/api/api.js +++ b/src/api/api.js @@ -3,8 +3,8 @@ import router from '../router'; // 创建axios实例 const service = axios.create({ // baseURL: "http://www.huorantech.cn:9000",//线上 - baseURL: "http://39.108.250.202:9000/", // 中台测试服 - // baseURL: "http://192.168.31.137:9000/", // 赓 + // baseURL: "http://39.108.250.202:9000/", // 中台测试服 + baseURL: "http://192.168.31.137:9000/", // 赓 // baseURL: "http://192.168.31.151:9000/", // 榕 // baseURL: "http://192.168.31.125:9000/", // 坤 // baseURL: 'http://39.108.250.202:9000', diff --git a/src/pages/counter/list/index.vue b/src/pages/counter/list/index.vue index 97a3a9e..708fd77 100644 --- a/src/pages/counter/list/index.vue +++ b/src/pages/counter/list/index.vue @@ -104,7 +104,7 @@
-
+

{{item.name}}

@@ -979,6 +979,17 @@ export default { } else { this.manageVisible = false; } + + //在页面加载时读取localStorage里的状态信息 + if(sessionStorage.getItem('systemKey')) { + this.$store.commit('system/containBusinessKey', sessionStorage.getItem('systemKey')) + console.log('---') + console.log(this.$store.state.system.businessKey) + } + + window.addEventListener("beforeunload",()=>{ + sessionStorage.setItem('systemKey', this.$store.state.system.businessKey) + }) }, mounted(){ let that = this @@ -1259,9 +1270,7 @@ export default { // } // }) // }) - - console.log(clickList) - + this.addGoods(clickList) // this.$store.commit('system/changeGoods',{push:arr}) // // 加东西 // this.auditGoodsShelf.push({name:'银行卡', src:require('@/assets/img/goods/bankCard.png'), id:16}) // diff --git a/src/store/modules/system.js b/src/store/modules/system.js index 8163bcf..c131363 100644 --- a/src/store/modules/system.js +++ b/src/store/modules/system.js @@ -32,8 +32,8 @@ export default { needs: [] }, '项目一': { - data: [14, 12, 11, 13], - needs: [0] + data: [15, 13, 23, 14], + needs: [16, 17] } }, goods:[// 物品栏的物品 @@ -76,6 +76,9 @@ export default { ], }, mutations: { + containBusinessKey(state, containKey) { + state.businessKey = containKey + }, setBusinessKey: (state, val) => { state.businessKey = val }, @@ -86,16 +89,18 @@ export default { const needArr = [...state.businessSelect[state.businessKey].needs] for(let i=0; i { // 传个物品对象过来 diff --git a/src/utils/utilFunction.js b/src/utils/utilFunction.js index a89b46c..968c8e8 100644 --- a/src/utils/utilFunction.js +++ b/src/utils/utilFunction.js @@ -156,7 +156,8 @@ const autoPlay = (parentId, form, myTable2, myTable, cards=[]) => { let params= { parentId, lcJudgmentRuleReq:formList, - projectId:+projectId, + projectId: 11, + // projectId:+projectId, startTime:startTime, } console.log('---提交的')