From 99b44440c3f09f9b48e6a10d295f2b6b8812c7e3 Mon Sep 17 00:00:00 2001 From: ch Date: Wed, 1 Jun 2022 17:37:47 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E6=B3=A8=E9=87=8A=E9=A6=96=E9=A1=B5?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E7=BB=9F=E8=AE=A1=E7=9B=B8=E5=85=B3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/home/index copy.vue | 419 ++++++++++++++++++++++++++++++++++ src/views/home/index.vue | 418 +-------------------------------- 2 files changed, 422 insertions(+), 415 deletions(-) create mode 100644 src/views/home/index copy.vue diff --git a/src/views/home/index copy.vue b/src/views/home/index copy.vue new file mode 100644 index 0000000..b88ea81 --- /dev/null +++ b/src/views/home/index copy.vue @@ -0,0 +1,419 @@ + + + + + diff --git a/src/views/home/index.vue b/src/views/home/index.vue index b88ea81..ed2e35a 100644 --- a/src/views/home/index.vue +++ b/src/views/home/index.vue @@ -1,419 +1,7 @@ - - const handleRoute = (route) => router.push(route); - const handleChart = (selector, color, name, data) => { - const chart = echarts.init(document.querySelector(selector)); - const option = { - color: color, - tooltip: { - trigger: 'axis', - axisPointer: { - type: 'shadow', - }, - }, - grid: { - left: '3%', - right: '4%', - bottom: '3%', - containLabel: true, - }, - xAxis: [ - { - type: 'category', - boundaryGap: false, - data: data.map((item) => item.label), - }, - ], - yAxis: [ - { - type: 'value', - }, - ], - series: [ - { - name, - type: 'line', - stack: 'Total', - smooth: true, - lineStyle: { - width: 0, - }, - showSymbol: false, - areaStyle: { - opacity: 0.8, - color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [ - { - offset: 0, - color: 'rgb(128, 255, 165)', - }, - { - offset: 1, - color: 'rgb(1, 191, 236)', - }, - ]), - }, - emphasis: { - focus: 'series', - }, - data: data.map((item) => item.value), - }, - ], - }; - chart.setOption(option); - }; - onActivated(async () => { - await store.dispatch('home/load'); - handleChart('.row-5 .chart', '#80FFA5', '访客数量', unref(opts).chart[0].data); - handleChart('.row-6 .chart', '#00DDFF', '订单数量', unref(opts).chart[1].data); - handleChart('.row-7 .chart', '#37A2FF', '销售额', unref(opts).chart[2].data); - }); - - - +