From f7a02eb176bef16356d8fafee644887b182827cc Mon Sep 17 00:00:00 2001 From: "liujw155@outlook.com" Date: Mon, 21 Aug 2023 17:57:09 +0800 Subject: [PATCH] fix bug && vtest 1.1.41 --- src/store/device.js | 2 +- src/subpackage/device/pages/device_manage/device_manage.vue | 7 +++++-- src/subpackage/device/pages/index/index.vue | 2 +- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/store/device.js b/src/store/device.js index 9a52a06..dd10812 100644 --- a/src/store/device.js +++ b/src/store/device.js @@ -29,7 +29,7 @@ export default { if(stadium_id&&_list.some(item=>item.id===stadium_id)){ commit('setStoreInfo', _list.find(item=>item.id===stadium_id)); }else{ - commit('setStoreInfo', _list?.[0] || {}); + if(storeChange || !state?.curStoreInfo?.id)commit('setStoreInfo', _list?.[0] || {}); } return res; }) diff --git a/src/subpackage/device/pages/device_manage/device_manage.vue b/src/subpackage/device/pages/device_manage/device_manage.vue index f2df6ad..225a632 100644 --- a/src/subpackage/device/pages/device_manage/device_manage.vue +++ b/src/subpackage/device/pages/device_manage/device_manage.vue @@ -215,7 +215,7 @@ export default { }, changeDeviceStatus({info, status}){ - let { pageInfo } = this; + let { pageInfo, curStoreInfo } = this; util.showLoad(); deviceServer.get({ url: deviceApi.hardwareSave, @@ -228,7 +228,10 @@ export default { .then(res=>{ if(res.data.code == 0){ util.showNone(res.data.message || '操作成功!') - setTimeout(_=>this.getDeviceList(pageInfo),1200); + setTimeout(_=>this.getDeviceList({ + hardware_type: pageInfo.deviceType, + stadium_id: curStoreInfo.id + }),1200); }else{ util.showNone(res.data.message || '操作失败!'); } diff --git a/src/subpackage/device/pages/index/index.vue b/src/subpackage/device/pages/index/index.vue index 153fbf3..88762b6 100644 --- a/src/subpackage/device/pages/index/index.vue +++ b/src/subpackage/device/pages/index/index.vue @@ -132,7 +132,7 @@ export default { if(nw?.id === od?.id)return; let { brandInfo } = this; this.$store.commit('setBrandInfo', { ...brandInfo, brand: nw }); - this.$store.dispatch('getStoreList'); + this.$store.dispatch('getStoreList', { storeChange: true }); } }, data(){