mirror of
https://gitee.com/dromara/go-view.git
synced 2026-04-23 00:00:12 +08:00
feat: 新增编辑阶段 mock 接口轮询请求功能
This commit is contained in:
@@ -47,8 +47,7 @@ export const option = {
|
||||
]
|
||||
}
|
||||
|
||||
export default class Config extends publicConfig
|
||||
implements CreateComponentType {
|
||||
export default class Config extends publicConfig implements CreateComponentType {
|
||||
public key = BarCommonConfig.key
|
||||
public chartConfig = cloneDeep(BarCommonConfig)
|
||||
// 图表配置项
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<template>
|
||||
<VChart :theme="themeColor" :option="option" autoresize></VChart>
|
||||
<v-chart :theme="themeColor" :option="option" autoresize></v-chart>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
@@ -8,8 +8,10 @@ import VChart from 'vue-echarts'
|
||||
import { use } from 'echarts/core'
|
||||
import { CanvasRenderer } from 'echarts/renderers'
|
||||
import { BarChart } from 'echarts/charts'
|
||||
import config, { includes } from './config'
|
||||
import { includes } from './config'
|
||||
import { mergeTheme } from '@/packages/public/chart'
|
||||
import { useChartDataFetch } from '@/hooks/useChartDataFetch.hook'
|
||||
import { CreateComponentType } from '@/packages/index.d'
|
||||
import {
|
||||
DatasetComponent,
|
||||
GridComponent,
|
||||
@@ -27,7 +29,7 @@ const props = defineProps({
|
||||
required: true
|
||||
},
|
||||
chartConfig: {
|
||||
type: Object as PropType<config>,
|
||||
type: Object as PropType<CreateComponentType>,
|
||||
required: true
|
||||
}
|
||||
})
|
||||
@@ -42,7 +44,8 @@ use([
|
||||
])
|
||||
|
||||
const option = computed(() => {
|
||||
// TODO dataset的数据要设计一下,不能这样把数据进行监听,太耗性能
|
||||
return mergeTheme(props.chartConfig.option, props.themeSetting, includes)
|
||||
})
|
||||
|
||||
useChartDataFetch(props.chartConfig)
|
||||
</script>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<template>
|
||||
<VChart :theme="themeColor" :option="option" autoresize></VChart>
|
||||
<v-chart :theme="themeColor" :option="option" autoresize></v-chart>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
@@ -10,6 +10,7 @@ import { CanvasRenderer } from 'echarts/renderers'
|
||||
import { BarChart } from 'echarts/charts'
|
||||
import { mergeTheme } from '@/packages/public/chart'
|
||||
import config, { includes } from './config'
|
||||
import { useChartDataFetch } from '@/hooks/useChartDataFetch.hook'
|
||||
import {
|
||||
DatasetComponent,
|
||||
GridComponent,
|
||||
@@ -44,4 +45,6 @@ use([
|
||||
const option = computed(() => {
|
||||
return mergeTheme(props.chartConfig.option, props.themeSetting, includes)
|
||||
})
|
||||
|
||||
useChartDataFetch(props.chartConfig)
|
||||
</script>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<template>
|
||||
<VChart :theme="themeColor" :option="option.options" autoresize></VChart>
|
||||
<v-chart :theme="themeColor" :option="option.options" autoresize></v-chart>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<template>
|
||||
<VChart :theme="themeColor" :option="option.options" autoresize></VChart>
|
||||
<v-chart :theme="themeColor" :option="option.options" autoresize></v-chart>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<template>
|
||||
<VChart :theme="themeColor" :option="option.options" autoresize></VChart>
|
||||
<v-chart :theme="themeColor" :option="option.options" autoresize></v-chart>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<template>
|
||||
<VChart :theme="themeColor" :option="option" autoresize></VChart>
|
||||
<v-chart :theme="themeColor" :option="option" autoresize></v-chart>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
|
||||
Reference in New Issue
Block a user