feat: 新增图表独立配置混合

This commit is contained in:
mtruning
2022-02-26 17:38:24 +08:00
parent 0bf38c032c
commit 8d97bdc976
43 changed files with 271 additions and 170 deletions
@@ -5,7 +5,7 @@ import omit from 'lodash/omit'
export const includes = ['legend', 'xAxis', 'yAxis']
const options = echartOptionProfixHandle({
const option = {
legend: {
show: true,
},
@@ -23,18 +23,13 @@ const options = echartOptionProfixHandle({
name: 'data1',
type: 'line',
data: [120, 200, 150, 80, 70, 110, 130]
},
{
name: 'data2',
type: 'line',
data: [130, 130, 312, 268, 155, 117, 160]
}
]
}, includes)
}
export default class Config extends publicConfig implements CreateComponentType {
public key: string = LineCommonConfig.key
public chartConfig = omit(LineCommonConfig, ['node'])
// 图表配置项
public option = options
public option = echartOptionProfixHandle(option, includes)
}
@@ -1,5 +1,4 @@
<template>
<div>配置项目</div>
</template>
<script setup lang="ts">
@@ -1,4 +1,5 @@
import LineCommon from './index.vue'
import Configuration from './config.vue'
import image from '@/assets/images/chart/charts/line.png'
import { ConfigType, PackagesCategoryEnum } from '@/packages/index.d'
import { ChatCategoryEnum, ChatCategoryEnumName } from '../../index.d'
@@ -10,5 +11,6 @@ export const LineCommonConfig: ConfigType = {
categoryName: ChatCategoryEnumName.LINE,
package: PackagesCategoryEnum.CHARTS,
node: LineCommon,
conNode: () => Configuration,
image: image
}