cnhis-design-vue 3.1.14-beta.1 → 3.1.14-beta.10

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 (73) hide show
  1. package/README.md +1 -1
  2. package/es/packages/annotation-edit/index.d.ts +17 -0
  3. package/es/packages/annotation-edit/index.js +10 -0
  4. package/es/packages/annotation-edit/src/AnnotationEdit.d.ts +16 -0
  5. package/es/packages/annotation-edit/src/AnnotationEdit.js +119 -0
  6. package/es/packages/annotation-edit/style/index.css +15 -0
  7. package/es/packages/big-table/index.d.ts +2 -9
  8. package/es/packages/big-table/src/BigTable.vue.d.ts +30 -18
  9. package/es/packages/big-table/src/BigTable.vue_vue_type_script_setup_true_lang.js +53 -25
  10. package/es/packages/big-table/src/bigTableEmits.js +1 -1
  11. package/es/packages/big-table/src/components/edit-form/edit-separate.vue.d.ts +25 -8
  12. package/es/packages/big-table/src/components/edit-form/edit-separate.vue_vue_type_script_setup_true_lang.js +29 -9
  13. package/es/packages/big-table/src/components/separate.vue.d.ts +3 -4
  14. package/es/packages/big-table/src/components/separate.vue_vue_type_script_setup_true_lang.js +7 -3
  15. package/es/packages/big-table/src/hooks/useEdit.d.ts +25 -7
  16. package/es/packages/big-table/src/hooks/useSeparateRow.d.ts +1 -1
  17. package/es/packages/big-table/src/hooks/useSeparateRow.js +14 -10
  18. package/es/packages/big-table/src/utils.js +3 -3
  19. package/es/packages/big-table/style/index.css +15 -2
  20. package/es/packages/button-print/index.d.ts +1 -0
  21. package/es/packages/button-print/index.js +1 -0
  22. package/es/packages/button-print/src/ButtonPrint.vue_vue_type_script_setup_true_lang.js +5 -1
  23. package/es/packages/button-print/src/utils/index.d.ts +1 -0
  24. package/es/packages/button-print/src/utils/index.js +1 -0
  25. package/es/packages/button-print/src/utils/print.d.ts +1 -1
  26. package/es/packages/button-print/src/utils/print.js +1 -1
  27. package/es/packages/fabric-chart/index.d.ts +7 -2
  28. package/es/packages/fabric-chart/src/FabricChart.vue.d.ts +8 -3
  29. package/es/packages/fabric-chart/src/FabricChart.vue_vue_type_script_setup_true_lang.js +40 -9
  30. package/es/packages/fabric-chart/src/hooks/index.d.ts +1 -1
  31. package/es/packages/fabric-chart/src/hooks/index.js +2 -2
  32. package/es/packages/fabric-chart/src/hooks/useCenter.js +19 -14
  33. package/es/packages/fabric-chart/src/hooks/useDraw.js +1 -0
  34. package/es/packages/fabric-chart/src/hooks/useEvent.d.ts +6 -0
  35. package/es/packages/fabric-chart/src/hooks/useEvent.js +67 -1
  36. package/es/packages/fabric-chart/src/hooks/useLeft.js +14 -14
  37. package/es/packages/fabric-chart/src/hooks/useRight.js +2 -13
  38. package/es/packages/fabric-chart/src/hooks/useTop.js +10 -20
  39. package/es/packages/fabric-chart/src/interface.d.ts +7 -0
  40. package/es/packages/form-render/index.d.ts +1 -1
  41. package/es/packages/form-render/src/FormRender.vue.d.ts +1 -1
  42. package/es/packages/form-render/src/components/renderer/cascader.d.ts +1 -1
  43. package/es/packages/form-render/src/components/renderer/cascader.js +4 -8
  44. package/es/packages/form-render/src/components/renderer/formItem.js +8 -92
  45. package/es/packages/form-render/src/components/renderer/input.js +5 -16
  46. package/es/packages/form-render/src/components/renderer/inputNumber.d.ts +12 -0
  47. package/es/packages/form-render/src/components/renderer/inputNumber.js +11 -4
  48. package/es/packages/form-render/src/components/renderer/select.js +9 -2
  49. package/es/packages/form-render/src/components/renderer/simpleComponent.d.ts +15 -2
  50. package/es/packages/form-render/src/components/renderer/simpleComponent.js +16 -15
  51. package/es/packages/form-render/src/hooks/useAnchor.d.ts +1 -1
  52. package/es/packages/form-render/src/hooks/useAnchor.js +3 -3
  53. package/es/packages/form-render/src/hooks/useFieldListAdaptor.js +10 -6
  54. package/es/packages/form-render/src/types/fieldItem.d.ts +2 -1
  55. package/es/packages/form-render/src/utils/index.d.ts +9 -2
  56. package/es/packages/form-render/src/utils/index.js +43 -14
  57. package/es/packages/form-render/style/index.css +17 -15
  58. package/es/packages/index.css +32 -17
  59. package/es/packages/index.d.ts +1 -0
  60. package/es/packages/index.js +1 -0
  61. package/es/packages/info-header/index.d.ts +1375 -358
  62. package/es/packages/info-header/src/HiddenContent.vue.d.ts +689 -178
  63. package/es/packages/info-header/src/HiddenContent.vue_vue_type_script_setup_true_lang.js +11 -13
  64. package/es/packages/info-header/src/InfoEllipsis.js +4 -0
  65. package/es/packages/info-header/src/InfoEllipsis.vue.d.ts +833 -0
  66. package/es/packages/info-header/src/InfoEllipsis.vue_vue_type_script_setup_true_lang.js +41 -0
  67. package/es/packages/info-header/src/InfoHeader.vue.d.ts +1375 -358
  68. package/es/packages/info-header/src/InfoHeader.vue_vue_type_script_setup_true_lang.js +9 -13
  69. package/es/{packages/info-header/src → src/components/SlotRender}/SlotRender.d.ts +3 -5
  70. package/es/{packages/info-header/src → src/components/SlotRender}/SlotRender.js +9 -9
  71. package/es/src/components/SlotRender/index.d.ts +2 -0
  72. package/es/src/components/SlotRender/index.js +2 -0
  73. package/package.json +2 -2
@@ -9,7 +9,7 @@ import { useLeft } from './hooks/useLeft.js';
9
9
  import { useRight } from './hooks/useRight.js';
10
10
  import { useBottom } from './hooks/useBottom.js';
11
11
  import { useOther } from './hooks/useOther.js';
12
- import { useEvent } from './hooks/useEvent.js';
12
+ import { useEvent, useCanvasEvent } from './hooks/useEvent.js';
13
13
  import script$1 from './components/PopupTip.vue_vue_type_script_setup_true_lang.js';
14
14
  import { useCumputedPoint } from './hooks/useCumputedPoint.js';
15
15
 
@@ -19,10 +19,11 @@ var script = /* @__PURE__ */ defineComponent({
19
19
  data: { type: null, required: true },
20
20
  addRenderItem: { type: Function, required: false }
21
21
  },
22
- emits: ["change", "add"],
23
- setup(__props, { emit: emits }) {
22
+ emits: ["change", "add", "select"],
23
+ setup(__props, { expose, emit: emits }) {
24
24
  const props = __props;
25
25
  const defaultHeight = 15;
26
+ let select = ref();
26
27
  const canvasRef = ref(null);
27
28
  let canvas = ref();
28
29
  const dateHeight = computed(() => {
@@ -53,11 +54,11 @@ var script = /* @__PURE__ */ defineComponent({
53
54
  });
54
55
  const gridXNumber = computed(() => {
55
56
  const { grid } = props.data;
56
- return grid.mainXCell * grid.subXCell;
57
+ return grid.mainXCell * grid.subXCell + grid.surplusXCell;
57
58
  });
58
59
  const gridYNumber = computed(() => {
59
60
  const { grid } = props.data;
60
- return grid.mainYCell * grid.subYCell;
61
+ return grid.mainYCell * grid.subYCell + grid.surplusYCell;
61
62
  });
62
63
  const endX = computed(() => {
63
64
  const { width, right = null, top } = props.data;
@@ -66,6 +67,10 @@ var script = /* @__PURE__ */ defineComponent({
66
67
  const endWidth = right.width || 50;
67
68
  return width - endWidth;
68
69
  });
70
+ const endXLimit = computed(() => {
71
+ const { grid } = props.data;
72
+ return endX.value - grid.surplusXCell * xCellWidth.value;
73
+ });
69
74
  const originX = computed(() => {
70
75
  const { top, left } = props.data;
71
76
  const originX2 = top.titleWidth + iconsWidth.value;
@@ -85,6 +90,10 @@ var script = /* @__PURE__ */ defineComponent({
85
90
  const topHeight = dateHeight.value + dayHeight + xScaleHeight + hospitalDaysHeight.value + operationDaysHeight.value;
86
91
  return topHeight;
87
92
  });
93
+ const originYLimit = computed(() => {
94
+ const { grid } = props.data;
95
+ return originY.value + grid.surplusYCell * yCellHeight.value;
96
+ });
88
97
  const xCellWidth = computed(() => {
89
98
  return (endX.value - originX.value) / gridXNumber.value;
90
99
  });
@@ -177,8 +186,8 @@ var script = /* @__PURE__ */ defineComponent({
177
186
  endY: endY.value
178
187
  };
179
188
  if (painIndex.value === 0) {
180
- obj.originY = originY.value;
181
- obj.endY = originY.value + painHeight.value;
189
+ obj.originY = originYLimit.value;
190
+ obj.endY = originYLimit.value + painHeight.value;
182
191
  } else if (painIndex.value === left.yScaleValue.length - 1) {
183
192
  obj.originY = endY.value - painHeight.value;
184
193
  obj.endY = endY.value;
@@ -192,22 +201,37 @@ var script = /* @__PURE__ */ defineComponent({
192
201
  endY: endY.value
193
202
  };
194
203
  if (painIndex.value === 0) {
195
- obj.originY = originY.value + painHeight.value;
204
+ obj.originY = originYLimit.value + painHeight.value;
196
205
  obj.endY = endY.value;
197
206
  } else if (painIndex.value === left.yScaleValue.length - 1) {
198
- obj.originY = originY.value;
207
+ obj.originY = originYLimit.value;
199
208
  obj.endY = endY.value - painHeight.value;
200
209
  }
201
210
  return obj;
202
211
  });
212
+ const topList = computed(() => {
213
+ const { top } = props.data;
214
+ let topList2 = [];
215
+ for (let i in top) {
216
+ if (top[i].show) {
217
+ topList2.push({
218
+ ...top[i],
219
+ key: i
220
+ });
221
+ }
222
+ }
223
+ return topList2.sort((a, b) => a.seq - b.seq);
224
+ });
203
225
  const propItems = reactive({
204
226
  canvasWidth: props.data.width,
205
227
  canvasHeight: props.data.height,
206
228
  borderStyle: props.data.borderStyle || defaultBorderStyle,
229
+ selectionStyle: props.data.selectionStyle || {},
207
230
  dateHeight: dateHeight.value,
208
231
  hospitalDaysHeight: hospitalDaysHeight.value,
209
232
  operationDaysHeight: operationDaysHeight.value,
210
233
  xScalevalueHeight: xScalevalueHeight.value,
234
+ topList: topList.value,
211
235
  breathingHeight: breathingHeight.value,
212
236
  grid: props.data.grid,
213
237
  top: props.data.top,
@@ -224,7 +248,9 @@ var script = /* @__PURE__ */ defineComponent({
224
248
  iconsWidth: iconsWidth.value,
225
249
  originX: originX.value,
226
250
  originY: originY.value,
251
+ originYLimit: originYLimit.value,
227
252
  endX: endX.value,
253
+ endXLimit: endXLimit.value,
228
254
  endY: endY.value,
229
255
  xCellWidth: xCellWidth.value,
230
256
  yCellHeight: yCellHeight.value,
@@ -253,11 +279,16 @@ var script = /* @__PURE__ */ defineComponent({
253
279
  fireRightClick: true
254
280
  });
255
281
  useEvent(canvasRef.value);
282
+ const { select: selectFunc } = useCanvasEvent(canvas, propItems, emits);
283
+ select.value = selectFunc;
256
284
  });
257
285
  onBeforeUnmount(() => {
258
286
  canvas.value.clear();
259
287
  canvas.value = null;
260
288
  });
289
+ expose({
290
+ select
291
+ });
261
292
  return (_ctx, _cache) => {
262
293
  return openBlock(), createElementBlock(Fragment, null, [
263
294
  createElementVNode("canvas", {
@@ -1,4 +1,4 @@
1
- export { defaultBorderStyle } from './useDraw';
1
+ export * from './useDraw';
2
2
  export * from './useCumputedPoint';
3
3
  export * from './useTop';
4
4
  export * from './useLeft';
@@ -1,4 +1,4 @@
1
- export { defaultBorderStyle } from './useDraw.js';
1
+ export { defaultBorderStyle, defaultLineStyle, defaultRectStyle, defaultStyle, defaultTextStyle, drawLine, drawPoint, drawTextGroup } from './useDraw.js';
2
2
  export { useCumputedPoint } from './useCumputedPoint.js';
3
3
  export { useTop } from './useTop.js';
4
4
  export { useLeft } from './useLeft.js';
@@ -6,4 +6,4 @@ export { useRight } from './useRight.js';
6
6
  export { useCenter } from './useCenter.js';
7
7
  export { useBottom } from './useBottom.js';
8
8
  export { useOther } from './useOther.js';
9
- export { useEvent } from './useEvent.js';
9
+ export { useCanvasEvent, useEvent } from './useEvent.js';
@@ -88,19 +88,26 @@ function useCenter(canvas, propItems, emits, cumputedX, cumputedY, getXValue, ge
88
88
  }
89
89
  const [data1, data2] = copyDataList;
90
90
  const getPoint = (item) => {
91
- return item.x && item.y ? {
92
- x: item.x,
93
- y: item.y
94
- } : {
95
- x: cumputedX(item.time),
96
- y: cumputedY(pulseObj.type, pulseObj.list, item.value)
97
- };
91
+ if (item.x && item.y) {
92
+ return {
93
+ x: item.x,
94
+ y: item.y
95
+ };
96
+ }
97
+ if (isEffectiveNode(item) && isLimit(item.time)) {
98
+ let y = cumputedY(pulseObj.type, pulseObj.list, item.value);
99
+ y = y < vitalSignsOriginY.originY ? vitalSignsOriginY.originY : y > vitalSignsOriginY.endY ? vitalSignsOriginY.endY : y;
100
+ return {
101
+ x: cumputedX(item.time),
102
+ y
103
+ };
104
+ }
98
105
  };
99
106
  data1.list.forEach((item, index) => {
100
107
  const point1 = getPoint(item);
101
108
  const item2 = data2.list[index];
102
109
  const point2 = item2 ? getPoint(item2) : null;
103
- if (point2 && point1.x === point2.x && point1.y !== point2.y) {
110
+ if (point1 && point2 && point1.x === point2.x && point1.y !== point2.y) {
104
111
  points1.push(point1);
105
112
  points2.push(point2);
106
113
  const itemPrev = data1.list[index - 1];
@@ -108,12 +115,12 @@ function useCenter(canvas, propItems, emits, cumputedX, cumputedY, getXValue, ge
108
115
  const itemNext2 = data2.list[index + 1];
109
116
  if (itemPrev && points1.length === 1) {
110
117
  const point = getPoint(itemPrev);
111
- points1.unshift(point);
118
+ point && points1.unshift(point);
112
119
  }
113
120
  if (itemNext && itemNext2) {
114
121
  const pointNext = getPoint(itemNext);
115
122
  const pointNext2 = getPoint(itemNext2);
116
- if (pointNext.x === pointNext2.x && pointNext.y === pointNext2.y) {
123
+ if (pointNext && pointNext2 && pointNext.x === pointNext2.x && pointNext.y === pointNext2.y) {
117
124
  points1.push(pointNext);
118
125
  }
119
126
  } else {
@@ -349,13 +356,11 @@ function useCenter(canvas, propItems, emits, cumputedX, cumputedY, getXValue, ge
349
356
  coolPoint && otherList.push(coolPoint);
350
357
  }
351
358
  }
352
- let line;
353
359
  let point;
354
- let previousLine;
355
- line = points && nextPoint && !v.breakpoint ? drawLine([...points, ...nextPoint], {
360
+ const line = points && nextPoint && !v.breakpoint ? drawLine([...points, ...nextPoint], {
356
361
  ...lineAttr
357
362
  }) : null;
358
- previousLine = lineList[index - 1];
363
+ const previousLine = lineList[index - 1];
359
364
  const pointAttrNew = {
360
365
  origin: {
361
366
  data: v,
@@ -62,6 +62,7 @@ function drawPoint(type = "circle", style) {
62
62
  originY: "center",
63
63
  hasControls: false,
64
64
  hasBorders: false,
65
+ hoverCursor: "pointer",
65
66
  ...style
66
67
  };
67
68
  const createCircleBorder = () => {
@@ -1 +1,7 @@
1
+ import { Ref } from 'vue';
2
+ import { fabric } from '../utils';
3
+ import { IPropItems } from '../interface';
1
4
  export declare function useEvent(element: HTMLCanvasElement | any): void;
5
+ export declare function useCanvasEvent(canvas: Ref<fabric.Canvas>, propItems: IPropItems, emits: any): {
6
+ select: (key: string) => void;
7
+ };
@@ -1,4 +1,5 @@
1
1
  import { useEventListener } from '@vueuse/core';
2
+ import { fabric } from '../utils/index.js';
2
3
 
3
4
  function useEvent(element) {
4
5
  useEventListener(element.nextSibling, "contextmenu", (e) => {
@@ -6,5 +7,70 @@ function useEvent(element) {
6
7
  return false;
7
8
  });
8
9
  }
10
+ function useCanvasEvent(canvas, propItems, emits) {
11
+ const { originY, originX, endX, endY, iconsWidth, selectionStyle, topList } = propItems;
12
+ function drawRect(options, key) {
13
+ const { left, top, width, height } = options;
14
+ const rect = new fabric.Rect({
15
+ key,
16
+ left: left != null ? left : 0,
17
+ top: top != null ? top : 0,
18
+ width,
19
+ height,
20
+ stroke: "transparent",
21
+ strokeWidth: 1,
22
+ fill: "transparent",
23
+ lockMovementX: true,
24
+ lockMovementY: true,
25
+ transparentCorners: false,
26
+ ...selectionStyle
27
+ });
28
+ canvas.value.add(rect);
29
+ rect.on("mousedown", () => {
30
+ emits("select", key);
31
+ });
32
+ return rect;
33
+ }
34
+ function initSelection() {
35
+ if (typeof (selectionStyle == null ? void 0 : selectionStyle.evented) === "boolean" && !(selectionStyle == null ? void 0 : selectionStyle.evented))
36
+ return;
37
+ const selections2 = [];
38
+ selections2.push(drawRect({
39
+ left: iconsWidth,
40
+ top: originY,
41
+ width: originX - iconsWidth,
42
+ height: endY
43
+ }, "left"));
44
+ let topY = 0;
45
+ topList.forEach((item, index) => {
46
+ if (index > 0) {
47
+ topY += propItems[`${topList[index - 1].key}Height`];
48
+ }
49
+ selections2.push(drawRect({
50
+ left: iconsWidth,
51
+ top: topY,
52
+ width: endX - iconsWidth,
53
+ height: propItems[`${item.key}Height`]
54
+ }, item.key));
55
+ });
56
+ selections2.push(drawRect({
57
+ left: originX,
58
+ top: originY,
59
+ width: endX - originX,
60
+ height: endY - originY
61
+ }, "grid"));
62
+ canvas.value.renderAll();
63
+ return selections2;
64
+ }
65
+ const selections = initSelection();
66
+ function select(key) {
67
+ canvas.value.discardActiveObject();
68
+ canvas.value.renderAll();
69
+ const obj = selections == null ? void 0 : selections.find((obj2) => obj2.key === key);
70
+ obj && obj.bringToFront();
71
+ obj && canvas.value.setActiveObject(obj);
72
+ }
73
+ return { select };
74
+ }
9
75
 
10
- export { useEvent };
76
+ export { useCanvasEvent, useEvent };
@@ -9,13 +9,13 @@ function useLeft(canvas, propItems, emits, setPopup, pointTipProps, getXValue, g
9
9
  originX,
10
10
  endX,
11
11
  yCellHeight,
12
- borderStyle,
13
12
  left,
14
13
  vitalSignsOriginY,
15
14
  painOriginY,
16
15
  painHeight,
17
16
  iconsWidth,
18
- itemList
17
+ itemList,
18
+ painIndex
19
19
  } = propItems;
20
20
  const mainScaleWidth = 9;
21
21
  const subScaleWidth = 5;
@@ -86,7 +86,7 @@ ${item.title.slice(-2)}`,
86
86
  title.sendToBack();
87
87
  }
88
88
  function drawScaleValue() {
89
- let groupList = [];
89
+ const groupList = [];
90
90
  const column = !painHeight ? left.yScaleValue.length : left.yScaleValue.length - 1;
91
91
  const colWidth = (originX - iconsWidth) / column;
92
92
  const residue = (originX - iconsWidth) % column;
@@ -96,10 +96,17 @@ ${item.title.slice(-2)}`,
96
96
  drwaPainScaleValue(item);
97
97
  return;
98
98
  }
99
- let list = [];
99
+ const list = [];
100
+ function createLine(points) {
101
+ const line2 = new fabric.Line(points, {
102
+ ...defaultBorderStyle,
103
+ ...item.style
104
+ });
105
+ list.push(line2);
106
+ }
100
107
  const rectWidth = index === 0 ? firstColWidth : colWidth;
101
108
  const rectLeft = index === 0 ? iconsWidth : firstColWidth + iconsWidth + (index - 1) * colWidth;
102
- const line = index > 0 ? new fabric.Line([rectLeft, vitalSignsOriginY.originY, rectLeft, vitalSignsOriginY.endY], {
109
+ const line = index > 0 ? new fabric.Line([rectLeft, painIndex == 0 ? vitalSignsOriginY.originY : originY, rectLeft, vitalSignsOriginY.endY], {
103
110
  ...defaultBorderStyle
104
111
  }) : null;
105
112
  line && list.push(line);
@@ -118,13 +125,6 @@ ${item.title.slice(-2)}`,
118
125
  if (item.showScale && i !== item.list.length - 1) {
119
126
  for (let j = 0; j < 5; j++) {
120
127
  if (j > 0 || !item.showNumber || position !== "center") {
121
- let createLine = function(points) {
122
- const line2 = new fabric.Line(points, {
123
- ...defaultBorderStyle,
124
- ...item.style
125
- });
126
- list.push(line2);
127
- };
128
128
  const x1 = j == 0 ? lineXMain[0] : lineXSub[0];
129
129
  const x2 = j == 0 ? lineXMain[1] : lineXSub[1];
130
130
  const y = top - j * spaceScale;
@@ -164,9 +164,9 @@ ${item.title.slice(-2)}`,
164
164
  group && group.sendToBack();
165
165
  }
166
166
  function drawIcons() {
167
- let list = JSON.parse(JSON.stringify(itemList));
167
+ const list = JSON.parse(JSON.stringify(itemList));
168
168
  let topY = endY;
169
- let leftX = iconsWidth - left.icons.marginRight;
169
+ const leftX = iconsWidth - left.icons.marginRight;
170
170
  list.reverse().forEach((item, index) => {
171
171
  topY -= 10;
172
172
  let title = item.title.replace(/(.{2})/g, "$1\n");
@@ -3,25 +3,14 @@ import { fabric } from '../utils/index.js';
3
3
  import { defaultBorderStyle, defaultRectStyle, defaultStyle } from './useDraw.js';
4
4
 
5
5
  function useRight(canvas, propItems) {
6
- const {
7
- endX,
8
- endY,
9
- temperatureYCell,
10
- canvasWidth,
11
- canvasHeight,
12
- left,
13
- right,
14
- breathingHeight,
15
- vitalSignsOriginY,
16
- painOriginY
17
- } = propItems;
6
+ const { endX, endY, temperatureYCell, canvasWidth, canvasHeight, left, right, breathingHeight, vitalSignsOriginY } = propItems;
18
7
  function drawScaleValue() {
19
8
  var _a, _b, _c;
20
9
  if (!right) {
21
10
  canvas.value.add(new fabric.Line([canvasWidth - 1, 0, canvasWidth - 1, canvasHeight], defaultBorderStyle));
22
11
  return false;
23
12
  }
24
- let list = [];
13
+ const list = [];
25
14
  list.push(new fabric.Rect({
26
15
  ...defaultRectStyle,
27
16
  width: canvasWidth - endX - 1,
@@ -1,34 +1,24 @@
1
1
  import { onMounted, nextTick } from 'vue';
2
2
  import { fabric } from '../utils/index.js';
3
- import { defaultStyle, drawTextGroup, defaultTextStyle, defaultRectStyle } from './useDraw.js';
3
+ import { defaultBorderStyle, defaultStyle, drawTextGroup, defaultTextStyle, defaultRectStyle } from './useDraw.js';
4
4
 
5
5
  function useTop(canvas, propItems) {
6
6
  const {
7
- originY,
8
7
  grid,
9
8
  originX,
10
9
  xCellWidth,
11
10
  gridXNumber,
12
11
  top,
13
- dateHeight,
14
- hospitalDaysHeight,
15
- operationDaysHeight,
16
12
  xScalevalueHeight,
17
- iconsWidth
13
+ iconsWidth,
14
+ topList,
15
+ endXLimit,
16
+ canvasWidth
18
17
  } = propItems;
19
18
  function drawTop() {
20
- let list = [];
19
+ const list = [];
20
+ endXLimit && list.push(new fabric.Line([endXLimit, 0, canvasWidth, 0], defaultBorderStyle));
21
21
  let topY = 0;
22
- let topList = [];
23
- for (let i in top) {
24
- if (top[i].show) {
25
- topList.push({
26
- ...top[i],
27
- key: i
28
- });
29
- }
30
- }
31
- topList.sort((a, b) => a.seq - b.seq);
32
22
  topList.forEach((item, index) => {
33
23
  if (index > 0) {
34
24
  topY += propItems[`${topList[index - 1].key}Height`];
@@ -62,7 +52,7 @@ function useTop(canvas, propItems) {
62
52
  top: topY
63
53
  });
64
54
  list.push(title);
65
- let timeList = [];
55
+ const timeList = [];
66
56
  for (let j = 0; j < grid.mainXCell; j++) {
67
57
  timeList.push(top.xScalevalue.list);
68
58
  }
@@ -89,7 +79,7 @@ function useTop(canvas, propItems) {
89
79
  return false;
90
80
  const height = top.dayHeight;
91
81
  const width = xCellWidth * grid.subSecondXCell;
92
- const dayList = gridXNumber / grid.subSecondXCell;
82
+ const dayList = (gridXNumber - grid.surplusXCell) / grid.subSecondXCell;
93
83
  for (let i = 0; i < dayList; i++) {
94
84
  const left = originX + i * width;
95
85
  const value = i % 2 === 0 ? "\u4E0A\u5348" : "\u4E0B\u5348";
@@ -108,7 +98,7 @@ function useTop(canvas, propItems) {
108
98
  }
109
99
  }
110
100
  function drawDate(item, list, topY) {
111
- let height = propItems[`${item.key}Height`];
101
+ const height = propItems[`${item.key}Height`];
112
102
  const title = drawTextGroup({
113
103
  width: originX - iconsWidth,
114
104
  height,
@@ -14,6 +14,8 @@ interface IGrid {
14
14
  subSecondXCell: number;
15
15
  mainYCell: number;
16
16
  subYCell: number;
17
+ surplusXCell: number;
18
+ surplusYCell: number;
17
19
  mainLineStyle?: ImainLineStyle;
18
20
  subLineStyle?: fabric.ILineOptions;
19
21
  subSecondLineStyle?: fabric.ILineOptions;
@@ -23,10 +25,12 @@ export interface IPropItems {
23
25
  canvasWidth: number;
24
26
  canvasHeight: number;
25
27
  borderStyle: fabric.ILineOptions;
28
+ selectionStyle: any;
26
29
  dateHeight: number;
27
30
  hospitalDaysHeight: number;
28
31
  operationDaysHeight: number;
29
32
  xScalevalueHeight: number;
33
+ topList: IDate[];
30
34
  breathingHeight: number;
31
35
  grid: IGrid;
32
36
  top: ITop;
@@ -43,7 +47,9 @@ export interface IPropItems {
43
47
  iconsWidth: number;
44
48
  originX: number;
45
49
  originY: number;
50
+ originYLimit: number;
46
51
  endX: number;
52
+ endXLimit: number;
47
53
  endY: number;
48
54
  xCellWidth: number;
49
55
  yCellHeight: number;
@@ -96,6 +102,7 @@ export interface IData {
96
102
  width: number;
97
103
  height: number;
98
104
  borderStyle?: fabric.ILineOptions;
105
+ selectionStyle?: any;
99
106
  grid: IGrid;
100
107
  other?: IOther;
101
108
  top: ITop;
@@ -409,7 +409,7 @@ declare const FormRender: SFCWithInstall<import("vue").DefineComponent<{
409
409
  }[]>;
410
410
  formHeight: import("vue").ComputedRef<any>;
411
411
  scrollTo: (id: string) => Promise<void>;
412
- onScroll: () => Promise<void>;
412
+ onScroll: () => void;
413
413
  bindInfo: (info: import("../../../es/src/types").AnyObject) => import("../../../es/src/types").AnyObject;
414
414
  queryWidget: (key: string, wrapperElement: HTMLElement, fieldList: import("./src/types").FieldItem[]) => Promise<{
415
415
  widgetElement: HTMLInputElement | null | undefined;
@@ -409,7 +409,7 @@ declare const _default: import("vue").DefineComponent<{
409
409
  }[]>;
410
410
  formHeight: import("vue").ComputedRef<any>;
411
411
  scrollTo: (id: string) => Promise<void>;
412
- onScroll: () => Promise<void>;
412
+ onScroll: () => void;
413
413
  bindInfo: (info: AnyObject) => AnyObject;
414
414
  queryWidget: (key: string, wrapperElement: HTMLElement, fieldList: FieldItem[]) => Promise<{
415
415
  widgetElement: HTMLInputElement | null | undefined;
@@ -8,7 +8,7 @@ declare type DependKeyObj = {
8
8
  declare type UrlConfig = {
9
9
  method: FormRequestType;
10
10
  nameKey: string;
11
- dependKey: ArrayAble<string> | ArrayAble<DependKeyObj>;
11
+ dependKey: ArrayAble<string> | Record<string, string> | ArrayAble<DependKeyObj>;
12
12
  url: string;
13
13
  valueKey: string;
14
14
  };
@@ -1,8 +1,8 @@
1
1
  import { defineComponent, ref, inject, computed, watch, createVNode } from 'vue';
2
2
  import { isField } from '@formily/core';
3
- import { isObject, isString } from 'lodash-es';
3
+ import { isObject } from 'lodash-es';
4
4
  import { InjectAsyncQueue } from '../../constants/index.js';
5
- import { assignUpdateValue, formRenderLog, arrayed } from '../../utils/index.js';
5
+ import { assignUpdateValue, formRenderLog, traverseDependKey } from '../../utils/index.js';
6
6
  import { connect, mapProps } from '@formily/vue';
7
7
  import { NCascader } from 'naive-ui';
8
8
  import { useFormField } from '../../hooks/useFormField.js';
@@ -74,12 +74,8 @@ const script = defineComponent({
74
74
  lvlnr: deep + 1 + ""
75
75
  };
76
76
  if (option2 && config2.dependKey) {
77
- arrayed(config2.dependKey).forEach((key) => {
78
- if (isString(key)) {
79
- params[key] = option2[valueKey.value];
80
- } else if (isObject(key)) {
81
- params[key.paramName] = option2[key.paramValue];
82
- }
77
+ traverseDependKey(config2.dependKey, (dependKey, valueKey2) => {
78
+ params[valueKey2] = option2[dependKey];
83
79
  });
84
80
  }
85
81
  return {