From 98ce49ee03fc278ec37d89b45c2982e5c6c115b3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A5=94=E8=B7=91=E7=9A=84=E9=9D=A2=E6=9D=A1?= <1262327911@qq.com> Date: Wed, 27 Apr 2022 17:45:40 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=96=B0=E5=A2=9E=E5=9B=BE=E7=89=87?= =?UTF-8?q?=E7=BB=84=E4=BB=B6=E6=A8=A1=E6=9D=BF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/hooks/useChartDataFetch.hook.ts | 2 +- .../components/Charts/Bars/BarCommon/config.ts | 1 - .../components/Informations/Mores/Image/config.ts | 14 ++++++++++++++ .../components/Informations/Mores/Image/index.vue | 2 +- src/packages/index.ts | 1 - 5 files changed, 16 insertions(+), 4 deletions(-) create mode 100644 src/packages/components/Informations/Mores/Image/config.ts diff --git a/src/hooks/useChartDataFetch.hook.ts b/src/hooks/useChartDataFetch.hook.ts index bbe668a5..b0230bb5 100644 --- a/src/hooks/useChartDataFetch.hook.ts +++ b/src/hooks/useChartDataFetch.hook.ts @@ -59,7 +59,7 @@ export const useChartDataFetch = ( }) } else { // 若遵守规范使用 datase 作为数据 key,则省自动赋值数据 - targetComponent.option.dataset = res.data + targetComponent.option.dataset && (targetComponent.option.dataset = res.data) } if (updateCallback) { updateCallback(res.data) diff --git a/src/packages/components/Charts/Bars/BarCommon/config.ts b/src/packages/components/Charts/Bars/BarCommon/config.ts index fc544a1c..187ff852 100644 --- a/src/packages/components/Charts/Bars/BarCommon/config.ts +++ b/src/packages/components/Charts/Bars/BarCommon/config.ts @@ -3,7 +3,6 @@ import { BarCommonConfig } from './index' import { CreateComponentType } from '@/packages/index.d' import cloneDeep from 'lodash/cloneDeep' import dataJson from './data.json' -import { GlobalThemeJsonType } from '@/settings/chartThemes/index' export const includes = ['legend', 'xAxis', 'yAxis'] diff --git a/src/packages/components/Informations/Mores/Image/config.ts b/src/packages/components/Informations/Mores/Image/config.ts new file mode 100644 index 00000000..453bbe5a --- /dev/null +++ b/src/packages/components/Informations/Mores/Image/config.ts @@ -0,0 +1,14 @@ +import { publicConfig } from '@/packages/public' +import { CreateComponentType } from '@/packages/index.d' +import { ImageConfig } from './index' +import cloneDeep from 'lodash/cloneDeep' + +export const option = { +} + +export default class Config extends publicConfig implements CreateComponentType +{ + public key = ImageConfig.key + public chartConfig = cloneDeep(ImageConfig) + public option = cloneDeep(option) +} diff --git a/src/packages/components/Informations/Mores/Image/index.vue b/src/packages/components/Informations/Mores/Image/index.vue index a962fd67..56830a1a 100644 --- a/src/packages/components/Informations/Mores/Image/index.vue +++ b/src/packages/components/Informations/Mores/Image/index.vue @@ -1,6 +1,6 @@ diff --git a/src/packages/index.ts b/src/packages/index.ts index adfa09f7..25476aa1 100644 --- a/src/packages/index.ts +++ b/src/packages/index.ts @@ -1,4 +1,3 @@ -import type { App } from 'vue' import { ChartList } from '@/packages/components/Charts/index' import { DecorateList } from '@/packages/components/Decorates/index' import { InformationList } from '@/packages/components/Informations/index'