From 39a8df2ea36a50d8b11548c6ca2744dec05901d3 Mon Sep 17 00:00:00 2001 From: Kubbo <390378816@qq.com> Date: Sat, 2 Nov 2024 11:48:44 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4=E7=BC=A9=E6=94=BE=E7=9A=84?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/App.vue | 13 ++++++++++--- src/router/index.js | 2 +- src/utils/inject.js | 1 + src/views/AppStoreKeyGoods.vue | 5 ++++- src/views/{ => board}/AppMarketBoard.vue | 6 ++++-- src/views/{ => board}/AppMultipleStoreBoard.vue | 0 src/views/{ => board}/AppStoreBoard.vue | 0 7 files changed, 20 insertions(+), 7 deletions(-) rename src/views/{ => board}/AppMarketBoard.vue (92%) rename src/views/{ => board}/AppMultipleStoreBoard.vue (100%) rename src/views/{ => board}/AppStoreBoard.vue (100%) diff --git a/src/App.vue b/src/App.vue index 0e4e914..05be0f3 100644 --- a/src/App.vue +++ b/src/App.vue @@ -22,7 +22,8 @@ html, body, #app { .pb-10 { padding-bottom: 10px; } -.mb-10{ + +.mb-10 { margin-bottom: 10px; } @@ -43,7 +44,10 @@ export default { const targetHeight = 1080; const ratio = targetWidth / targetHeight; const element = this.$el.querySelector('.components'); - const {width: originalWidth, height: originalHeight} = element.getBoundingClientRect(); + if (!element) return + let {width: originalWidth, height: originalHeight} = this.$el.getBoundingClientRect(); + originalWidth = originalWidth - 200 + console.log("当前面板大小:", originalWidth, originalHeight) const ratioHeight = originalWidth / ratio; let scale if (ratioHeight < originalHeight) { @@ -51,7 +55,6 @@ export default { } else { scale = originalHeight / targetHeight; } - element.style.transform = `scale(${scale})`; element.style.width = '1920px' element.style.height = '1080px' @@ -60,6 +63,10 @@ export default { }, mounted() { this.scaleByAspect() + window.addEventListener('resize', this.scaleByAspect) + }, + beforeDestroy() { + window.removeEventListener('resize', this.scaleByAspect) } } diff --git a/src/router/index.js b/src/router/index.js index 9a8a3b4..d392e60 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -2,7 +2,7 @@ import Vue from 'vue' import VueRouter from 'vue-router' Vue.use(VueRouter) -const ctx = import.meta.glob('../views/App*.vue', {eager: true}) +const ctx = import.meta.glob('../views/**/App*.vue', {eager: true}) const routes = [{path: '/', name: 'home'}] Object.values(ctx).map(file => { if (file.default) { diff --git a/src/utils/inject.js b/src/utils/inject.js index 6c3b616..252e728 100644 --- a/src/utils/inject.js +++ b/src/utils/inject.js @@ -65,6 +65,7 @@ window.evenRowBGC = (color = "#09265B") => `transparent;background-image: linear Vue.prototype.$marketBoard = Vue.observable({ screenId: '5b1849ac-4fc3-451a-844c-3362b47341ef', + goodsCategoryId: "", search: {"groupCodeList": [], "currentDate": "20240701", "compareDate": "20240630", "hourNum": "18"} }) Vue.prototype.$multipleStoreBoard = Vue.observable({ diff --git a/src/views/AppStoreKeyGoods.vue b/src/views/AppStoreKeyGoods.vue index 1c9486f..f5b9ec7 100644 --- a/src/views/AppStoreKeyGoods.vue +++ b/src/views/AppStoreKeyGoods.vue @@ -46,6 +46,9 @@ export default { this.$nextTick(() => this.$storeBoard.dialog = true) } }) + }, + relevanceMapData(row){ + console.log(arguments) } } } @@ -54,7 +57,7 @@ export default { diff --git a/src/views/AppMarketBoard.vue b/src/views/board/AppMarketBoard.vue similarity index 92% rename from src/views/AppMarketBoard.vue rename to src/views/board/AppMarketBoard.vue index bed34de..960ad2d 100644 --- a/src/views/AppMarketBoard.vue +++ b/src/views/board/AppMarketBoard.vue @@ -19,7 +19,6 @@ export default {