cnhis-design-vue 3.1.26-beta.4 → 3.1.27-beta.0

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 (80) hide show
  1. package/README.md +123 -123
  2. package/es/components/fabric-chart/index.d.ts +2 -0
  3. package/es/components/fabric-chart/src/FabricChart.js +4 -11
  4. package/es/components/fabric-chart/src/FabricChart.vue.d.ts +2 -0
  5. package/es/components/fabric-chart/src/hooks/useCenter.d.ts +2 -0
  6. package/es/components/fabric-chart/src/hooks/useCenter.js +76 -12
  7. package/es/components/fabric-chart/src/hooks/useLeft.d.ts +1 -1
  8. package/es/components/fabric-chart/src/hooks/useLeft.js +9 -10
  9. package/es/components/form-config/index.d.ts +2 -2
  10. package/es/components/form-config/src/FormConfig.vue.d.ts +2 -2
  11. package/es/components/form-config/src/components/FormConfigCreator.vue.d.ts +1 -1
  12. package/es/components/form-config/src/components/FormConfigEdit.vue.d.ts +1 -1
  13. package/es/components/form-render/index.d.ts +1 -1
  14. package/es/components/form-render/src/FormRender.js +1 -1
  15. package/es/components/form-render/src/FormRenderWrapper.js +1 -2
  16. package/es/components/form-render/src/FormRenderWrapper.vue.d.ts +18 -19
  17. package/es/components/iho-table/index.d.ts +6 -0
  18. package/es/components/iho-table/index.js +1 -1
  19. package/es/components/iho-table/src/IhoTable.js +12 -5
  20. package/es/components/iho-table/src/IhoTable.vue.d.ts +6 -0
  21. package/es/components/iho-table/src/constants/index.d.ts +16 -4
  22. package/es/components/iho-table/src/constants/index.js +15 -1
  23. package/es/components/iho-table/src/hooks/index.js +1 -1
  24. package/es/components/iho-table/src/hooks/tapHooks/index.d.ts +8 -1
  25. package/es/components/iho-table/src/hooks/tapHooks/index.js +21 -5
  26. package/es/components/iho-table/src/hooks/tapHooks/useDomInsertHooks.d.ts +15 -0
  27. package/es/components/iho-table/src/hooks/tapHooks/useDomInsertHooks.js +27 -0
  28. package/es/components/iho-table/src/hooks/tapHooks/useEventHooks.d.ts +67 -60
  29. package/es/components/iho-table/src/hooks/tapHooks/useEventHooks.js +29 -1
  30. package/es/components/iho-table/src/hooks/useTableContext.d.ts +7 -5
  31. package/es/components/iho-table/src/hooks/useTableContext.js +4 -2
  32. package/es/components/iho-table/src/plugins/anchorPlugin/index.d.ts +1 -0
  33. package/es/components/iho-table/src/plugins/anchorPlugin/index.js +19 -0
  34. package/es/components/iho-table/src/plugins/anchorPlugin/tableAnchor.d.ts +2 -0
  35. package/es/components/iho-table/src/plugins/anchorPlugin/tableAnchor.js +50 -0
  36. package/es/components/iho-table/src/plugins/anchorPlugin/useAnchor.d.ts +13 -0
  37. package/es/components/iho-table/src/plugins/anchorPlugin/useAnchor.js +87 -0
  38. package/es/components/iho-table/src/plugins/defaultConfigPlugin/index.js +1 -4
  39. package/es/components/iho-table/src/plugins/index.js +16 -14
  40. package/es/components/iho-table/src/plugins/lowCodeFieldAdaptorPlugin/index.js +3 -2
  41. package/es/components/iho-table/src/plugins/rowGroupSettingPlugin/rowGroupUtils.d.ts +3 -3
  42. package/es/components/iho-table/src/plugins/virtualTreePlugin/index.js +3 -1
  43. package/es/components/iho-table/src/types/index.d.ts +9 -6
  44. package/es/components/iho-table/src/types/index.js +1 -1
  45. package/es/components/iho-table/src/types/pluginType.d.ts +8 -3
  46. package/es/components/iho-table/src/types/pluginType.js +3 -1
  47. package/es/components/index.css +1 -1
  48. package/es/components/index.js +1 -1
  49. package/es/components/shortcut-setter/index.d.ts +1 -1
  50. package/es/components/shortcut-setter/src/ShortcutSetter.vue.d.ts +1 -1
  51. package/es/components/steps-wheel/index.d.ts +1 -1
  52. package/es/components/steps-wheel/src/StepsWheel.js +38 -18
  53. package/es/components/steps-wheel/src/StepsWheel.vue.d.ts +1 -1
  54. package/es/components/steps-wheel/style/index.css +1 -1
  55. package/es/components/time-line/index.d.ts +39 -11
  56. package/es/components/time-line/src/TimeLine.js +1 -1
  57. package/es/components/time-line/src/TimeLine.vue.d.ts +14 -13
  58. package/es/shared/assets/img/failure.js +1 -1
  59. package/es/shared/assets/img/icon-asc.js +1 -1
  60. package/es/shared/assets/img/icon-desc.js +1 -1
  61. package/es/shared/assets/img/no-permission.js +1 -1
  62. package/es/shared/assets/img/nodata.js +1 -1
  63. package/es/shared/assets/img/notfound.js +1 -1
  64. package/es/shared/assets/img/qr.js +1 -1
  65. package/es/shared/assets/img/success.js +1 -1
  66. package/es/shared/assets/img/video.js +1 -1
  67. package/es/shared/assets/img/video_default_cover.js +1 -1
  68. package/es/shared/assets/img/video_hover.js +1 -1
  69. package/es/shared/assets/img/video_play_hover.js +1 -1
  70. package/es/shared/assets/img/xb_big.js +1 -1
  71. package/es/shared/assets/img/xb_small.js +1 -1
  72. package/es/shared/types/index.d.ts +6 -2
  73. package/package.json +2 -2
  74. package/es/components/bpmn-workflow/src/BpmnWorkflow.d.ts +0 -0
  75. package/es/components/bpmn-workflow/types/BpmnViewer.d.ts +0 -1
  76. package/es/components/bpmn-workflow/types/ModelingModule.d.ts +0 -1
  77. package/es/components/bpmn-workflow/types/MoveCanvasModule.d.ts +0 -1
  78. package/es/components/fabric-chart/src/utils/index.d.ts +0 -6823
  79. package/es/shared/components/VueDraggable/src/vuedraggable.d.ts +0 -86
  80. package/es/shared/utils/tapable/index.d.ts +0 -139
package/README.md CHANGED
@@ -1,123 +1,123 @@
1
- # 安装
2
-
3
- ```shell
4
- npm i cnhis-design-vue@[版本号]
5
- # or
6
- yarn add cnhis-design-vue@[版本号] #推荐
7
- ```
8
-
9
- ## 1.全局引入
10
-
11
- ```typescript
12
- // main.ts
13
- import { createApp } from 'vue';
14
- import App from './App.vue';
15
- import 'cnhis-design-vue/es/packages/index.css';
16
- import cui from 'cnhis-design-vue';
17
-
18
- const app = createApp(App);
19
- app.use(cui).mount('#app');
20
- ```
21
-
22
- ## 2. 按需引入
23
-
24
- 组件现在支持了自动按需引入, 但是样式文件需要额外的处理
25
-
26
- ### 2.1 样式处理方式 1(按需引入样式)
27
-
28
- ```shell
29
- # 安装自动导入样式的插件
30
- npm i -d vite-plugin-style-import
31
- ```
32
-
33
- ```typescript
34
- // vite.config.ts
35
- import { defineConfig } from 'vite';
36
- import { createStyleImportPlugin } from 'vite-plugin-style-import';
37
-
38
- export default defineConfig({
39
- plugins: [
40
- // ...otherPlugins
41
- createStyleImportPlugin({
42
- libs: [
43
- {
44
- libraryName: 'cnhis-design-vue',
45
- esModule: true,
46
- ensureStyleFile: true,
47
- resolveStyle: name => {
48
- return `cnhis-design-vue/es/components/${ name.slice(2) }/style/index.css`;
49
- }
50
- }
51
- ]
52
- })
53
- ]
54
- });
55
- ```
56
-
57
- ### 2.2 样式处理方式 2(全局引入样式)
58
-
59
- ```typescript
60
- // main.ts
61
- import 'cnhis-design-vue/es/components/index.css';
62
- ```
63
-
64
- ## 3. 注意
65
-
66
- 由于 vxe-table 目前的引入方式是由组件 install 触发的,所以如果需要使用 c-grid/c-big-table 组件,需要全局注册二者任意一个
67
-
68
- ```typescript
69
- // main.ts
70
- import { createApp } from 'vue';
71
- import App from './App.vue';
72
-
73
- import { CGrid } from 'cnhis-design-vue';
74
- // 或者
75
- import { CBigTable } from 'cnhis-design-vue';
76
-
77
- const app = createApp(App);
78
- app.use(CGrid);
79
- // 或者
80
- app.use(CBigTable);
81
- app.mount('#app');
82
- ```
83
-
84
- ## 4.FAQ
85
-
86
- ### 4.1 项目打包后样式丢失
87
-
88
- > 处理方法, 将 cnhis-design-vue 从 vendor 包中移除
89
-
90
- ```typescript
91
- // vite.config.ts
92
- import { defineConfig } from 'vite';
93
-
94
- export default defineConfig({
95
- rollupOptions: {
96
- // ..otherOptions
97
- output: {
98
- dir: './dist',
99
- manualChunks(id: string) {
100
- if (id.includes('node_modules') && !id.includes('cnhis-design-vue')) {
101
- return 'vendor';
102
- }
103
- }
104
- }
105
- }
106
- });
107
- ```
108
-
109
- ### 4.2 找不到文件
110
-
111
- > 由于组件库输出文件类型由 js 修改成了 mjs, 如果配置了 resolve 属性的项目, 需要将 mjs 文件类型添加至 extensions 中
112
-
113
- ```javascript
114
- // vite.config.ts
115
- const config = {
116
- // ...otherOptions
117
- resolve: {
118
- // ...otherOptions
119
- // 如果没有配置, 则不用考虑
120
- extensions: ['.js', '.ts', '.vue', '.json', '.mjs']
121
- }
122
- };
123
- ```
1
+ # 安装
2
+
3
+ ```shell
4
+ npm i cnhis-design-vue@[版本号]
5
+ # or
6
+ yarn add cnhis-design-vue@[版本号] #推荐
7
+ ```
8
+
9
+ ## 1.全局引入
10
+
11
+ ```typescript
12
+ // main.ts
13
+ import { createApp } from 'vue';
14
+ import App from './App.vue';
15
+ import 'cnhis-design-vue/es/packages/index.css';
16
+ import cui from 'cnhis-design-vue';
17
+
18
+ const app = createApp(App);
19
+ app.use(cui).mount('#app');
20
+ ```
21
+
22
+ ## 2. 按需引入
23
+
24
+ 组件现在支持了自动按需引入, 但是样式文件需要额外的处理
25
+
26
+ ### 2.1 样式处理方式 1(按需引入样式)
27
+
28
+ ```shell
29
+ # 安装自动导入样式的插件
30
+ npm i -d vite-plugin-style-import
31
+ ```
32
+
33
+ ```typescript
34
+ // vite.config.ts
35
+ import { defineConfig } from 'vite';
36
+ import { createStyleImportPlugin } from 'vite-plugin-style-import';
37
+
38
+ export default defineConfig({
39
+ plugins: [
40
+ // ...otherPlugins
41
+ createStyleImportPlugin({
42
+ libs: [
43
+ {
44
+ libraryName: 'cnhis-design-vue',
45
+ esModule: true,
46
+ ensureStyleFile: true,
47
+ resolveStyle: name => {
48
+ return `cnhis-design-vue/es/components/${ name.slice(2) }/style/index.css`;
49
+ }
50
+ }
51
+ ]
52
+ })
53
+ ]
54
+ });
55
+ ```
56
+
57
+ ### 2.2 样式处理方式 2(全局引入样式)
58
+
59
+ ```typescript
60
+ // main.ts
61
+ import 'cnhis-design-vue/es/components/index.css';
62
+ ```
63
+
64
+ ## 3. 注意
65
+
66
+ 由于 vxe-table 目前的引入方式是由组件 install 触发的,所以如果需要使用 c-grid/c-big-table 组件,需要全局注册二者任意一个
67
+
68
+ ```typescript
69
+ // main.ts
70
+ import { createApp } from 'vue';
71
+ import App from './App.vue';
72
+
73
+ import { CGrid } from 'cnhis-design-vue';
74
+ // 或者
75
+ import { CBigTable } from 'cnhis-design-vue';
76
+
77
+ const app = createApp(App);
78
+ app.use(CGrid);
79
+ // 或者
80
+ app.use(CBigTable);
81
+ app.mount('#app');
82
+ ```
83
+
84
+ ## 4.FAQ
85
+
86
+ ### 4.1 项目打包后样式丢失
87
+
88
+ > 处理方法, 将 cnhis-design-vue 从 vendor 包中移除
89
+
90
+ ```typescript
91
+ // vite.config.ts
92
+ import { defineConfig } from 'vite';
93
+
94
+ export default defineConfig({
95
+ rollupOptions: {
96
+ // ..otherOptions
97
+ output: {
98
+ dir: './dist',
99
+ manualChunks(id: string) {
100
+ if (id.includes('node_modules') && !id.includes('cnhis-design-vue')) {
101
+ return 'vendor';
102
+ }
103
+ }
104
+ }
105
+ }
106
+ });
107
+ ```
108
+
109
+ ### 4.2 找不到文件
110
+
111
+ > 由于组件库输出文件类型由 js 修改成了 mjs, 如果配置了 resolve 属性的项目, 需要将 mjs 文件类型添加至 extensions 中
112
+
113
+ ```javascript
114
+ // vite.config.ts
115
+ const config = {
116
+ // ...otherOptions
117
+ resolve: {
118
+ // ...otherOptions
119
+ // 如果没有配置, 则不用考虑
120
+ extensions: ['.js', '.ts', '.vue', '.json', '.mjs']
121
+ }
122
+ };
123
+ ```
@@ -83,6 +83,8 @@ declare const FabricChart: SFCWithInstall<import("vue").DefineComponent<{
83
83
  setPopup: (point: any) => void;
84
84
  getEqualXTypes: (pointX: number) => import("./src/interface").IPointType[];
85
85
  isAddPoint: (x: number) => boolean;
86
+ updateData: (params: any, mode?: string) => void;
87
+ redrawPoints: () => void;
86
88
  drawScaleValue: (yScaleValueList: any[]) => void;
87
89
  PopupTip: import("vue").DefineComponent<{
88
90
  show: {
@@ -282,16 +282,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
282
282
  }
283
283
  const { cumputedX, cumputedY, getXValue, getYValue } = useCumputedPoint(propItems);
284
284
  useTop(canvas, propItems);
285
- const { pointTipProps, pointMenuProps, clickMenu, setPopup, getEqualXTypes, isAddPoint } = useCenter(
286
- canvas,
287
- propItems,
288
- emits,
289
- cumputedX,
290
- cumputedY,
291
- getXValue,
292
- getYValue,
293
- props.addRenderItem
294
- );
285
+ const { pointTipProps, pointMenuProps, clickMenu, setPopup, getEqualXTypes, isAddPoint, updateData, redrawPoints } = useCenter(canvas, propItems, emits, cumputedX, cumputedY, getXValue, getYValue, props.addRenderItem);
295
286
  const { drawScaleValue } = useLeft(
296
287
  canvas,
297
288
  propItems,
@@ -301,7 +292,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
301
292
  getXValue,
302
293
  getYValue,
303
294
  getEqualXTypes,
304
- isAddPoint
295
+ isAddPoint,
296
+ updateData
305
297
  );
306
298
  useRight(canvas, propItems, drawScaleValue);
307
299
  useBottom(canvas, propItems);
@@ -324,6 +316,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
324
316
  canvas.value = null;
325
317
  });
326
318
  expose({
319
+ redrawPoints,
327
320
  select,
328
321
  canvas
329
322
  });
@@ -84,6 +84,8 @@ declare const _default: import("vue").DefineComponent<{
84
84
  setPopup: (point: any) => void;
85
85
  getEqualXTypes: (pointX: number) => IPointType[];
86
86
  isAddPoint: (x: number) => boolean;
87
+ updateData: (params: any, mode?: string) => void;
88
+ redrawPoints: () => void;
87
89
  drawScaleValue: (yScaleValueList: any[]) => void;
88
90
  PopupTip: import("vue").DefineComponent<{
89
91
  show: {
@@ -27,4 +27,6 @@ export declare function useCenter(canvas: Ref<fabric.Canvas>, propItems: IPropIt
27
27
  setPopup: (point: any) => void;
28
28
  getEqualXTypes: (pointX: number) => IPointType[];
29
29
  isAddPoint: (x: number) => boolean;
30
+ updateData: (params: any, mode?: string) => void;
31
+ redrawPoints: () => void;
30
32
  };
@@ -4,6 +4,7 @@ import { drawLine, defaultStyle, drawPoint, drawText, drawArrow } from './useDra
4
4
  import useGrid from './useGrid.js';
5
5
  import { useShadow } from './useShadow.js';
6
6
  import { TEMPERATURE_MENU, PAIN_MENU, OVERLAP } from './constant.js';
7
+ import { cloneDeep } from 'lodash-es';
7
8
 
8
9
  function isEffectiveNode(node) {
9
10
  return (node == null ? void 0 : node.time) && ((node == null ? void 0 : node.value) || (node == null ? void 0 : node.value) === 0);
@@ -26,6 +27,10 @@ function deleteProperty(data, list) {
26
27
  Reflect.deleteProperty(data, key);
27
28
  });
28
29
  }
30
+ function getIndex(time, list) {
31
+ const index = list.findIndex((v) => new Date(v.time).getTime() > new Date(time).getTime());
32
+ return !~index ? list.length : index;
33
+ }
29
34
  function useCenter(canvas, propItems, emits, cumputedX, cumputedY, getXValue, getYValue, addRenderItem) {
30
35
  useGrid(canvas, propItems);
31
36
  const {
@@ -59,6 +64,8 @@ function useCenter(canvas, propItems, emits, cumputedX, cumputedY, getXValue, ge
59
64
  const maiboPoints = /* @__PURE__ */ new Set();
60
65
  const otherPoints = /* @__PURE__ */ new Set();
61
66
  const prevLines = /* @__PURE__ */ new Set();
67
+ const gridPoints = /* @__PURE__ */ new Set();
68
+ const yScaleValue = cloneDeep(left.yScaleValue);
62
69
  onMounted(() => {
63
70
  nextTick(() => {
64
71
  init();
@@ -69,7 +76,7 @@ function useCenter(canvas, propItems, emits, cumputedX, cumputedY, getXValue, ge
69
76
  maiboPoints.clear();
70
77
  otherPoints.clear();
71
78
  prevLines.clear();
72
- left.yScaleValue.forEach((scaleValue) => {
79
+ yScaleValue.forEach((scaleValue) => {
73
80
  drawPositionLine(scaleValue);
74
81
  scaleValue.dataList.forEach((item, dataIndex) => {
75
82
  if (scaleValue.type !== "temperature" || item.enable) {
@@ -90,7 +97,7 @@ function useCenter(canvas, propItems, emits, cumputedX, cumputedY, getXValue, ge
90
97
  }
91
98
  function drawShaDow(target) {
92
99
  var _a;
93
- const pulseObj = left.yScaleValue.find((item) => item.type === "pulse");
100
+ const pulseObj = yScaleValue.find((item) => item.type === "pulse");
94
101
  if (!pulseObj || !((_a = pulseObj.dataList) == null ? void 0 : _a.length))
95
102
  return;
96
103
  if (shadowLinesCache.size)
@@ -199,7 +206,7 @@ function useCenter(canvas, propItems, emits, cumputedX, cumputedY, getXValue, ge
199
206
  }
200
207
  function drawOverlapPoint() {
201
208
  var _a;
202
- const pulseObj = left.yScaleValue.find((item) => item.type === "pulse");
209
+ const pulseObj = yScaleValue.find((item) => item.type === "pulse");
203
210
  if (!pulseObj || !((_a = pulseObj.dataList) == null ? void 0 : _a.length))
204
211
  return;
205
212
  if (!pulseObj.dataList.some((item) => item.title.includes("\u8109\u640F")))
@@ -238,6 +245,7 @@ function useCenter(canvas, propItems, emits, cumputedX, cumputedY, getXValue, ge
238
245
  canvas.value.add(...points);
239
246
  points.forEach((v) => {
240
247
  v == null ? void 0 : v.bringToFront();
248
+ gridPoints.add(v);
241
249
  });
242
250
  });
243
251
  }
@@ -376,6 +384,10 @@ function useCenter(canvas, propItems, emits, cumputedX, cumputedY, getXValue, ge
376
384
  verifiedText: {
377
385
  obj: verifiedText,
378
386
  top: (value ? -yCellHeight : 0) - 5
387
+ },
388
+ reducePoint: {
389
+ obj: reducePoint,
390
+ type: "reduce"
379
391
  }
380
392
  });
381
393
  }
@@ -485,6 +497,7 @@ function useCenter(canvas, propItems, emits, cumputedX, cumputedY, getXValue, ge
485
497
  }
486
498
  setPointEvent(point);
487
499
  pointList.push(point);
500
+ gridPoints.add(point);
488
501
  }
489
502
  }
490
503
  }
@@ -507,13 +520,15 @@ function useCenter(canvas, propItems, emits, cumputedX, cumputedY, getXValue, ge
507
520
  if (event2.e.button === 0) {
508
521
  const { type } = point.origin;
509
522
  const value = getYValue(type, point.top);
510
- emits("change", {
523
+ const params = {
511
524
  ...point.origin,
512
525
  data: {
513
526
  ...point.origin.data,
514
527
  value
515
528
  }
516
- });
529
+ };
530
+ emits("change", params);
531
+ updateData(params, "change");
517
532
  }
518
533
  });
519
534
  }
@@ -552,6 +567,8 @@ function useCenter(canvas, propItems, emits, cumputedX, cumputedY, getXValue, ge
552
567
  (_b = point.rightLine) == null ? void 0 : _b.setCoords().set({ x1: point.left, y1: point.top });
553
568
  Object.values(point.otherObj).forEach((o) => {
554
569
  const { obj, type = "", top = 0 } = o;
570
+ if (type === "reduce")
571
+ return;
555
572
  if (type === "line") {
556
573
  obj == null ? void 0 : obj.setCoords().set({ x1: point.left, y1: point.top });
557
574
  } else {
@@ -588,27 +605,72 @@ function useCenter(canvas, propItems, emits, cumputedX, cumputedY, getXValue, ge
588
605
  }
589
606
  function clickMenu({ item, target }) {
590
607
  if (!target) {
591
- emits("add", {
608
+ const params = {
592
609
  data: {
593
610
  time: getXValue(item.pointer.x),
594
611
  value: getYValue(item.origin.type, item.pointer.y),
595
612
  ...item.origin.type !== "temperature" ? {} : { key: item.origin.key }
596
613
  },
597
614
  ...item.origin
598
- });
615
+ };
616
+ emits("add", params);
617
+ updateData(params);
599
618
  } else {
600
- const data = { ...target.origin.data };
619
+ const { data, type, dataIndex, index } = target.origin;
601
620
  deleteProperty(data, TEMPERATURE_MENU);
602
621
  deleteProperty(data, PAIN_MENU);
603
622
  data[`${item.type}`] = item.value;
604
- if (target.origin.type === "temperature") {
623
+ if (type === "temperature") {
605
624
  data["key"] = target.origin.key;
606
625
  }
607
- emits("change", {
626
+ const params = {
608
627
  ...target.origin,
609
628
  data
610
- });
629
+ };
630
+ emits("change", params);
631
+ updateData(params, "change");
632
+ }
633
+ }
634
+ function updateData(params, mode = "add") {
635
+ const { type, dataIndex, index, data, key } = params;
636
+ const obj = yScaleValue.find((v) => v.type === type);
637
+ if (mode === "add") {
638
+ const dataList = type !== "temperature" ? obj.dataList[dataIndex] : obj.dataList.find((v) => v.enable);
639
+ const index2 = getIndex(data.time, dataList.list);
640
+ dataList.list.splice(index2, 0, data);
641
+ } else {
642
+ obj.dataList[dataIndex].list[index] = data;
611
643
  }
644
+ redrawPoints();
645
+ }
646
+ function redrawPoints() {
647
+ var _a;
648
+ if (!gridPoints.size)
649
+ return;
650
+ const removePoints = [];
651
+ [...gridPoints].forEach((point) => {
652
+ point && removePoints.push(point);
653
+ (point == null ? void 0 : point.leftLine) && removePoints.push(point == null ? void 0 : point.leftLine);
654
+ (point == null ? void 0 : point.rightLine) && removePoints.push(point == null ? void 0 : point.rightLine);
655
+ Object.values((point == null ? void 0 : point.otherObj) || {}).forEach((o) => {
656
+ (o == null ? void 0 : o.obj) && removePoints.push(o == null ? void 0 : o.obj);
657
+ });
658
+ });
659
+ (_a = canvas.value) == null ? void 0 : _a.remove(...removePoints);
660
+ shadowPointCache = [];
661
+ gridPoints.clear();
662
+ maiboPoints.clear();
663
+ otherPoints.clear();
664
+ prevLines.clear();
665
+ yScaleValue.forEach((scaleValue) => {
666
+ scaleValue.dataList.forEach((item, dataIndex) => {
667
+ if (scaleValue.type !== "temperature" || item.enable) {
668
+ drawPolyLine(item, dataIndex, scaleValue);
669
+ }
670
+ });
671
+ });
672
+ drawShaDow();
673
+ drawOverlapPoint();
612
674
  }
613
675
  return {
614
676
  pointTipProps,
@@ -616,7 +678,9 @@ function useCenter(canvas, propItems, emits, cumputedX, cumputedY, getXValue, ge
616
678
  clickMenu,
617
679
  setPopup,
618
680
  getEqualXTypes,
619
- isAddPoint
681
+ isAddPoint,
682
+ updateData,
683
+ redrawPoints
620
684
  };
621
685
  }
622
686
 
@@ -1,6 +1,6 @@
1
1
  import { Ref } from 'vue';
2
2
  import { fabric } from '../utils';
3
3
  import { IPropItems } from '../interface';
4
- export declare function useLeft(canvas: Ref<fabric.Canvas>, propItems: IPropItems, emits: any, setPopup: Function, pointTipProps: any, getXValue: Function, getYValue: Function, getEqualXTypes: Function, isAddPoint: Function): {
4
+ export declare function useLeft(canvas: Ref<fabric.Canvas>, propItems: IPropItems, emits: any, setPopup: Function, pointTipProps: any, getXValue: Function, getYValue: Function, getEqualXTypes: Function, isAddPoint: Function, updateData: Function): {
5
5
  drawScaleValue: (yScaleValueList: any[]) => void;
6
6
  };
@@ -2,7 +2,7 @@ import { onMounted, nextTick } from 'vue';
2
2
  import { fabric } from '../utils/index.js';
3
3
  import { defaultBorderStyle, defaultTextStyle, defaultStyle, defaultRectStyle, drawPoint, drawTextGroup } from './useDraw.js';
4
4
 
5
- function useLeft(canvas, propItems, emits, setPopup, pointTipProps, getXValue, getYValue, getEqualXTypes, isAddPoint) {
5
+ function useLeft(canvas, propItems, emits, setPopup, pointTipProps, getXValue, getYValue, getEqualXTypes, isAddPoint, updateData) {
6
6
  const {
7
7
  originY,
8
8
  endY,
@@ -271,28 +271,27 @@ function useLeft(canvas, propItems, emits, setPopup, pointTipProps, getXValue, g
271
271
  if (event.e.button === 0) {
272
272
  if (isLimit(point)) {
273
273
  if (!getEqualXTypes(point.left).includes(point.origin.type) && isAddPoint(point.left)) {
274
- emits("add", {
274
+ const params = {
275
275
  data: {
276
276
  time: getXValue(point.left),
277
277
  value: getYValue(point.origin.type, point.top),
278
278
  ...point.origin.type !== "temperature" ? {} : { key: point.origin.key }
279
279
  },
280
280
  ...point.origin
281
- });
281
+ };
282
+ emits("add", params);
283
+ updateData(params);
282
284
  } else {
283
285
  console.log("\u5F53\u524D\u65F6\u95F4\u6BB5\u5185\u65E0\u53EF\u65B0\u589E\u8282\u70B9");
284
- setRestore();
285
286
  }
286
- } else {
287
- setRestore();
288
287
  }
289
288
  }
290
- function setRestore() {
291
- point.setCoords();
292
- point.set({ originX: "right", left: point.originLeft, top: point.originTop });
293
- }
289
+ setRestore(point);
294
290
  });
295
291
  }
292
+ function setRestore(point) {
293
+ point.setCoords().set({ originX: "right", left: point.originLeft, top: point.originTop });
294
+ }
296
295
  function drawBorder() {
297
296
  canvas.value.add(
298
297
  new fabric.Rect({
@@ -156,7 +156,7 @@ declare const FormConfig: SFCWithInstall<import("vue").DefineComponent<{
156
156
  key: import("vue").Ref<number>;
157
157
  reload: () => Promise<void>;
158
158
  formRenderExposeKeyList: readonly ["validate", "getFormValues", "setFormValues", "setFieldState", "resetFieldState", "resetFields", "queryWidget"];
159
- exposed: import("../../../es/shared/types").AnyObject;
159
+ exposed: Partial<import("..").FormRenderExpose>;
160
160
  FormRender: import("vue").DefineComponent<{
161
161
  fieldList: {
162
162
  type: import("vue").PropType<import("..").FieldItem[]>;
@@ -2591,7 +2591,7 @@ declare const FormConfig: SFCWithInstall<import("vue").DefineComponent<{
2591
2591
  key: import("vue").Ref<number>;
2592
2592
  reload: () => Promise<void>;
2593
2593
  formRenderExposeKeyList: readonly ["validate", "getFormValues", "setFormValues", "setFieldState", "resetFieldState", "resetFields", "queryWidget"];
2594
- exposed: import("../../../es/shared/types").AnyObject;
2594
+ exposed: Partial<import("..").FormRenderExpose>;
2595
2595
  FormRender: import("vue").DefineComponent<{
2596
2596
  fieldList: {
2597
2597
  type: import("vue").PropType<import("..").FieldItem[]>;
@@ -158,7 +158,7 @@ declare const _default: import("vue").DefineComponent<{
158
158
  key: import("vue").Ref<number>;
159
159
  reload: () => Promise<void>;
160
160
  formRenderExposeKeyList: readonly ["validate", "getFormValues", "setFormValues", "setFieldState", "resetFieldState", "resetFields", "queryWidget"];
161
- exposed: import("../../../../es/shared/types").AnyObject;
161
+ exposed: Partial<import("../..").FormRenderExpose>;
162
162
  FormRender: import("vue").DefineComponent<{
163
163
  fieldList: {
164
164
  type: PropType<import("../..").FieldItem[]>;
@@ -2593,7 +2593,7 @@ declare const _default: import("vue").DefineComponent<{
2593
2593
  key: import("vue").Ref<number>;
2594
2594
  reload: () => Promise<void>;
2595
2595
  formRenderExposeKeyList: readonly ["validate", "getFormValues", "setFormValues", "setFieldState", "resetFieldState", "resetFields", "queryWidget"];
2596
- exposed: import("../../../../es/shared/types").AnyObject;
2596
+ exposed: Partial<import("../..").FormRenderExpose>;
2597
2597
  FormRender: import("vue").DefineComponent<{
2598
2598
  fieldList: {
2599
2599
  type: PropType<import("../..").FieldItem[]>;
@@ -20,7 +20,7 @@ declare const _default: import("vue").DefineComponent<{}, {
20
20
  key: import("vue").Ref<number>;
21
21
  reload: () => Promise<void>;
22
22
  formRenderExposeKeyList: readonly ["validate", "getFormValues", "setFormValues", "setFieldState", "resetFieldState", "resetFields", "queryWidget"];
23
- exposed: import("../../../../shared/types").AnyObject;
23
+ exposed: Partial<FormRenderExpose>;
24
24
  FormRender: import("vue").DefineComponent<{
25
25
  fieldList: {
26
26
  type: import("vue").PropType<FieldItem[]>;
@@ -1714,7 +1714,7 @@ declare const _default: import("vue").DefineComponent<{}, {
1714
1714
  key: import("vue").Ref<number>;
1715
1715
  reload: () => Promise<void>;
1716
1716
  formRenderExposeKeyList: readonly ["validate", "getFormValues", "setFormValues", "setFieldState", "resetFieldState", "resetFields", "queryWidget"];
1717
- exposed: import("../../../../../es/shared/types").AnyObject;
1717
+ exposed: Partial<FormRenderExpose>;
1718
1718
  FormRender: import("vue").DefineComponent<{
1719
1719
  fieldList: {
1720
1720
  type: import("vue").PropType<FieldItem[]>;
@@ -7,7 +7,7 @@ declare const FormRender: SFCWithInstall<import("vue").DefineComponent<{}, {
7
7
  key: import("vue").Ref<number>;
8
8
  reload: () => Promise<void>;
9
9
  formRenderExposeKeyList: readonly ["validate", "getFormValues", "setFormValues", "setFieldState", "resetFieldState", "resetFields", "queryWidget"];
10
- exposed: import("../../../es/shared/types").AnyObject;
10
+ exposed: Partial<import("./src/types").FormRenderExpose>;
11
11
  FormRender: import("vue").DefineComponent<{
12
12
  fieldList: {
13
13
  type: import("vue").PropType<import("./src/types").FieldItem[]>;
@@ -169,7 +169,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
169
169
  values = splitExtendKey(_fieldList, values);
170
170
  }
171
171
  formModel.setFieldState("*", (state) => {
172
- if (!isField(state) || Reflect.has(values, state.path.toString()))
172
+ if (!isField(state))
173
173
  return;
174
174
  state.value = values[state.path.toString()];
175
175
  });
@@ -35,8 +35,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
35
35
  return openBlock(), createBlock(FormRender, {
36
36
  key: key.value,
37
37
  ref_key: "formRenderRef",
38
- ref: formRenderRef,
39
- onReload: reload
38
+ ref: formRenderRef
40
39
  });
41
40
  };
42
41
  }