-
矩形图
-
-
柱状图
-
-
饼图
-
+
+
+
+
+ 求药
+
+
+ 图例
+
+
+ Logo
+
+
+
+
-
-
-
@@ -194,12 +204,12 @@
option: {},
showList: true,
showChart: false,
- chartShow: {
- begInvite: false,
- showLogo: false,
- showLegend: false,
- shuffle: false,
- }
+
+ begInvite: false,
+ showLogo: true,
+ showLegend: true,
+ shuffle: false,
+
}
},
beforeMount() {
@@ -220,6 +230,23 @@
}
},
methods: {
+ begInviteMode() {
+ this.begInvite = !this.begInvite
+ if (this.begInvite) {
+ this.showLegend = false
+ this.showLogo = false
+ }
+
+ this.setPie()
+ },
+ showLogoMode() {
+ this.showLogo = !this.showLogo
+ this.setPie()
+ },
+ showLegendMode() {
+ this.showLegend = !this.showLegend
+ this.setPie()
+ },
setChartOption(option) {
this.option = option
if (this.chart) {
@@ -235,38 +262,46 @@
//})
},
shuffleList() {
- if (this.shuffle) {
- this.ptData.status_list.sort(() => {
- return Math.random() > 0.5 ? -1 : 1
- })
- } else {
- this.ptData.status_list.sort((a, b) => {
- if (b.mail == a.mail) {
- return b.uploaded - a.uploaded
- }
- return b.mail - a.mail
- })
+ this.shuffle = true
+ this.ptData.status_list.sort(() => {
+ return Math.random() > 0.5 ? -1 : 1
+ })
+
+ this.showList ? this.setCard() : this.setPie()
+ },
+ sortList() {
+ if (this.shuffle == false) {
+ return
}
+ this.shuffle = false
+ this.ptData.status_list.sort((a, b) => {
+ if (b.mail == a.mail) {
+ return b.uploaded - a.uploaded
+ }
+ return b.mail - a.mail
+ })
+ this.showList ? this.setCard() : this.setPie()
},
setCard() {
if (this.chart) {
this.chart.clear()
}
//乱序
- this.shuffleList()
+ {#this.shuffleList()#}
this.showList = true
+
},
setPie() {
let uploadedList = []
let siteList = []
let ptData = this.ptData
- let begInvite = !this.chartShow.begInvite
+ let begInvite = !this.begInvite
let status_list = ptData.status_list
this.showList = false
- if (this.chartShow.shuffle) {
- status_list.sort(shuffle)
- }
+ //if (this.shuffle) {
+ // status_list.sort(shuffle)
+ //}
status_list.forEach((site, index) => {
uploadedList.push({
'value': site.uploaded,
@@ -280,7 +315,7 @@
//})
siteList.push({
name: site.name,
- icon: begInvite ? `image://${site.icon}` : 'roundRect'
+ icon: this.showLogo ? `image://${site.icon}` : 'roundRect'
})
})
let option = {
@@ -317,7 +352,7 @@
'#d677f6',
],
legend: {
- show: this.chartShow.showLegend,
+ show: this.showLegend,
{#type: 'scroll',#}
{#top: 'bottom',#}
right: '2%',
@@ -379,7 +414,7 @@
},
setTree() {
let ptData = this.ptData
- let begInvite = !this.chartShow.begInvite
+ let begInvite = !this.begInvite
let uploadedList = []
let downloadedList = []
ptData.status_list.forEach((site, index) => {