From 81c1be1ce5f212f90017beaa20e96ef015463518 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E6=9D=8E=E5=8A=B2=E9=BE=99?= <2860996570@qq.com>
Date: Thu, 29 Aug 2024 20:02:01 +0800
Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9Eecharts?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
package.json | 2 +-
src/assets/styles/publicPro.scss | 12 +-
.../components/AFuwufazhanzonglan/index.vue | 12 +-
.../components/BJinsannianzijin/index.vue | 157 ++++++++++++------
.../BJinsannianzijin/mixins/resize.js | 56 +++++++
5 files changed, 169 insertions(+), 70 deletions(-)
create mode 100644 src/views/workbenchPro/components/BJinsannianzijin/mixins/resize.js
diff --git a/package.json b/package.json
index 02979ad..e3f8d83 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "ruoyi",
- "version": "1.0.202408291813",
+ "version": "1.0.202408291841",
"description": "金鸡湖现代服务业品牌管理系统",
"author": "若依",
"license": "MIT",
diff --git a/src/assets/styles/publicPro.scss b/src/assets/styles/publicPro.scss
index c86b599..f45eeed 100644
--- a/src/assets/styles/publicPro.scss
+++ b/src/assets/styles/publicPro.scss
@@ -355,9 +355,6 @@
}
.AFuwufazhanzonglan-item-top {
- div {
-
- }
div:nth-child(1) {
font-size: 20px;
@@ -405,7 +402,14 @@
//近三年
.BJinsannianzijin-box {
- .BJinsannianzijin {}
+ width: 100%;
+ .BJinsannianzijin {
+ width: 100%;
+ .BJinsannianzijinchart-left{
+ width: 50%;
+ height: 25vh;
+ }
+ }
}
}
diff --git a/src/views/workbenchPro/components/AFuwufazhanzonglan/index.vue b/src/views/workbenchPro/components/AFuwufazhanzonglan/index.vue
index 1472e4b..7593164 100644
--- a/src/views/workbenchPro/components/AFuwufazhanzonglan/index.vue
+++ b/src/views/workbenchPro/components/AFuwufazhanzonglan/index.vue
@@ -93,20 +93,12 @@ export default {
},
},
mounted() {
- // this.cancalDebounce();
- window.addEventListener('resize', this.cancalDebounce);
+
},
methods: {
// 获取top5列表
- // 屏幕尺寸变化
- cancalDebounce() {
- const element = document.getElementById('zhijinbofu-qingkaung'); // 通过元素的 ID 获取元素
- const header = document.getElementById('zhijinbofu-header-id'); // 通过元素的 ID 获取元素
- const elementHeight = element.offsetHeight;
- const headerHeight = header.offsetHeight;
- this.tabHeader = elementHeight - headerHeight - 35;
- }
+
},
}
diff --git a/src/views/workbenchPro/components/BJinsannianzijin/index.vue b/src/views/workbenchPro/components/BJinsannianzijin/index.vue
index 04e3456..e486645 100644
--- a/src/views/workbenchPro/components/BJinsannianzijin/index.vue
+++ b/src/views/workbenchPro/components/BJinsannianzijin/index.vue
@@ -1,60 +1,107 @@
-
-
-
-
-
-
\ No newline at end of file
+}
+
diff --git a/src/views/workbenchPro/components/BJinsannianzijin/mixins/resize.js b/src/views/workbenchPro/components/BJinsannianzijin/mixins/resize.js
new file mode 100644
index 0000000..b1e76e9
--- /dev/null
+++ b/src/views/workbenchPro/components/BJinsannianzijin/mixins/resize.js
@@ -0,0 +1,56 @@
+import { debounce } from '@/utils'
+
+export default {
+ data() {
+ return {
+ $_sidebarElm: null,
+ $_resizeHandler: null
+ }
+ },
+ mounted() {
+ this.initListener()
+ },
+ activated() {
+ if (!this.$_resizeHandler) {
+ // avoid duplication init
+ this.initListener()
+ }
+
+ // when keep-alive chart activated, auto resize
+ this.resize()
+ },
+ beforeDestroy() {
+ this.destroyListener()
+ },
+ deactivated() {
+ this.destroyListener()
+ },
+ methods: {
+ // use $_ for mixins properties
+ // https://vuejs.org/v2/style-guide/index.html#Private-property-names-essential
+ $_sidebarResizeHandler(e) {
+ if (e.propertyName === 'width') {
+ this.$_resizeHandler()
+ }
+ },
+ initListener() {
+ this.$_resizeHandler = debounce(() => {
+ this.resize()
+ }, 100)
+ window.addEventListener('resize', this.$_resizeHandler)
+
+ this.$_sidebarElm = document.getElementsByClassName('sidebar-container')[0]
+ this.$_sidebarElm && this.$_sidebarElm.addEventListener('transitionend', this.$_sidebarResizeHandler)
+ },
+ destroyListener() {
+ window.removeEventListener('resize', this.$_resizeHandler)
+ this.$_resizeHandler = null
+
+ this.$_sidebarElm && this.$_sidebarElm.removeEventListener('transitionend', this.$_sidebarResizeHandler)
+ },
+ resize() {
+ const { chart } = this
+ chart && chart.resize()
+ }
+ }
+}