From 4f0af65fc2195cd7422e09c81abcf00016c0ce0b Mon Sep 17 00:00:00 2001 From: ngfchl Date: Tue, 24 Jan 2023 21:19:22 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=EF=BC=9A=E5=A2=9E=E5=8A=A0?= =?UTF-8?q?=E5=8D=95=E4=BD=93=E4=B8=8A=E4=BC=A0=E6=95=B0=E6=8D=AE=E9=A5=BC?= =?UTF-8?q?=E5=9B=BE=20=E4=BC=98=E5=8C=96=EF=BC=9A=E7=AB=99=E7=82=B9?= =?UTF-8?q?=E6=93=8D=E4=BD=9C=E6=8C=89=E9=92=AE=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- templates/auto_pt/status.html | 190 +++++++++++++++++++++++----------- 1 file changed, 132 insertions(+), 58 deletions(-) diff --git a/templates/auto_pt/status.html b/templates/auto_pt/status.html index 708cea2..26b0314 100644 --- a/templates/auto_pt/status.html +++ b/templates/auto_pt/status.html @@ -162,7 +162,7 @@ 更新 - 历史 + 数据 种子 @@ -171,7 +171,7 @@
- 关注度 + 关注 @@ -372,45 +372,53 @@
- - - 签到 - - - - - - 更新 - - - 历史 - - - 编辑 - - - - 种子 - - - - - + + + + 签到 + + + + + + 更新 + + 数据 + + + + + + + 编辑 + + + + 种子 + + + + 规则 + + + + +

- 关注度 + 关注 @@ -555,10 +563,16 @@ 图例
- - - + + + + + + + + @@ -676,7 +690,7 @@ showSiteChart: false, begInvite: false, showLogo: true, - showLegend: window.innerWidth > 1200 ? true : false, + showLegend: false, shuffle: false, searchKey: '', sortStep: 1, @@ -1092,6 +1106,8 @@ let dateList = this.incrementData.date_list.slice(this.dataLength) {#console.log(dateList)#} let diff = [] + let today = [] + let today_total = 0 this.incrementData.diff.forEach((item, index) => { let diff_item = {} diff_item = JSON.parse(JSON.stringify(item)); @@ -1099,15 +1115,21 @@ diff_item.data = item.data.slice(this.dataLength) {#console.log(diff_item)#} diff.push(diff_item) + let today_data = diff_item.data[diff_item.data.length - 1] + today_total += today_data + today_data != 0 ? today.push({ + 'name': diff_item.name, + 'value': today_data + }) : '' }) let option = { title: { - text: '每日增量--全部站点', + text: '每日上传', textStyle: { color: 'orangered', }, left: 'center', - top: '3%', + top: '12', }, tooltip: { show: true, @@ -1119,7 +1141,7 @@ //console.log(params) // console.log(params[0].value[1]) let text = '' - let total = 0 + {#let total = 0#} params.sort((a, b) => { return b.value - a.value }) @@ -1131,13 +1153,13 @@
` text += temp - total += param.value + {#total += param.value#} }) let total_str = `
- 总计:${renderSize(total)} + 总计:${renderSize(today_total)} ${params[0].axisValue}

@@ -1147,15 +1169,15 @@ }, position: function (point, params, dom, rect, size) { let customVH = window.innerWidth - if (customVH - point[0] < 280) { - point[0] = customVH - 320 + if (customVH - point[0] < 768) { + point[0] = 12 } - console.log(customVH) - console.log(point[0]) - if (customVH > 768) { - return point - } - return [point[0], 5] + {#console.log(customVH - point[0])#} + {#console.log(point[0])#} + //if (customVH - point[0] > 768) { + // return point + //} + return [12, 8] }, order: 'valueDesc', confine: false, @@ -1164,8 +1186,8 @@ legend: { show: this.showLegend, {#top: '3%',#} - left: 'center', - bottom: '12', + left: '15%', + bottom: '5', tooltip: { show: true }, @@ -1174,7 +1196,7 @@ grid: { left: '3%', right: '4%', - bottom: '25%', + bottom: '55', containLabel: true }, toolbox: { @@ -1205,14 +1227,66 @@ }, series: diff, }; + console.log(today) + today.sort((a, b) => { + return a.value - b.value + }) + let today_option = { + title: { + text: `今日上传总量: ${renderSize(today_total)}`, + top: '12', + left: 'center', + textStyle: { + fontSize: '18px', + color: 'orangered', + } + }, + tooltip: { + show: true, + formatter: function (params) { + return params.name + ':\t' + renderSize(params.data.value) + }, + valueFormatter: function (value) { + return renderSize(value) + } + }, + series: [ + { + name: '今日上传', + type: 'pie', + top: '10%', + bottom: '10%', + radius: '55%', + {#visualDimension: 1,#} + center: ['45%', '50%'], + roseType: '', + data: today, + label: { + show: true, + formatter: function (params) { + {#return params.name + ' \t ' + renderSize(params.data.value)#} + return `${params.name} \t ${renderSize(params.data.value)}` + }, + itemHeight: 12, + itemWidth: 20, + textStyle: { + fontSize: '14px', + } + }, + } + ], + } this.site.name = '全部站点' this.showSiteChart = true this.showAllHistory = true - this.showLegend ? option.grid.bottom = '25%' : option.grid.bottom = '3%' + this.showLegend ? option.grid.bottom = '32%' : option.grid.bottom = '5%' setTimeout(() => { this.chart = this.$refs.history_charts.chart this.chart.clear() this.setChartOption(this.chart, option) + this.chart = this.$refs.today_charts.chart + this.chart.clear() + this.setChartOption(this.chart, today_option) }, 15) }, begInviteMode() {