feat:对接首页数据

This commit is contained in:
zjc
2025-03-11 16:02:49 +08:00
parent a63ace50c4
commit 999d99b68c
5 changed files with 79 additions and 16 deletions

View File

@@ -3,21 +3,21 @@ import * as echarts from 'echarts'
import { guid } from '@/utils/util'
export function useEchart() {
let chart = ref(null)
let chart = null
let id = ref(guid())
const initChart = () => {
const dom = document.getElementById(id.value)
chart.value = echarts.init(dom)
chart = echarts.init(dom)
}
const setOption = (params, update = false) => {
chart.value.setOption(params, update)
chart.setOption(params, update)
}
const dispose = () => {
chart.value.dispose()
chart.value = null
chart.dispose()
chart = null
}
const resize = () => {
chart.value.resize()
if (chart) chart.resize()
}
onMounted(() => {
initChart()