state.js 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. // import _ from 'lodash'
  2. import cloneDeep from 'lodash/cloneDeep'
  3. export const defaultData = {
  4. // 大屏信息
  5. pageInfo: {
  6. className:
  7. 'com.gccloud.dataroom.core.module.manage.dto.DataRoomPageDTO',
  8. id: '',
  9. name: '测试bigScreen',
  10. code: '',
  11. icon: '',
  12. iconColor: '#007aff',
  13. orderNum: 0,
  14. remark: '',
  15. type: 'bigScreen',
  16. style: '',
  17. parentCode: '0',
  18. // 大屏页面的配置
  19. pageConfig: {
  20. w: 1920,
  21. h: 1080,
  22. bgColor: '#151a26', // 背景色
  23. bg: '', // 背景图
  24. lightBgColor: '#f5f7fa',
  25. lightBg: '',
  26. opacity: 100,
  27. customTheme: 'dark',
  28. themeJson: {}, // 自定义主题配置
  29. // 缓存的数据集 { name: '', dataSetId: '' }
  30. cacheDataSets: [],
  31. refreshConfig: [],
  32. // 自适应模式 无(none) 、自动(auto)、宽度铺满(fitWidth)、高度铺满(fitHeight)和 双向铺满(cover) 5 种自适应模式
  33. fitMode: 'none'
  34. },
  35. // 图表的集合
  36. chartList: []
  37. },
  38. // 当前选中的组件code
  39. activeCode: null,
  40. // 当前鼠标悬浮的组件code
  41. hoverCode: null,
  42. // 页面初始化加载状态
  43. pageLoading: true,
  44. // 当前选中的组件的配置
  45. activeItemConfig: null,
  46. // 当前选中的组件的对齐线
  47. presetLine: [],
  48. // 强制更新键
  49. updateKey: null,
  50. // 是否显示网格
  51. hasGrid: false,
  52. // 多选的组件code数据
  53. activeCodes: [],
  54. // 复制到粘贴板上的组件编码
  55. copyChartCodes: [],
  56. // false 表示 shift 键没有被按下, true表示 shift 键被按下
  57. shiftKeyDown: false,
  58. // 缩放
  59. zoom: 100,
  60. // 自适应下的缩放比例
  61. fitZoom: 100,
  62. iframeDialog: false
  63. }
  64. export default () => ({
  65. // 存储的大屏timeline信息
  66. timelineStore: [],
  67. // 当前的timeline 的index
  68. currentTimeLine: 0,
  69. // 具体信息
  70. ...cloneDeep(defaultData)
  71. })