From e11d319ec3afc147dd5e5c8c4d665aea04fe8042 Mon Sep 17 00:00:00 2001 From: aixianling Date: Mon, 4 Nov 2024 10:45:54 +0800 Subject: [PATCH 1/8] =?UTF-8?q?=E4=BC=98=E5=8C=96=E5=9C=B0=E5=9B=BE?= =?UTF-8?q?=E7=BB=84=E4=BB=B6=E5=88=B7=E6=96=B0=E9=80=BB=E8=BE=91=E5=8F=8A?= =?UTF-8?q?=E5=88=9D=E5=A7=8B=E5=8C=96=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/AppMap.vue | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/src/views/AppMap.vue b/src/views/AppMap.vue index 9bdf9f8..eb0d288 100644 --- a/src/views/AppMap.vue +++ b/src/views/AppMap.vue @@ -16,17 +16,18 @@ export default { watch: { search: { deep: true, handler() { - this.getData().then(() => this.refreshData()) + this.getData().then(() => this.refreshData("watch search")) } }, thirdGoods: { deep: true, handler() { - this.getData().then(() => this.refreshData()) + this.getData().then(() => this.refreshData("watch thirdGoods")) } }, }, methods: { loadLib() { + const {$loadScript} = window return Promise.all([ '/presource/datascreen/js/turf.min.js', ].map(e => $loadScript('js', e))) @@ -63,7 +64,7 @@ export default { return this.geoJson = {type: 'FeatureCollection', features: maps.flat(1)} }) }, - async initMap() { + initMap() { const {echarts, turf, $waitFor} = window const boundary = turf.union(this.geoJson) boundary.properties.name = "boundary" @@ -71,6 +72,7 @@ export default { echarts.registerMap('zhengzhou', this.geoJson) $waitFor(this.$el).then(() => { this.map = echarts.init(this.$el) + if (!this.map) return setTimeout(() => this.initMap(), 500) const areaColor = { type: 'linear', x: 0, y: 0, x2: 0, y2: 1, colorStops: [ {offset: 0, color: 'rgba(61,127,255,0.35)'}, @@ -119,7 +121,7 @@ export default { this.$marketBoard.screenId = 'a90522ef-869b-40ea-8542-d1fc9674a1e8' } }) - this.refreshData() + this.refreshData("initMap") }) }, convertData(layers) { @@ -135,16 +137,16 @@ export default { }) return Object.values(result).map(data => ({data})) }, - refreshData() { + refreshData(from) { + console.log("refreshData调用位置:", from) const {thirdGoods: {goodsName}} = this const title = {left: 20, top: 20, text: goodsName ? `{sub|选择产品:}${goodsName}` : '', textStyle: {color: "#fff", rich: {sub: {color: "#fff", fontSize: 16}}}} - this.map.setOption({title, series: this.convertData(this.layers)}) + if (!this.map) return this.initMap() + this.map?.setOption({title, series: this.convertData(this.layers)}) }, }, mounted() { - this.loadLib().then(() => Promise.all([ - this.getData(), - ])).then(() => this.initMap()) + this.loadLib().then(() => this.getData()).then(() => this.initMap()) } } From 42c72225df0e96049f3893365b0c7d2d35a97c55 Mon Sep 17 00:00:00 2001 From: aixianling Date: Thu, 14 Nov 2024 18:14:54 +0800 Subject: [PATCH 2/8] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E9=94=80=E5=94=AE?= =?UTF-8?q?=E5=B0=8F=E6=97=B6=E5=AD=97=E6=AE=B5=E5=B9=B6=E6=9B=B4=E6=96=B0?= =?UTF-8?q?=E7=9B=B8=E5=85=B3=E8=A7=86=E5=9B=BE=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/utils/inject.js | 1 + src/views/AppHourCount.vue | 7 ++++++- src/views/AppHourSale.vue | 2 ++ 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/utils/inject.js b/src/utils/inject.js index d4b3eba..e7878f9 100644 --- a/src/utils/inject.js +++ b/src/utils/inject.js @@ -66,6 +66,7 @@ window.evenRowBGC = (color = "#09265B") => `transparent;background-image: linear Vue.prototype.$marketBoard = Vue.observable({ screenId: '5b1849ac-4fc3-451a-844c-3362b47341ef', thirdGoods: {}, + saleHour: undefined, search: {"groupCodeList": [], "currentDate": "20240701", "compareDate": "20240630", "hourNum": "18"} }) Vue.prototype.$multipleStoreBoard = Vue.observable({ diff --git a/src/views/AppHourCount.vue b/src/views/AppHourCount.vue index 0527566..63abe24 100644 --- a/src/views/AppHourCount.vue +++ b/src/views/AppHourCount.vue @@ -11,6 +11,7 @@ export default { }, computed: { search: v => v.$marketBoard.search, + saleHour: v => v.$marketBoard.saleHour, columns: v => { return [ {label: '品类', prop: "categoryName", width: 100}, @@ -70,8 +71,9 @@ export default { methods: { getTableData() { const {$http, $waitFor} = window + const {saleHour: hourNum} = this $waitFor($http).then(() => $http.post("/data-boot/la/screen/marketBoard/hourCount", { - ...this.search, limit: 999 + ...this.search, limit: 999, hourNum })).then(res => { if (res?.data) { this.tableData = res.data?.page?.records?.sort((a, b) => sort.indexOf(a.categoryId) - sort.indexOf(b.categoryId)) || [] @@ -85,6 +87,9 @@ export default { immediate: true, deep: true, handler() { this.getTableData() } + }, + saleHour() { + this.getTableData() } } } diff --git a/src/views/AppHourSale.vue b/src/views/AppHourSale.vue index e630dfc..b9e9ca3 100644 --- a/src/views/AppHourSale.vue +++ b/src/views/AppHourSale.vue @@ -97,6 +97,8 @@ export default { }, handleSta({hour}) { this.handleMouseout() + const hourNum = Number(hour?.substring(0, 2) || -1) + this.$set(this.$marketBoard, 'saleHour', hourNum < this.search.hourNum ? hourNum : undefined) const rowIndex = this.tableData.findIndex(e => e.hour == hour) const v = this const summary = { From f638418345ab090cdc8832018f70458a3207f214 Mon Sep 17 00:00:00 2001 From: aixianling Date: Fri, 15 Nov 2024 09:03:05 +0800 Subject: [PATCH 3/8] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=B0=8F=E6=97=B6?= =?UTF-8?q?=E6=95=B0=E8=AE=A1=E7=AE=97=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/AppHourSale.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/views/AppHourSale.vue b/src/views/AppHourSale.vue index b9e9ca3..41a2b51 100644 --- a/src/views/AppHourSale.vue +++ b/src/views/AppHourSale.vue @@ -97,7 +97,7 @@ export default { }, handleSta({hour}) { this.handleMouseout() - const hourNum = Number(hour?.substring(0, 2) || -1) + const hourNum = Number(hour?.substring(0, 2) || -2) + 1 this.$set(this.$marketBoard, 'saleHour', hourNum < this.search.hourNum ? hourNum : undefined) const rowIndex = this.tableData.findIndex(e => e.hour == hour) const v = this From a127b3ea47948e2a23142aa5ca5da2279ba4a64c Mon Sep 17 00:00:00 2001 From: aixianling Date: Wed, 27 Nov 2024 10:55:44 +0800 Subject: [PATCH 4/8] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E6=97=B6=E9=97=B4?= =?UTF-8?q?=E6=88=B3=E5=AD=97=E6=AE=B5=E4=BB=A5=E5=90=8C=E6=AD=A5=E6=90=9C?= =?UTF-8?q?=E7=B4=A2=E7=8A=B6=E6=80=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/utils/inject.js | 6 +++--- src/views/AppNavbar.vue | 18 ++++++++++++++---- 2 files changed, 17 insertions(+), 7 deletions(-) diff --git a/src/utils/inject.js b/src/utils/inject.js index e7878f9..ed10730 100644 --- a/src/utils/inject.js +++ b/src/utils/inject.js @@ -67,18 +67,18 @@ Vue.prototype.$marketBoard = Vue.observable({ screenId: '5b1849ac-4fc3-451a-844c-3362b47341ef', thirdGoods: {}, saleHour: undefined, - search: {"groupCodeList": [], "currentDate": "20240701", "compareDate": "20240630", "hourNum": "18"} + search: {"groupCodeList": [], "currentDate": "20240701", "compareDate": "20240630", "hourNum": "18", t: null} }) Vue.prototype.$multipleStoreBoard = Vue.observable({ carouselIndex: 0, - search: {"groupCodeList": [], "hourNum": "", type: "1"} + search: {"groupCodeList": [], "hourNum": "", type: "1", t: null} }) Vue.prototype.$storeBoard = Vue.observable({ currentDate: "20240705", dialog: false, aroundStock: [], query: {}, - search: {} + search: {t: null} }) Vue.component("HlsPlayer", { render: (h) => h('div', {style: {width: '100%', height: '100%'}}), diff --git a/src/views/AppNavbar.vue b/src/views/AppNavbar.vue index fef356a..ccdb7dc 100644 --- a/src/views/AppNavbar.vue +++ b/src/views/AppNavbar.vue @@ -1,14 +1,14 @@ From 1845f6cc9a47873e5a7146a32d755e252f1fd4cb Mon Sep 17 00:00:00 2001 From: aixianling Date: Wed, 27 Nov 2024 15:13:20 +0800 Subject: [PATCH 5/8] =?UTF-8?q?=E4=BC=98=E5=8C=96=E6=90=9C=E7=B4=A2?= =?UTF-8?q?=E7=8A=B6=E6=80=81=E5=90=8C=E6=AD=A5=E5=8F=8A=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E5=88=B7=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() { From 9c6248e5df885a6598ff36663e8f5364ae3cbb0b Mon Sep 17 00:00:00 2001 From: aixianling Date: Fri, 29 Nov 2024 18:03:26 +0800 Subject: [PATCH 6/8] =?UTF-8?q?=E4=BC=98=E5=8C=96=E6=90=9C=E7=B4=A2?= =?UTF-8?q?=E7=8A=B6=E6=80=81=E5=A4=84=E7=90=86=E5=8F=8A=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E8=AF=B7=E6=B1=82=E8=8A=82=E6=B5=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/AppStoresTable.vue | 64 +++++++++++++++++++++++++----------- 1 file changed, 45 insertions(+), 19 deletions(-) diff --git a/src/views/AppStoresTable.vue b/src/views/AppStoresTable.vue index b5e0d3b..cb6e69b 100644 --- a/src/views/AppStoresTable.vue +++ b/src/views/AppStoresTable.vue @@ -1,4 +1,14 @@