configuration.data.ts 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150
  1. import { ModuleBGOptions, ModuleChartTypeOptions, ModulePositionOptions, ModuleSizeOptions } from './options';
  2. import { BasicColumn } from '/@/components/Table';
  3. import { FormSchema } from '/@/components/Table';
  4. import _ from 'lodash-es';
  5. export const columns: BasicColumn[] = [
  6. {
  7. title: '所属页面',
  8. dataIndex: 'pageType',
  9. },
  10. {
  11. title: '设备类型',
  12. dataIndex: 'deviceType',
  13. },
  14. {
  15. title: '模块标题',
  16. dataIndex: 'moduleName',
  17. },
  18. {
  19. title: '模块主体配置',
  20. dataIndex: 'moduleData.main',
  21. },
  22. {
  23. title: '模块图表配置',
  24. dataIndex: 'moduleData.chart',
  25. },
  26. {
  27. title: '模块尺寸',
  28. dataIndex: 'showStyle.size',
  29. },
  30. {
  31. title: '模块背景',
  32. dataIndex: 'showStyle.background',
  33. },
  34. {
  35. title: '模块定位',
  36. dataIndex: 'showStyle.position',
  37. },
  38. {
  39. title: '模块图表类型',
  40. dataIndex: 'showStyle.charttype',
  41. },
  42. ];
  43. export const searchFormSchema: FormSchema[] = [
  44. {
  45. label: '设备类型',
  46. field: 'deviceType',
  47. component: 'JDictSelectTag',
  48. componentProps: {
  49. dictCode: 'devicekind',
  50. placeholder: '请选择设备类型',
  51. },
  52. colProps: { span: 6 },
  53. },
  54. {
  55. label: '所属页面',
  56. field: 'pageType',
  57. component: 'JDictSelectTag',
  58. componentProps: {
  59. dictCode: 'configurable_homepage',
  60. placeholder: '请选择所属页面',
  61. },
  62. colProps: { span: 6 },
  63. },
  64. ];
  65. export const formSchema: FormSchema[] = [
  66. {
  67. label: '',
  68. field: 'id',
  69. component: 'InputNumber',
  70. show: false,
  71. },
  72. {
  73. label: '模块标题',
  74. field: 'moduleName',
  75. component: 'Input',
  76. },
  77. {
  78. label: '设备类型',
  79. field: 'deviceType',
  80. component: 'JDictSelectTag',
  81. required: true,
  82. componentProps: {
  83. dictCode: 'devicekind',
  84. placeholder: '请选择设备类型',
  85. },
  86. },
  87. {
  88. label: '所属页面',
  89. field: 'pageType',
  90. component: 'JDictSelectTag',
  91. required: true,
  92. componentProps: {
  93. dictCode: 'configurable_homepage',
  94. placeholder: '请选择所属页面',
  95. },
  96. },
  97. {
  98. label: '模块主体配置',
  99. field: 'moduleData.main',
  100. component: 'JAddInput',
  101. componentProps: {
  102. min: 0,
  103. placeholders: ['请输入点位', '请输入名称'],
  104. },
  105. },
  106. {
  107. label: '模块图表配置',
  108. field: 'moduleData.chart',
  109. component: 'JAddInput',
  110. componentProps: {
  111. min: 0,
  112. placeholders: ['请输入点位', '请输入名称'],
  113. },
  114. },
  115. {
  116. label: '模块尺寸',
  117. field: 'showStyle.size',
  118. component: 'Select',
  119. componentProps: {
  120. options: ModuleSizeOptions,
  121. },
  122. },
  123. {
  124. label: '模块背景',
  125. field: 'showStyle.background',
  126. component: 'Select',
  127. componentProps: {
  128. options: ModuleBGOptions,
  129. },
  130. },
  131. {
  132. label: '模块定位',
  133. field: 'showStyle.position',
  134. component: 'Select',
  135. componentProps: {
  136. options: ModulePositionOptions,
  137. },
  138. },
  139. {
  140. label: '模块图表类型',
  141. field: 'showStyle.charttype',
  142. component: 'Select',
  143. componentProps: {
  144. options: ModuleChartTypeOptions,
  145. },
  146. },
  147. ];