cnhis-design-vue 3.1.13-beta.7 → 3.1.13

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 (51) hide show
  1. package/es/packages/big-table/src/BigTable.vue.d.ts +6 -15
  2. package/es/packages/big-table/src/BigTable.vue_vue_type_script_setup_true_lang.js +11 -2
  3. package/es/packages/big-table/src/bigTableEmits.js +2 -1
  4. package/es/packages/big-table/src/hooks/useColumnConfigAdaptor.d.ts +12 -0
  5. package/es/packages/big-table/src/hooks/useColumnConfigAdaptor.js +91 -0
  6. package/es/packages/button-print/index.d.ts +15 -1
  7. package/es/packages/button-print/src/ButtonPrint.vue.d.ts +199 -185
  8. package/es/packages/button-print/src/ButtonPrint.vue_vue_type_script_setup_true_lang.js +39 -4
  9. package/es/packages/button-print/src/utils/print.d.ts +41 -0
  10. package/es/packages/button-print/src/utils/print.js +325 -0
  11. package/es/packages/fabric-chart/index.d.ts +3 -4
  12. package/es/packages/fabric-chart/src/FabricChart.vue.d.ts +3 -4
  13. package/es/packages/fabric-chart/src/FabricChart.vue_vue_type_script_setup_true_lang.js +21 -12
  14. package/es/packages/fabric-chart/src/hooks/useBottom.js +2 -3
  15. package/es/packages/fabric-chart/src/hooks/useCenter.js +33 -11
  16. package/es/packages/fabric-chart/src/hooks/useCumputedPoint.d.ts +2 -2
  17. package/es/packages/fabric-chart/src/hooks/useCumputedPoint.js +27 -13
  18. package/es/packages/fabric-chart/src/hooks/useGrid.js +18 -13
  19. package/es/packages/fabric-chart/src/hooks/useLeft.js +63 -40
  20. package/es/packages/fabric-chart/src/hooks/useRight.js +2 -2
  21. package/es/packages/fabric-chart/src/interface.d.ts +6 -3
  22. package/es/packages/fabric-chart/src/utils/index.d.ts +6815 -6815
  23. package/es/packages/form-render/index.d.ts +297 -0
  24. package/es/packages/form-render/src/FormRender.vue.d.ts +297 -0
  25. package/es/packages/form-render/src/FormRender.vue_vue_type_script_setup_true_lang.js +34 -24
  26. package/es/packages/form-render/src/components/renderer/formItem.js +6 -4
  27. package/es/packages/form-render/src/hooks/useAnchor.js +3 -3
  28. package/es/packages/form-render/src/hooks/useFieldListAdaptor.js +2 -2
  29. package/es/packages/form-render/src/hooks/useFieldVisitor.js +3 -0
  30. package/es/packages/form-render/src/hooks/useFormItemDeps.js +2 -3
  31. package/es/packages/form-render/src/utils/index.d.ts +1 -0
  32. package/es/packages/form-render/src/utils/index.js +4 -1
  33. package/es/packages/form-render/style/index.css +25 -7
  34. package/es/packages/form-table/src/hooks/useNuiThemeOverrides.d.ts +4 -0
  35. package/es/packages/form-table/src/hooks/useNuiThemeOverrides.js +18 -0
  36. package/es/packages/index.css +193 -9
  37. package/es/packages/index.d.ts +2 -1
  38. package/es/packages/index.js +3 -0
  39. package/es/packages/steps-wheel/index.d.ts +548 -0
  40. package/es/packages/steps-wheel/index.js +11 -0
  41. package/es/packages/steps-wheel/src/StepsWheel.js +4 -0
  42. package/es/packages/steps-wheel/src/StepsWheel.vue.d.ts +547 -0
  43. package/es/packages/steps-wheel/src/StepsWheel.vue_vue_type_script_setup_true_lang.js +252 -0
  44. package/es/packages/steps-wheel/style/index.css +161 -0
  45. package/es/packages/time-line/index.d.ts +1 -0
  46. package/es/packages/time-line/src/TimeLine.vue.d.ts +1 -0
  47. package/es/packages/time-line/src/TimeLine.vue_vue_type_script_setup_true_lang.js +6 -1
  48. package/es/packages/time-line/style/index.css +7 -2
  49. package/package.json +1 -1
  50. package/es/packages/button-print/src/utils/print.es.min.d.ts +0 -2
  51. package/es/packages/button-print/src/utils/print.es.min.js +0 -2532
@@ -1,13 +1,22 @@
1
1
  function useCumputedPoint(propItems) {
2
- const { xScaleList, xScaleCell, originX, endY, xCellWidth, left, vitalSignsOriginY, painOriginY } = propItems;
2
+ const { xScaleList, originX, endY, xCellWidth, left, vitalSignsOriginY, painOriginY, canvasWidth } = propItems;
3
3
  function cumputedX(value) {
4
4
  const time = new Date(value).getTime();
5
- const minScale = Math.min(...xScaleList.map((v) => +v));
6
- const i = Math.floor((time - minScale) / xScaleCell);
7
- if (xScaleList.includes(time)) {
8
- return originX + xCellWidth * i;
5
+ const [minScale] = xScaleList;
6
+ const maxScale = xScaleList.at(-1);
7
+ if (time < minScale.start)
8
+ return 0;
9
+ if (time > maxScale.end)
10
+ return canvasWidth;
11
+ const index = xScaleList.findIndex((v) => v.end >= time);
12
+ if (index > -1) {
13
+ const item = xScaleList[index];
14
+ if (time === item.start) {
15
+ return item.left;
16
+ } else {
17
+ return item.center;
18
+ }
9
19
  }
10
- return originX + xCellWidth * i + xCellWidth / 2;
11
20
  }
12
21
  function cumputedY(type, scaleValueList, value) {
13
22
  const yScaleCell = propItems[`${type}YCell`];
@@ -16,13 +25,18 @@ function useCumputedPoint(propItems) {
16
25
  return newEndY - yScaleCell * yCellUnit;
17
26
  }
18
27
  function getXValue(pointX) {
19
- const minScale = Math.min(...xScaleList.map((v) => +v));
20
- const time = minScale + (pointX - originX) / xCellWidth * xScaleCell;
21
- let d = new Date(time);
22
- const month = `00${d.getMonth() + 1}`.slice(-2);
23
- const day = `00${d.getDate()}`.slice(-2);
24
- const date = `${d.getFullYear()}-${month}-${day} ${d.getHours()}:00`;
25
- return date;
28
+ const index = xScaleList.findIndex((v) => v.left + xCellWidth >= pointX);
29
+ if (index > -1) {
30
+ const item = xScaleList[index];
31
+ const residueX = pointX - item.left;
32
+ const residueTime = item.scaleCell * residueX;
33
+ const time = item.start + residueTime;
34
+ let d = new Date(time);
35
+ const month = `00${d.getMonth() + 1}`.slice(-2);
36
+ const day = `00${d.getDate()}`.slice(-2);
37
+ const date = `${d.getFullYear()}-${month}-${day} ${d.getHours()}:${d.getMinutes()}`;
38
+ return date;
39
+ }
26
40
  }
27
41
  function getYValue(type, pointY) {
28
42
  var _a;
@@ -3,33 +3,38 @@ import { fabric } from '../utils/index.js';
3
3
  import { drawLine } from './useDraw.js';
4
4
 
5
5
  function useGrid(canvas, propItems) {
6
+ var _a, _b;
6
7
  const { gridYNumber, originY, grid, originX, endX, xCellWidth, yCellHeight, gridXNumber, endY } = propItems;
7
8
  const yList = [];
8
9
  const xList = [];
10
+ const mainList = /* @__PURE__ */ new Set();
9
11
  for (let i = 0; i <= gridYNumber; i++) {
10
12
  const y = originY + parseInt(String(yCellHeight * (gridYNumber - i)));
11
- const style = i % grid.subYCell === 0 ? grid.mainLineStyle || {} : grid.subLineStyle || {};
12
- yList.push(drawLine([originX, y, endX, y], {
13
- id: i + "_" + new Date().getTime(),
14
- ...style
15
- }));
13
+ const style = i % grid.subYCell === 0 ? ((_a = grid.mainLineStyle) == null ? void 0 : _a.x) || {} : grid.subLineStyle || {};
14
+ const line = drawLine([originX, y, endX, y], style);
15
+ if (i % grid.subYCell === 0) {
16
+ mainList.add(line);
17
+ } else {
18
+ yList.push(line);
19
+ }
16
20
  }
17
21
  for (let i = 0; i <= gridXNumber; i++) {
18
22
  const x = originX + parseInt(String(xCellWidth * i));
19
- let style;
20
- style = i % grid.subXCell === 0 ? grid.mainLineStyle || {} : grid.subLineStyle || {};
23
+ let style = grid.subLineStyle || {};
21
24
  if (i % grid.subSecondXCell === 0) {
22
25
  style = grid.subSecondLineStyle || {};
23
26
  }
24
27
  if (i % grid.subXCell === 0) {
25
- style = grid.mainLineStyle || {};
28
+ style = ((_b = grid.mainLineStyle) == null ? void 0 : _b.y) || {};
29
+ }
30
+ const line = drawLine([x, originY, x, endY], style);
31
+ if (i % grid.subXCell === 0) {
32
+ mainList.add(line);
33
+ } else {
34
+ xList.push(line);
26
35
  }
27
- xList.push(drawLine([x, originY, x, endY], {
28
- id: i + "_" + new Date().getTime(),
29
- ...style
30
- }));
31
36
  }
32
- const group = new fabric.Group([...xList, ...yList], {
37
+ const group = new fabric.Group([...xList, ...yList, ...mainList], {
33
38
  evented: false,
34
39
  selectable: false
35
40
  });
@@ -17,6 +17,36 @@ function useLeft(canvas, propItems, emits, setPopup, pointTipProps, getXValue, g
17
17
  iconsWidth,
18
18
  itemList
19
19
  } = propItems;
20
+ const mainScaleWidth = 9;
21
+ const subScaleWidth = 5;
22
+ function drawScaleNumber(text, item, left2, top) {
23
+ return new fabric.Text(String(text), {
24
+ ...defaultTextStyle,
25
+ originX: item.position || "center",
26
+ left: left2,
27
+ top,
28
+ ...item.style
29
+ });
30
+ }
31
+ function getScaleInfo(position = "center", x, width) {
32
+ let scaleLeft = x + width / 2;
33
+ let lineXMain = [scaleLeft - mainScaleWidth / 2, scaleLeft + mainScaleWidth / 2];
34
+ let lineXSub = [scaleLeft - subScaleWidth / 2, scaleLeft + subScaleWidth / 2];
35
+ let textLeft = scaleLeft;
36
+ if (position === "left") {
37
+ scaleLeft = x;
38
+ lineXMain = [scaleLeft, scaleLeft + mainScaleWidth];
39
+ lineXSub = [scaleLeft, scaleLeft + subScaleWidth];
40
+ textLeft = lineXMain[1];
41
+ }
42
+ if (position === "right") {
43
+ scaleLeft = x + width;
44
+ lineXMain = [scaleLeft - mainScaleWidth, scaleLeft];
45
+ lineXSub = [scaleLeft - subScaleWidth, scaleLeft];
46
+ textLeft = lineXMain[0];
47
+ }
48
+ return { lineXMain, lineXSub, textLeft };
49
+ }
20
50
  function drwaPainScaleValue(item) {
21
51
  const title = drawTextGroup({
22
52
  width: originX - iconsWidth,
@@ -32,18 +62,28 @@ ${item.title.slice(-2)}`,
32
62
  top: painOriginY.originY
33
63
  });
34
64
  const list = [];
35
- item.list.forEach((v, i) => {
36
- const top = painOriginY.endY - i * yCellHeight * item.spaceGridNumber;
37
- const text = new fabric.Text(String(v), {
38
- ...defaultTextStyle,
39
- originX: "right",
40
- left: originX - (item.marginRight || 3),
41
- top: i === 0 ? endY - 5 : top,
42
- ...item.style
65
+ if (item.showScale || item.showNumber) {
66
+ const { lineXMain, textLeft } = getScaleInfo(item.position, iconsWidth, originX - iconsWidth);
67
+ item.list.forEach((v, i) => {
68
+ let top = painOriginY.endY - i * yCellHeight * item.spaceGridNumber;
69
+ if (i === 0) {
70
+ top = endY - 5;
71
+ }
72
+ if (item.showNumber) {
73
+ list.push(drawScaleNumber(v, item, textLeft, top));
74
+ }
75
+ if (item.showScale && i !== 0) {
76
+ const [x1, x2] = lineXMain;
77
+ const line = new fabric.Line([x1, top, x2, top], {
78
+ ...defaultBorderStyle,
79
+ ...item.style
80
+ });
81
+ list.push(line);
82
+ }
43
83
  });
44
- list.push(text);
45
- });
84
+ }
46
85
  canvas.value.add(title, ...list);
86
+ title.sendToBack();
47
87
  }
48
88
  function drawScaleValue() {
49
89
  let groupList = [];
@@ -64,51 +104,34 @@ ${item.title.slice(-2)}`,
64
104
  }) : null;
65
105
  line && list.push(line);
66
106
  const centerX = rectLeft + rectWidth / 2;
67
- let leftVal = centerX;
68
107
  const spaceGridNumber = item.spaceGridNumber || 5;
69
108
  if (item.showScale || item.showNumber) {
70
- const mainScaleWidth = 9;
71
- const subScaleWidth = 5;
72
109
  const spaceScale = spaceGridNumber * yCellHeight / 5;
73
110
  const position = item.position || "center";
74
- let leftX = leftVal;
75
- let lineXMain = [leftVal - mainScaleWidth / 2, leftVal + mainScaleWidth / 2];
76
- let lineXSub = [leftVal - subScaleWidth / 2, leftVal + subScaleWidth / 2];
77
- if (position === "left") {
78
- leftVal = rectLeft;
79
- lineXMain = [leftVal, leftVal + mainScaleWidth];
80
- lineXSub = [leftVal, leftVal + subScaleWidth];
81
- leftX = lineXMain[1];
82
- }
83
- if (position === "right") {
84
- leftVal = rectLeft + rectWidth;
85
- lineXMain = [leftVal - mainScaleWidth, leftVal];
86
- lineXSub = [leftVal - subScaleWidth, leftVal];
87
- leftX = lineXMain[0];
88
- }
111
+ const { lineXMain, lineXSub, textLeft } = getScaleInfo(item.position, rectLeft, rectWidth);
89
112
  item.list.forEach((v, i) => {
90
113
  const top = vitalSignsOriginY.endY - i * yCellHeight * spaceGridNumber;
91
114
  if (item.showNumber) {
92
- const text = new fabric.Text(String(v), {
93
- ...defaultTextStyle,
94
- originX: position,
95
- left: leftX,
96
- top: i === 0 ? top - 5 : top,
97
- ...item.style
98
- });
115
+ const text = drawScaleNumber(v, item, textLeft, i === 0 ? top - 5 : top);
99
116
  list.push(text);
100
117
  }
101
118
  if (item.showScale && i !== item.list.length - 1) {
102
119
  for (let j = 0; j < 5; j++) {
103
120
  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
+ };
104
128
  const x1 = j == 0 ? lineXMain[0] : lineXSub[0];
105
129
  const x2 = j == 0 ? lineXMain[1] : lineXSub[1];
106
130
  const y = top - j * spaceScale;
107
- const line2 = new fabric.Line([x1, y, x2, y], {
108
- ...defaultBorderStyle,
109
- ...item.style
110
- });
111
- list.push(line2);
131
+ createLine([x1, y, x2, y]);
132
+ if (i == item.list.length - 2 && j == 4) {
133
+ createLine([lineXMain[0], y - spaceScale, lineXMain[1], y - spaceScale]);
134
+ }
112
135
  }
113
136
  }
114
137
  }
@@ -25,7 +25,7 @@ function useRight(canvas, propItems) {
25
25
  list.push(new fabric.Rect({
26
26
  ...defaultRectStyle,
27
27
  width: canvasWidth - endX - 1,
28
- height: endY + breathingHeight,
28
+ height: endY + breathingHeight - 1,
29
29
  left: endX,
30
30
  top: 0,
31
31
  originX: "left",
@@ -76,8 +76,8 @@ function useRight(canvas, propItems) {
76
76
  }) : null;
77
77
  unit && list.push(unit);
78
78
  const group = list.length > 0 ? new fabric.Group([...list], { ...defaultStyle }) : null;
79
- group && group.sendToBack();
80
79
  group && canvas.value.add(group);
80
+ group && group.sendToBack();
81
81
  }
82
82
  onMounted(() => {
83
83
  nextTick(() => {
@@ -4,13 +4,17 @@ interface IEvent {
4
4
  selectable: boolean;
5
5
  evented: boolean;
6
6
  }
7
+ interface ImainLineStyle {
8
+ x: fabric.ILineOptions;
9
+ y: fabric.ILineOptions;
10
+ }
7
11
  interface IGrid {
8
12
  mainXCell: number;
9
13
  subXCell: number;
10
14
  subSecondXCell: number;
11
15
  mainYCell: number;
12
16
  subYCell: number;
13
- mainLineStyle?: fabric.ILineOptions;
17
+ mainLineStyle?: ImainLineStyle;
14
18
  subLineStyle?: fabric.ILineOptions;
15
19
  subSecondLineStyle?: fabric.ILineOptions;
16
20
  event?: Partial<IEvent>;
@@ -43,8 +47,7 @@ export interface IPropItems {
43
47
  endY: number;
44
48
  xCellWidth: number;
45
49
  yCellHeight: number;
46
- xScaleList: Array<string | number>;
47
- xScaleCell: number;
50
+ xScaleList: Array<any>;
48
51
  breatheYCell: number;
49
52
  pulseYCell: number;
50
53
  temperatureYCell: number;