cnhis-design-vue 3.4.0-beta.60 → 3.4.0-beta.63

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 (38) hide show
  1. package/es/components/expand-field/index.d.ts +31 -0
  2. package/es/components/expand-field/src/components/FormItemPerson.vue.d.ts +31 -0
  3. package/es/components/expand-field/src/components/PersonModal.vue.d.ts +31 -0
  4. package/es/components/expand-field/src/components/form.vue.d.ts +31 -0
  5. package/es/components/expand-field/src/index.vue.d.ts +31 -0
  6. package/es/components/fabric-chart/index.d.ts +3 -3
  7. package/es/components/fabric-chart/src/FabricChart.vue.d.ts +3 -3
  8. package/es/components/fabric-chart/src/components/PopupMenu.d.ts +4 -4
  9. package/es/components/fabric-chart/src/components/PopupMenu.js +57 -39
  10. package/es/components/fabric-chart/src/constants/index.d.ts +19 -4
  11. package/es/components/fabric-chart/src/constants/index.js +26 -10
  12. package/es/components/fabric-chart/src/hooks/birthProcess/useBirthProcess.d.ts +4 -3
  13. package/es/components/fabric-chart/src/hooks/birthProcess/useBirthProcess.js +119 -193
  14. package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useCenter.d.ts +4 -3
  15. package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useCenter.js +15 -26
  16. package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useOther.d.ts +4 -3
  17. package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useOther.js +6 -7
  18. package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useTop.d.ts +4 -3
  19. package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useTop.js +8 -9
  20. package/es/components/fabric-chart/src/hooks/temperature/useCenter.d.ts +4 -3
  21. package/es/components/fabric-chart/src/hooks/temperature/useCenter.js +81 -218
  22. package/es/components/fabric-chart/src/hooks/temperature/useTemperatureChart.js +1 -1
  23. package/es/components/fabric-chart/src/interface.d.ts +14 -1
  24. package/es/components/fabric-chart/src/utils/index.d.ts +0 -1
  25. package/es/components/fabric-chart/src/utils/index.js +1 -10
  26. package/es/components/fabric-chart/style/index.css +1 -1
  27. package/es/components/iho-table/src/plugins/filterDaterangeRenderPlugin/filter.vue.d.ts +2 -4
  28. package/es/components/iho-table/src/plugins/filterDaterangeRenderPlugin/filter.vue2.js +22 -8
  29. package/es/components/iho-table/src/plugins/lowCodeFieldAdaptorPlugin.js +1 -1
  30. package/es/components/iho-table/src/types/index.d.ts +3 -1
  31. package/es/components/index.css +1 -1
  32. package/es/components/select-person/index.d.ts +31 -0
  33. package/es/components/select-person/src/SelectPerson.vue.d.ts +14 -0
  34. package/es/components/select-person/src/SelectPerson.vue2.js +16 -4
  35. package/es/components/select-person/src/index.vue.d.ts +31 -0
  36. package/es/components/select-person/src/index.vue2.js +4 -0
  37. package/es/shared/package.json.js +1 -1
  38. package/package.json +2 -2
@@ -1,35 +1,25 @@
1
- import { i18n } from '../../../../../_virtual/_virtual_i18n-methods.js';
2
1
  import { fabric } from '../../../../../shared/utils/fabricjs/index.js';
3
2
  import { drawLine, defaultStyle, drawPoint, drawText, drawArrow } from '../useDraw.js';
4
3
  import { useGrid } from '../useGrid.js';
5
4
  import { format } from 'date-fns';
6
- import { getType, getTime, isOneLine, isOverlapPoint, getFloorNumber, isValidValue, setOtherType, isEffectiveNode, deleteProperty, getIndex } from '../../utils/index.js';
5
+ import { getType, getTime, isOneLine, isOverlapPoint, getFloorNumber, isValidValue, setOtherType, isEffectiveNode, getIndex } from '../../utils/index.js';
7
6
  import { cloneDeep, omit, flatten, last } from 'lodash-es';
8
7
  import '../useEvent.js';
9
8
  import { useShadow } from '../useShadow.js';
10
9
  import { useCommon } from '../useCommon.js';
11
10
  import 'vue';
11
+ import { TEMPERATURE_MENU, PAIN_MENU, TITLE_MENU_MAP, OVERLAP } from '../../constants/index.js';
12
12
  import 'naive-ui';
13
13
  import '../surgicalAnesthesia/useTop.js';
14
14
  import '@vueuse/core';
15
- import { TEMPERATURE_MENU, PAIN_MENU, OVERLAP } from '../../constants/index.js';
16
15
  import '../surgicalAnesthesia/useOther.js';
17
16
  import '../../../../../shared/utils/index.js';
18
17
  import { promiseTimeout } from '@vueuse/shared';
19
18
 
20
19
  function useCenter(canvas, propItems, emits, computedX, computedY, getXValue, getYValue, addRenderItem, pointTipProps, pointMenuProps) {
21
- useGrid(canvas, {
22
- ...propItems,
23
- isTemperature: true
24
- });
25
- const {
26
- getEqualXTypes,
27
- handleAddPrevent,
28
- getPointEventProps
29
- } = useCommon(canvas, emits, propItems);
30
- const {
31
- createShadowLines
32
- } = useShadow();
20
+ useGrid(canvas, { ...propItems, isTemperature: true });
21
+ const { getEqualXTypes, handleAddPrevent, getPointEventProps } = useCommon(canvas, emits, propItems);
22
+ const { createShadowLines } = useShadow();
33
23
  const {
34
24
  left,
35
25
  xScaleList,
@@ -75,21 +65,20 @@ function useCenter(canvas, propItems, emits, computedX, computedY, getXValue, ge
75
65
  }
76
66
  function drawBorder() {
77
67
  const borderList = [];
78
- borderList.push(new fabric.Rect({
79
- left: iconsWidth,
80
- top: 0,
81
- width: canvasWidth - iconsWidth - borderStyle.strokeWidth,
82
- height: canvasHeight - borderStyle.strokeWidth,
83
- fill: "transparent",
84
- ...borderStyle
85
- }));
68
+ borderList.push(
69
+ new fabric.Rect({
70
+ left: iconsWidth,
71
+ top: 0,
72
+ width: canvasWidth - iconsWidth - borderStyle.strokeWidth,
73
+ height: canvasHeight - borderStyle.strokeWidth,
74
+ fill: "transparent",
75
+ ...borderStyle
76
+ })
77
+ );
86
78
  if (painBorderColor) {
87
79
  const painTop = painOriginY.originY - painSurplusCell[0] * yCellHeight;
88
80
  const painEndTop = painTop + painHeight + (painSurplusCell[0] + painSurplusCell[1]) * yCellHeight - 1;
89
- const style = {
90
- ...borderStyle,
91
- stroke: painBorderColor
92
- };
81
+ const style = { ...borderStyle, stroke: painBorderColor };
93
82
  const topLine = drawLine([iconsWidth, painTop, endX, painTop], style);
94
83
  const bottomLine = drawLine([iconsWidth, painEndTop, endX, painEndTop], style);
95
84
  borderList.push(topLine, bottomLine);
@@ -104,7 +93,9 @@ function useCenter(canvas, propItems, emits, computedX, computedY, getXValue, ge
104
93
  Array.from(gridPoints).forEach((point) => {
105
94
  var _a, _b;
106
95
  if (((_a = point == null ? void 0 : point.origin) == null ? void 0 : _a.type) === "pulse") {
107
- if (pointerItem.find((pointer) => Math.abs(point.left - pointer[0]) <= 1 && Math.abs(point.top - pointer[1]) <= 1)) {
96
+ if (pointerItem.find(
97
+ (pointer) => Math.abs(point.left - pointer[0]) <= 1 && Math.abs(point.top - pointer[1]) <= 1
98
+ )) {
108
99
  if (((_b = point == null ? void 0 : point.origin) == null ? void 0 : _b.key) === SHADOWKEYS[0]) {
109
100
  heartRatePoints.push(point);
110
101
  } else {
@@ -171,36 +162,20 @@ function useCenter(canvas, propItems, emits, computedX, computedY, getXValue, ge
171
162
  shadowLinesCache.clear();
172
163
  if (shadowPointCache.size > 1) {
173
164
  if (target) {
174
- const {
175
- type,
176
- key
177
- } = target.origin || {};
165
+ const { type, key } = target.origin || {};
178
166
  if (type === "pulse") {
179
167
  const list = shadowPointCache.get(key);
180
168
  const index = list == null ? void 0 : list.findIndex((point) => point.left === target.left);
181
- list.splice(index, 1, {
182
- ...list[index],
183
- left: target.left,
184
- top: target.top
185
- });
169
+ list.splice(index, 1, { ...list[index], left: target.left, top: target.top });
186
170
  }
187
171
  }
188
- const {
189
- data,
190
- otherLineData
191
- } = getShadowData();
172
+ const { data, otherLineData } = getShadowData();
192
173
  if (data.length > 0) {
193
174
  removePulsePointLine(data);
194
175
  }
195
- const {
196
- mode,
197
- style = {}
198
- } = pulseObj.shadow || {};
176
+ const { mode, style = {} } = pulseObj.shadow || {};
199
177
  data.forEach((item) => {
200
- const points = item.map((v) => ({
201
- x: v[0],
202
- y: v[1]
203
- }));
178
+ const points = item.map((v) => ({ x: v[0], y: v[1] }));
204
179
  const polygon = mode === "color" ? new fabric.Polygon(points, {
205
180
  ...defaultStyle,
206
181
  ...style,
@@ -222,10 +197,7 @@ function useCenter(canvas, propItems, emits, computedX, computedY, getXValue, ge
222
197
  finalData.push(...otherFilters);
223
198
  }
224
199
  finalData.forEach((_item) => {
225
- const l = drawLine([...flatten(_item)], {
226
- ...style,
227
- originX: "center"
228
- });
200
+ const l = drawLine([...flatten(_item)], { ...style, originX: "center" });
229
201
  shadowLines.push(l);
230
202
  shadowLinesCache.add(l);
231
203
  });
@@ -243,7 +215,9 @@ function useCenter(canvas, propItems, emits, computedX, computedY, getXValue, ge
243
215
  acc[key] = !acc[key] ? [cur] : acc[key].concat([cur]);
244
216
  return acc;
245
217
  }, {});
246
- const finalResult = Object.values(result).filter((item) => item.length === 2 && Math.trunc(item[0][1]) !== Math.trunc(item[1][1]));
218
+ const finalResult = Object.values(result).filter(
219
+ (item) => item.length === 2 && Math.trunc(item[0][1]) !== Math.trunc(item[1][1])
220
+ );
247
221
  return finalResult;
248
222
  }
249
223
  function getXY(point) {
@@ -261,11 +235,10 @@ function useCenter(canvas, propItems, emits, computedX, computedY, getXValue, ge
261
235
  pulsePoints.push(item[1]);
262
236
  if (item[0] === SHADOWKEYS[0]) {
263
237
  item[1].forEach((_item) => {
264
- const someIndex = (shadowPointCache.get(SHADOWKEYS[1]) || []).findIndex((v) => v.left === _item.left || v.time === _item.time);
265
- someIndex > -1 && sames.push({
266
- time: _item.time,
267
- left: _item.left
268
- });
238
+ const someIndex = (shadowPointCache.get(SHADOWKEYS[1]) || []).findIndex(
239
+ (v) => v.left === _item.left || v.time === _item.time
240
+ );
241
+ someIndex > -1 && sames.push({ time: _item.time, left: _item.left });
269
242
  });
270
243
  }
271
244
  }
@@ -282,10 +255,7 @@ function useCenter(canvas, propItems, emits, computedX, computedY, getXValue, ge
282
255
  _arr1 = [];
283
256
  _arr2 = [];
284
257
  };
285
- sames.forEach(({
286
- time,
287
- left: left2
288
- }) => {
258
+ sames.forEach(({ time, left: left2 }) => {
289
259
  const index1 = points1.findIndex((point) => point.left === left2 || point.time === time);
290
260
  const index2 = points2.findIndex((point) => point.left === left2 || point.time === time);
291
261
  const currentPoint1 = points1[index1];
@@ -332,34 +302,19 @@ function useCenter(canvas, propItems, emits, computedX, computedY, getXValue, ge
332
302
  otherLineData.push([getXY(currentPoint1), getXY(currentPoint2)]);
333
303
  }
334
304
  });
335
- return {
336
- data,
337
- otherLineData
338
- };
305
+ return { data, otherLineData };
339
306
  }
340
307
  function setCanvasEvent() {
341
308
  canvas.value.on("mouse:up", (event2) => {
342
- const {
343
- button,
344
- target,
345
- pointer = {}
346
- } = event2;
309
+ const { button, target, pointer = {} } = event2;
347
310
  if (button === 3) {
348
311
  if (!propItems.event.evented)
349
312
  return;
350
- const {
351
- x = 0,
352
- y = 0
353
- } = pointer;
313
+ const { x = 0, y = 0 } = pointer;
354
314
  if (x >= originX && x <= endX && y >= originY && y <= endY) {
355
- pointMenuProps.point = {
356
- x,
357
- y
358
- };
315
+ pointMenuProps.point = { x, y };
359
316
  pointMenuProps.show = true;
360
- const {
361
- type
362
- } = (target == null ? void 0 : target.origin) || {};
317
+ const { type } = (target == null ? void 0 : target.origin) || {};
363
318
  if (target && ["temperature", "pain"].includes(type)) {
364
319
  if (type === "temperature") {
365
320
  pointMenuProps.list = [...TEMPERATURE_MENU];
@@ -370,7 +325,7 @@ function useCenter(canvas, propItems, emits, computedX, computedY, getXValue, ge
370
325
  pointMenuProps.target = target;
371
326
  } else {
372
327
  pointMenuProps.target = null;
373
- pointMenuProps.list = [i18n("10010.1.219", "\u65B0\u589E\u8282\u70B9")];
328
+ pointMenuProps.list = [TITLE_MENU_MAP.add];
374
329
  itemList.forEach((v) => {
375
330
  if (!getEqualXTypes([...gridPoints], x, "_type").includes(v.bigType)) {
376
331
  const newY = ["pain"].includes(v.bigType) ? painOriginY : vitalSignsOriginY;
@@ -385,7 +340,7 @@ function useCenter(canvas, propItems, emits, computedX, computedY, getXValue, ge
385
340
  key: v.key,
386
341
  isOneLine: v.isOneLine
387
342
  },
388
- pointer
343
+ key: v.key
389
344
  });
390
345
  }
391
346
  }
@@ -401,10 +356,7 @@ function useCenter(canvas, propItems, emits, computedX, computedY, getXValue, ge
401
356
  if (button === 1) {
402
357
  if (target)
403
358
  return;
404
- const {
405
- x = 0,
406
- y = 0
407
- } = pointer;
359
+ const { x = 0, y = 0 } = pointer;
408
360
  if (x >= originX && x <= endX && y > 0 && y < canvasHeight) {
409
361
  emits("click:grid", {
410
362
  x,
@@ -441,10 +393,12 @@ function useCenter(canvas, propItems, emits, computedX, computedY, getXValue, ge
441
393
  type = key;
442
394
  }
443
395
  const styleKey = overlapKey || key;
444
- points.push(drawPoint(type, {
445
- ...overlap[styleKey],
446
- ...pointer
447
- }));
396
+ points.push(
397
+ drawPoint(type, {
398
+ ...overlap[styleKey],
399
+ ...pointer
400
+ })
401
+ );
448
402
  }
449
403
  }
450
404
  });
@@ -474,10 +428,7 @@ function useCenter(canvas, propItems, emits, computedX, computedY, getXValue, ge
474
428
  dataList = [],
475
429
  list: scaleList = []
476
430
  } = scaleValue;
477
- const {
478
- type: nonePainPointType,
479
- textStyle: nonePainPointTextStyle
480
- } = nonePainPointStyle;
431
+ const { type: nonePainPointType, textStyle: nonePainPointTextStyle } = nonePainPointStyle;
481
432
  const pointList = [];
482
433
  const lineList = [];
483
434
  const otherList = [];
@@ -488,19 +439,11 @@ function useCenter(canvas, propItems, emits, computedX, computedY, getXValue, ge
488
439
  const _isOneLine = isOneLine(scaleValue);
489
440
  (_a = item.list) == null ? void 0 : _a.forEach((v, index) => {
490
441
  const _item = !_isOneLine ? item : dataList.find((_v) => _v.key === v.key);
491
- const points = getPointer(isRespirator(v) ? {
492
- ...v,
493
- value: respiratorStyle.fixedValue
494
- } : v, scaleValue);
442
+ const points = getPointer(isRespirator(v) ? { ...v, value: respiratorStyle.fixedValue } : v, scaleValue);
495
443
  const nextV = item.list[index + 1];
496
- const nextPoint = nextV ? getPointer(isRespirator(nextV) ? {
497
- ...nextV,
498
- value: respiratorStyle.fixedValue
499
- } : nextV, scaleValue) : void 0;
444
+ const nextPoint = nextV ? getPointer(isRespirator(nextV) ? { ...nextV, value: respiratorStyle.fixedValue } : nextV, scaleValue) : void 0;
500
445
  const nextItem = nextV ? !_isOneLine ? item : dataList.find((_v) => _v.key === nextV.key) : {};
501
- const {
502
- key = ""
503
- } = _item;
446
+ const { key = "" } = _item;
504
447
  const mai = "mai";
505
448
  if (!(key === mai && nextItem.key !== mai || key !== mai && nextItem.key === mai) && points && nextPoint && getFloorNumber(points[0], 1) === getFloorNumber(nextPoint[0], 1)) {
506
449
  const pointOriginX = points[0] - xCellWidth / 2;
@@ -537,12 +480,7 @@ function useCenter(canvas, propItems, emits, computedX, computedY, getXValue, ge
537
480
  }
538
481
  nextDoublePointsX2 = null;
539
482
  }
540
- return {
541
- time: (_d = (_c = point.origin) == null ? void 0 : _c.data) == null ? void 0 : _d.time,
542
- left: point.left,
543
- top: point.top,
544
- breakpoint: !point.rightLine
545
- };
483
+ return { time: (_d = (_c = point.origin) == null ? void 0 : _c.data) == null ? void 0 : _d.time, left: point.left, top: point.top, breakpoint: !point.rightLine };
546
484
  });
547
485
  };
548
486
  if (_isOneLine) {
@@ -555,9 +493,7 @@ function useCenter(canvas, propItems, emits, computedX, computedY, getXValue, ge
555
493
  shadowPointCache.set(key, getData(pulsePoints[key]));
556
494
  });
557
495
  } else {
558
- const {
559
- key
560
- } = item;
496
+ const { key } = item;
561
497
  shadowPointCache.set(key, getData(pointList));
562
498
  }
563
499
  }
@@ -566,9 +502,7 @@ function useCenter(canvas, propItems, emits, computedX, computedY, getXValue, ge
566
502
  function drawValue(points, v, _item) {
567
503
  if (!(points == null ? void 0 : points.length) || !config.showValue)
568
504
  return;
569
- const {
570
- lineAttr = {}
571
- } = _item;
505
+ const { lineAttr = {} } = _item;
572
506
  const y = points[1] <= vitalSignsOriginY.originY + yCellHeight ? points[1] + yCellHeight : points[1] - yCellHeight;
573
507
  const value = drawText([points[0], y], {
574
508
  value: isRespirator(v) ? respiratorStyle.fixedValue : v.value,
@@ -592,13 +526,8 @@ function useCenter(canvas, propItems, emits, computedX, computedY, getXValue, ge
592
526
  return;
593
527
  if (!v.value && type === "breathe")
594
528
  return;
595
- const {
596
- lineAttr = {},
597
- key
598
- } = _item;
599
- const {
600
- value
601
- } = otherObj;
529
+ const { lineAttr = {}, key } = _item;
530
+ const { value } = otherObj;
602
531
  const x = computedX(v.time);
603
532
  let reduceLine, reducePoint, noRise, riseText, verifiedText, respirator;
604
533
  if (v.noRise && noRiseStyle.show) {
@@ -613,9 +542,7 @@ function useCenter(canvas, propItems, emits, computedX, computedY, getXValue, ge
613
542
  gridPoints.add(noRise);
614
543
  } else if (v.value) {
615
544
  const top = y + yCellHeight * 2;
616
- noRise = drawArrow([x, y, top], {
617
- ...noRiseStyle.style
618
- });
545
+ noRise = drawArrow([x, y, top], { ...noRiseStyle.style });
619
546
  }
620
547
  noRise && otherList.push(noRise);
621
548
  if (noRise && isFixed(noRiseStyle, v)) {
@@ -708,10 +635,7 @@ function useCenter(canvas, propItems, emits, computedX, computedY, getXValue, ge
708
635
  const maxValue = Math.max(...scaleList);
709
636
  const minValue = Math.min(...scaleList);
710
637
  let upArrow, limitValue, belowMinValue;
711
- const {
712
- upArrowShow = false,
713
- limitValueShow = false
714
- } = _item;
638
+ const { upArrowShow = false, limitValueShow = false } = _item;
715
639
  if (upArrowShow && +v.value > 180) {
716
640
  let top = points[1] - yCellHeight * 2.5;
717
641
  let yArr = [points[1] - yCellHeight / 2, top];
@@ -749,9 +673,7 @@ function useCenter(canvas, propItems, emits, computedX, computedY, getXValue, ge
749
673
  });
750
674
  } else {
751
675
  const top = y + yCellHeight * 2;
752
- belowMinValue = drawArrow([points[0], y, top], {
753
- ...belowMinValueStyle.style
754
- });
676
+ belowMinValue = drawArrow([points[0], y, top], { ...belowMinValueStyle.style });
755
677
  }
756
678
  otherList.push(belowMinValue);
757
679
  }
@@ -773,14 +695,7 @@ function useCenter(canvas, propItems, emits, computedX, computedY, getXValue, ge
773
695
  function drawPointLine(points, nextPoint, v, index, _item, otherObj) {
774
696
  let point;
775
697
  let line;
776
- const {
777
- pointAttr = {},
778
- lineAttr = {},
779
- title = "",
780
- key,
781
- type: pointType = "circle",
782
- overlapKey
783
- } = _item;
698
+ const { pointAttr = {}, lineAttr = {}, title = "", key, type: pointType = "circle", overlapKey } = _item;
784
699
  const pointHalfHeight = pointAttr.height ? pointAttr.height / 2 : 5;
785
700
  const nextV = item.list[index + 1];
786
701
  let newPoints = cloneDeep(points);
@@ -822,9 +737,7 @@ function useCenter(canvas, propItems, emits, computedX, computedY, getXValue, ge
822
737
  line = drawLine([...newPoints, ...newNextPoint], {
823
738
  ...lineAttr
824
739
  });
825
- const {
826
- obj: reduceObj
827
- } = (otherObj == null ? void 0 : otherObj.reducePoint) || {};
740
+ const { obj: reduceObj } = (otherObj == null ? void 0 : otherObj.reducePoint) || {};
828
741
  if (points && nextPoint && (reduceObj == null ? void 0 : reduceObj.top) < points[1] && (config == null ? void 0 : config.hypothermyViewCustom)) {
829
742
  const reduceRightLine = drawLine([reduceObj.left, reduceObj.top, ...nextPoint], {
830
743
  ...lineAttr
@@ -843,10 +756,7 @@ function useCenter(canvas, propItems, emits, computedX, computedY, getXValue, ge
843
756
  const previousLine = lineList[index - 1];
844
757
  const pointAttrNew = {
845
758
  origin: {
846
- data: isRespirator(v) ? {
847
- ...v,
848
- value: respiratorStyle.fixedValue
849
- } : v,
759
+ data: isRespirator(v) ? { ...v, value: respiratorStyle.fixedValue } : v,
850
760
  title,
851
761
  key: key || "",
852
762
  overlapKey,
@@ -863,11 +773,7 @@ function useCenter(canvas, propItems, emits, computedX, computedY, getXValue, ge
863
773
  ...v.pacemakerShow && type == "pulse" ? pacemaker.style : isRespirator(v) ? respiratorStyle.style : pointAttr,
864
774
  ...getPointEventProps(),
865
775
  lockMovementX: true,
866
- ...isNonePain ? {
867
- selectable: false,
868
- evented: false,
869
- ...nonePainPointType === "number" ? nonePainPointTextStyle : {}
870
- } : {}
776
+ ...isNonePain ? { selectable: false, evented: false, ...nonePainPointType === "number" ? nonePainPointTextStyle : {} } : {}
871
777
  };
872
778
  if (points) {
873
779
  if (!previousLine) {
@@ -918,9 +824,7 @@ function useCenter(canvas, propItems, emits, computedX, computedY, getXValue, ge
918
824
  point.on("mouseup", (event2) => {
919
825
  pointTipProps.show = false;
920
826
  if (event2.button === 1) {
921
- const {
922
- type
923
- } = point.origin;
827
+ const { type } = point.origin;
924
828
  const value = getYValue(type, point.top);
925
829
  const params = {
926
830
  ...point.origin,
@@ -936,12 +840,7 @@ function useCenter(canvas, propItems, emits, computedX, computedY, getXValue, ge
936
840
  });
937
841
  }
938
842
  function setPopup(point, status = "moving") {
939
- const {
940
- title,
941
- unit,
942
- type,
943
- data
944
- } = point.origin;
843
+ const { title, unit, type, data } = point.origin;
945
844
  pointTipProps.point = {
946
845
  x: point.left,
947
846
  y: point.top
@@ -950,10 +849,7 @@ function useCenter(canvas, propItems, emits, computedX, computedY, getXValue, ge
950
849
  pointTipProps.list = [getListValue(), timeText];
951
850
  pointTipProps.show = true;
952
851
  function getListValue() {
953
- const {
954
- drugReduce,
955
- physicsReduce
956
- } = data || {};
852
+ const { drugReduce, physicsReduce } = data || {};
957
853
  const value = status === "hover" ? data.value : getYValue(type, point.top);
958
854
  if (isValidValue(drugReduce)) {
959
855
  timeText += (data == null ? void 0 : data.changeTime) ? "\u2014>" + (data == null ? void 0 : data.changeTime.slice(-5)) : "";
@@ -978,37 +874,18 @@ function useCenter(canvas, propItems, emits, computedX, computedY, getXValue, ge
978
874
  }
979
875
  function updateLine(point) {
980
876
  var _a, _b;
981
- (_a = point.leftLine) == null ? void 0 : _a.setCoords().set({
982
- x2: point.left,
983
- y2: point.top
984
- });
985
- (_b = point.rightLine) == null ? void 0 : _b.setCoords().set({
986
- x1: point.left,
987
- y1: point.top
988
- });
877
+ (_a = point.leftLine) == null ? void 0 : _a.setCoords().set({ x2: point.left, y2: point.top });
878
+ (_b = point.rightLine) == null ? void 0 : _b.setCoords().set({ x1: point.left, y1: point.top });
989
879
  Object.values(point.otherObj).forEach((o) => {
990
- const {
991
- obj,
992
- type = "",
993
- top = 0,
994
- isFixed: isFixed2,
995
- moveHide = false,
996
- left: left2 = 0
997
- } = o || {};
880
+ const { obj, type = "", top = 0, isFixed: isFixed2, moveHide = false, left: left2 = 0 } = o || {};
998
881
  if (type === "reduce")
999
882
  return;
1000
883
  if (obj) {
1001
884
  if (type === "line") {
1002
- obj.setCoords().set({
1003
- x1: point.left,
1004
- y1: point.top
1005
- });
885
+ obj.setCoords().set({ x1: point.left, y1: point.top });
1006
886
  } else {
1007
887
  if (!isFixed2) {
1008
- obj.setCoords().set({
1009
- left: point.left + left2,
1010
- top: point.top + top
1011
- });
888
+ obj.setCoords().set({ left: point.left + left2, top: point.top + top });
1012
889
  }
1013
890
  if (moveHide) {
1014
891
  canvas.value.remove(obj);
@@ -1051,33 +928,25 @@ function useCenter(canvas, propItems, emits, computedX, computedY, getXValue, ge
1051
928
  }
1052
929
  return true;
1053
930
  }
1054
- function clickMenu({
1055
- item,
1056
- target
1057
- }) {
931
+ function clickMenu({ item, target, pointer }) {
1058
932
  if (!target) {
1059
933
  const params = {
1060
934
  data: {
1061
- time: getXValue(item.pointer.x),
1062
- value: getYValue(item.origin.type, item.pointer.y),
1063
- ...!item.origin.isOneLine ? {} : {
1064
- key: item.origin.key
1065
- }
935
+ time: getXValue(pointer.x),
936
+ value: getYValue(item.origin.type, pointer.y),
937
+ ...item.origin.isOneLine && { key: item.origin.key }
1066
938
  },
1067
939
  ...item.origin
1068
940
  };
1069
941
  emits("add", params);
1070
942
  updateData(params);
1071
943
  } else {
1072
- const {
944
+ const { data, type, isOneLine: isOneLine2, dataIndex, index } = target.origin;
945
+ const _data = omit(
1073
946
  data,
1074
- type,
1075
- isOneLine: isOneLine2,
1076
- dataIndex,
1077
- index
1078
- } = target.origin;
1079
- const _data = deleteProperty(data, [...TEMPERATURE_MENU, ...PAIN_MENU]);
1080
- _data[`${item.type}`] = item.value;
947
+ [...TEMPERATURE_MENU, ...PAIN_MENU].map((v) => v.key)
948
+ );
949
+ _data[`${item.key}`] = item.value;
1081
950
  _data.changeTime = format(new Date(), "yyyy-MM-dd HH:mm");
1082
951
  if (isOneLine2) {
1083
952
  _data["key"] = target.origin.key;
@@ -1091,13 +960,7 @@ function useCenter(canvas, propItems, emits, computedX, computedY, getXValue, ge
1091
960
  }
1092
961
  }
1093
962
  function updateData(params, mode = "add") {
1094
- const {
1095
- type,
1096
- dataIndex,
1097
- index,
1098
- data,
1099
- key
1100
- } = params;
963
+ const { type, dataIndex, index, data, key } = params;
1101
964
  const obj = yScaleValue.find((v) => v.type === type);
1102
965
  if (mode === "add") {
1103
966
  const dataList = !isOneLine(obj) ? obj.dataList[dataIndex] : obj.dataList.find((v) => v.enable);
@@ -8,10 +8,10 @@ import '../useCommon.js';
8
8
  import { setOtherType, isOneLine, getFloorNumber } from '../../utils/index.js';
9
9
  import { flatten } from 'lodash-es';
10
10
  import { format, addDays } from 'date-fns';
11
+ import '../../constants/index.js';
11
12
  import 'naive-ui';
12
13
  import '../surgicalAnesthesia/useTop.js';
13
14
  import '@vueuse/core';
14
- import '../../constants/index.js';
15
15
  import '../surgicalAnesthesia/useOther.js';
16
16
  import '../../../../../shared/utils/index.js';
17
17
  import { useTop } from './useTop.js';
@@ -1,4 +1,4 @@
1
- import { type Ref } from 'vue';
1
+ import { type Ref, VNode } from 'vue';
2
2
  import { fabric } from '../../../shared/utils/fabricjs';
3
3
  import { AnyObject, AnyFn } from '../../../shared/types';
4
4
  export type IType = 'temperature' | 'birthProcess' | 'surgicalAnesthesia' | 'electrocardiogram' | 'newBirthProcess' | undefined;
@@ -198,4 +198,17 @@ export type IexposeMethods = Partial<{
198
198
  useRectRuler: AnyFn | null;
199
199
  redrawLinePoints: AnyFn | null;
200
200
  }>;
201
+ export type PopupMenuItem = {
202
+ label: string;
203
+ key: string;
204
+ value?: any;
205
+ _type?: 'tree' | 'other';
206
+ mode?: 'add' | 'remove';
207
+ origin?: AnyObject;
208
+ isTitle?: boolean;
209
+ hasInput?: boolean;
210
+ renderItem?: () => VNode;
211
+ children?: PopupMenuItem[];
212
+ [key: string]: any;
213
+ };
201
214
  export {};
@@ -1,7 +1,6 @@
1
1
  import { IPoint, ITreeItem } from '../interface';
2
2
  import { AnyObject } from '../../../../shared/types';
3
3
  export declare function isEffectiveNode(node: IPoint): string | number | boolean;
4
- export declare function deleteProperty(data: AnyObject, list: AnyObject[]): {};
5
4
  /**
6
5
  * @description: 判断yScaleValue数组内的项类型是否可以连成一条折线,比如温度线
7
6
  * @param {string} type
@@ -3,15 +3,6 @@ import { isNull, isNumber } from 'lodash-es';
3
3
  function isEffectiveNode(node) {
4
4
  return (node == null ? void 0 : node.time) && ((node == null ? void 0 : node.value) || (node == null ? void 0 : node.value) === 0);
5
5
  }
6
- function deleteProperty(data, list) {
7
- const _data = {};
8
- for (const key in data) {
9
- if (!list.map((v) => v.type).includes(key)) {
10
- _data[key] = data[key];
11
- }
12
- }
13
- return _data;
14
- }
15
6
  function isOneLine(scaleItem) {
16
7
  return ["temperature", "pulse"].includes(scaleItem.type) && scaleItem.dataList.length && !!scaleItem.dataList.find((i) => i.enable);
17
8
  }
@@ -81,4 +72,4 @@ function nearlyEqual(v1, v2) {
81
72
  return Math.abs(v1 - v2) <= 1e-4;
82
73
  }
83
74
 
84
- export { deleteProperty, getChildrenSize, getFloorNumber, getIndex, getPointRange, getRoundNumber, getScaleNumberList, getTime, getType, isEffectiveNode, isOneLine, isOverlapPoint, isValidValue, nearlyEqual, setOtherType };
75
+ export { getChildrenSize, getFloorNumber, getIndex, getPointRange, getRoundNumber, getScaleNumberList, getTime, getType, isEffectiveNode, isOneLine, isOverlapPoint, isValidValue, nearlyEqual, setOtherType };
@@ -1 +1 @@
1
- .c-fabric-chart{position:relative;user-select:none}.c-fabric-chart-popup{font-size:12px;margin:0;position:absolute;z-index:1001}.c-fabric-chart-popup li{list-style:none}.c-fabric-chart-popup__tip{color:#000}.c-fabric-chart-popup__tip .default-box{background:rgba(0,0,0,.7);border-radius:4px;display:flex;flex-flow:column nowrap;margin:0;padding:8px 12px}.c-fabric-chart-popup__tip .default-box>li{color:#fff}.c-fabric-chart-popup__menu{background:#fff;border:1px solid #e2e6ed;border-radius:2px;box-shadow:0 2px 12px 0 rgba(56,56,56,.2);display:flex;flex-flow:column nowrap;padding:8px 5px!important}.c-fabric-chart-popup__menu>li{background:#fff;cursor:pointer;padding:5px}.c-fabric-chart-popup__menu>li:hover{background:#f0f7ff}.c-fabric-chart-popup__menu>li.no-click{cursor:default}.c-fabric-chart-popup__menu>li.no-click:hover{background:#fff}
1
+ .c-fabric-chart{position:relative;user-select:none}.c-fabric-chart-popup{font-size:12px;margin:0;position:absolute;z-index:1001}.c-fabric-chart-popup li{list-style:none}.c-fabric-chart-popup li ul{padding-left:5px}.c-fabric-chart-popup__tip{color:#000}.c-fabric-chart-popup__tip .default-box{background:rgba(0,0,0,.7);border-radius:4px;display:flex;flex-flow:column nowrap;margin:0;padding:8px 12px}.c-fabric-chart-popup__tip .default-box>li{color:#fff}.c-fabric-chart-popup__menu{background:#fff;border:1px solid #e2e6ed;border-radius:2px;box-shadow:0 2px 12px 0 rgba(56,56,56,.2);display:flex;flex-flow:column nowrap;padding:8px 5px!important}.c-fabric-chart-popup__menu>li{background:#fff;cursor:pointer;padding:5px;position:relative}.c-fabric-chart-popup__menu>li .menu-item__content{align-items:center;display:flex;justify-content:space-between}.c-fabric-chart-popup__menu>li .submenu-arrow{color:#999;margin-left:8px}.c-fabric-chart-popup__menu>li:hover{background:#f0f7ff}.c-fabric-chart-popup__menu>li.no-click{cursor:default}.c-fabric-chart-popup__menu>li.no-click:hover{background:#fff}.c-fabric-chart-popup__menu>li:hover>.c-fabric-chart-popup__submenu{display:block}.c-fabric-chart-popup__submenu{background:#fff;border:1px solid #e2e6ed;border-radius:2px;box-shadow:0 2px 12px 0 rgba(56,56,56,.2);display:none;left:100%;padding:8px 5px;position:absolute;top:0;white-space:nowrap;width:max-content}.c-fabric-chart-popup__submenu>li{background:#fff;cursor:pointer;padding:5px}.c-fabric-chart-popup__submenu>li .menu-item__content{align-items:center;display:flex;justify-content:flex-start}.c-fabric-chart-popup__submenu>li .submenu-arrow{color:#999;margin-left:8px}.c-fabric-chart-popup__submenu>li:hover{background:#f0f7ff}.c-fabric-chart-popup__submenu>li.no-click{cursor:default}.c-fabric-chart-popup__submenu>li.no-click:hover{background:#fff}.c-fabric-chart-popup>li:hover>.c-fabric-chart-popup__submenu{display:block}
@@ -20,10 +20,8 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
20
20
  checked: boolean;
21
21
  _checked: boolean;
22
22
  };
23
- shortcuts: {
24
- 近一周: () => number[];
25
- 近一个月: () => number[];
26
- };
23
+ datePickerProps: import("vue").ComputedRef<import("../../../../../shared/types").AnyObject>;
24
+ shortcuts: import("vue").ComputedRef<any>;
27
25
  onConfirm: (value: [number, number], formattedValue: [string, string] | null) => void;
28
26
  readonly CDatePicker: import("../../../../../shared/types").SFCWithInstall<import("vue").DefineComponent<import("vue").ExtractPropTypes<{
29
27
  updateUnchangedValue: {