diff --git a/templates/auto_pt/status.html b/templates/auto_pt/status.html index 1fc17ec..d27e275 100644 --- a/templates/auto_pt/status.html +++ b/templates/auto_pt/status.html @@ -41,24 +41,16 @@ 站点数据 - - 矩形树图 - 柱状图 - 饼图 - 列表 - - - - - - + + 图表 + + 卡片 + + - + + + + 矩形图 + + 柱状图 + + 饼图 + + + + + + + + + + + @@ -172,21 +189,24 @@ el: '#status', data() { return { - chart: {}, + chart: null, ptData: {}, option: {}, - begInvite: false, - showLogo: false, - showLegend: false, - showList: false, - shuffle: false, + showList: true, + showChart: false, + chartShow: { + begInvite: false, + showLogo: false, + showLegend: false, + shuffle: false, + } } }, beforeMount() { }, mounted() { - this.chart = this.$refs.charts.chart + {#this.chart = this.$refs.charts.chart#} this.getData() }, watch: { @@ -202,14 +222,17 @@ methods: { setChartOption(option) { this.option = option - this.showList = false - this.$refs.charts.chart.clear() - this.$refs.charts.chart.setOption(this.option) + if (this.chart) { + this.chart.clear() + } + this.chart = this.$refs.charts.chart + this.chart.setOption(this.option) window.addEventListener("resize", () => { - if (this.$refs.charts.chart) { - this.$refs.charts.chart.resize() - } + this.chart.resize() }) + //this.$nextTick(() => {//自适应宽度 + // this.chart.resize(); + //}) }, shuffleList() { if (this.shuffle) { @@ -227,7 +250,7 @@ }, setCard() { if (this.chart) { - this.$refs.charts.chart.clear() + this.chart.clear() } //乱序 this.shuffleList() @@ -237,9 +260,11 @@ let uploadedList = [] let siteList = [] let ptData = this.ptData - let begInvite = !this.begInvite + let begInvite = !this.chartShow.begInvite let status_list = ptData.status_list - if (this.shuffle) { + this.showList = false + + if (this.chartShow.shuffle) { status_list.sort(shuffle) } status_list.forEach((site, index) => { @@ -292,7 +317,7 @@ '#d677f6', ], legend: { - show: this.showLegend, + show: this.chartShow.showLegend, {#type: 'scroll',#} {#top: 'bottom',#} right: '2%', @@ -314,7 +339,8 @@ { name: '站点数据', type: 'pie', - bottom: '2%', + top: '10%', + bottom: '10%', radius: '55%', {#visualDimension: 1,#} center: ['45%', '50%'], @@ -353,7 +379,7 @@ }, setTree() { let ptData = this.ptData - let begInvite = !this.begInvite + let begInvite = !this.chartShow.begInvite let uploadedList = [] let downloadedList = [] ptData.status_list.forEach((site, index) => {