初始化
This commit is contained in:
39
frontend/packages/Svgs/svgConfigList.js
Normal file
39
frontend/packages/Svgs/svgConfigList.js
Normal file
@@ -0,0 +1,39 @@
|
||||
/*
|
||||
* @description: webpack读取当前文件夹下的所有 图表的js文件配置, 生成g2Plot配置列表
|
||||
* @Date: 2023-03-28 10:40:22
|
||||
* @Author: xing.heng
|
||||
*/
|
||||
import { dataConfig, settingConfig } from './settingConfig'
|
||||
// import _ from 'lodash'
|
||||
import cloneDeep from 'lodash/cloneDeep'
|
||||
import icon from './export'
|
||||
const iconList = icon.getIconList()
|
||||
const svgList = getSvgList(iconList)
|
||||
|
||||
// 获取svg配置
|
||||
function getSvgList (iconList) {
|
||||
const svgList = []
|
||||
iconList.forEach((svg, index) => {
|
||||
svgList[index] = {
|
||||
title: svg + '图标',
|
||||
name: svg,
|
||||
icon: svg,
|
||||
className: 'com.gccloud.dataroom.core.module.chart.components.ScreenSvgsChart',
|
||||
w: 100,
|
||||
h: 100,
|
||||
x: 0,
|
||||
y: 0,
|
||||
type: 'svgs',
|
||||
chartType: 'svg',
|
||||
option: {
|
||||
...cloneDeep(settingConfig)
|
||||
},
|
||||
setting: {}, // 右侧面板自定义配置
|
||||
dataHandler: {}, // 数据自定义处理js脚本
|
||||
...cloneDeep(dataConfig)
|
||||
}
|
||||
})
|
||||
return svgList
|
||||
}
|
||||
|
||||
export default svgList
|
||||
Reference in New Issue
Block a user