422
This commit is contained in:
@@ -42,6 +42,7 @@
|
||||
watch(
|
||||
() => props.list,
|
||||
(val) => {
|
||||
// console.log(val,'88888888888888888')
|
||||
aIndex+=1
|
||||
if(aIndex>=3&&!val.length){
|
||||
condShow.value = 1
|
||||
|
||||
@@ -40,6 +40,7 @@
|
||||
let params = null
|
||||
let condShow = ref(0)
|
||||
let aIndex = 1
|
||||
let newList = ref([])
|
||||
watch(
|
||||
() => props.list,
|
||||
(val) => {
|
||||
@@ -48,6 +49,7 @@
|
||||
condShow.value = 1
|
||||
}
|
||||
if (val.length > 0) {
|
||||
newList.value = val
|
||||
setTimeout(() => {
|
||||
condShow.value = 2
|
||||
init()
|
||||
@@ -61,7 +63,7 @@
|
||||
|
||||
const getSeriesData = () => {
|
||||
console.log(props.list,'props.listprops.listprops.list')
|
||||
return props.list.map((item) => {
|
||||
return newList.value.map((item) => {
|
||||
item.value?item.value:0;
|
||||
return {
|
||||
type: 'bar',
|
||||
@@ -79,7 +81,7 @@
|
||||
}
|
||||
|
||||
const init = () => {
|
||||
if (!params) {
|
||||
// if (!params) {
|
||||
params = {
|
||||
legend: {
|
||||
show: true,
|
||||
@@ -89,6 +91,7 @@
|
||||
itemWidth: fitChartSize(12),
|
||||
itemGap: fitChartSize(6),
|
||||
formatter: function (name) {
|
||||
console.log(name,'nnnnnnnnnnnnnnnnnnnnnnnn')
|
||||
let obj = props.list.find((item) => item.name == name)
|
||||
if(obj?.value){
|
||||
obj.value?obj.value:0;
|
||||
@@ -133,10 +136,11 @@
|
||||
},
|
||||
series: getSeriesData()
|
||||
}
|
||||
}
|
||||
else {
|
||||
params.series = getSeriesData()
|
||||
}
|
||||
let datas = getSeriesData()
|
||||
// }
|
||||
// else {
|
||||
// params.series = getSeriesData()
|
||||
// }
|
||||
setOption(params)
|
||||
}
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user