cnhis-design-vue 3.4.0-beta.56 → 3.4.0-beta.59
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/components/fabric-chart/src/constants/index.d.ts +0 -1
- package/es/components/fabric-chart/src/constants/index.js +0 -1
- package/es/components/fabric-chart/src/hooks/birthProcess/useBirthProcessChart.js +69 -117
- package/es/components/fabric-chart/src/hooks/electrocardiogram/useElectrocardiogram.js +6 -5
- package/es/components/fabric-chart/src/hooks/electrocardiogram/useElectrocardiogramChart.d.ts +2 -2
- package/es/components/fabric-chart/src/hooks/electrocardiogram/useElectrocardiogramChart.js +83 -122
- package/es/components/fabric-chart/src/hooks/newBirthProcess/useNewBirthProcessChart.js +65 -113
- package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useSurgicalAnesthesiaChart.js +152 -208
- package/es/components/fabric-chart/src/hooks/temperature/useCenter.js +3 -3
- package/es/components/fabric-chart/src/hooks/temperature/useTemperatureChart.js +194 -272
- package/es/components/field-set/src/FieldColor.vue.d.ts +1 -1
- package/es/components/field-set/src/FieldFilter.vue.d.ts +1 -1
- package/es/components/field-set/src/FieldSet.vue.d.ts +1 -1
- package/es/components/field-set/src/components/table-row.vue.d.ts +1 -1
- package/es/components/form-render/src/hooks/useNewLowCodeReactions.js +8 -0
- package/es/shared/package.json.js +1 -1
- package/es/shared/types/business.d.ts +3 -2
- package/es/shared/utils/business.js +16 -0
- package/package.json +2 -2
|
@@ -82,7 +82,6 @@ const OVERLAP = {
|
|
|
82
82
|
};
|
|
83
83
|
var ECG = /* @__PURE__ */ ((ECG2) => {
|
|
84
84
|
ECG2[ECG2["SMALLCELLNUMBER"] = 5] = "SMALLCELLNUMBER";
|
|
85
|
-
ECG2[ECG2["MAXLINENUMBER"] = 13] = "MAXLINENUMBER";
|
|
86
85
|
ECG2[ECG2["DEFAULTMAINXCELLVALUE"] = 0.2] = "DEFAULTMAINXCELLVALUE";
|
|
87
86
|
return ECG2;
|
|
88
87
|
})(ECG || {});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { reactive,
|
|
1
|
+
import { reactive, watch, toRefs } from 'vue';
|
|
2
2
|
import { defaultBorderStyle } from '../useDraw.js';
|
|
3
3
|
import '../../../../../shared/utils/fabricjs/index.js';
|
|
4
4
|
import 'date-fns';
|
|
@@ -22,101 +22,83 @@ function useBirthProcessChart(canvas, props, emits, canvasRef, pointTipProps, po
|
|
|
22
22
|
redrawPoints: null,
|
|
23
23
|
clickMenu: null
|
|
24
24
|
});
|
|
25
|
-
const leftScales = computed(
|
|
26
|
-
() => props.data.scaleValues.map((item) => {
|
|
27
|
-
var _a;
|
|
28
|
-
return { ...item, width: (_a = item.width) != null ? _a : 60 };
|
|
29
|
-
}).filter(({ layout = "left", show = true }) => layout === "left" && show)
|
|
30
|
-
);
|
|
31
|
-
const rightScales = computed(
|
|
32
|
-
() => props.data.scaleValues.map((item) => {
|
|
33
|
-
var _a;
|
|
34
|
-
return { ...item, width: (_a = item.width) != null ? _a : 60 };
|
|
35
|
-
}).filter(({ layout = "left", show = true }) => layout === "right" && show)
|
|
36
|
-
);
|
|
37
25
|
const leftAddAreaWidth = 30;
|
|
38
|
-
|
|
39
|
-
var _a;
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
const
|
|
45
|
-
|
|
46
|
-
return width;
|
|
47
|
-
},
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
var _a;
|
|
26
|
+
function buildDerived() {
|
|
27
|
+
var _a, _b;
|
|
28
|
+
const leftScales = props.data.scaleValues.map((item) => {
|
|
29
|
+
var _a2;
|
|
30
|
+
return { ...item, width: (_a2 = item.width) != null ? _a2 : 60 };
|
|
31
|
+
}).filter(({ layout = "left", show = true }) => layout === "left" && show);
|
|
32
|
+
const rightScales = props.data.scaleValues.map((item) => {
|
|
33
|
+
var _a2;
|
|
34
|
+
return { ...item, width: (_a2 = item.width) != null ? _a2 : 60 };
|
|
35
|
+
}).filter(({ layout = "left", show = true }) => layout === "right" && show);
|
|
36
|
+
const rightAddAreaWidth = !(rightScales == null ? void 0 : rightScales.length) ? 0 : 30;
|
|
37
|
+
const leftScalesWidth = leftScales == null ? void 0 : leftScales.reduce((width2, item) => width2 + item.width, 0);
|
|
38
|
+
const originX = leftAddAreaWidth + leftScalesWidth;
|
|
52
39
|
const { width } = props.data;
|
|
53
|
-
const rightScalesWidth =
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
}, 0);
|
|
57
|
-
return width - rightAddAreaWidth.value - rightScalesWidth;
|
|
58
|
-
});
|
|
59
|
-
const gridXNumber = computed(() => props.data.grid.mainXCell);
|
|
60
|
-
const gridYNumber = computed(() => {
|
|
40
|
+
const rightScalesWidth = rightScales == null ? void 0 : rightScales.reduce((w, item) => w + item.width, 0);
|
|
41
|
+
const endX = width - rightAddAreaWidth - rightScalesWidth;
|
|
42
|
+
const gridXNumber = props.data.grid.mainXCell;
|
|
61
43
|
const mainYCell = props.data.grid.mainYCell || 14;
|
|
62
|
-
const
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
return (endX.value - originX.value) / gridXNumber.value;
|
|
67
|
-
});
|
|
68
|
-
const padding = computed(() => {
|
|
69
|
-
const p = props.data.padding || [5, 5];
|
|
44
|
+
const fhrItemShow = props.data.scaleValues.find((item) => item.show && item.key === "FHR");
|
|
45
|
+
const gridYNumber = !fhrItemShow && mainYCell === 14 ? 10 : mainYCell;
|
|
46
|
+
const xCellWidth = (endX - originX) / gridXNumber;
|
|
47
|
+
const defaultPadding = props.data.padding || [5, 5];
|
|
70
48
|
const xAxisNumberTop = getxAxisNumber("top");
|
|
71
49
|
const xAxisNumberBottom = getxAxisNumber("bottom");
|
|
72
|
-
|
|
73
|
-
});
|
|
74
|
-
const yCellHeight = computed(() => {
|
|
50
|
+
const padding = [xAxisNumberTop ? 0 : defaultPadding[0], xAxisNumberBottom ? 0 : defaultPadding[1]];
|
|
75
51
|
const { height } = props.data;
|
|
76
|
-
const
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
const
|
|
81
|
-
return yCellHeight.value * xAxisNumber + padding.value[0];
|
|
82
|
-
});
|
|
83
|
-
const originYCervix = computed(() => {
|
|
84
|
-
var _a;
|
|
85
|
-
const { scaleValues } = props.data;
|
|
52
|
+
const xAxisNumberAll = getxAxisNumber();
|
|
53
|
+
const yCellHeight = (height - padding.reduce((p1, p2) => p1 + p2, 0)) / (gridYNumber + xAxisNumberAll);
|
|
54
|
+
const originY = yCellHeight * xAxisNumberTop + padding[0];
|
|
55
|
+
const endY = height - yCellHeight * xAxisNumberBottom - padding[1];
|
|
56
|
+
const scaleValues = props.data.scaleValues;
|
|
86
57
|
const FHRisShow = (_a = scaleValues.find((item) => item.key === "FHR")) == null ? void 0 : _a.show;
|
|
87
|
-
if (!FHRisShow && !originY.value)
|
|
88
|
-
return originY.value;
|
|
89
58
|
const cervixItem = scaleValues.find((item) => item.key === "cervix");
|
|
90
59
|
const [, max] = (cervixItem == null ? void 0 : cervixItem.range) || [0, 10];
|
|
91
60
|
const spaceValue = (cervixItem == null ? void 0 : cervixItem.spaceValue) || 1;
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
const
|
|
96
|
-
const
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
61
|
+
const originYCervix = !FHRisShow && !originY ? originY : endY - padding[0] - max * spaceValue * yCellHeight;
|
|
62
|
+
const startTime = getTime(props.data.xAxis.time.startTime);
|
|
63
|
+
const timeXCell = 1 * 60 * 60 * 1e3 / xCellWidth;
|
|
64
|
+
const cervixYCell = yCellHeight / ((cervixItem == null ? void 0 : cervixItem.spaceValue) || 1);
|
|
65
|
+
const FHRItem = scaleValues.find((item) => item.key === "FHR");
|
|
66
|
+
const FHRYCell = yCellHeight / ((FHRItem == null ? void 0 : FHRItem.spaceValue) || 10);
|
|
67
|
+
const fetalPresentationItem = scaleValues.find((item) => item.key === "fetalPresentation");
|
|
68
|
+
const fetalPresentationYCell = yCellHeight / ((fetalPresentationItem == null ? void 0 : fetalPresentationItem.spaceValue) || 1);
|
|
69
|
+
const event = ((_b = props.data.grid) == null ? void 0 : _b.event) || { selectable: true, evented: true, hovered: true };
|
|
70
|
+
return {
|
|
71
|
+
canvasWidth: props.data.width,
|
|
72
|
+
canvasHeight: props.data.height,
|
|
73
|
+
borderStyle: { ...defaultBorderStyle, ...props.data.borderStyle },
|
|
74
|
+
selectionStyle: props.data.selectionStyle || {},
|
|
75
|
+
grid: props.data.grid,
|
|
76
|
+
other: props.data.other,
|
|
77
|
+
originX,
|
|
78
|
+
endX,
|
|
79
|
+
originY,
|
|
80
|
+
endY,
|
|
81
|
+
xCellWidth,
|
|
82
|
+
yCellHeight,
|
|
83
|
+
gridXNumber,
|
|
84
|
+
gridYNumber,
|
|
85
|
+
xAxis: props.data.xAxis,
|
|
86
|
+
leftScales,
|
|
87
|
+
rightScales,
|
|
88
|
+
leftAddAreaWidth,
|
|
89
|
+
rightAddAreaWidth,
|
|
90
|
+
startTime,
|
|
91
|
+
timeXCell,
|
|
92
|
+
cervixYCell,
|
|
93
|
+
FHRYCell,
|
|
94
|
+
fetalPresentationYCell,
|
|
95
|
+
scaleValues: props.data.scaleValues,
|
|
96
|
+
event,
|
|
97
|
+
originYCervix,
|
|
98
|
+
scalebarBorder: Reflect.has(props.data, "scalebarBorder") ? props.data.scalebarBorder : true,
|
|
99
|
+
padding
|
|
100
|
+
};
|
|
101
|
+
}
|
|
120
102
|
function getxAxisNumber(position) {
|
|
121
103
|
const { xAxis } = props.data;
|
|
122
104
|
return Object.values(xAxis).reduce((num, item) => {
|
|
@@ -125,37 +107,7 @@ function useBirthProcessChart(canvas, props, emits, canvasRef, pointTipProps, po
|
|
|
125
107
|
return num;
|
|
126
108
|
}, 0);
|
|
127
109
|
}
|
|
128
|
-
const propItems = reactive(
|
|
129
|
-
canvasWidth: props.data.width,
|
|
130
|
-
canvasHeight: props.data.height,
|
|
131
|
-
borderStyle: { ...defaultBorderStyle, ...props.data.borderStyle || {} },
|
|
132
|
-
selectionStyle: props.data.selectionStyle || {},
|
|
133
|
-
grid: props.data.grid,
|
|
134
|
-
other: props.data.other,
|
|
135
|
-
originX: originX.value,
|
|
136
|
-
endX: endX.value,
|
|
137
|
-
originY: originY.value,
|
|
138
|
-
endY: endY.value,
|
|
139
|
-
xCellWidth: xCellWidth.value,
|
|
140
|
-
yCellHeight: yCellHeight.value,
|
|
141
|
-
gridXNumber: gridXNumber.value,
|
|
142
|
-
gridYNumber: gridYNumber.value,
|
|
143
|
-
xAxis: props.data.xAxis,
|
|
144
|
-
leftScales: leftScales.value,
|
|
145
|
-
rightScales: rightScales.value,
|
|
146
|
-
leftAddAreaWidth,
|
|
147
|
-
rightAddAreaWidth: rightAddAreaWidth.value,
|
|
148
|
-
startTime: startTime.value,
|
|
149
|
-
timeXCell: timeXCell.value,
|
|
150
|
-
cervixYCell: cervixYCell.value,
|
|
151
|
-
FHRYCell: FHRYCell.value,
|
|
152
|
-
fetalPresentationYCell: fetalPresentationYCell.value,
|
|
153
|
-
scaleValues: props.data.scaleValues,
|
|
154
|
-
event: event.value,
|
|
155
|
-
originYCervix: originYCervix.value,
|
|
156
|
-
scalebarBorder: Reflect.has(props.data, "scalebarBorder") ? props.data.scalebarBorder : true,
|
|
157
|
-
padding: padding.value
|
|
158
|
-
});
|
|
110
|
+
const propItems = reactive(buildDerived());
|
|
159
111
|
watch(
|
|
160
112
|
() => canvas.value,
|
|
161
113
|
(value) => {
|
|
@@ -36,7 +36,8 @@ function useElectrocardiogram(canvas, propItems, flag) {
|
|
|
36
36
|
titleStyle,
|
|
37
37
|
titleOffset,
|
|
38
38
|
config,
|
|
39
|
-
calibrationLineHeight
|
|
39
|
+
calibrationLineHeight,
|
|
40
|
+
maxLineNumber
|
|
40
41
|
} = propItems;
|
|
41
42
|
const gridPoints = /* @__PURE__ */ new Set();
|
|
42
43
|
const fixedPointsCache = /* @__PURE__ */ new Set();
|
|
@@ -66,17 +67,17 @@ function useElectrocardiogram(canvas, propItems, flag) {
|
|
|
66
67
|
function drawPolyLine(startIdx = 0) {
|
|
67
68
|
const overflowIsScroll = config.overflow === "scroll";
|
|
68
69
|
dataList.forEach((lineItem, idx) => {
|
|
69
|
-
if (idx ===
|
|
70
|
+
if (idx === maxLineNumber - 1 && arguments.length && !overflowIsScroll)
|
|
70
71
|
return;
|
|
71
72
|
const { x, y, rowIdx, limitX } = lineItem.origin;
|
|
72
73
|
const lineLength = lineItem.data.length;
|
|
73
|
-
const showLength = idx <
|
|
74
|
+
const showLength = idx < maxLineNumber - 1 ? getShowLength(lineItem.data) : lineLength;
|
|
74
75
|
const points = [];
|
|
75
76
|
let pointIndex = 0;
|
|
76
77
|
for (let _idx = startIdx; _idx <= startIdx + showLength && _idx < lineLength; _idx++) {
|
|
77
78
|
const value = lineItem.data[_idx];
|
|
78
79
|
const point = { x: computedX(pointIndex + 1), y: computedY(-+value) + y };
|
|
79
|
-
if (idx <
|
|
80
|
+
if (idx < maxLineNumber - 1 && point.x > limitX) {
|
|
80
81
|
break;
|
|
81
82
|
}
|
|
82
83
|
points.push(point);
|
|
@@ -107,7 +108,7 @@ function useElectrocardiogram(canvas, propItems, flag) {
|
|
|
107
108
|
detailRadius: 370,
|
|
108
109
|
beforeEvent: () => flag.value && Promise.reject()
|
|
109
110
|
});
|
|
110
|
-
if (idx <
|
|
111
|
+
if (idx < maxLineNumber - 1 || overflowIsScroll) {
|
|
111
112
|
gridPoints.add(polyline);
|
|
112
113
|
} else {
|
|
113
114
|
fixedPointsCache.add(polyline);
|
package/es/components/fabric-chart/src/hooks/electrocardiogram/useElectrocardiogramChart.d.ts
CHANGED
|
@@ -5,8 +5,8 @@ import { IPointTipProps, IPointMenuProps } from '../../../../../components/fabri
|
|
|
5
5
|
import { ECG } from '../../../../../components/fabric-chart/src/constants';
|
|
6
6
|
export declare function useElectrocardiogramChart(canvas: Ref<fabric.Canvas>, props: AnyObject, emits: Function, canvasRef: Ref<HTMLCanvasElement | null>, pointTipProps: IPointTipProps, pointMenuProps: IPointMenuProps): {
|
|
7
7
|
getGridInfo: () => {
|
|
8
|
-
cellWidth:
|
|
9
|
-
cellHeight:
|
|
8
|
+
cellWidth: any;
|
|
9
|
+
cellHeight: any;
|
|
10
10
|
smallCellNumber: ECG;
|
|
11
11
|
};
|
|
12
12
|
select?: Ref<import("../../../../../shared/types").AnyFn | null | undefined, import("../../../../../shared/types").AnyFn | null | undefined> | undefined;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { reactive,
|
|
1
|
+
import { reactive, watch, toRefs } from 'vue';
|
|
2
2
|
import { defaultBorderStyle, defaultLineStyle, defaultTextStyle } from '../useDraw.js';
|
|
3
3
|
import '../../../../../shared/utils/fabricjs/index.js';
|
|
4
4
|
import 'date-fns';
|
|
5
|
-
import { cloneDeep,
|
|
5
|
+
import { cloneDeep, last, isNumber } from 'lodash-es';
|
|
6
6
|
import '../useEvent.js';
|
|
7
7
|
import '../useShadow.js';
|
|
8
8
|
import '../useCommon.js';
|
|
@@ -25,142 +25,103 @@ function useElectrocardiogramChart(canvas, props, emits, canvasRef, pointTipProp
|
|
|
25
25
|
useRectRuler: null
|
|
26
26
|
});
|
|
27
27
|
const originX = 0, originY = 0;
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
const
|
|
32
|
-
const
|
|
33
|
-
const
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
const xCellWidth = computed(() => {
|
|
40
|
-
return (endX.value - originX) / gridXNumber.value;
|
|
41
|
-
});
|
|
42
|
-
const yCellHeight = computed(() => {
|
|
43
|
-
return (endY.value - originY) / gridYNumber.value;
|
|
44
|
-
});
|
|
45
|
-
const gridXNumber = computed(() => {
|
|
46
|
-
var _a, _b, _c;
|
|
47
|
-
const { config, grid } = props.data;
|
|
48
|
-
if (isNumber(grid.gridXNumber))
|
|
49
|
-
return grid.gridXNumber;
|
|
50
|
-
const totalLength = (_c = (_b = (_a = last(__dataList.value)) == null ? void 0 : _a.data) == null ? void 0 : _b.length) != null ? _c : 0;
|
|
28
|
+
function buildDerived() {
|
|
29
|
+
var _a, _b, _c, _d, _e, _f;
|
|
30
|
+
const endX = props.data.width;
|
|
31
|
+
const endY = props.data.height;
|
|
32
|
+
const { dataList = [], config = {} } = props.data;
|
|
33
|
+
const list = cloneDeep(dataList);
|
|
34
|
+
const matchItem = list.find((item) => config.lastDataKey && item.key === config.lastDataKey);
|
|
35
|
+
const __dataList = matchItem ? [...list, matchItem] : list;
|
|
36
|
+
const maxLineNumber = list.length + 1;
|
|
37
|
+
const { grid } = props.data;
|
|
38
|
+
const totalLength = (_c = (_b = (_a = last(__dataList)) == null ? void 0 : _a.data) == null ? void 0 : _b.length) != null ? _c : 0;
|
|
51
39
|
const totalSeconds = totalLength / config.hz;
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
const gridYNumber = computed(() => {
|
|
55
|
-
const { config, grid } = props.data;
|
|
56
|
-
if (isNumber(grid.gridYNumber))
|
|
57
|
-
return grid.gridYNumber;
|
|
58
|
-
const totalLineLength = __dataList.value.length;
|
|
59
|
-
return Math.ceil(totalValueMV.value * totalLineLength * 2 / config.mainYCellValue);
|
|
60
|
-
});
|
|
61
|
-
const totalValueMV = computed(() => {
|
|
62
|
-
var _a;
|
|
63
|
-
const { config } = props.data;
|
|
64
|
-
const totalData = (_a = last(__dataList.value)) == null ? void 0 : _a.data;
|
|
40
|
+
const gridXNumber = isNumber(grid.gridXNumber) ? grid.gridXNumber : Math.ceil(totalSeconds / config.mainXCellValue);
|
|
41
|
+
const totalData = ((_d = last(__dataList)) == null ? void 0 : _d.data) || [];
|
|
65
42
|
const maxValue = Math.max(...totalData);
|
|
66
43
|
const minValue = Math.min(...totalData);
|
|
67
44
|
const totalValue = maxValue - minValue;
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
const
|
|
76
|
-
const
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
rowNumber
|
|
80
|
-
};
|
|
81
|
-
});
|
|
82
|
-
const rowSpace = computed(() => {
|
|
83
|
-
const { rowNumber } = layoutInfo.value;
|
|
84
|
-
const totalLineLength = __dataList.value.length;
|
|
85
|
-
return Math.round(gridYNumber.value / (rowNumber + (totalLineLength === ECG.MAXLINENUMBER ? 1 : 0)));
|
|
86
|
-
});
|
|
87
|
-
const dataList = computed(() => {
|
|
88
|
-
const { width, config, grid } = props.data;
|
|
89
|
-
const { columnNumber, rowNumber } = layoutInfo.value;
|
|
90
|
-
const columnWidth = width / columnNumber;
|
|
91
|
-
const dataListLen = __dataList.value.length;
|
|
92
|
-
const baseYCellNumber = Math.ceil(rowSpace.value / 2);
|
|
93
|
-
const firstRowLineMaxHeight = getFirstRowLineMaxHeight();
|
|
94
|
-
const _baseY = yCellHeight.value * baseYCellNumber;
|
|
95
|
-
const baseY = columnNumber === 1 || _baseY < firstRowLineMaxHeight ? yCellHeight.value * Math.ceil(firstRowLineMaxHeight / yCellHeight.value) : _baseY;
|
|
96
|
-
const baseX = xCellWidth.value;
|
|
97
|
-
return __dataList.value.map((item, idx) => {
|
|
98
|
-
const itemRowIdx = ECG.MAXLINENUMBER === dataListLen && idx === dataListLen - 1 ? rowNumber : idx % rowNumber;
|
|
99
|
-
const itemColumnIdx = ECG.MAXLINENUMBER === dataListLen && idx === dataListLen - 1 ? 0 : Math.floor(idx / rowNumber);
|
|
100
|
-
return {
|
|
101
|
-
...item,
|
|
102
|
-
origin: {
|
|
103
|
-
x: itemColumnIdx * columnWidth + baseX,
|
|
104
|
-
y: itemRowIdx * (yCellHeight.value * rowSpace.value) + baseY,
|
|
105
|
-
rowIdx: itemRowIdx,
|
|
106
|
-
limitX: columnWidth - baseX
|
|
107
|
-
}
|
|
108
|
-
};
|
|
109
|
-
});
|
|
45
|
+
const totalValueMV = config.valueUnit === "uv" ? totalValue * 1e-3 : config.valueUnit === "v" ? totalValue * 1e3 : totalValue;
|
|
46
|
+
const totalLineLength = __dataList.length;
|
|
47
|
+
const gridYNumber = isNumber(grid.gridYNumber) ? grid.gridYNumber : Math.ceil(totalValueMV * totalLineLength * 2 / config.mainYCellValue);
|
|
48
|
+
const xCellWidth = (endX - originX) / gridXNumber;
|
|
49
|
+
const yCellHeight = (endY - originY) / gridYNumber;
|
|
50
|
+
const event = ((_e = props.data.grid) == null ? void 0 : _e.event) || { selectable: true, evented: true };
|
|
51
|
+
const columnNumber = +(props.data.columnNumber || 2);
|
|
52
|
+
const rowNumber = Math.ceil(list.length / columnNumber);
|
|
53
|
+
const rowSpace = ~~(gridYNumber / (rowNumber + (totalLineLength === maxLineNumber ? 1 : 0)));
|
|
54
|
+
const columnWidth = props.data.width / columnNumber;
|
|
55
|
+
const baseYCellNumber = Math.ceil(rowSpace / 2);
|
|
110
56
|
function getFirstRowLineMaxHeight() {
|
|
111
|
-
const { valueUnit, mainYCellValue } = config;
|
|
112
|
-
const data1 = __dataList
|
|
57
|
+
const { valueUnit, mainYCellValue: mainYCellValue2 } = config;
|
|
58
|
+
const data1 = __dataList[0].data;
|
|
113
59
|
const data1Max = Math.max(...data1);
|
|
114
60
|
const data1MaxHeight = computedY(data1Max);
|
|
115
61
|
if (columnNumber !== 2) {
|
|
116
62
|
return data1MaxHeight;
|
|
117
63
|
}
|
|
118
|
-
const
|
|
119
|
-
const
|
|
120
|
-
const
|
|
121
|
-
return Math.max(data1MaxHeight,
|
|
64
|
+
const halfIndexData = __dataList[rowNumber].data;
|
|
65
|
+
const halfIndexDataMax = Math.max(...halfIndexData);
|
|
66
|
+
const halfIndexDataMaxHeight = computedY(halfIndexDataMax);
|
|
67
|
+
return Math.max(data1MaxHeight, halfIndexDataMaxHeight);
|
|
122
68
|
function computedY(value) {
|
|
123
69
|
const currentMV = valueUnit === "uv" ? value * 1e-3 : valueUnit === "v" ? value * 1e3 : value;
|
|
124
|
-
return currentMV /
|
|
70
|
+
return currentMV / mainYCellValue2 * yCellHeight;
|
|
125
71
|
}
|
|
126
72
|
}
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
const
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
73
|
+
const firstRowLineMaxHeight = getFirstRowLineMaxHeight();
|
|
74
|
+
const _baseY = yCellHeight * baseYCellNumber;
|
|
75
|
+
const baseY = columnNumber === 1 || _baseY < firstRowLineMaxHeight ? yCellHeight * Math.ceil(firstRowLineMaxHeight / yCellHeight) : _baseY;
|
|
76
|
+
const baseX = xCellWidth;
|
|
77
|
+
const derivedDataList = __dataList.map((item, idx) => {
|
|
78
|
+
const isLastLine = maxLineNumber === totalLineLength && idx === totalLineLength - 1;
|
|
79
|
+
const itemRowIdx = isLastLine ? rowNumber : idx % rowNumber;
|
|
80
|
+
const itemColumnIdx = isLastLine ? 0 : ~~(idx / rowNumber);
|
|
81
|
+
return {
|
|
82
|
+
...item,
|
|
83
|
+
origin: {
|
|
84
|
+
x: itemColumnIdx * columnWidth + baseX,
|
|
85
|
+
y: itemRowIdx * (yCellHeight * rowSpace) + baseY,
|
|
86
|
+
rowIdx: itemRowIdx,
|
|
87
|
+
limitX: columnWidth - baseX
|
|
88
|
+
}
|
|
89
|
+
};
|
|
90
|
+
});
|
|
91
|
+
const { calibrationLineGridYNumber, mainYCellValue } = ((_f = props.data) == null ? void 0 : _f.config) || {};
|
|
92
|
+
const calibrationLineHeight = calibrationLineGridYNumber ? yCellHeight * calibrationLineGridYNumber : mainYCellValue ? yCellHeight / mainYCellValue : yCellHeight;
|
|
93
|
+
return {
|
|
94
|
+
canvasWidth: props.data.width,
|
|
95
|
+
canvasHeight: props.data.height,
|
|
96
|
+
borderStyle: { ...defaultBorderStyle, ...props.data.borderStyle },
|
|
97
|
+
lineStyle: { ...defaultLineStyle, ...props.data.lineStyle },
|
|
98
|
+
titleStyle: { ...defaultTextStyle, ...props.data.titleStyle },
|
|
99
|
+
titleOffset: props.data.titleOffset,
|
|
100
|
+
measureLineStyle: { ...defaultLineStyle, ...props.data.measureLineStyle },
|
|
101
|
+
measureTextStyle: { ...defaultTextStyle, ...props.data.measureTextStyle },
|
|
102
|
+
grid: props.data.grid,
|
|
103
|
+
originX,
|
|
104
|
+
endX,
|
|
105
|
+
originY,
|
|
106
|
+
endY,
|
|
107
|
+
xCellWidth,
|
|
108
|
+
yCellHeight,
|
|
109
|
+
gridXNumber,
|
|
110
|
+
gridYNumber,
|
|
111
|
+
event,
|
|
112
|
+
dataList: derivedDataList,
|
|
113
|
+
columnNumber,
|
|
114
|
+
rowNumber,
|
|
115
|
+
config: props.data.config,
|
|
116
|
+
calibrationLineHeight,
|
|
117
|
+
maxLineNumber
|
|
118
|
+
};
|
|
119
|
+
}
|
|
120
|
+
const propItems = reactive(buildDerived());
|
|
160
121
|
function getGridInfo() {
|
|
161
122
|
return {
|
|
162
|
-
cellWidth: xCellWidth
|
|
163
|
-
cellHeight: yCellHeight
|
|
123
|
+
cellWidth: propItems.xCellWidth,
|
|
124
|
+
cellHeight: propItems.yCellHeight,
|
|
164
125
|
smallCellNumber: ECG.SMALLCELLNUMBER
|
|
165
126
|
};
|
|
166
127
|
}
|