diff --git a/src/assets/main.css b/src/assets/main.css index da5dcb6..49c426f 100644 --- a/src/assets/main.css +++ b/src/assets/main.css @@ -249,3 +249,20 @@ a, .green { .AppSubTitle .el-select { width: 120px; } + +@keyframes flashOpacity { + 0%, 100% { + opacity: 1; /* 完全不透明 */ + } + 50% { + opacity: 0; /* 完全透明 */ + } +} + +/* 应用动画到元素 */ +.flash-opacity { + .cell > span { + animation: flashOpacity 1s infinite; /* 动画名称、持续时间、重复次数 */ + color: red + } +} diff --git a/src/utils/inject.js b/src/utils/inject.js index d4b3eba..0a41839 100644 --- a/src/utils/inject.js +++ b/src/utils/inject.js @@ -66,18 +66,19 @@ window.evenRowBGC = (color = "#09265B") => `transparent;background-image: linear Vue.prototype.$marketBoard = Vue.observable({ screenId: '5b1849ac-4fc3-451a-844c-3362b47341ef', thirdGoods: {}, - search: {"groupCodeList": [], "currentDate": "20240701", "compareDate": "20240630", "hourNum": "18"} + saleHour: undefined, + 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%'}}), @@ -134,6 +135,10 @@ Vue.component("scrollTable", { return h('el-table', { props: { headerCellClassName: 'tableHeader', cellClassName: 'tableCell', stripe: !0, height: '100%', + rowClassName({row}) { + const item = columns.find(e => e.flash == 1) + return item?.prop && row[item.prop] <= 0 ? 'flash-opacity' : '' + }, ...config, data: tableData, }, class: 'scrollTable', on: { diff --git a/src/views/AppCarouselList.vue b/src/views/AppCarouselList.vue index a71d4a1..54abd55 100644 --- a/src/views/AppCarouselList.vue +++ b/src/views/AppCarouselList.vue @@ -23,7 +23,7 @@ export default { {label: "昨日销售数量", prop: "yesterdaySaleNum", width: 70}, {label: "上周同天销售数量", prop: "lastWeekSaleNum", width: 70}, {label: "今日销售数量", prop: "saleNum", width: 70}, - {label: "现在库存数量", prop: "stockNum", width: 70}, + {label: "现在库存数量", prop: "stockNum", width: 70, flash: 1}, {label: "剩余时间预计销售数量", prop: "preSaleNum"}, // {label: "提醒", custom: 1, width: 70, align: 'center', prop: "remind"}, ], 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..41a2b51 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) || -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 = { diff --git a/src/views/AppKeyGoods.vue b/src/views/AppKeyGoods.vue index d7e6038..bca5566 100644 --- a/src/views/AppKeyGoods.vue +++ b/src/views/AppKeyGoods.vue @@ -8,7 +8,7 @@ export default { columns: [ {label: "重点单品", prop: "goodsName"}, {label: "销售数量", prop: "saleNum", width: 70}, - {label: "库存数量", prop: "stockNum", width: 70}, + {label: "库存数量", prop: "stockNum", width: 70, flash: 1}, {label: "销售目标", prop: "targetSaleNum", width: 70}, {label: "销售达成", prop: "saleAchieveRate"}, ], 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()) } } diff --git a/src/views/AppMultipleStoreBoardFilter.vue b/src/views/AppMultipleStoreBoardFilter.vue index 73a9890..679ebdd 100644 --- a/src/views/AppMultipleStoreBoardFilter.vue +++ b/src/views/AppMultipleStoreBoardFilter.vue @@ -24,6 +24,13 @@ export default { } }) }, + reset() { + $http.post("/data-boot/la/screen/multipleStoreBoard/move").then(res => { + if (res?.data) { + this.$message.success("已重置") + } + }) + } }, watch: { 'form.interval'(v) { @@ -53,6 +60,9 @@ export default {