cnhis-design-vue 3.1.25 → 3.1.26-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.
@@ -269,7 +269,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
269
269
  painYCell: painYCell.value,
270
270
  event: event.value,
271
271
  itemList: itemList.value,
272
- getRightInfo: getRightInfo.value
272
+ getRightInfo: getRightInfo.value,
273
+ config: props.data.config || {}
273
274
  });
274
275
  function computedYCell(type) {
275
276
  const { yScaleValue } = props.data.left;
@@ -40,7 +40,8 @@ function useCenter(canvas, propItems, emits, cumputedX, cumputedY, getXValue, ge
40
40
  event,
41
41
  vitalSignsOriginY,
42
42
  painOriginY,
43
- hospitalizationDate
43
+ hospitalizationDate,
44
+ config
44
45
  } = propItems;
45
46
  const pointTipProps = reactive({
46
47
  show: false,
@@ -256,100 +257,176 @@ function useCenter(canvas, propItems, emits, cumputedX, cumputedY, getXValue, ge
256
257
  const lineList = [];
257
258
  const otherList = [];
258
259
  item.list.forEach((v, index) => {
259
- var _a;
260
260
  const _item = type !== "temperature" ? item : dataList.find((_v) => _v.key === v.key);
261
- const {
262
- pointAttr = {},
263
- lineAttr = {},
264
- type: pointType = "circle",
265
- upArrowShow = false,
266
- limitValueShow = false
267
- } = _item;
268
261
  const points = getPointer(v, scaleValue);
269
- const nextV = item.list[index + 1];
270
- const nextPoint = getPointer(nextV, scaleValue);
271
- let reduceLine, reducePoint, noRiseText, arrowGroup, riseText, verifiedText;
272
- if ((points == null ? void 0 : points.length) && (type === "temperature" || type === "pain")) {
273
- if (v.noRise && noRiseStyle.show) {
274
- if (typeof v.noRise === "string") {
275
- noRiseText = drawText([points[0], points[1] + 5], {
276
- value: v.noRise.split("").join("\n"),
277
- originY: "top",
278
- ...noRiseStyle
279
- });
280
- otherList.push(noRiseText);
281
- } else {
282
- const top = points[1] + yCellHeight * 2;
283
- arrowGroup = drawArrow([points[0], points[1], top], noRiseStyle);
284
- otherList.push(arrowGroup);
285
- }
262
+ const otherObj = {};
263
+ otherObj.value = drawValue(points, v, _item);
264
+ drawOther(points, v, _item, otherObj);
265
+ drawPulseOther(points, v, _item, otherObj);
266
+ drawPointLine(points, v, index, _item, otherObj);
267
+ });
268
+ type === "pulse" && shadowPointCache.push(pointList);
269
+ Promise.all(pointList).then((res) => {
270
+ const lineListFilter = lineList.filter((v) => v);
271
+ let prevPoint = null;
272
+ res = res.filter((v) => {
273
+ if (v && prevPoint) {
274
+ prevPoint.nextPoint = v;
275
+ v.prevPoint = prevPoint;
286
276
  }
287
- if (v.rise && riseStyle.show) {
288
- riseText = drawText([points[0], points[1] - 5], {
289
- value: v.rise.split("").join("\n"),
290
- originY: "bottom",
291
- ...riseStyle
277
+ prevPoint = v || prevPoint;
278
+ v == null ? void 0 : v.bringToFront();
279
+ return v;
280
+ });
281
+ Promise.all(otherList).then((r) => {
282
+ canvas.value.add(...lineListFilter, ...res, ...r);
283
+ res.forEach((v) => {
284
+ v == null ? void 0 : v.bringToFront();
285
+ });
286
+ });
287
+ });
288
+ function drawValue(points, v, _item) {
289
+ if (!(points == null ? void 0 : points.length) || !config.showValue)
290
+ return;
291
+ const { lineAttr = {} } = _item;
292
+ const y = points[1] <= vitalSignsOriginY.originY + yCellHeight ? points[1] + yCellHeight : points[1] - yCellHeight;
293
+ const value = drawText([points[0], y], {
294
+ value: v.value,
295
+ originX: "center",
296
+ originY: "center",
297
+ fill: lineAttr.stroke || "#000"
298
+ });
299
+ otherList.push(value);
300
+ return {
301
+ obj: value,
302
+ top: -yCellHeight
303
+ };
304
+ }
305
+ function drawOther(points, v, _item, otherObj) {
306
+ var _a;
307
+ if (!(points == null ? void 0 : points.length) || !["temperature", "pain"].includes(type))
308
+ return;
309
+ const { lineAttr = {} } = _item;
310
+ const { value } = otherObj;
311
+ let reduceLine, reducePoint, noRiseText, arrowGroup, riseText, verifiedText;
312
+ if (v.noRise && noRiseStyle.show) {
313
+ if (typeof v.noRise === "string") {
314
+ noRiseText = drawText([points[0], points[1] + 5], {
315
+ value: v.noRise.split("").join("\n"),
316
+ originY: "top",
317
+ ...noRiseStyle
292
318
  });
293
- otherList.push(riseText);
319
+ otherList.push(noRiseText);
320
+ } else {
321
+ const top = points[1] + yCellHeight * 2;
322
+ arrowGroup = drawArrow([points[0], points[1], top], noRiseStyle);
323
+ otherList.push(arrowGroup);
294
324
  }
295
- if (v.verified) {
296
- verifiedText = drawText([points[0], points[1] - 5], {
297
- value: "v",
298
- originX: "center",
299
- originY: "bottom",
300
- ...verifiedStyle
301
- });
302
- otherList.push(verifiedText);
325
+ }
326
+ if (v.rise && riseStyle.show) {
327
+ riseText = drawText([points[0], points[1] - (value ? yCellHeight : 0) - 5], {
328
+ value: v.rise.split("").join("\n"),
329
+ originY: "bottom",
330
+ ...riseStyle
331
+ });
332
+ otherList.push(riseText);
333
+ }
334
+ if (v.verified) {
335
+ verifiedText = drawText([points[0], points[1] - (value ? yCellHeight : 0) - 5], {
336
+ value: "v",
337
+ originX: "center",
338
+ originY: "bottom",
339
+ ...verifiedStyle
340
+ });
341
+ otherList.push(verifiedText);
342
+ }
343
+ if (v.physicsReduce || v.drugReduce) {
344
+ const reduceY = cumputedY(type, scaleValue.list, v.physicsReduce || v.drugReduce);
345
+ reduceLine = drawLine([...points, points[0], reduceY], {
346
+ ...lineAttr,
347
+ ...reduceStyle.line,
348
+ ...defaultStyle
349
+ });
350
+ reducePoint = drawPoint(((_a = reduceStyle == null ? void 0 : reduceStyle.point) == null ? void 0 : _a.type) || "circle", {
351
+ left: points[0],
352
+ top: reduceY,
353
+ ...reduceStyle.point,
354
+ ...defaultStyle
355
+ });
356
+ reduceLine && otherList.push(reduceLine);
357
+ reducePoint && otherList.push(reducePoint);
358
+ }
359
+ Object.assign(otherObj, {
360
+ reduceLine: {
361
+ obj: reduceLine,
362
+ type: "line"
363
+ },
364
+ noRiseText: {
365
+ obj: noRiseText,
366
+ top: 5
367
+ },
368
+ arrowGroup: {
369
+ obj: arrowGroup,
370
+ top: yCellHeight * 2
371
+ },
372
+ riseText: {
373
+ obj: riseText,
374
+ top: (value ? -yCellHeight : 0) - 5
375
+ },
376
+ verifiedText: {
377
+ obj: verifiedText,
378
+ top: (value ? -yCellHeight : 0) - 5
303
379
  }
304
- if (v.physicsReduce || v.drugReduce) {
305
- const reduceY = cumputedY(type, scaleValue.list, v.physicsReduce || v.drugReduce);
306
- reduceLine = drawLine([...points, points[0], reduceY], {
307
- ...lineAttr,
308
- ...reduceStyle.line,
309
- ...defaultStyle
310
- });
311
- reducePoint = drawPoint(((_a = reduceStyle == null ? void 0 : reduceStyle.point) == null ? void 0 : _a.type) || "circle", {
312
- left: points[0],
313
- top: reduceY,
314
- ...reduceStyle.point,
315
- ...defaultStyle
316
- });
317
- reduceLine && otherList.push(reduceLine);
318
- reducePoint && otherList.push(reducePoint);
380
+ });
381
+ }
382
+ function drawPulseOther(points, v, _item, otherObj) {
383
+ if (!(points == null ? void 0 : points.length) || !["pulse"].includes(type))
384
+ return;
385
+ let upArrow, limitValue;
386
+ const { upArrowShow = false, limitValueShow = false } = _item;
387
+ if (upArrowShow && v.value > 180) {
388
+ let top = points[1] - yCellHeight * 2.5;
389
+ let yArr = [points[1] - yCellHeight / 2, top];
390
+ if (top < vitalSignsOriginY.originY) {
391
+ top = points[1] + yCellHeight * 2.5;
392
+ yArr = [top, points[1] + yCellHeight / 2];
319
393
  }
394
+ upArrow = drawArrow([points[0], yArr[0], yArr[1]], upArrowStyle, "up");
395
+ otherList.push(upArrow);
320
396
  }
321
- if ((points == null ? void 0 : points.length) && type === "pulse") {
322
- let upArrow;
323
- if (upArrowShow && v.value > 180) {
324
- let top = points[1] - yCellHeight * 2.5;
325
- let yArr = [points[1] - yCellHeight / 2, top];
326
- if (top < vitalSignsOriginY.originY) {
327
- top = points[1] + yCellHeight * 2.5;
328
- yArr = [top, points[1] + yCellHeight / 2];
329
- }
330
- upArrow = drawArrow([points[0], yArr[0], yArr[1]], upArrowStyle, "up");
331
- otherList.push(upArrow);
397
+ if (limitValueShow) {
398
+ const commonOptions = {
399
+ value: v.value,
400
+ originX: "center",
401
+ originY: "center",
402
+ ...limitValueStyle
403
+ };
404
+ if (v.value > Math.max(...scaleValue.list)) {
405
+ const top = upArrow ? points[1] + yCellHeight / 2 + upArrow.height : points[1] + yCellHeight;
406
+ limitValue = drawText([points[0], top], commonOptions);
407
+ otherList.push(limitValue);
332
408
  }
333
- if (limitValueShow) {
334
- const commonOptions = {
335
- value: v.value,
336
- originX: "center",
337
- originY: "center",
338
- ...limitValueStyle
339
- };
340
- if (v.value > Math.max(...scaleValue.list)) {
341
- const top = upArrow ? points[1] + yCellHeight / 2 + upArrow.height : points[1] + yCellHeight;
342
- const limitValue = drawText([points[0], top], commonOptions);
343
- otherList.push(limitValue);
344
- }
345
- if (v.value < Math.min(...scaleValue.list)) {
346
- const limitValue = drawText([points[0], points[1] - yCellHeight], commonOptions);
347
- otherList.push(limitValue);
348
- }
409
+ if (v.value < Math.min(...scaleValue.list)) {
410
+ limitValue = drawText([points[0], points[1] - yCellHeight], commonOptions);
411
+ otherList.push(limitValue);
349
412
  }
350
413
  }
414
+ Object.assign(otherObj, {
415
+ upArrow: {
416
+ obj: upArrow
417
+ },
418
+ limitValue: {
419
+ obj: limitValue,
420
+ top: -yCellHeight
421
+ }
422
+ });
423
+ }
424
+ function drawPointLine(points, v, index, _item, otherObj) {
351
425
  let point;
352
426
  let line;
427
+ const { pointAttr = {}, lineAttr = {}, title = "", key, type: pointType = "circle" } = _item;
428
+ const nextV = item.list[index + 1];
429
+ const nextPoint = getPointer(nextV, scaleValue);
353
430
  if (points && nextPoint && !v.breakpoint) {
354
431
  line = drawLine([...points, ...nextPoint], {
355
432
  ...lineAttr
@@ -368,20 +445,16 @@ function useCenter(canvas, propItems, emits, cumputedX, cumputedY, getXValue, ge
368
445
  const pointAttrNew = {
369
446
  origin: {
370
447
  data: v,
371
- title: _item.title,
372
- key: _item.key || "",
448
+ title,
449
+ key: key || "",
373
450
  unit: scaleValue.unit,
374
451
  type,
375
452
  dataIndex,
376
453
  index
377
454
  },
378
- noRiseText,
379
- arrowGroup,
380
- verifiedText,
381
455
  leftLine: previousLine,
382
456
  rightLine: line,
383
- reduceLine,
384
- reducePoint,
457
+ otherObj,
385
458
  lockMovementX: true,
386
459
  ...v.pacemakerShow && type == "pulse" ? pacemaker.style : pointAttr,
387
460
  ...propItems.event
@@ -405,7 +478,7 @@ function useCenter(canvas, propItems, emits, cumputedX, cumputedY, getXValue, ge
405
478
  }
406
479
  lineList.push(line);
407
480
  if (point) {
408
- if (_item.title.includes("\u8109\u640F")) {
481
+ if (title.includes("\u8109\u640F")) {
409
482
  maiboPoints.add(point);
410
483
  } else {
411
484
  otherPoints.add(point);
@@ -413,27 +486,7 @@ function useCenter(canvas, propItems, emits, cumputedX, cumputedY, getXValue, ge
413
486
  setPointEvent(point);
414
487
  pointList.push(point);
415
488
  }
416
- });
417
- type === "pulse" && shadowPointCache.push(pointList);
418
- Promise.all(pointList).then((res) => {
419
- const lineListFilter = lineList.filter((v) => v);
420
- let prevPoint = null;
421
- res = res.filter((v) => {
422
- if (v && prevPoint) {
423
- prevPoint.nextPoint = v;
424
- v.prevPoint = prevPoint;
425
- }
426
- prevPoint = v || prevPoint;
427
- v == null ? void 0 : v.bringToFront();
428
- return v;
429
- });
430
- Promise.all(otherList).then((r) => {
431
- canvas.value.add(...lineListFilter, ...res, ...r);
432
- res.forEach((v) => {
433
- v == null ? void 0 : v.bringToFront();
434
- });
435
- });
436
- });
489
+ }
437
490
  }
438
491
  function setPointEvent(point) {
439
492
  if (event.hovered) {
@@ -494,30 +547,17 @@ function useCenter(canvas, propItems, emits, cumputedX, cumputedY, getXValue, ge
494
547
  }
495
548
  }
496
549
  function updateLine(point) {
497
- if (point.leftLine) {
498
- point.leftLine.setCoords();
499
- point.leftLine.set({ x2: point.left, y2: point.top });
500
- }
501
- if (point.rightLine) {
502
- point.rightLine.setCoords();
503
- point.rightLine.set({ x1: point.left, y1: point.top });
504
- }
505
- if (point.reduceLine) {
506
- point.reduceLine.setCoords();
507
- point.reduceLine.set({ x1: point.left, y1: point.top });
508
- }
509
- if (point.noRiseText) {
510
- point.noRiseText.setCoords();
511
- point.noRiseText.set({ left: point.left, top: point.top + 5 });
512
- }
513
- if (point.arrowGroup) {
514
- point.arrowGroup.setCoords();
515
- point.arrowGroup.set({ left: point.left, top: point.top });
516
- }
517
- if (point.verifiedText) {
518
- point.verifiedText.setCoords();
519
- point.verifiedText.set({ left: point.left, top: point.top - 5 });
520
- }
550
+ var _a, _b;
551
+ (_a = point.leftLine) == null ? void 0 : _a.setCoords().set({ x2: point.left, y2: point.top });
552
+ (_b = point.rightLine) == null ? void 0 : _b.setCoords().set({ x1: point.left, y1: point.top });
553
+ Object.values(point.otherObj).forEach((o) => {
554
+ const { obj, type = "", top = 0 } = o;
555
+ if (type === "line") {
556
+ obj == null ? void 0 : obj.setCoords().set({ x1: point.left, y1: point.top });
557
+ } else {
558
+ obj == null ? void 0 : obj.setCoords().set({ left: point.left, top: point.top + top });
559
+ }
560
+ });
521
561
  drawShaDow(point);
522
562
  }
523
563
  function isLimit(time) {
@@ -64,6 +64,7 @@ export interface IPropItems {
64
64
  event: Partial<IEvent>;
65
65
  itemList: Array<any>;
66
66
  getRightInfo: AnyObject;
67
+ config: AnyObject;
67
68
  }
68
69
  export interface IPoint {
69
70
  time: string;
@@ -114,6 +115,7 @@ export interface IData {
114
115
  left: ILeft;
115
116
  right?: IRight;
116
117
  bottom: any;
118
+ config?: any;
117
119
  }
118
120
  export interface ICoordinateValue {
119
121
  x: number;
@@ -1,8 +1,8 @@
1
- import { defineComponent, ref, computed, inject, watch, createVNode } from 'vue';
1
+ import { defineComponent, ref, computed, inject, watch, createVNode, nextTick } from 'vue';
2
2
  import { isField } from '@formily/core';
3
3
  import { isEqual, isArray } from 'lodash-es';
4
4
  import { useCommonInjection } from '../../hooks/useCommonInjection.js';
5
- import { InjectAsyncQueue } from '../../constants/index.js';
5
+ import { InjectAsyncQueue, InjectionFormUUID } from '../../constants/index.js';
6
6
  import '../../../../../shared/utils/index.js';
7
7
  import '../../../index.js';
8
8
  import '../../utils/index.js';
@@ -92,8 +92,9 @@ const script = defineComponent({
92
92
  }
93
93
  }
94
94
  const asyncQueue = inject(InjectAsyncQueue);
95
- function fetchData(option) {
96
- return props.filterable ? fetchFullData() : fetchGradeData(option);
95
+ async function fetchData(option) {
96
+ props.filterable ? await fetchFullData() : await fetchGradeData(option);
97
+ await syncPosition();
97
98
  }
98
99
  async function fetchFullData() {
99
100
  if (!props.urlConfig || remoteOptions.value && props.requestCache)
@@ -178,6 +179,15 @@ const script = defineComponent({
178
179
  return (_a = target == null ? void 0 : target.depth) != null ? _a : -1;
179
180
  }
180
181
  }
182
+ const uuid = inject(InjectionFormUUID);
183
+ const uniClassname = `form-render__cascade--menu-${uuid}`;
184
+ async function syncPosition() {
185
+ await nextTick();
186
+ const target = document.querySelector(`.${uniClassname} .v-vl`);
187
+ if (!target)
188
+ return;
189
+ target.dispatchEvent(new CustomEvent("scroll"));
190
+ }
181
191
  const {
182
192
  injectValueValidate,
183
193
  injectValueWatchFromEmpty,
@@ -214,6 +224,10 @@ const script = defineComponent({
214
224
  "key": key.value,
215
225
  "remote": remote.value,
216
226
  "filterable": props.filterable,
227
+ "menu-props": {
228
+ class: uniClassname,
229
+ onClick: syncPosition
230
+ },
217
231
  "checkStrategy": "child",
218
232
  "show": !!show.value,
219
233
  "onUpdate:show": updateShow,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cnhis-design-vue",
3
- "version": "3.1.25",
3
+ "version": "3.1.26-beta.0",
4
4
  "license": "ISC",
5
5
  "module": "./es/components/index.js",
6
6
  "main": "./es/components/index.js",
@@ -61,5 +61,5 @@
61
61
  "iOS 7",
62
62
  "last 3 iOS versions"
63
63
  ],
64
- "gitHead": "f51ff7746243e9e72dc93d5e0e883f1ad4082fe3"
64
+ "gitHead": "1bced75ada75e3cd1fe13e6b6c88d7ea29202122"
65
65
  }