mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/learning-system-portal.git
synced 2025-12-22 17:26:43 +08:00
提交
This commit is contained in:
@@ -34,7 +34,11 @@
|
||||
<div class="experience">
|
||||
<div class="exp-hear">
|
||||
<div class="exp-hear-text">
|
||||
经验值排行榜<svg-icon style="margin-left: 5px;font-size:20px;padding-top: 4px;" icon-class="doubt"></svg-icon>
|
||||
经验值排行榜
|
||||
<el-tooltip placement="top" effect="light">
|
||||
<div slot="content">占位内容<br/>占位内容</div>
|
||||
<svg-icon style="margin-left: 5px;font-size:20px;padding-top: 4px;" icon-class="doubt"></svg-icon>
|
||||
</el-tooltip>
|
||||
<span class="exp-hear-textbor"></span>
|
||||
</div>
|
||||
<div class="exp-hear-xiala">
|
||||
@@ -212,6 +216,7 @@
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
percentageNum:0,
|
||||
cutOrgNamePath:cutOrgNamePath,
|
||||
chatData:[],
|
||||
isShowChart:false,
|
||||
@@ -450,8 +455,34 @@
|
||||
}
|
||||
},
|
||||
label: {
|
||||
show: false,
|
||||
show: true,
|
||||
position: 'center',
|
||||
formatter:`{total|${this.percentageNum}%}\n{active|来源top3}`,
|
||||
// formatter: function(name) {
|
||||
// console.log(name,'name');
|
||||
// let data = option.series[0].data;
|
||||
// let total = 0;
|
||||
// let tarValue = 0; //每一项值
|
||||
// for (let i = 0; i < data.length; i++) {
|
||||
// total += data[i].value;
|
||||
// if (data[i].name == name) {
|
||||
// tarValue = data[i].value;
|
||||
// }
|
||||
// }
|
||||
// let p = total != 0 ? Math.round((tarValue / total) * 100) + '%' : 0 + '%';
|
||||
// return ` ${p} ${name}`
|
||||
// },
|
||||
rich:{
|
||||
total:{
|
||||
fontSize:20,
|
||||
color:'#000',
|
||||
},
|
||||
active: {
|
||||
fontSize:16,
|
||||
color:'#333',
|
||||
lineHeight:30,
|
||||
}
|
||||
}
|
||||
},
|
||||
labelLine: {
|
||||
show: false
|
||||
@@ -472,15 +503,28 @@
|
||||
})
|
||||
}
|
||||
let chatData = [];
|
||||
let total = null;
|
||||
let totalList = [];
|
||||
for (let key in res.result.chatData) {
|
||||
if(res.result.chatData[key] > 0) {
|
||||
this.isShowChart = true;
|
||||
}
|
||||
total += res.result.chatData[key];
|
||||
totalList.push(res.result.chatData[key]);
|
||||
chatData.push({
|
||||
value: res.result.chatData[key],
|
||||
name: this.getUType(key)
|
||||
})
|
||||
}
|
||||
totalList.sort();
|
||||
totalList = totalList.splice(1,3);
|
||||
let top3 = null;
|
||||
totalList.forEach(item => {
|
||||
top3+=item;
|
||||
})
|
||||
this.percentageNum = (top3/total)*100;
|
||||
console.log(top3,total,this.percentageNum,'3333');
|
||||
console.log(totalList,'totalList');
|
||||
this.chatData = chatData;
|
||||
this.initChat(chatData);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user