svgConfigList.js 986 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. /*
  2. * @description: webpack读取当前文件夹下的所有 图表的js文件配置, 生成g2Plot配置列表
  3. * @Date: 2023-03-28 10:40:22
  4. * @Author: xing.heng
  5. */
  6. import { dataConfig, settingConfig } from './settingConfig'
  7. import _ from 'lodash'
  8. import icon from './export'
  9. const iconList = icon.getIconList()
  10. const svgList = getSvgList(iconList)
  11. // 获取svg配置
  12. function getSvgList (iconList) {
  13. const svgList = []
  14. iconList.forEach((svg, index) => {
  15. svgList[index] = {
  16. title: svg + '图标',
  17. name: svg,
  18. icon: svg,
  19. className: 'com.gccloud.dataroom.core.module.chart.components.ScreenSvgsChart',
  20. w: 100,
  21. h: 100,
  22. x: 0,
  23. y: 0,
  24. type: 'svgs',
  25. chartType: 'svg',
  26. option: {
  27. ..._.cloneDeep(settingConfig)
  28. },
  29. setting: {}, // 右侧面板自定义配置
  30. dataHandler: {}, // 数据自定义处理js脚本
  31. ..._.cloneDeep(dataConfig)
  32. }
  33. })
  34. return svgList
  35. }
  36. export default svgList