aldehyde 0.2.283 → 0.2.285

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (203) hide show
  1. package/lib/controls/entity-select/entity-select.d.ts +2 -2
  2. package/lib/controls/entity-select/entity-select.d.ts.map +1 -1
  3. package/lib/controls/entity-select/entity-select.js +14 -12
  4. package/lib/controls/entity-select/entity-select.js.map +1 -1
  5. package/lib/controls/entry-control.d.ts.map +1 -1
  6. package/lib/controls/entry-control.js +4 -0
  7. package/lib/controls/entry-control.js.map +1 -1
  8. package/lib/controls/select/index.d.ts.map +1 -1
  9. package/lib/controls/select/index.js +1 -0
  10. package/lib/controls/select/index.js.map +1 -1
  11. package/lib/controls/view-control.d.ts.map +1 -1
  12. package/lib/controls/view-control.js +1 -0
  13. package/lib/controls/view-control.js.map +1 -1
  14. package/lib/detail/view/act-dtmpl-view.d.ts.map +1 -1
  15. package/lib/detail/view/act-dtmpl-view.js +3 -2
  16. package/lib/detail/view/act-dtmpl-view.js.map +1 -1
  17. package/lib/detail/view/dtmpl-view.js +1 -1
  18. package/lib/detail/view/dtmpl-view.js.map +1 -1
  19. package/lib/form/form-Item-group.d.ts.map +1 -1
  20. package/lib/form/form-Item-group.js +0 -1
  21. package/lib/form/form-Item-group.js.map +1 -1
  22. package/lib/lowcode-components/bar-chart/index.d.ts +10 -6
  23. package/lib/lowcode-components/bar-chart/index.d.ts.map +1 -1
  24. package/lib/lowcode-components/bar-chart/index.js +91 -11
  25. package/lib/lowcode-components/bar-chart/index.js.map +1 -1
  26. package/lib/lowcode-components/base-map/index.d.ts +10 -6
  27. package/lib/lowcode-components/base-map/index.d.ts.map +1 -1
  28. package/lib/lowcode-components/base-map/index.js +86 -7
  29. package/lib/lowcode-components/base-map/index.js.map +1 -1
  30. package/lib/lowcode-components/base-table/index.d.ts +53 -0
  31. package/lib/lowcode-components/base-table/index.d.ts.map +1 -0
  32. package/lib/lowcode-components/base-table/index.js +158 -0
  33. package/lib/lowcode-components/base-table/index.js.map +1 -0
  34. package/lib/lowcode-components/base-table/index.less +59 -0
  35. package/lib/lowcode-components/capsule-bar-chart/index.d.ts +43 -0
  36. package/lib/lowcode-components/capsule-bar-chart/index.d.ts.map +1 -0
  37. package/lib/lowcode-components/capsule-bar-chart/index.js +179 -0
  38. package/lib/lowcode-components/capsule-bar-chart/index.js.map +1 -0
  39. package/lib/lowcode-components/circular-progress-chart/index.d.ts +26 -0
  40. package/lib/lowcode-components/circular-progress-chart/index.d.ts.map +1 -0
  41. package/lib/lowcode-components/circular-progress-chart/index.js +179 -0
  42. package/lib/lowcode-components/circular-progress-chart/index.js.map +1 -0
  43. package/lib/lowcode-components/column-chart/index.d.ts +11 -6
  44. package/lib/lowcode-components/column-chart/index.d.ts.map +1 -1
  45. package/lib/lowcode-components/column-chart/index.js +115 -16
  46. package/lib/lowcode-components/column-chart/index.js.map +1 -1
  47. package/lib/lowcode-components/data-number/index.d.ts +10 -0
  48. package/lib/lowcode-components/data-number/index.d.ts.map +1 -1
  49. package/lib/lowcode-components/data-number/index.js +80 -6
  50. package/lib/lowcode-components/data-number/index.js.map +1 -1
  51. package/lib/lowcode-components/decoration/decoration1/index.d.ts +19 -0
  52. package/lib/lowcode-components/decoration/decoration1/index.d.ts.map +1 -0
  53. package/lib/lowcode-components/decoration/decoration1/index.js +58 -0
  54. package/lib/lowcode-components/decoration/decoration1/index.js.map +1 -0
  55. package/lib/lowcode-components/decoration/decoration1/index.less +8 -0
  56. package/lib/lowcode-components/decoration/decoration10/index.d.ts +20 -0
  57. package/lib/lowcode-components/decoration/decoration10/index.d.ts.map +1 -0
  58. package/lib/lowcode-components/decoration/decoration10/index.js +29 -0
  59. package/lib/lowcode-components/decoration/decoration10/index.js.map +1 -0
  60. package/lib/lowcode-components/decoration/decoration10/index.less +6 -0
  61. package/lib/lowcode-components/decoration/decoration11/index.d.ts +20 -0
  62. package/lib/lowcode-components/decoration/decoration11/index.d.ts.map +1 -0
  63. package/lib/lowcode-components/decoration/decoration11/index.js +81 -0
  64. package/lib/lowcode-components/decoration/decoration11/index.js.map +1 -0
  65. package/lib/lowcode-components/decoration/decoration11/index.less +6 -0
  66. package/lib/lowcode-components/decoration/decoration2/index.d.ts +19 -0
  67. package/lib/lowcode-components/decoration/decoration2/index.d.ts.map +1 -0
  68. package/lib/lowcode-components/decoration/decoration2/index.js +23 -0
  69. package/lib/lowcode-components/decoration/decoration2/index.js.map +1 -0
  70. package/lib/lowcode-components/decoration/decoration2/index.less +7 -0
  71. package/lib/lowcode-components/decoration/decoration3/index.d.ts +19 -0
  72. package/lib/lowcode-components/decoration/decoration3/index.d.ts.map +1 -0
  73. package/lib/lowcode-components/decoration/decoration3/index.js +39 -0
  74. package/lib/lowcode-components/decoration/decoration3/index.js.map +1 -0
  75. package/lib/lowcode-components/decoration/decoration3/index.less +8 -0
  76. package/lib/lowcode-components/decoration/decoration4/index.d.ts +19 -0
  77. package/lib/lowcode-components/decoration/decoration4/index.d.ts.map +1 -0
  78. package/lib/lowcode-components/decoration/decoration4/index.js +20 -0
  79. package/lib/lowcode-components/decoration/decoration4/index.js.map +1 -0
  80. package/lib/lowcode-components/decoration/decoration4/index.less +30 -0
  81. package/lib/lowcode-components/decoration/decoration5/index.d.ts +19 -0
  82. package/lib/lowcode-components/decoration/decoration5/index.d.ts.map +1 -0
  83. package/lib/lowcode-components/decoration/decoration5/index.js +56 -0
  84. package/lib/lowcode-components/decoration/decoration5/index.js.map +1 -0
  85. package/lib/lowcode-components/decoration/decoration5/index.less +4 -0
  86. package/lib/lowcode-components/decoration/decoration6/index.d.ts +19 -0
  87. package/lib/lowcode-components/decoration/decoration6/index.d.ts.map +1 -0
  88. package/lib/lowcode-components/decoration/decoration6/index.js +55 -0
  89. package/lib/lowcode-components/decoration/decoration6/index.js.map +1 -0
  90. package/lib/lowcode-components/decoration/decoration6/index.less +8 -0
  91. package/lib/lowcode-components/decoration/decoration7/index.d.ts +20 -0
  92. package/lib/lowcode-components/decoration/decoration7/index.d.ts.map +1 -0
  93. package/lib/lowcode-components/decoration/decoration7/index.js +28 -0
  94. package/lib/lowcode-components/decoration/decoration7/index.js.map +1 -0
  95. package/lib/lowcode-components/decoration/decoration7/index.less +5 -0
  96. package/lib/lowcode-components/decoration/decoration8/index.d.ts +20 -0
  97. package/lib/lowcode-components/decoration/decoration8/index.d.ts.map +1 -0
  98. package/lib/lowcode-components/decoration/decoration8/index.js +31 -0
  99. package/lib/lowcode-components/decoration/decoration8/index.js.map +1 -0
  100. package/lib/lowcode-components/decoration/decoration8/index.less +15 -0
  101. package/lib/lowcode-components/decoration/decoration9/index.d.ts +20 -0
  102. package/lib/lowcode-components/decoration/decoration9/index.d.ts.map +1 -0
  103. package/lib/lowcode-components/decoration/decoration9/index.js +52 -0
  104. package/lib/lowcode-components/decoration/decoration9/index.js.map +1 -0
  105. package/lib/lowcode-components/decoration/decoration9/index.less +5 -0
  106. package/lib/lowcode-components/effectScatter-map/index.d.ts +10 -6
  107. package/lib/lowcode-components/effectScatter-map/index.d.ts.map +1 -1
  108. package/lib/lowcode-components/effectScatter-map/index.js +87 -9
  109. package/lib/lowcode-components/effectScatter-map/index.js.map +1 -1
  110. package/lib/lowcode-components/gauge-chart/index.d.ts +10 -6
  111. package/lib/lowcode-components/gauge-chart/index.d.ts.map +1 -1
  112. package/lib/lowcode-components/gauge-chart/index.js +65 -8
  113. package/lib/lowcode-components/gauge-chart/index.js.map +1 -1
  114. package/lib/lowcode-components/index.d.ts +30 -0
  115. package/lib/lowcode-components/index.d.ts.map +1 -1
  116. package/lib/lowcode-components/index.js +25 -28
  117. package/lib/lowcode-components/index.js.map +1 -1
  118. package/lib/lowcode-components/line-chart/index.d.ts +10 -6
  119. package/lib/lowcode-components/line-chart/index.d.ts.map +1 -1
  120. package/lib/lowcode-components/line-chart/index.js +91 -11
  121. package/lib/lowcode-components/line-chart/index.js.map +1 -1
  122. package/lib/lowcode-components/liquid-chart/index.d.ts +10 -6
  123. package/lib/lowcode-components/liquid-chart/index.d.ts.map +1 -1
  124. package/lib/lowcode-components/liquid-chart/index.js +64 -7
  125. package/lib/lowcode-components/liquid-chart/index.js.map +1 -1
  126. package/lib/lowcode-components/lowcode-view/component/assets.d.ts.map +1 -1
  127. package/lib/lowcode-components/lowcode-view/component/assets.js +134 -0
  128. package/lib/lowcode-components/lowcode-view/component/assets.js.map +1 -1
  129. package/lib/lowcode-components/lowcode-view/component/component-container.d.ts.map +1 -1
  130. package/lib/lowcode-components/lowcode-view/component/component-container.js +30 -29
  131. package/lib/lowcode-components/lowcode-view/component/component-container.js.map +1 -1
  132. package/lib/lowcode-components/pie-chart/index.d.ts +11 -6
  133. package/lib/lowcode-components/pie-chart/index.d.ts.map +1 -1
  134. package/lib/lowcode-components/pie-chart/index.js +102 -15
  135. package/lib/lowcode-components/pie-chart/index.js.map +1 -1
  136. package/lib/lowcode-components/text-scroller/index.d.ts +23 -0
  137. package/lib/lowcode-components/text-scroller/index.d.ts.map +1 -0
  138. package/lib/lowcode-components/text-scroller/index.js +96 -0
  139. package/lib/lowcode-components/text-scroller/index.js.map +1 -0
  140. package/lib/lowcode-components/text-scroller/index.less +29 -0
  141. package/lib/table/act-table.d.ts.map +1 -1
  142. package/lib/table/act-table.js.map +1 -1
  143. package/lib/table/query-table.js +5 -5
  144. package/lib/table/query-table.js.map +1 -1
  145. package/lib/table/relation-table.d.ts.map +1 -1
  146. package/lib/table/relation-table.js +0 -2
  147. package/lib/table/relation-table.js.map +1 -1
  148. package/lib/tmpl/control-type-supportor.d.ts.map +1 -1
  149. package/lib/tmpl/control-type-supportor.js +1 -0
  150. package/lib/tmpl/control-type-supportor.js.map +1 -1
  151. package/package.json +1 -1
  152. package/src/aldehyde/controls/entity-select/entity-select.tsx +15 -15
  153. package/src/aldehyde/controls/entry-control.tsx +12 -0
  154. package/src/aldehyde/controls/select/index.tsx +1 -0
  155. package/src/aldehyde/controls/view-control.tsx +1 -0
  156. package/src/aldehyde/detail/view/act-dtmpl-view.tsx +22 -23
  157. package/src/aldehyde/detail/view/dtmpl-view.tsx +1 -1
  158. package/src/aldehyde/form/form-Item-group.tsx +0 -1
  159. package/src/aldehyde/lowcode-components/bar-chart/index.tsx +100 -19
  160. package/src/aldehyde/lowcode-components/base-map/index.tsx +94 -15
  161. package/src/aldehyde/lowcode-components/base-table/index.less +59 -0
  162. package/src/aldehyde/lowcode-components/base-table/index.tsx +233 -0
  163. package/src/aldehyde/lowcode-components/capsule-bar-chart/index.tsx +219 -0
  164. package/src/aldehyde/lowcode-components/circular-progress-chart/index.tsx +201 -0
  165. package/src/aldehyde/lowcode-components/column-chart/index.tsx +128 -24
  166. package/src/aldehyde/lowcode-components/data-number/index.tsx +89 -7
  167. package/src/aldehyde/lowcode-components/data.d.ts +6 -0
  168. package/src/aldehyde/lowcode-components/decoration/decoration1/index.less +8 -0
  169. package/src/aldehyde/lowcode-components/decoration/decoration1/index.tsx +153 -0
  170. package/src/aldehyde/lowcode-components/decoration/decoration10/index.less +6 -0
  171. package/src/aldehyde/lowcode-components/decoration/decoration10/index.tsx +89 -0
  172. package/src/aldehyde/lowcode-components/decoration/decoration11/index.less +6 -0
  173. package/src/aldehyde/lowcode-components/decoration/decoration11/index.tsx +133 -0
  174. package/src/aldehyde/lowcode-components/decoration/decoration2/index.less +7 -0
  175. package/src/aldehyde/lowcode-components/decoration/decoration2/index.tsx +61 -0
  176. package/src/aldehyde/lowcode-components/decoration/decoration3/index.less +8 -0
  177. package/src/aldehyde/lowcode-components/decoration/decoration3/index.tsx +87 -0
  178. package/src/aldehyde/lowcode-components/decoration/decoration4/index.less +30 -0
  179. package/src/aldehyde/lowcode-components/decoration/decoration4/index.tsx +53 -0
  180. package/src/aldehyde/lowcode-components/decoration/decoration5/index.less +4 -0
  181. package/src/aldehyde/lowcode-components/decoration/decoration5/index.tsx +116 -0
  182. package/src/aldehyde/lowcode-components/decoration/decoration6/index.less +8 -0
  183. package/src/aldehyde/lowcode-components/decoration/decoration6/index.tsx +121 -0
  184. package/src/aldehyde/lowcode-components/decoration/decoration7/index.less +5 -0
  185. package/src/aldehyde/lowcode-components/decoration/decoration7/index.tsx +70 -0
  186. package/src/aldehyde/lowcode-components/decoration/decoration8/index.less +15 -0
  187. package/src/aldehyde/lowcode-components/decoration/decoration8/index.tsx +122 -0
  188. package/src/aldehyde/lowcode-components/decoration/decoration9/index.less +5 -0
  189. package/src/aldehyde/lowcode-components/decoration/decoration9/index.tsx +196 -0
  190. package/src/aldehyde/lowcode-components/effectScatter-map/index.tsx +93 -19
  191. package/src/aldehyde/lowcode-components/gauge-chart/index.tsx +73 -16
  192. package/src/aldehyde/lowcode-components/index.ts +40 -29
  193. package/src/aldehyde/lowcode-components/line-chart/index.tsx +105 -22
  194. package/src/aldehyde/lowcode-components/liquid-chart/index.tsx +70 -15
  195. package/src/aldehyde/lowcode-components/lowcode-view/component/assets.ts +134 -0
  196. package/src/aldehyde/lowcode-components/lowcode-view/component/component-container.tsx +29 -28
  197. package/src/aldehyde/lowcode-components/pie-chart/index.tsx +111 -25
  198. package/src/aldehyde/lowcode-components/text-scroller/index.less +29 -0
  199. package/src/aldehyde/lowcode-components/text-scroller/index.tsx +122 -0
  200. package/src/aldehyde/table/act-table.tsx +0 -1
  201. package/src/aldehyde/table/query-table.tsx +5 -5
  202. package/src/aldehyde/table/relation-table.tsx +0 -2
  203. package/src/aldehyde/tmpl/control-type-supportor.tsx +1 -0
@@ -27,6 +27,21 @@ import Border10 from "../../border/border10";
27
27
  import Border11 from "../../border/border11";
28
28
  import Border12 from "../../border/border12";
29
29
  import Border13 from "../../border/border13";
30
+ import Decoration1 from "../../decoration/decoration1";
31
+ import Decoration2 from "../../decoration/decoration2";
32
+ import Decoration3 from "../../decoration/decoration3";
33
+ import Decoration4 from "../../decoration/decoration4";
34
+ import Decoration5 from "../../decoration/decoration5";
35
+ import Decoration6 from "../../decoration/decoration6";
36
+ import Decoration7 from "../../decoration/decoration7";
37
+ import Decoration8 from "../../decoration/decoration8";
38
+ import Decoration9 from "../../decoration/decoration9";
39
+ import Decoration10 from "../../decoration/decoration10";
40
+ import Decoration11 from "../../decoration/decoration11";
41
+ import BaseTable from "../../base-table";
42
+ import TextScroller from "../../text-scroller";
43
+ import CapsuleBarChart from "../../capsule-bar-chart";
44
+ import CircularProgressChart from "../../circular-progress-chart";
30
45
 
31
46
  interface ComponentItemConfig {
32
47
  baseInfo: BaseInfoType, // 基础信息
@@ -98,6 +113,13 @@ export const compsConfig: { [key: string]: ComponentItemConfig } = {
98
113
  compKey: "ColumnChart",
99
114
  },
100
115
  },
116
+ StackColumnChart: {
117
+ componentNode: ColumnChart,
118
+ baseInfo: {
119
+ compName: "堆叠柱状图",
120
+ compKey: "StackColumnChart",
121
+ },
122
+ },
101
123
  BarChart: {
102
124
  componentNode: BarChart,
103
125
  baseInfo: {
@@ -112,6 +134,13 @@ export const compsConfig: { [key: string]: ComponentItemConfig } = {
112
134
  compKey: "PieChart"
113
135
  }
114
136
  },
137
+ RoseChart: {
138
+ componentNode: PieChart,
139
+ baseInfo: {
140
+ compName: "玫瑰图",
141
+ compKey: "RoseChart"
142
+ }
143
+ },
115
144
  GaugeChart: {
116
145
  componentNode: GaugeChart,
117
146
  baseInfo: {
@@ -237,5 +266,110 @@ export const compsConfig: { [key: string]: ComponentItemConfig } = {
237
266
  compName: "边框13",
238
267
  compKey: "Border13"
239
268
  }
269
+ },
270
+ Decoration1: {
271
+ componentNode: Decoration1,
272
+ baseInfo: {
273
+ compName: "装饰1",
274
+ compKey: "Decoration1"
275
+ }
276
+ },
277
+ Decoration2: {
278
+ componentNode: Decoration2,
279
+ baseInfo: {
280
+ compName: "装饰2",
281
+ compKey: "Decoration2"
282
+ }
283
+ },
284
+ Decoration3: {
285
+ componentNode: Decoration3,
286
+ baseInfo: {
287
+ compName: "装饰3",
288
+ compKey: "Decoration3"
289
+ }
290
+ },
291
+ Decoration4: {
292
+ componentNode: Decoration4,
293
+ baseInfo: {
294
+ compName: "装饰4",
295
+ compKey: "Decoration4"
296
+ }
297
+ },
298
+ Decoration5: {
299
+ componentNode: Decoration5,
300
+ baseInfo: {
301
+ compName: "装饰5",
302
+ compKey: "Decoration5"
303
+ }
304
+ },
305
+ Decoration6: {
306
+ componentNode: Decoration6,
307
+ baseInfo: {
308
+ compName: "装饰6",
309
+ compKey: "Decoration6"
310
+ }
311
+ },
312
+ Decoration7: {
313
+ componentNode: Decoration7,
314
+ baseInfo: {
315
+ compName: "装饰7",
316
+ compKey: "Decoration7"
317
+ }
318
+ },
319
+ Decoration8: {
320
+ componentNode: Decoration8,
321
+ baseInfo: {
322
+ compName: "装饰8",
323
+ compKey: "Decoration8"
324
+ }
325
+ },
326
+ Decoration9: {
327
+ componentNode: Decoration9,
328
+ baseInfo: {
329
+ compName: "装饰9",
330
+ compKey: "Decoration9"
331
+ }
332
+ },
333
+ Decoration10: {
334
+ componentNode: Decoration10,
335
+ baseInfo: {
336
+ compName: "装饰10",
337
+ compKey: "Decoration10"
338
+ }
339
+ },
340
+ Decoration11: {
341
+ componentNode: Decoration11,
342
+ baseInfo: {
343
+ compName: "装饰11",
344
+ compKey: "Decoration11"
345
+ }
346
+ },
347
+ BaseTable: {
348
+ componentNode: BaseTable,
349
+ baseInfo: {
350
+ compName: "基础表格",
351
+ compKey: "BaseTable"
352
+ }
353
+ },
354
+ TextScroller: {
355
+ componentNode: TextScroller,
356
+ baseInfo: {
357
+ compName: "文本跑马灯",
358
+ compKey: "TextScroller"
359
+ }
360
+ },
361
+ CapsuleBarChart: {
362
+ componentNode: CapsuleBarChart,
363
+ baseInfo: {
364
+ compName: "胶囊图",
365
+ compKey: "CapsuleBarChart"
366
+ }
367
+ },
368
+ CircularProgressChart: {
369
+ componentNode: CircularProgressChart,
370
+ baseInfo: {
371
+ compName: "环形进度图",
372
+ compKey: "CircularProgressChart"
373
+ }
240
374
  }
241
375
  };
@@ -20,40 +20,41 @@ export interface ComponentContainerProps {
20
20
  const ComponentContainer = memo((props: ComponentContainerProps) => {
21
21
  const { layer, layerManager } = props;
22
22
  const ref = useRef(null);
23
- const [compController, setCompController] = useState<{ [key: string]: AbstractDesignerController }>({})
23
+ const [compController, setCompController] = useState<{ [key: string]: AbstractDesignerController }>({});
24
24
 
25
25
  useEffect(() => {
26
26
  //通过ref创建组件,并将组件实例存入Map中。后续通过Map匹配到具体实例,调用实例的对象方法进行组件的更新操作
27
27
  const { elemConfigs } = layerManager;
28
28
  const componentDefine = abstractDesignerLoader.definitionMap[layer.type];
29
- if (componentDefine) {
30
- const Controller = componentDefine.getController() as any;
31
- if (Controller) {
32
- let config;
33
- if (layer.id! in compController!) {
34
- //重新编组后,被编组组件会重新渲染,需从之前的实例中获取原有数据
35
- config = compController![layer.id!].getConfig();
36
- } else if (layer.id! in elemConfigs!) {
37
- config = elemConfigs![layer.id!];
38
- }
39
- /**
40
- * 此处注意,执行顺序尤为重要!!!
41
- * 第一步:动态代理绑定在前,
42
- * 第二步:赋值controller在后,
43
- * 第三步:最后才是执行create方法。
44
- */
45
- //todo 此处逻辑应该使用设计模式优化,而非写死
46
- registerProxy(layer.id!, Controller);
47
- setCompController(val => ({ ...val, [layer.id]: Controller }))
48
- Controller.create(ref.current!, config).then(() => {
49
- //在组件完全渲染完毕后进行数据的加载和事件的注册
50
- Controller.loadComponentData();
51
- //设置组件滤镜效果(todo 考虑是否应该在此处设置?)
52
- Controller.updateFilter(Controller.getConfig()?.filter);
53
- //渲染后删除elemConfigs中的映射关系(需要观察是否会造成其他问题)
54
- delete elemConfigs![layer.id!];
55
- });
29
+ const Controller = componentDefine?.getController() as any;
30
+ if (Controller) {
31
+ let config;
32
+ if (layer.id! in compController!) {
33
+ //重新编组后,被编组组件会重新渲染,需从之前的实例中获取原有数据
34
+ config = compController![layer.id!].getConfig();
35
+ } else if (layer.id! in elemConfigs!) {
36
+ config = elemConfigs![layer.id!];
56
37
  }
38
+ /**
39
+ * 此处注意,执行顺序尤为重要!!!
40
+ * 第一步:动态代理绑定在前,
41
+ * 第二步:赋值controller在后,
42
+ * 第三步:最后才是执行create方法。
43
+ */
44
+ //todo 此处逻辑应该使用设计模式优化,而非写死
45
+ registerProxy(layer.id!, Controller);
46
+ setCompController(val => ({ ...val, [layer.id]: Controller }))
47
+ Controller.create(ref.current!, config).then(() => {
48
+ //在组件完全渲染完毕后进行数据的加载和事件的注册
49
+ Controller.loadComponentData();
50
+ //设置组件滤镜效果(todo 考虑是否应该在此处设置?)
51
+ Controller.updateFilter(Controller.getConfig()?.filter);
52
+ //渲染后删除elemConfigs中的映射关系(需要观察是否会造成其他问题)
53
+ delete elemConfigs![layer.id!];
54
+ });
55
+ }
56
+ return () => {
57
+ Controller.destroy();
57
58
  }
58
59
  }, []);
59
60
 
@@ -1,8 +1,16 @@
1
1
  import * as echarts from 'echarts';
2
2
  import React, { useEffect, useRef, useState, ForwardedRef, forwardRef, useImperativeHandle } from 'react';
3
3
  import _ from 'lodash';
4
+ import HydrocarbonService from "../../tmpl/hcservice-v3";
5
+ import { DataConfigProps } from "../data";
4
6
 
5
7
  const defOption = {
8
+ title: {
9
+ text: '暂无数据',
10
+ left: 'center',
11
+ top: 'middle',
12
+ show: false, // 无数据时显示
13
+ },
6
14
  color: ["#5470c6", "#91cc75", "#fac858", "#ee6666", "#73c0de"],
7
15
  padAngle: 0,
8
16
  tooltip: {
@@ -14,15 +22,18 @@ const defOption = {
14
22
  },
15
23
  series: [
16
24
  {
17
- name: 'Access From',
25
+ name: '数值',
18
26
  type: 'pie',
19
27
  radius: ["0%", "50%"],
28
+ padAngle: 0,
29
+ label: {},
30
+ labelLine: {},
20
31
  data: [
21
- { value: 1048, name: 'Search Engine' },
22
- { value: 735, name: 'Direct' },
23
- { value: 580, name: 'Email' },
24
- { value: 484, name: 'Union Ads' },
25
- { value: 300, name: 'Video Ads' }
32
+ { value: 1048, name: 'Value1' },
33
+ { value: 735, name: 'Value2' },
34
+ { value: 580, name: 'Value3' },
35
+ { value: 484, name: 'Value4' },
36
+ { value: 300, name: 'Value5' }
26
37
  ]
27
38
  }
28
39
  ],
@@ -37,9 +48,28 @@ const legends = {
37
48
  rightTop: { right: 5 },
38
49
  leftBottom: { left: 5, bottom: 0 },
39
50
  rightBottom: { right: 5, bottom: 0 },
40
- }
51
+ };
52
+
53
+ // 处理数据格式
54
+ const handleData = (data: { config: { [key: string]: string }, value: { [key: string]: any }[] }[]) => {
55
+ if (!data?.length) {
56
+ return [];
57
+ }
58
+ const temData = data.map((r) => {
59
+ const { config, value } = r;
60
+ const vNames = Object.keys(config).filter((r) => r.startsWith("v")).sort((a, b) => parseInt(a.substring(1)) - parseInt(b.substring(1)));
61
+ return {
62
+ name: config.d1,
63
+ data: vNames.map((r) => ({
64
+ name: config[r],
65
+ value: value[0]?.[r],
66
+ }))
67
+ };
68
+ });
69
+ return temData || [];
70
+ };
41
71
 
42
- export interface ChartComponentStyle {
72
+ export interface ComponentStyle {
43
73
  tooltip?: { show: boolean };
44
74
  color?: string[];
45
75
  grid?: { top: number, let: number, right: number, bottom: number };
@@ -49,29 +79,45 @@ export interface ChartComponentStyle {
49
79
  innerRadius?: number;
50
80
  label?: { [key: string]: any };
51
81
  labelLine?: { [key: string]: any };
82
+ roseType?: string; // 玫瑰图配置
52
83
  }
53
84
 
54
- export interface ChartComponentProps {
55
- style?: ChartComponentStyle;
56
- base: { width: number, height: number }
85
+ export interface ComponentProps {
86
+ style?: ComponentStyle;
87
+ base: { width: number, height: number },
88
+ data?: DataConfigProps;
89
+ isDesignMode?: boolean; // 是否编辑模式
57
90
  }
58
91
 
59
- export interface BaseTextComponentRef {
60
- updateConfig: (newConfig: ChartComponentProps) => void;
92
+ export interface ComponentRef {
93
+ updateConfig: (newConfig: ComponentProps) => void;
94
+ destroy: () => void;
61
95
  }
62
96
 
63
- const Index = forwardRef((props: ChartComponentProps, ref: ForwardedRef<BaseTextComponentRef>) => {
64
- const [config, setConfig] = useState<ChartComponentStyle>(props.style || {});
65
- const [size, setSize] = useState<{ width: number, height: number }>()
97
+ const Index = forwardRef((props: ComponentProps, ref: ForwardedRef<ComponentRef>) => {
98
+ const { style, data: propsData, isDesignMode } = props;
99
+ const [config, setConfig] = useState<ComponentStyle>(style || {});
100
+ const [size, setSize] = useState<{ width: number, height: number }>();
101
+ const [dataConfig, setDataConfig] = useState<DataConfigProps>({ ...propsData }); // 数据源配置
102
+ const [data, setData] = useState<{ name: string, data: any }[]>([]);
66
103
  const chartRef = useRef<HTMLDivElement>(null);
67
104
  const chart = useRef<any>(null);
105
+ const pollingIntervalRef = useRef<number | NodeJS.Timeout>(null);
106
+
107
+ const handleDestroy = () => {
108
+ pollingIntervalRef.current && clearInterval(pollingIntervalRef.current);
109
+ window.removeEventListener('resize', handleResize);
110
+ chart.current.dispose();
111
+ };
68
112
 
69
113
  useImperativeHandle(ref, () => ({
70
114
  updateConfig: (newConfig) => {
71
- const { base, style } = newConfig;
72
- setConfig({ ...(style || {}) });
115
+ const { base, style: newStyle, data: newDataConfig } = newConfig;
116
+ setConfig({ ...(newStyle || {}) });
73
117
  setSize({ width: base.width, height: base.height });
118
+ setDataConfig(newDataConfig);
74
119
  },
120
+ destroy: handleDestroy,
75
121
  }));
76
122
 
77
123
  // 窗口大小变化时重新调整图表大小
@@ -83,23 +129,63 @@ const Index = forwardRef((props: ChartComponentProps, ref: ForwardedRef<BaseText
83
129
  chart.current = echarts.init(chartRef.current);
84
130
  window.addEventListener('resize', handleResize);
85
131
  return () => {
86
- window.removeEventListener('resize', handleResize);
87
- chart.current.dispose();
132
+ handleDestroy();
88
133
  }
89
134
  }, []);
90
135
 
136
+ // 请求数据
137
+ const getData = async () => {
138
+ const { entities: { config, value } } = await HydrocarbonService.requestMstrucLtmplQueryTop(null, dataConfig?.sourceId, null) || {};
139
+ const temData = handleData(value);
140
+ setData(temData);
141
+ return config;
142
+ };
143
+
144
+ // 初始化请求数据
145
+ const getInitData = async () => {
146
+ pollingIntervalRef.current && clearInterval(pollingIntervalRef.current);
147
+ const config = await getData();
148
+ if (config?.requestType === "polling") {
149
+ pollingIntervalRef.current = setInterval(() => { getData() }, config?.pollingInterval || 60000);
150
+ }
151
+ };
152
+
153
+ // 静态数据处理
154
+ useEffect(() => {
155
+ if (dataConfig?.sourceType === 'staticData') {
156
+ setData(handleData(dataConfig.staticData));
157
+ }
158
+ }, [dataConfig?.sourceType, dataConfig?.staticData]);
159
+
160
+ /**
161
+ * 数据源数据请求
162
+ * 1、编辑态不请求数据
163
+ */
164
+ useEffect(() => {
165
+ if (!isDesignMode && dataConfig?.sourceType === 'sourceId' && dataConfig?.sourceId) {
166
+ getInitData();
167
+ } else if (dataConfig?.sourceType === 'sourceId') {
168
+ setData([]);
169
+ }
170
+ }, [dataConfig?.sourceType, dataConfig?.sourceId]);
171
+
91
172
  const renderChart = () => {
92
- const { legend, tooltip, radius, innerRadius, color, label, labelLine, padAngle } = config;
173
+ const { legend, tooltip, radius, innerRadius, color, label, labelLine, padAngle, roseType } = config;
93
174
  const option = _.cloneDeep(defOption);
175
+ // 编辑态无数据显示默认数据
176
+ const temData = isDesignMode && !data?.length ? option.series : data;
94
177
  option.legend = { ...legend, ...legends[legend?.position] };
95
178
  option.tooltip = { trigger: "item", ...tooltip };
96
179
  option.color = color;
97
- option.series = option.series.map((r) => ({
98
- ...r,
180
+ option.title.show = !temData?.length;
181
+ option.series = temData.map(r => ({
182
+ type: "pie",
99
183
  radius: [`${innerRadius}%`, `${radius}%`],
100
184
  padAngle,
101
185
  label,
102
- labelLine
186
+ labelLine,
187
+ roseType,
188
+ ...r
103
189
  }));
104
190
  chart.current.setOption(option, true);
105
191
  }
@@ -107,7 +193,7 @@ const Index = forwardRef((props: ChartComponentProps, ref: ForwardedRef<BaseText
107
193
  if (config) {
108
194
  renderChart();
109
195
  }
110
- }, [config]);
196
+ }, [config, data]);
111
197
 
112
198
  useEffect(() => {
113
199
  if (size) {
@@ -0,0 +1,29 @@
1
+ .text-scroller-container {
2
+ --speed: 10s;
3
+ --container-width: 320px;
4
+
5
+ width: 100%;
6
+ height: 100%;
7
+ overflow: hidden;
8
+ white-space: nowrap;
9
+ position: relative;
10
+
11
+ .text-scroller {
12
+ height: inherit;
13
+ position: absolute;
14
+ color: white;
15
+ animation: scrollText var(--speed) linear infinite;
16
+ display: flex;
17
+ align-items: center;
18
+ }
19
+
20
+ @keyframes scrollText {
21
+ 0% {
22
+ transform: translateX(var(--container-width));
23
+ }
24
+
25
+ 100% {
26
+ transform: translateX(-100%);
27
+ }
28
+ }
29
+ }
@@ -0,0 +1,122 @@
1
+ import React, { forwardRef, ForwardedRef, useEffect, useImperativeHandle, useRef, useState } from 'react';
2
+ import './index.less';
3
+ import _ from "lodash";
4
+ import HydrocarbonService from "../../tmpl/hcservice-v3";
5
+ import { DataConfigProps } from "../data";
6
+
7
+ export interface ComponentStyle {
8
+ speed?: number;
9
+ fontSize?: number;
10
+ color?: string;
11
+ fontFamily?: string;
12
+ fontWeight?: number;
13
+ defaultValue?: string;
14
+ }
15
+
16
+ export interface ComponentProps {
17
+ style?: ComponentStyle;
18
+ data?: DataConfigProps;
19
+ isDesignMode?: boolean; // 是否编辑模式
20
+ }
21
+
22
+ export interface ComponentRef {
23
+ updateConfig: (newConfig: ComponentProps) => void;
24
+ destroy: () => void;
25
+ }
26
+
27
+ const Index = forwardRef((props: ComponentProps, ref: ForwardedRef<ComponentRef>) => {
28
+ const { style, data: propsData, isDesignMode } = props;
29
+ const [config, setConfig] = useState<ComponentStyle>(style || {});
30
+ const [speed, setSpeed] = useState<number>(style?.speed || 5);
31
+ const [dataConfig, setDataConfig] = useState<DataConfigProps>({ ...propsData }); // 数据源配置
32
+ const [data, setData] = useState<string>('');
33
+ const textScrollerRef = useRef<HTMLDivElement>(null);
34
+ const textContainerRef = useRef<HTMLDivElement>(null);
35
+ const resizeObserverRef = useRef<ResizeObserver | null>(null);
36
+ const pollingIntervalRef = useRef<number | NodeJS.Timeout>(null);
37
+
38
+ const handleDestroy = () => {
39
+ resizeObserverRef.current && resizeObserverRef.current.disconnect();
40
+ pollingIntervalRef.current && clearInterval(pollingIntervalRef.current);
41
+ };
42
+
43
+ useImperativeHandle(ref, () => ({
44
+ updateConfig: (newConfig) => {
45
+ const { style: newStyle, data: newDataConfig } = newConfig;
46
+ setConfig({ ...(newStyle || {}) });
47
+ setSpeed(newStyle?.speed || 5);
48
+ setDataConfig({ ...newDataConfig });
49
+ },
50
+ destroy: handleDestroy,
51
+ }));
52
+
53
+ useEffect(() => {
54
+ if (textContainerRef.current) {
55
+ resizeObserverRef.current = new ResizeObserver(_.debounce((entries) => {
56
+ for (const entry of entries) {
57
+ const { width } = entry.contentRect;
58
+ textContainerRef.current.style.setProperty('--container-width', `${width}px`);
59
+ }
60
+ }, 100));
61
+ // 开始观察
62
+ resizeObserverRef.current.observe(textContainerRef.current);
63
+ }
64
+ return () => {
65
+ handleDestroy();
66
+ }
67
+ }, []);
68
+
69
+ useEffect(() => {
70
+ if (textContainerRef.current) {
71
+ textContainerRef.current.style.setProperty('--speed', `${speed || 5}s`);
72
+ }
73
+ }, [speed]);
74
+
75
+ // 请求数据
76
+ const getData = async () => {
77
+ const { entities: { config, value } } = await HydrocarbonService.requestMstrucLtmplQueryTop(null, dataConfig?.sourceId, null) || {};
78
+ const temData = value?.[0]?.value?.[0]?.v1;
79
+ setData(temData);
80
+ return config;
81
+ };
82
+
83
+ // 初始化请求数据
84
+ const getInitData = async () => {
85
+ pollingIntervalRef.current && clearInterval(pollingIntervalRef.current);
86
+ const config = await getData();
87
+ if (config?.requestType === "polling") {
88
+ pollingIntervalRef.current = setInterval(() => { getData() }, config?.pollingInterval || 60000);
89
+ }
90
+ };
91
+
92
+ // 静态数据处理
93
+ useEffect(() => {
94
+ if (dataConfig?.sourceType === 'staticData') {
95
+ const { value } = dataConfig.staticData || {};
96
+ setData(value);
97
+ }
98
+ }, [dataConfig?.sourceType, dataConfig?.staticData]);
99
+
100
+ /**
101
+ * 数据源数据请求
102
+ * 1、编辑态不请求数据
103
+ */
104
+ useEffect(() => {
105
+ if (!isDesignMode && dataConfig?.sourceType === 'sourceId' && dataConfig?.sourceId) {
106
+ getInitData();
107
+ } else if (dataConfig?.sourceType === 'sourceId') {
108
+ setData("文本跑马灯");
109
+ }
110
+ }, [dataConfig?.sourceType, dataConfig?.sourceId]);
111
+
112
+
113
+ return (
114
+ <div className="text-scroller-container" ref={textContainerRef}>
115
+ <div className="text-scroller" style={{ ...config }} ref={textScrollerRef}>
116
+ {data}
117
+ </div>
118
+ </div>
119
+ );
120
+ });
121
+
122
+ export default Index;
@@ -1348,7 +1348,6 @@ class ActTable extends React.PureComponent<ActTableProps, ActTableStat> {
1348
1348
  title={
1349
1349
  <>
1350
1350
  {!title ? ltmplConfig.title : title}
1351
-
1352
1351
  <ToolTipBar
1353
1352
  content={tip ? tip : ltmplConfig ? ltmplConfig.tip : null}
1354
1353
  />
@@ -181,8 +181,8 @@ class QueryTable extends React.PureComponent<QueryTableProps, QueryTableStat> {
181
181
  return;
182
182
  } else {
183
183
  let dataSource: object[] = [];
184
- pageInfo = queryData.pageInfo;
185
- if (queryData.entities) {
184
+ pageInfo = queryData?.pageInfo;
185
+ if (queryData?.entities) {
186
186
  queryData.entities.forEach((item, index) => {
187
187
  let row = {
188
188
  key: item.code,
@@ -194,7 +194,7 @@ class QueryTable extends React.PureComponent<QueryTableProps, QueryTableStat> {
194
194
  });
195
195
  }
196
196
 
197
- let touchEnd = queryData.touchEnd;
197
+ let touchEnd = queryData?.touchEnd;
198
198
  //缓存数据
199
199
  queryCache.set(pageInfo?.pageNo + "_" + pageInfo?.pageSize, {
200
200
  dataSource,
@@ -524,7 +524,7 @@ class QueryTable extends React.PureComponent<QueryTableProps, QueryTableStat> {
524
524
  })
525
525
  }else if(aggregateItems.length<aggregateShowSize){
526
526
  aggregateItems.push({key: av.fieldId,
527
- label: <div style={{fontSize:14}}>{av.fieldTitle}</div>,
527
+ label: <div style={{fontSize:14}}>{translate("${"+av.fieldTitle+"}") }</div>,
528
528
  children: <Statistic valueStyle={{fontSize:16}} value={av.value?av.value:0} />
529
529
  // <div style={{fontSize:24}}>{av.value}</div>
530
530
  })
@@ -534,7 +534,7 @@ class QueryTable extends React.PureComponent<QueryTableProps, QueryTableStat> {
534
534
  aggregateVO.aggregates.forEach(av=> {
535
535
  aggregateItems.push({
536
536
  key: av.fieldId,
537
- label: <div style={{fontSize: 14}}>{av.fieldTitle}</div>,
537
+ label: <div style={{fontSize: 14}}>{translate("${"+av.fieldTitle+"}") }</div>,
538
538
  children: <Statistic valueStyle={{fontSize:16}} value={av.value ? av.value : 0}/>
539
539
  })
540
540
  });
@@ -431,7 +431,6 @@ class RelationTable extends React.PureComponent<
431
431
  }
432
432
  }
433
433
  }
434
- debugger
435
434
  //直接删除
436
435
  if(fieldGroupConfig.deleteData){
437
436
  let result: boolean = await HcserviceV3.deleteByCode(serverKey, fieldGroupConfig.id, [record.code]);
@@ -640,7 +639,6 @@ class RelationTable extends React.PureComponent<
640
639
 
641
640
  let editingCodes=[...editings];
642
641
  let i=0;
643
- debugger
644
642
  for(let f of fieldMaps){
645
643
  let newData: DtmplData = {};
646
644
  newData.code=Date.now()+""+i++;
@@ -29,6 +29,7 @@ SupportInputTypes.add('timerange-unorder');
29
29
 
30
30
  SupportInputTypes.add('text');
31
31
  SupportInputTypes.add('textarea');
32
+ SupportInputTypes.add('text-view');
32
33
  SupportInputTypes.add('html');
33
34
  SupportInputTypes.add('steps');
34
35
  SupportInputTypes.add('progress');