Commit d82c2e5d by 匡雅琴

Merge branch 'v2.2.0' of http://192.168.3.233:8090/h5/glsk-data-view-pd into v2.2.0

2 parents 968ff906 684f43c8
......@@ -3,14 +3,14 @@
* @Author: huyue
* @Date: 2023-07-07 14:01:42
* @LastEditors: huyue
* @LastEditTime: 2023-09-11 11:09:19
* @LastEditTime: 2023-09-11 14:31:10
-->
<template>
<div>
<div v-if="!isEmpty">
<div v-show="!isEmpty">
<div :id="domId" style="width: 100%" :style="{ height }"></div>
</div>
<div v-else class="empty" :style="{ height }">
<div v-show="isEmpty" class="empty" :style="{ height }">
<Empty></Empty>
</div>
</div>
......@@ -88,13 +88,11 @@ export default {
drawBar(dataList) {
if (!dataList || dataList.length === 0) return (this.isEmpty = true)
if (dataList && dataList.length) {
console.log(this.dataList)
this.dataList = dataList
this.isEmpty = false
this.barOptions.xAxis.data = dataList.map(item => item[this.label])
this.barOptions.series[0].data = dataList.map(item => item[this.valueName])
this[this.domId].setOption(this.barOptions)
this[this.domId].resize()
}
},
chartBindEvent() {
......@@ -103,6 +101,9 @@ export default {
this[this.domId].resize()
})
}
},
updated() {
this[this.domId].resize()
}
}
</script>
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!