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.
- package/es/packages/big-table/src/BigTable.vue.d.ts +6 -15
- package/es/packages/big-table/src/BigTable.vue_vue_type_script_setup_true_lang.js +11 -2
- package/es/packages/big-table/src/bigTableEmits.js +2 -1
- package/es/packages/big-table/src/hooks/useColumnConfigAdaptor.d.ts +12 -0
- package/es/packages/big-table/src/hooks/useColumnConfigAdaptor.js +91 -0
- package/es/packages/button-print/index.d.ts +15 -1
- package/es/packages/button-print/src/ButtonPrint.vue.d.ts +199 -185
- package/es/packages/button-print/src/ButtonPrint.vue_vue_type_script_setup_true_lang.js +39 -4
- package/es/packages/button-print/src/utils/print.d.ts +41 -0
- package/es/packages/button-print/src/utils/print.js +325 -0
- package/es/packages/fabric-chart/index.d.ts +3 -4
- package/es/packages/fabric-chart/src/FabricChart.vue.d.ts +3 -4
- package/es/packages/fabric-chart/src/FabricChart.vue_vue_type_script_setup_true_lang.js +21 -12
- package/es/packages/fabric-chart/src/hooks/useBottom.js +2 -3
- package/es/packages/fabric-chart/src/hooks/useCenter.js +33 -11
- package/es/packages/fabric-chart/src/hooks/useCumputedPoint.d.ts +2 -2
- package/es/packages/fabric-chart/src/hooks/useCumputedPoint.js +27 -13
- package/es/packages/fabric-chart/src/hooks/useGrid.js +18 -13
- package/es/packages/fabric-chart/src/hooks/useLeft.js +63 -40
- package/es/packages/fabric-chart/src/hooks/useRight.js +2 -2
- package/es/packages/fabric-chart/src/interface.d.ts +6 -3
- package/es/packages/fabric-chart/src/utils/index.d.ts +6815 -6815
- package/es/packages/form-render/index.d.ts +297 -0
- package/es/packages/form-render/src/FormRender.vue.d.ts +297 -0
- package/es/packages/form-render/src/FormRender.vue_vue_type_script_setup_true_lang.js +34 -24
- package/es/packages/form-render/src/components/renderer/formItem.js +6 -4
- package/es/packages/form-render/src/hooks/useAnchor.js +3 -3
- package/es/packages/form-render/src/hooks/useFieldListAdaptor.js +2 -2
- package/es/packages/form-render/src/hooks/useFieldVisitor.js +3 -0
- package/es/packages/form-render/src/hooks/useFormItemDeps.js +2 -3
- package/es/packages/form-render/src/utils/index.d.ts +1 -0
- package/es/packages/form-render/src/utils/index.js +4 -1
- package/es/packages/form-render/style/index.css +25 -7
- package/es/packages/form-table/src/hooks/useNuiThemeOverrides.d.ts +4 -0
- package/es/packages/form-table/src/hooks/useNuiThemeOverrides.js +18 -0
- package/es/packages/index.css +193 -9
- package/es/packages/index.d.ts +2 -1
- package/es/packages/index.js +3 -0
- package/es/packages/steps-wheel/index.d.ts +548 -0
- package/es/packages/steps-wheel/index.js +11 -0
- package/es/packages/steps-wheel/src/StepsWheel.js +4 -0
- package/es/packages/steps-wheel/src/StepsWheel.vue.d.ts +547 -0
- package/es/packages/steps-wheel/src/StepsWheel.vue_vue_type_script_setup_true_lang.js +252 -0
- package/es/packages/steps-wheel/style/index.css +161 -0
- package/es/packages/time-line/index.d.ts +1 -0
- package/es/packages/time-line/src/TimeLine.vue.d.ts +1 -0
- package/es/packages/time-line/src/TimeLine.vue_vue_type_script_setup_true_lang.js +6 -1
- package/es/packages/time-line/style/index.css +7 -2
- package/package.json +1 -1
- package/es/packages/button-print/src/utils/print.es.min.d.ts +0 -2
- 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,
|
|
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 =
|
|
6
|
-
const
|
|
7
|
-
if (
|
|
8
|
-
return
|
|
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
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
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
|
-
|
|
13
|
-
|
|
14
|
-
|
|
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.
|
|
36
|
-
const
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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 =
|
|
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
|
-
|
|
108
|
-
|
|
109
|
-
|
|
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?:
|
|
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<
|
|
47
|
-
xScaleCell: number;
|
|
50
|
+
xScaleList: Array<any>;
|
|
48
51
|
breatheYCell: number;
|
|
49
52
|
pulseYCell: number;
|
|
50
53
|
temperatureYCell: number;
|