From 78d6c22e0d0a831651e99f7d9501b785b0afe9b3 Mon Sep 17 00:00:00 2001 From: ngfchl Date: Tue, 6 Dec 2022 23:24:32 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E7=AB=99=E7=82=B9=E5=8E=86?= =?UTF-8?q?=E5=8F=B2=E5=9B=BE=E8=A1=A8=E4=BF=A1=E6=81=AF=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- templates/auto_pt/status.html | 117 ++++++++++++++++++++++------------ 1 file changed, 75 insertions(+), 42 deletions(-) diff --git a/templates/auto_pt/status.html b/templates/auto_pt/status.html index 526bc8d..b85f5f7 100644 --- a/templates/auto_pt/status.html +++ b/templates/auto_pt/status.html @@ -336,26 +336,32 @@ - - - - - - - - - - - - - - - +
+ + + + + + + + + + + + + +
+ {% include 'admin/includes/js-part.html' %} @@ -371,7 +377,7 @@ return { chart: null, ptData: {}, - siteData: [], + site: {}, option: {}, showList: true, showSiteChart: false, @@ -572,14 +578,14 @@ this.showLegend = !this.showLegend this.setPie() }, - setChartOption(option) { + setChartOption(charts, option) { {#this.option = option#} - if (this.chart) { - this.chart.clear() + if (charts) { + charts.clear() } - this.chart.setOption(option) + charts.setOption(option) window.addEventListener("resize", () => { - this.chart.resize() + charts.resize() }) //this.$nextTick(() => {//自适应宽度 // this.chart.resize(); @@ -747,7 +753,7 @@ setTimeout(() => { console.log(666) this.chart = this.$refs.charts.chart - this.setChartOption(option) + this.setChartOption(this.chart, option) }, 50) }, setTree() { @@ -855,7 +861,7 @@ {#this.treeOption.series[0].data.push()#} {#this.$refs.charts.chart.setOption(treeOption)#} this.chart = this.$refs.charts.chart - this.setChartOption(option) + this.setChartOption(this.chart, option) }, setBar() { let option = { @@ -932,10 +938,11 @@ option.series.push(downloaded, uploaded) option.xAxis.data = siteList this.chart = this.$refs.charts.chart - this.setChartOption(option) + this.setChartOption(this.chart, option) }, setLine(siteData) { let site = siteData.site + this.site = siteData.site let dataList = siteData.site_status_list let uploadedList = [] let downloadedList = [] @@ -954,9 +961,14 @@ dateList.push(info.info_date) }) let option = { - title: { - text: `${site.name} - Copyright By PTools` - }, + //title: { + // text: site.name, + // textStyle: { + // color: 'orangered', + // }, + // left: 'center', + // top: '3%', + //}, tooltip: { show: true, trigger: 'axis', @@ -969,6 +981,8 @@ }, legend: { show: true, + top: '3%', + left: 'center', }, grid: { left: '3%', @@ -1013,24 +1027,43 @@ {#stack: 'Total',#} data: downloadedList }, - { - name: '魔力值', - type: 'line', - {#stack: 'Total',#} - data: spList - }, - { - name: '积分', - type: 'line', - {#stack: 'Total',#} - data: bonusList - } + ] }; this.showSiteChart = true setTimeout(() => { this.chart = this.$refs.seeding_charts.chart - this.setChartOption(option) + this.setChartOption(this.chart, option) + {#option.title.text = `${site.name} - 魔力积分`#} + option.series = [{ + name: '魔力值', + type: 'line', + {#stack: 'Total',#} + data: spList + }, + { + name: '积分', + type: 'line', + {#stack: 'Total',#} + data: bonusList + }] + option.tooltip.valueFormatter = function (value) { + return numberFormat(value) + } + option.yAxis.axisLabel.formatter = function (value) { + return numberFormat(value) + } + this.setChartOption(this.$refs.bonus_charts.chart, option) + {#option.title.text = `${site.name} - 分享率`#} + option.series = [{ + name: '分享率', + type: 'line', + {#stack: 'Total',#} + data: ratioList + }] + option.tooltip.valueFormatter = null + option.yAxis.axisLabel.formatter = null + this.setChartOption(this.$refs.ratio_charts.chart, option) }, 50)