From 1845f6cc9a47873e5a7146a32d755e252f1fd4cb Mon Sep 17 00:00:00 2001 From: aixianling Date: Wed, 27 Nov 2024 15:13:20 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E6=90=9C=E7=B4=A2=E7=8A=B6?= =?UTF-8?q?=E6=80=81=E5=90=8C=E6=AD=A5=E5=8F=8A=E6=95=B0=E6=8D=AE=E5=88=B7?= =?UTF-8?q?=E6=96=B0=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/AppStoresTable.vue | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/src/views/AppStoresTable.vue b/src/views/AppStoresTable.vue index 92cca7a..b5e0d3b 100644 --- a/src/views/AppStoresTable.vue +++ b/src/views/AppStoresTable.vue @@ -65,8 +65,12 @@ export default { }, watch: { search: { - immediate: true, deep: true, handler(v) { - this.getData().then(() => { + immediate: true, deep: true, handler(v, old) { + if (old) { + delete v.t + old?.t && delete old.t + } + (old && JSON.stringify(v) == JSON.stringify(old) ? this.refreshData() : this.getData()).then(() => { if (v.interval > 0 && v.changeWay == '1') { this.$refs.carousel?.$forceUpdate() } @@ -164,6 +168,14 @@ export default { } else if (e.code == "ArrowRight") { this.$refs.carousel.next() } + }, + async refreshData() { + return Promise.all([this.getStoreKeyGoods(), this.getCategorySales()]).then(() => { + this.stores.map(store => { + store.keyGoods = this.storeKeyGoods.filter(e => e.storeCode == store.storeCode) || [] + store.categorySale = this.categorySales.filter(e => e.storeCode == store.storeCode) || [] + }) + }) } }, mounted() {