mirror of
https://gitee.com/dromara/go-view.git
synced 2025-02-24 08:12:49 +08:00
fix: 完成数据监控,更新图表
This commit is contained in:
parent
9c0f1f793f
commit
5763ff0d57
@ -10,6 +10,6 @@ export const RadarConfig: ConfigType = {
|
|||||||
category: ChatCategoryEnum.MORE,
|
category: ChatCategoryEnum.MORE,
|
||||||
categoryName: ChatCategoryEnumName.MORE,
|
categoryName: ChatCategoryEnumName.MORE,
|
||||||
package: PackagesCategoryEnum.CHARTS,
|
package: PackagesCategoryEnum.CHARTS,
|
||||||
chartFrame: ChartFrameEnum.ECHARTS,
|
chartFrame: ChartFrameEnum.COMMON,
|
||||||
image
|
image
|
||||||
}
|
}
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { computed, PropType } from 'vue'
|
import { computed, PropType, watch } from 'vue'
|
||||||
import VChart from 'vue-echarts'
|
import VChart from 'vue-echarts'
|
||||||
import { use } from 'echarts/core'
|
import { use } from 'echarts/core'
|
||||||
import { CanvasRenderer } from 'echarts/renderers'
|
import { CanvasRenderer } from 'echarts/renderers'
|
||||||
@ -37,5 +37,23 @@ const option = computed(() => {
|
|||||||
return mergeTheme(props.chartConfig.option, props.themeSetting, includes)
|
return mergeTheme(props.chartConfig.option, props.themeSetting, includes)
|
||||||
})
|
})
|
||||||
|
|
||||||
const { vChartRef } = useChartDataFetch(props.chartConfig, useChartEditStore)
|
const dataSetHandle = (dataset: any) => {
|
||||||
|
props.chartConfig.option.legend.data = dataset.seriesData.map(i => i.name)
|
||||||
|
props.chartConfig.option.radar.indicator = dataset.radarIndicator
|
||||||
|
props.chartConfig.option.series[0].data = dataset.seriesData
|
||||||
|
}
|
||||||
|
|
||||||
|
watch(
|
||||||
|
() => props.chartConfig.option.dataset,
|
||||||
|
newData => {
|
||||||
|
dataSetHandle(newData)
|
||||||
|
},
|
||||||
|
{
|
||||||
|
immediate: true
|
||||||
|
}
|
||||||
|
)
|
||||||
|
|
||||||
|
const { vChartRef } = useChartDataFetch(props.chartConfig, useChartEditStore, (newData: any) => {
|
||||||
|
dataSetHandle(newData)
|
||||||
|
})
|
||||||
</script>
|
</script>
|
||||||
|
Loading…
Reference in New Issue
Block a user