From 493937a656bfa22d42fb37b156d24b5a21356729 Mon Sep 17 00:00:00 2001 From: MTrun <1262327911@qq.com> Date: Sat, 18 Sep 2021 11:25:56 +0800 Subject: [PATCH 1/5] =?UTF-8?q?doc=EF=BC=9A=E6=9B=B4=E6=96=B0=E8=AF=B4?= =?UTF-8?q?=E6=98=8E=E6=96=87=E6=A1=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index a53b381..73d79d6 100644 --- a/README.md +++ b/README.md @@ -138,6 +138,7 @@ setup() { * 部分图表选择展示的内容会报错,怀疑是配置问题。 * 地图组件由于 `Vue3` 无法直接通过 ref 取到 ECharts 组件内部函数,暂时无法实现自动轮播。 +* Vue 3.0+版本中,修改了 useContext() API,需要进行兼容升级 ## 五、其余 -- Gitee From e47e2417b1451d6524bc9b52abfc429baa7e5048 Mon Sep 17 00:00:00 2001 From: MTrun <1262327911@qq.com> Date: Sat, 18 Sep 2021 11:58:12 +0800 Subject: [PATCH 2/5] =?UTF-8?q?fix:=20=E9=9A=90=E8=97=8F=E5=B7=A6=E4=B8=8B?= =?UTF-8?q?=E8=A7=92=E5=9B=BE=E6=A0=87=E7=9A=84=20legend=20=EF=BC=8C?= =?UTF-8?q?=E7=82=B9=E5=87=BB=E4=BC=9A=E6=8A=A5=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/bottomLeft/chart/draw.tsx | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/views/bottomLeft/chart/draw.tsx b/src/views/bottomLeft/chart/draw.tsx index 5d1af89..974f483 100644 --- a/src/views/bottomLeft/chart/draw.tsx +++ b/src/views/bottomLeft/chart/draw.tsx @@ -35,11 +35,7 @@ export default defineComponent({ } }, legend: { - data: ["已贯通", "计划贯通", "贯通率"], - textStyle: { - color: "#B4B4B4" - }, - top: "0%" + show: false, }, grid: { x: "8%", -- Gitee From d888d766ddad63cd10a31288b908b15894e9b8c5 Mon Sep 17 00:00:00 2001 From: MTrun <1262327911@qq.com> Date: Sat, 18 Sep 2021 14:28:46 +0800 Subject: [PATCH 3/5] doc: upadte doc --- README.md | 1 - 1 file changed, 1 deletion(-) diff --git a/README.md b/README.md index 73d79d6..2577608 100644 --- a/README.md +++ b/README.md @@ -136,7 +136,6 @@ setup() { ## 优化方向 -* 部分图表选择展示的内容会报错,怀疑是配置问题。 * 地图组件由于 `Vue3` 无法直接通过 ref 取到 ECharts 组件内部函数,暂时无法实现自动轮播。 * Vue 3.0+版本中,修改了 useContext() API,需要进行兼容升级 -- Gitee From 164169382ca3bda65269fc35c9a4994a8f8c27ea Mon Sep 17 00:00:00 2001 From: MTrun <1262327911@qq.com> Date: Sat, 18 Sep 2021 18:22:13 +0800 Subject: [PATCH 4/5] =?UTF-8?q?fix:=20=E4=BF=AE=E6=94=B9=20useIndex=20?= =?UTF-8?q?=E9=94=99=E8=AF=AF=E5=90=8D=E7=A7=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/utils/useDraw.ts | 2 +- src/views/index/index.vue | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/utils/useDraw.ts b/src/utils/useDraw.ts index 10779b1..db6e639 100644 --- a/src/utils/useDraw.ts +++ b/src/utils/useDraw.ts @@ -1,6 +1,6 @@ import { ref } from 'vue' -export default function useIndex() { +export default function useDraw() { // * 指向最外层容器 const appRef = ref() // * 定时函数 diff --git a/src/views/index/index.vue b/src/views/index/index.vue index 0b05f8d..9221d60 100644 --- a/src/views/index/index.vue +++ b/src/views/index/index.vue @@ -102,7 +102,7 @@ import { } from 'vue' import { formatTime } from '@/utils/index' import { WEEK } from '@/constant/index' -import useIndex from '@/utils/useDraw' +import useDraw from '@/utils/useDraw' import { title, subtitle, moduleInfo } from '@/constant/index' import CenterLeft1 from '../centerLeft1/index.vue' import CenterLeft2 from '../centerLeft2/index.vue' @@ -133,7 +133,7 @@ export default defineComponent({ dateWeek: '' }) // * 适配处理 - const { appRef, calcRate, windowDraw } = useIndex() + const { appRef, calcRate, windowDraw } = useDraw() // 生命周期 onMounted(() => { cancelLoading() -- Gitee From 6e0d2bbac0e41a240611820e9b3ce2ec9caf7b91 Mon Sep 17 00:00:00 2001 From: MTrun <1262327911@qq.com> Date: Sat, 18 Sep 2021 18:32:51 +0800 Subject: [PATCH 5/5] =?UTF-8?q?fix:=20=E6=96=B0=E5=A2=9E=E3=80=90=E5=B1=8F?= =?UTF-8?q?=E5=B9=95=E7=9B=91=E5=90=AC=E3=80=91=E5=8D=B8=E8=BD=BD=E5=87=BD?= =?UTF-8?q?=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/utils/useDraw.ts | 6 ++++++ src/views/index/index.vue | 3 ++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/utils/useDraw.ts b/src/utils/useDraw.ts index db6e639..674d3a0 100644 --- a/src/utils/useDraw.ts +++ b/src/utils/useDraw.ts @@ -46,9 +46,15 @@ export default function useDraw() { window.addEventListener('resize', resize) } + // 改变窗口大小重新绘制 + const unWindowDraw = () => { + window.removeEventListener('resize', resize) + } + return { appRef, calcRate, windowDraw, + unWindowDraw } } diff --git a/src/views/index/index.vue b/src/views/index/index.vue index 9221d60..f8977a8 100644 --- a/src/views/index/index.vue +++ b/src/views/index/index.vue @@ -133,7 +133,7 @@ export default defineComponent({ dateWeek: '' }) // * 适配处理 - const { appRef, calcRate, windowDraw } = useDraw() + const { appRef, calcRate, windowDraw, unWindowDraw } = useDraw() // 生命周期 onMounted(() => { cancelLoading() @@ -144,6 +144,7 @@ export default defineComponent({ }) onBeforeUnmount(() => { + unWindowDraw() clearInterval(timeInfo.setInterval) }) -- Gitee