类型:开发
描述:
This commit is contained in:
@@ -19,7 +19,7 @@
|
||||
},
|
||||
total: {
|
||||
type: Number,
|
||||
default: () => 123456
|
||||
default: () => 0
|
||||
},
|
||||
colors: {
|
||||
type: Array,
|
||||
@@ -42,7 +42,14 @@
|
||||
itemGap: fitChartSize(6),
|
||||
formatter: (name) => {
|
||||
let obj = props.dataList.find((item) => item.name == name)
|
||||
return `{name|${name}} {value|${obj?.value}}{value|%}`
|
||||
let total = getTotal();
|
||||
if(total==0){
|
||||
return `{name|${name}} {value|0}{value|%}`
|
||||
}else{
|
||||
let value = ((obj?.value/total).toFixed(4)*100).toFixed(2);
|
||||
return `{name|${name}} {value|${value}}{value|%}`
|
||||
}
|
||||
|
||||
},
|
||||
textStyle: {
|
||||
rich: {
|
||||
@@ -126,7 +133,26 @@
|
||||
return `{value|${getTotal()}}` + '\n' + `{name|告警总数}`
|
||||
}
|
||||
}
|
||||
const changeChart = setOption(params)
|
||||
changeChart.off('legendselectchanged');
|
||||
changeChart.on('legendselectchanged', function (e) {
|
||||
var echartsArr = [];
|
||||
for (let key in e.selected) {
|
||||
if (e.selected[key]) {
|
||||
echartsArr.push(key)
|
||||
}
|
||||
}
|
||||
var echartsNum = 0;
|
||||
props.dataList.forEach(item => {
|
||||
if(echartsArr.includes(item.name)){
|
||||
echartsNum += parseFloat(item.value)
|
||||
}
|
||||
})
|
||||
params.series[0].label.formatter = () => {
|
||||
return `{value|${echartsNum}}` + '\n' + `{name|告警总数}`
|
||||
}
|
||||
setOption(params)
|
||||
});
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
@@ -439,8 +439,6 @@ const handleCollect = async (id, status, index) => {
|
||||
if(thisVideo.value){
|
||||
thisVideo.value.isCollect =1
|
||||
}
|
||||
console.log("88888888")
|
||||
console.log( videoList.value[index].isCollect);
|
||||
if(index!=null){
|
||||
videoList.value[index].isCollect = 1
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user