cnhis-design-vue 3.4.0-beta.62 → 3.4.0-beta.65

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 (27) hide show
  1. package/es/_virtual/_virtual_i18n-methods.js +5 -1
  2. package/es/components/fabric-chart/index.d.ts +3 -3
  3. package/es/components/fabric-chart/src/FabricChart.vue.d.ts +3 -3
  4. package/es/components/fabric-chart/src/components/PopupMenu.d.ts +4 -4
  5. package/es/components/fabric-chart/src/components/PopupMenu.js +57 -39
  6. package/es/components/fabric-chart/src/constants/index.d.ts +19 -4
  7. package/es/components/fabric-chart/src/constants/index.js +26 -10
  8. package/es/components/fabric-chart/src/hooks/birthProcess/useBirthProcess.d.ts +4 -3
  9. package/es/components/fabric-chart/src/hooks/birthProcess/useBirthProcess.js +119 -193
  10. package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useCenter.d.ts +4 -3
  11. package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useCenter.js +15 -26
  12. package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useOther.d.ts +4 -3
  13. package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useOther.js +6 -7
  14. package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useTop.d.ts +4 -3
  15. package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useTop.js +8 -9
  16. package/es/components/fabric-chart/src/hooks/temperature/useCenter.d.ts +4 -3
  17. package/es/components/fabric-chart/src/hooks/temperature/useCenter.js +81 -218
  18. package/es/components/fabric-chart/src/hooks/temperature/useTemperatureChart.js +1 -1
  19. package/es/components/fabric-chart/src/interface.d.ts +14 -1
  20. package/es/components/fabric-chart/src/utils/index.d.ts +0 -1
  21. package/es/components/fabric-chart/src/utils/index.js +1 -10
  22. package/es/components/fabric-chart/style/index.css +1 -1
  23. package/es/components/form-render/src/components/renderer/combination/jsonCombination.js +1 -0
  24. package/es/components/index.css +1 -1
  25. package/es/components/select-person/src/SelectPerson.vue2.js +4 -3
  26. package/es/shared/package.json.js +1 -1
  27. package/package.json +2 -2
@@ -1,4 +1,3 @@
1
- import { i18n } from '../../../../../_virtual/_virtual_i18n-methods.js';
2
1
  import { fabric } from '../../../../../shared/utils/fabricjs/index.js';
3
2
  import { drawLine, drawArrow, drawPoint, defaultStyle, drawText, defaultTextStyle, drawTextAndIconGroup, defaultRectStyle } from '../useDraw.js';
4
3
  import { useGrid } from '../useGrid.js';
@@ -10,7 +9,7 @@ import { useCommon } from '../useCommon.js';
10
9
  import 'vue';
11
10
  import { getIndex, isEffectiveNode, getTime, getScaleNumberList } from '../../utils/index.js';
12
11
  import { cloneDeep, isString, last, range } from 'lodash-es';
13
- import '../../constants/index.js';
12
+ import { TITLE_MENU_MAP } from '../../constants/index.js';
14
13
  import '@vueuse/shared';
15
14
  import { format, getHours, getMinutes } from 'date-fns';
16
15
  import 'naive-ui';
@@ -29,19 +28,12 @@ function isStartTimeHalfOrLater(startTime) {
29
28
  return getMinutes(startTimeDate) >= 30;
30
29
  }
31
30
  function useBirthProcess(canvas, propItems, emits, pointTipProps, pointMenuProps) {
32
- const {
33
- computedX,
34
- computedY,
35
- getXValue,
36
- getYValue
37
- } = useBirthProcessCumputedPoint(propItems);
38
- const {
39
- getEqualXTypes,
40
- handleAddPrevent,
41
- isGridLimit,
42
- setPrevAndNextPoint,
43
- getPointEventProps
44
- } = useCommon(canvas, emits, propItems);
31
+ const { computedX, computedY, getXValue, getYValue } = useBirthProcessCumputedPoint(propItems);
32
+ const { getEqualXTypes, handleAddPrevent, isGridLimit, setPrevAndNextPoint, getPointEventProps } = useCommon(
33
+ canvas,
34
+ emits,
35
+ propItems
36
+ );
45
37
  const {
46
38
  xAxis,
47
39
  grid,
@@ -80,9 +72,7 @@ function useBirthProcess(canvas, propItems, emits, pointTipProps, pointMenuProps
80
72
  drawIcons();
81
73
  }
82
74
  function drawPolyLine() {
83
- yScaleValue.filter(({
84
- showData = true
85
- }) => showData).forEach((item, dataIndex) => {
75
+ yScaleValue.filter(({ showData = true }) => showData).forEach((item, dataIndex) => {
86
76
  var _a;
87
77
  const pointList = [];
88
78
  const lineList = [];
@@ -103,9 +93,7 @@ function useBirthProcess(canvas, propItems, emits, pointTipProps, pointMenuProps
103
93
  canvas.value.add(...lineList, ...otherList, ...pointList);
104
94
  pointList.forEach((point) => {
105
95
  point == null ? void 0 : point.bringToFront();
106
- const {
107
- childbirthIcon
108
- } = point.otherObj || {};
96
+ const { childbirthIcon } = point.otherObj || {};
109
97
  if ((childbirthIcon == null ? void 0 : childbirthIcon.obj) && (childbirthIcon == null ? void 0 : childbirthIcon.type) !== "arrow") {
110
98
  childbirthIcon.obj.bringToFront();
111
99
  }
@@ -130,11 +118,7 @@ function useBirthProcess(canvas, propItems, emits, pointTipProps, pointMenuProps
130
118
  let childbirthIcon;
131
119
  let childbirthText;
132
120
  if (v.childbirth) {
133
- const {
134
- type = "arrow",
135
- style = {},
136
- textStyle = {}
137
- } = childbirthStyle;
121
+ const { type = "arrow", style = {}, textStyle = {} } = childbirthStyle;
138
122
  if (type === "arrow") {
139
123
  const top = points[1] + yCellHeight;
140
124
  childbirthIcon = drawArrow([points[0], points[1], top], style);
@@ -180,10 +164,7 @@ function useBirthProcess(canvas, propItems, emits, pointTipProps, pointMenuProps
180
164
  }
181
165
  }
182
166
  if (v.mark) {
183
- const {
184
- type = "triangle",
185
- style = {}
186
- } = v.markStyle || {};
167
+ const { type = "triangle", style = {} } = v.markStyle || {};
187
168
  const y = otherObj.childbirthIcon ? otherObj.childbirthIcon.obj._bottomY + 5 : points[1] + 10;
188
169
  const markObj = isString(v.mark) ? drawText([points[0], y], {
189
170
  value: String(v.mark),
@@ -244,11 +225,7 @@ function useBirthProcess(canvas, propItems, emits, pointTipProps, pointMenuProps
244
225
  }
245
226
  function drawFetalPresentationOther(points, v, k, otherObj) {
246
227
  if (v[k]) {
247
- const {
248
- type = "circle",
249
- style = {},
250
- arrowStyle = {}
251
- } = item[k + "Style"];
228
+ const { type = "circle", style = {}, arrowStyle = {} } = item[k + "Style"];
252
229
  const x = computedX(v[k]);
253
230
  const line = drawLine([...points, x, points[1]], {
254
231
  ...lineAttr,
@@ -310,9 +287,7 @@ function useBirthProcess(canvas, propItems, emits, pointTipProps, pointMenuProps
310
287
  point.on("mouseup", (event2) => {
311
288
  pointTipProps.show = false;
312
289
  if (event2.button === 1) {
313
- const {
314
- key
315
- } = point.origin;
290
+ const { key } = point.origin;
316
291
  const params = {
317
292
  ...point.origin,
318
293
  data: {
@@ -334,12 +309,7 @@ function useBirthProcess(canvas, propItems, emits, pointTipProps, pointMenuProps
334
309
  });
335
310
  }
336
311
  function updateData(params, mode = "add") {
337
- const {
338
- dataIndex,
339
- data,
340
- index,
341
- key
342
- } = params;
312
+ const { dataIndex, data, index, key } = params;
343
313
  const item = yScaleValue.find((v) => v.key === key);
344
314
  switch (mode) {
345
315
  case "remove":
@@ -376,35 +346,15 @@ function useBirthProcess(canvas, propItems, emits, pointTipProps, pointMenuProps
376
346
  }
377
347
  function updateLine(point) {
378
348
  var _a, _b;
379
- (_a = point.leftLine) == null ? void 0 : _a.setCoords().set({
380
- x2: point.left,
381
- y2: point.top
382
- });
383
- (_b = point.rightLine) == null ? void 0 : _b.setCoords().set({
384
- x1: point.left,
385
- y1: point.top
386
- });
349
+ (_a = point.leftLine) == null ? void 0 : _a.setCoords().set({ x2: point.left, y2: point.top });
350
+ (_b = point.rightLine) == null ? void 0 : _b.setCoords().set({ x1: point.left, y1: point.top });
387
351
  Object.values(point.otherObj).forEach((o) => {
388
- const {
389
- obj,
390
- top = 0,
391
- left = 0,
392
- type = "",
393
- moveHide
394
- } = o || {};
352
+ const { obj, top = 0, left = 0, type = "", moveHide } = o || {};
395
353
  if (obj) {
396
354
  if (type === "line") {
397
- obj.setCoords().set({
398
- x1: point.left,
399
- y1: point.top,
400
- x2: point.left + left,
401
- y2: point.top
402
- });
355
+ obj.setCoords().set({ x1: point.left, y1: point.top, x2: point.left + left, y2: point.top });
403
356
  } else {
404
- obj.setCoords().set({
405
- left: point.left + left,
406
- top: point.top + top
407
- });
357
+ obj.setCoords().set({ left: point.left + left, top: point.top + top });
408
358
  }
409
359
  if (moveHide) {
410
360
  canvas.value.remove(obj);
@@ -424,16 +374,15 @@ function useBirthProcess(canvas, propItems, emits, pointTipProps, pointMenuProps
424
374
  point.left > limitRight && point.set("left", limitRight);
425
375
  }
426
376
  function setPopup(point, status = "moving") {
427
- const {
428
- title,
429
- key,
430
- data
431
- } = point.origin;
377
+ const { title, key, data } = point.origin;
432
378
  pointTipProps.point = {
433
379
  x: point.left,
434
380
  y: point.top
435
381
  };
436
- pointTipProps.list = [`${title} ${status === "hover" ? data.value : getYValue(key, point.top)}`, `\u65F6\u95F4 ${getXValue(point.left).slice(-5)}`];
382
+ pointTipProps.list = [
383
+ `${title} ${status === "hover" ? data.value : getYValue(key, point.top)}`,
384
+ `\u65F6\u95F4 ${getXValue(point.left).slice(-5)}`
385
+ ];
437
386
  pointTipProps.show = true;
438
387
  }
439
388
  function getPointer(v, item) {
@@ -453,19 +402,13 @@ function useBirthProcess(canvas, propItems, emits, pointTipProps, pointMenuProps
453
402
  return;
454
403
  canvas.value.on("mouse:up", (event2) => {
455
404
  if (event2.button === 3) {
456
- const {
457
- x = 0,
458
- y = 0
459
- } = event2.pointer || {};
405
+ const { x = 0, y = 0 } = event2.pointer || {};
460
406
  if (x >= originX && x <= endX && y >= originY && y <= endY) {
461
- pointMenuProps.point = {
462
- x,
463
- y
464
- };
407
+ pointMenuProps.point = { x, y };
465
408
  pointMenuProps.show = true;
466
409
  if (!event2.target) {
467
410
  pointMenuProps.target = null;
468
- pointMenuProps.list = [i18n("10010.1.219", "\u65B0\u589E\u8282\u70B9")];
411
+ pointMenuProps.list = [TITLE_MENU_MAP.add];
469
412
  yScaleValue.filter((item) => item.show).forEach((item) => {
470
413
  if (!getEqualXTypes([...gridPoints], x, "key").includes(item.key)) {
471
414
  if (["cervix", "fetalPresentation"].includes(item.key) && y < originYCervix)
@@ -480,16 +423,14 @@ function useBirthProcess(canvas, propItems, emits, pointTipProps, pointMenuProps
480
423
  }
481
424
  } else {
482
425
  pointMenuProps.target = event2.target;
483
- pointMenuProps.list = [i18n("10010.1.220", "\u5220\u9664\u8282\u70B9")];
426
+ pointMenuProps.list = [TITLE_MENU_MAP.remove];
484
427
  [...gridPoints].forEach((obj) => {
485
428
  if (obj.origin && obj.left === event2.target.left && obj.top === event2.target.top) {
486
429
  pointMenuProps.list.push({
487
- renderItem: () => obj.origin.title,
488
- origin: {
489
- ...obj.origin
490
- },
430
+ label: obj.origin.title,
431
+ origin: { ...obj.origin },
491
432
  mode: "remove",
492
- pointer: event2.pointer
433
+ key: obj.origin.key
493
434
  });
494
435
  }
495
436
  });
@@ -500,21 +441,19 @@ function useBirthProcess(canvas, propItems, emits, pointTipProps, pointMenuProps
500
441
  function getPointMenuList(item, pointer) {
501
442
  const dataIndex = yScaleValue.findIndex((_item) => _item.key === item.key);
502
443
  return {
503
- renderItem: () => item.title,
444
+ label: item.title,
504
445
  origin: {
505
446
  title: item.title,
506
447
  unit: item.unit,
507
448
  dataIndex,
508
449
  key: item.key
509
450
  },
510
- pointer
451
+ key: item.key,
452
+ mode: "add"
511
453
  };
512
454
  }
513
455
  }
514
- function clickMenu({
515
- item,
516
- target
517
- }) {
456
+ function clickMenu({ item, pointer, target }) {
518
457
  const params = {
519
458
  ...item.origin
520
459
  };
@@ -524,8 +463,8 @@ function useBirthProcess(canvas, propItems, emits, pointTipProps, pointMenuProps
524
463
  } else {
525
464
  Object.assign(params, {
526
465
  data: {
527
- time: getXValue(item.pointer.x),
528
- value: getYValue(item.origin.key, item.pointer.y)
466
+ time: getXValue(pointer.x),
467
+ value: getYValue(item.origin.key, pointer.y)
529
468
  }
530
469
  });
531
470
  emits("add", params);
@@ -542,43 +481,42 @@ function useBirthProcess(canvas, propItems, emits, pointTipProps, pointMenuProps
542
481
  lineData.forEach((line) => {
543
482
  if (!line.show)
544
483
  return;
545
- const {
546
- key
547
- } = line;
484
+ const { key } = line;
548
485
  switch (key) {
549
486
  case "fetalPresentation": {
550
- const {
551
- range: range2,
552
- show
553
- } = yScaleValue.find((item) => item.key === key);
487
+ const { range: range2, show } = yScaleValue.find((item) => item.key === key);
554
488
  if (show) {
555
489
  const y = computedY(key, range2, 0);
556
- lines.push(drawLine([originX, y, endX, y], {
557
- ...line
558
- }));
490
+ lines.push(
491
+ drawLine([originX, y, endX, y], {
492
+ ...line
493
+ })
494
+ );
559
495
  }
560
496
  break;
561
497
  }
562
498
  case "alert": {
563
499
  if (alertStartPoint) {
564
- const {
565
- key: key2,
566
- range: range2
567
- } = alertItem || {};
500
+ const { key: key2, range: range2 } = alertItem || {};
568
501
  const _time = 6 * 60 * 60 * 1e3;
569
502
  const endPoint = {
570
503
  time: format(new Date(getTime(alertStartPoint.time) + _time), "yyyy-MM-dd HH:mm"),
571
504
  value: 10
572
505
  };
573
- const [x1, y1] = [computedX(alertStartPoint.time) - originX, endY - computedY(key2, range2, alertStartPoint.value)];
506
+ const [x1, y1] = [
507
+ computedX(alertStartPoint.time) - originX,
508
+ endY - computedY(key2, range2, alertStartPoint.value)
509
+ ];
574
510
  const [x2, y2] = [computedX(endPoint.time) - originX, endY - computedY(key2, range2, endPoint.value)];
575
511
  const k = (y2 - y1) / (x2 - x1);
576
512
  const b = y1 - x1 * k;
577
513
  const pointer = computePointer(k, b);
578
514
  if (pointer.length > 0) {
579
- lines.push(drawLine(pointer, {
580
- ...line
581
- }));
515
+ lines.push(
516
+ drawLine(pointer, {
517
+ ...line
518
+ })
519
+ );
582
520
  Object.assign(alertData, {
583
521
  k,
584
522
  b
@@ -589,19 +527,18 @@ function useBirthProcess(canvas, propItems, emits, pointTipProps, pointMenuProps
589
527
  }
590
528
  case "handling": {
591
529
  if (alertStartPoint) {
592
- const {
593
- k,
594
- b
595
- } = alertData;
530
+ const { k, b } = alertData;
596
531
  const _time = 4 * 60 * 60 * 1e3;
597
532
  const endTime = computedX(format(new Date(getTime(alertStartPoint.time) + _time), "yyyy-MM-dd HH:mm"));
598
533
  const a = endTime - computedX(alertStartPoint.time);
599
534
  const _b = b - a * k;
600
535
  const pointer = computePointer(k, _b);
601
536
  if (pointer.length > 0) {
602
- lines.push(drawLine(pointer, {
603
- ...line
604
- }));
537
+ lines.push(
538
+ drawLine(pointer, {
539
+ ...line
540
+ })
541
+ );
605
542
  }
606
543
  }
607
544
  break;
@@ -609,10 +546,7 @@ function useBirthProcess(canvas, propItems, emits, pointTipProps, pointMenuProps
609
546
  }
610
547
  });
611
548
  function computePointer(k, b) {
612
- const {
613
- key,
614
- range: range2
615
- } = alertItem || {};
549
+ const { key, range: range2 } = alertItem || {};
616
550
  const _originY = computedY(key, range2, 10);
617
551
  const startPointer1 = [0, b];
618
552
  const startPointer2 = [-(b / k), 0];
@@ -660,28 +594,30 @@ function useBirthProcess(canvas, propItems, emits, pointTipProps, pointMenuProps
660
594
  const title = (item.alias || item.title).split("").join("\n");
661
595
  const dataIndex = scaleValues.findIndex((_item) => _item.key === item.key);
662
596
  if (!item.alias) {
663
- const {
664
- text,
665
- icon
666
- } = drawTextAndIconGroup(title, item, {
667
- text: {
668
- originX: "center",
669
- originY: "top",
670
- left,
671
- top: topY
672
- },
673
- icon: {
674
- left,
675
- topY,
676
- originX: "center",
677
- originY: "top",
678
- origin: {
679
- type: item.type,
680
- dataIndex
597
+ const { text, icon } = drawTextAndIconGroup(
598
+ title,
599
+ item,
600
+ {
601
+ text: {
602
+ originX: "center",
603
+ originY: "top",
604
+ left,
605
+ top: topY
681
606
  },
682
- ...propItems.event
683
- }
684
- }, "vertical");
607
+ icon: {
608
+ left,
609
+ topY,
610
+ originX: "center",
611
+ originY: "top",
612
+ origin: {
613
+ type: item.type,
614
+ dataIndex
615
+ },
616
+ ...propItems.event
617
+ }
618
+ },
619
+ "vertical"
620
+ );
685
621
  topY += text.height + icon.height + 15;
686
622
  setIconEvent(icon);
687
623
  objs.push(text, icon);
@@ -748,20 +684,10 @@ function useBirthProcess(canvas, propItems, emits, pointTipProps, pointMenuProps
748
684
  });
749
685
  }
750
686
  function setRestore(point) {
751
- point.setCoords().set({
752
- originY: "top",
753
- left: point.originLeft,
754
- top: point.originTop
755
- });
687
+ point.setCoords().set({ originY: "top", left: point.originLeft, top: point.originTop });
756
688
  }
757
689
  function drawXScale() {
758
- const {
759
- show,
760
- startTime: startTime2,
761
- range: timeRange = [0, 23],
762
- position = "top",
763
- style
764
- } = xAxis.time;
690
+ const { show, startTime: startTime2, range: timeRange = [0, 23], position = "top", style } = xAxis.time;
765
691
  const {
766
692
  show: processTimeShow,
767
693
  range: processTimeRange = [0, 23],
@@ -777,47 +703,51 @@ function useBirthProcess(canvas, propItems, emits, pointTipProps, pointMenuProps
777
703
  const halfYCellHeight = yCellHeight / 2;
778
704
  for (let i = 0; i < grid.mainXCell; i++) {
779
705
  if (show) {
780
- const {
781
- textAlign = "center"
782
- } = style;
706
+ const { textAlign = "center" } = style;
783
707
  const baseLeft = originX + (textAlign === "center" ? xCellWidth / 2 : 0);
784
708
  const left = i === 0 && textAlign !== "center" ? baseLeft + 5 : baseLeft;
785
709
  const currentTime = i === 0 ? isStartTimeHalfOrLater(startTime2) && textAlign === "center" ? firstTime + 1 : firstTime : getCurrentTime(last(timeList), timeRange);
786
710
  timeList.push(currentTime);
787
711
  const top = position === "top" ? originY - halfYCellHeight : endY + halfYCellHeight;
788
- timeTextList.push(drawText([left + i * xCellWidth, top], {
789
- value: String(currentTime),
790
- ...defaultTextStyle,
791
- ...style
792
- }));
793
- if (i === grid.mainXCell - 1 && textAlign !== "center") {
794
- timeTextList.push(drawText([endX - 1, top], {
795
- value: String(getCurrentTime(last(timeList), timeRange)),
712
+ timeTextList.push(
713
+ drawText([left + i * xCellWidth, top], {
714
+ value: String(currentTime),
796
715
  ...defaultTextStyle,
797
- ...style,
798
- originX: textAlign !== "center" ? "right" : "center"
799
- }));
716
+ ...style
717
+ })
718
+ );
719
+ if (i === grid.mainXCell - 1 && textAlign !== "center") {
720
+ timeTextList.push(
721
+ drawText([endX - 1, top], {
722
+ value: String(getCurrentTime(last(timeList), timeRange)),
723
+ ...defaultTextStyle,
724
+ ...style,
725
+ originX: textAlign !== "center" ? "right" : "center"
726
+ })
727
+ );
800
728
  }
801
729
  }
802
730
  if (processTimeShow && i <= processTimeList.length) {
803
- const {
804
- textAlign = "center"
805
- } = processTimeStyle;
731
+ const { textAlign = "center" } = processTimeStyle;
806
732
  const baseLeft = originX + (textAlign === "center" ? xCellWidth / 2 : 0);
807
733
  const left = i === 0 && textAlign !== "center" ? baseLeft + 5 : baseLeft;
808
734
  const top = processPosition === "top" ? halfYCellHeight : canvasHeight - halfYCellHeight;
809
- processTimeTextList.push(drawText([left + i * xCellWidth, top], {
810
- value: String(processTimeList[i]),
811
- ...defaultTextStyle,
812
- ...processTimeStyle
813
- }));
814
- if (i === grid.mainXCell - 1 && textAlign !== "center") {
815
- processTimeTextList.push(drawText([endX - 1, top], {
816
- value: String(last(processTimeList)),
735
+ processTimeTextList.push(
736
+ drawText([left + i * xCellWidth, top], {
737
+ value: String(processTimeList[i]),
817
738
  ...defaultTextStyle,
818
- ...style,
819
- originX: textAlign !== "center" ? "right" : "center"
820
- }));
739
+ ...processTimeStyle
740
+ })
741
+ );
742
+ if (i === grid.mainXCell - 1 && textAlign !== "center") {
743
+ processTimeTextList.push(
744
+ drawText([endX - 1, top], {
745
+ value: String(last(processTimeList)),
746
+ ...defaultTextStyle,
747
+ ...style,
748
+ originX: textAlign !== "center" ? "right" : "center"
749
+ })
750
+ );
821
751
  }
822
752
  }
823
753
  }
@@ -854,11 +784,7 @@ function useBirthProcess(canvas, propItems, emits, pointTipProps, pointMenuProps
854
784
  const left = baseLeft + width / 2;
855
785
  const list = getScaleNumberList(range2, spaceValue);
856
786
  const listLen = list.length;
857
- const {
858
- lineXMain,
859
- lineXSub,
860
- textLeft
861
- } = getScaleInfo(position, baseLeft, width);
787
+ const { lineXMain, lineXSub, textLeft } = getScaleInfo(position, baseLeft, width);
862
788
  list.forEach((num, i) => {
863
789
  const baseTop = endY - i * yCellHeight * spaceGridNumber;
864
790
  const top = i === 0 ? endY - 8 : i === list.length - 1 && padding[0] && (!originYCervix || key === "FHR") ? originY + 8 : baseTop;
@@ -1,12 +1,13 @@
1
1
  import { type Ref } from 'vue';
2
2
  import { fabric } from '../../../../../shared/utils/fabricjs';
3
3
  import { AnyObject } from '../../../../../shared/types';
4
- import { IObject, IPointTipProps, IPointMenuProps } from '../../../../../components/fabric-chart/src/interface';
4
+ import { IObject, ICoordinateValue, IPointTipProps, IPointMenuProps, PopupMenuItem } from '../../../../../components/fabric-chart/src/interface';
5
5
  export declare function useCenter(canvas: Ref<fabric.Canvas>, propItems: AnyObject, emits: Function, pointTipProps: IPointTipProps, pointMenuProps: IPointMenuProps, isPopupTipRender: boolean): {
6
6
  redrawPoints: (ItemObj?: AnyObject) => void;
7
- clickMenu: ({ item, target }: {
8
- item: any;
7
+ clickMenu: ({ item, target, pointer }: {
8
+ item: PopupMenuItem;
9
9
  target: any;
10
+ pointer: ICoordinateValue;
10
11
  }) => void;
11
12
  moveLimit: (point: IObject, limitRight?: any) => void;
12
13
  setPopup: (point: any, status?: string) => void;
@@ -260,14 +260,7 @@ function useCenter(canvas, propItems, emits, pointTipProps, pointMenuProps, isPo
260
260
  const {
261
261
  menuList = []
262
262
  } = extraMenuConfig;
263
- pointMenuProps.list = filter(OTHER_MENU, (o) => o.type === "add").concat(menuList).map((item) => {
264
- return {
265
- ...item,
266
- renderItem: () => item.label,
267
- type: item.key || item.type,
268
- pointer: event2.pointer
269
- };
270
- });
263
+ pointMenuProps.list = filter(OTHER_MENU, (o) => o.key === "add").concat(menuList);
271
264
  } else {
272
265
  if (event2.target.__type !== "main")
273
266
  return;
@@ -276,16 +269,10 @@ function useCenter(canvas, propItems, emits, pointTipProps, pointMenuProps, isPo
276
269
  x: point.left,
277
270
  y: point.top
278
271
  }, event2.target, []);
279
- pointMenuProps.list = filter(OTHER_MENU, (o) => o.type !== "edit").map((item) => {
272
+ pointMenuProps.list = filter(OTHER_MENU, (o) => o.key !== "edit").map((item) => {
280
273
  return {
281
274
  ...item,
282
- renderItem: () => item.label,
283
- type: item.key || item.type,
284
- pointer: {
285
- x: point.left,
286
- y: point.top
287
- },
288
- ...item.type === "add" ? {} : {
275
+ ...item.key !== "add" && {
289
276
  origin: {
290
277
  ...point.origin
291
278
  }
@@ -305,13 +292,13 @@ function useCenter(canvas, propItems, emits, pointTipProps, pointMenuProps, isPo
305
292
  }
306
293
  function clickMenu({
307
294
  item,
308
- target
295
+ target,
296
+ pointer
309
297
  }) {
310
298
  var _a;
311
299
  const {
312
- type,
313
- origin,
314
- pointer
300
+ key,
301
+ origin
315
302
  } = item;
316
303
  const params = {
317
304
  ...origin
@@ -324,13 +311,13 @@ function useCenter(canvas, propItems, emits, pointTipProps, pointMenuProps, isPo
324
311
  type: null
325
312
  });
326
313
  }
327
- if (filter(OTHER_MENU, (o) => o.type !== "edit").map((item2) => item2.type).includes(type)) {
328
- if (type === "remove") {
314
+ if (["add", "remove"].includes(key)) {
315
+ if (key === "remove") {
329
316
  updateData(params, "remove");
330
317
  }
331
- emits(type, params);
318
+ emits(key, params);
332
319
  } else {
333
- (_a = extraMenuConfig.click) == null ? void 0 : _a.call(extraMenuConfig, type, params);
320
+ (_a = extraMenuConfig.click) == null ? void 0 : _a.call(extraMenuConfig, key, params);
334
321
  }
335
322
  }
336
323
  function drawCordonLine(item, scaleValue) {
@@ -524,7 +511,8 @@ function useCenter(canvas, propItems, emits, pointTipProps, pointMenuProps, isPo
524
511
  const {
525
512
  type,
526
513
  selfKey,
527
- dataIndex
514
+ dataIndex,
515
+ data: oldData
528
516
  } = point.origin;
529
517
  const params = {
530
518
  ...point.origin,
@@ -575,7 +563,8 @@ function useCenter(canvas, propItems, emits, pointTipProps, pointMenuProps, isPo
575
563
  } else {
576
564
  emits("change", {
577
565
  ...omit(params, ["selfKey", "lineAttr"]),
578
- key: selfKey
566
+ key: selfKey,
567
+ oldData
579
568
  });
580
569
  updateData(params, "change");
581
570
  }
@@ -1,11 +1,12 @@
1
1
  import { Ref } from 'vue';
2
2
  import { fabric } from '../../../../../shared/utils/fabricjs';
3
- import { IPointTipProps, IPointMenuProps } from '../../../../../components/fabric-chart/src/interface';
3
+ import { IPointTipProps, IPointMenuProps, PopupMenuItem, ICoordinateValue } from '../../../../../components/fabric-chart/src/interface';
4
4
  import { AnyObject } from '../../../../../shared/types';
5
5
  export declare function useOther(canvas: Ref<fabric.Canvas>, propItems: AnyObject, emits: Function, pointTipProps: IPointTipProps, pointMenuProps: IPointMenuProps, moveLimit: Function, getContainPoints: Function, showDialog: Function, removeCurrentSelection: Function): {
6
- clickMenu: ({ item, target }: {
7
- item: AnyObject;
6
+ clickMenu: ({ item, target, pointer }: {
7
+ item: PopupMenuItem;
8
8
  target: any;
9
+ pointer: ICoordinateValue;
9
10
  }) => void;
10
11
  handleKeydown: (evt: KeyboardEvent) => void;
11
12
  };