feat:完善功能
This commit is contained in:
@@ -27,16 +27,10 @@
|
||||
}
|
||||
})
|
||||
|
||||
const { id, setOption } = useEchart()
|
||||
const { id, chart, setOption } = useEchart()
|
||||
|
||||
let params = null
|
||||
|
||||
let getTotal = () => {
|
||||
return props.dataList.reduce((per, cur) => {
|
||||
return per + cur.count
|
||||
}, 0)
|
||||
}
|
||||
|
||||
let defaultCofig = {
|
||||
color: [],
|
||||
legend: {
|
||||
@@ -48,7 +42,7 @@
|
||||
itemGap: fitChartSize(6),
|
||||
formatter: (name) => {
|
||||
let obj = props.dataList.find((item) => item.name == name)
|
||||
return `{name|${name}} {value|${obj?.value}}{value|%}`
|
||||
return `{name|${name}} {value|${obj?.value}}{value|次}`
|
||||
},
|
||||
textStyle: {
|
||||
rich: {
|
||||
@@ -97,13 +91,17 @@
|
||||
]
|
||||
}
|
||||
|
||||
let getTotal = () => {
|
||||
return props.dataList.reduce((per, cur) => {
|
||||
return per + cur.value
|
||||
}, 0)
|
||||
}
|
||||
|
||||
watch(
|
||||
() => props.dataList,
|
||||
(val) => {
|
||||
if (val.length > 0) {
|
||||
setTimeout(() => {
|
||||
init()
|
||||
}, 1000)
|
||||
() => [props.dataList, chart.value],
|
||||
() => {
|
||||
if (props.dataList.length > 0 && chart.value) {
|
||||
init()
|
||||
}
|
||||
},
|
||||
{ immediate: true }
|
||||
|
||||
Reference in New Issue
Block a user