cnhis-design-vue 3.1.34-beta.6 → 3.1.34-beta.7
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/README.md +123 -123
- package/es/components/big-table/index.d.ts +1 -0
- package/es/components/big-table/src/BigTable.vue.d.ts +1 -0
- package/es/components/big-table/src/BigTable.vue2.js +13 -1
- package/es/components/big-table/src/components/edit-form/edit-select.js +26 -1
- package/es/components/big-table/src/hooks/useEvent.js +3 -4
- package/es/components/fabric-chart/index.d.ts +141 -374
- package/es/components/fabric-chart/src/BirthProcessChart.vue.d.ts +2 -2
- package/es/components/fabric-chart/src/FabricChart.vue.d.ts +142 -374
- package/es/components/fabric-chart/src/FabricChart.vue.js +52 -22
- package/es/components/fabric-chart/src/hooks/index.d.ts +1 -0
- package/es/components/fabric-chart/src/hooks/index.js +1 -0
- package/es/components/fabric-chart/src/hooks/useBirthProcess.js +2 -2
- package/es/components/fabric-chart/src/hooks/useBottom.js +1 -6
- package/es/components/fabric-chart/src/hooks/useCenter.d.ts +4 -18
- package/es/components/fabric-chart/src/hooks/useCenter.js +3 -20
- package/es/components/fabric-chart/src/hooks/useCommon.d.ts +1 -1
- package/es/components/fabric-chart/src/hooks/useCommon.js +2 -2
- package/es/components/fabric-chart/src/hooks/useGrid.js +2 -7
- package/es/components/fabric-chart/src/hooks/useLeft.d.ts +2 -1
- package/es/components/fabric-chart/src/hooks/useLeft.js +22 -28
- package/es/components/fabric-chart/src/hooks/useOther.js +1 -6
- package/es/components/fabric-chart/src/hooks/useRight.js +13 -18
- package/es/components/fabric-chart/src/hooks/useTemperatureChart.d.ts +25 -0
- package/es/components/fabric-chart/src/hooks/useTemperatureChart.js +339 -0
- package/es/components/fabric-chart/src/hooks/useTop.js +1 -6
- package/es/components/iho-table/index.d.ts +6 -6
- package/es/components/iho-table/src/IhoTable.vue.d.ts +6 -6
- package/es/components/iho-table/src/plugins/defaultConfigPlugin/index.js +4 -3
- package/es/components/iho-table/src/plugins/lowCodeFieldAdaptorPlugin/index.js +5 -5
- package/es/components/iho-table/src/types/index.d.ts +7 -7
- package/es/components/iho-table/src/utils/index.d.ts +6 -0
- package/es/components/iho-table/src/utils/index.js +16 -2
- package/es/shared/assets/img/failure.js +1 -1
- package/es/shared/assets/img/failure.png.js +1 -1
- package/es/shared/assets/img/icon-asc.js +1 -1
- package/es/shared/assets/img/icon-desc.js +1 -1
- package/es/shared/assets/img/no-permission.js +1 -1
- package/es/shared/assets/img/no-permission.png.js +1 -1
- package/es/shared/assets/img/nodata.js +1 -1
- package/es/shared/assets/img/nodata.png.js +1 -1
- package/es/shared/assets/img/notfound.js +1 -1
- package/es/shared/assets/img/notfound.png.js +1 -1
- package/es/shared/assets/img/qr.js +1 -1
- package/es/shared/assets/img/qr.png.js +1 -1
- package/es/shared/assets/img/success.js +1 -1
- package/es/shared/assets/img/success.png.js +1 -1
- package/es/shared/assets/img/video.js +1 -1
- package/es/shared/assets/img/video.png.js +1 -1
- package/es/shared/assets/img/video_default_cover.js +1 -1
- package/es/shared/assets/img/video_default_cover.png.js +1 -1
- package/es/shared/assets/img/video_hover.js +1 -1
- package/es/shared/assets/img/video_play_hover.js +1 -1
- package/es/shared/assets/img/xb_big.js +1 -1
- package/es/shared/assets/img/xb_big.png.js +1 -1
- package/es/shared/assets/img/xb_small.js +1 -1
- package/es/shared/assets/img/xb_small.png.js +1 -1
- package/es/shared/types/index.d.ts +1 -0
- package/package.json +2 -2
- package/es/components/bpmn-workflow/src/BpmnWorkflow.d.ts +0 -0
- package/es/components/bpmn-workflow/types/BpmnViewer.d.ts +0 -1
- package/es/components/bpmn-workflow/types/ModelingModule.d.ts +0 -1
- package/es/components/bpmn-workflow/types/MoveCanvasModule.d.ts +0 -1
- package/es/components/fabric-chart/src/BirthProcessChart.vue.js +0 -172
- package/es/components/fabric-chart/src/TemperatureChart.vue.d.ts +0 -214
- package/es/components/fabric-chart/src/TemperatureChart.vue.js +0 -355
- package/es/components/fabric-chart/src/utils/index.d.ts +0 -6823
- package/es/shared/components/VueDraggable/src/vuedraggable.d.ts +0 -86
- package/es/shared/utils/tapable/index.d.ts +0 -139
|
@@ -4,12 +4,12 @@ import useGrid from './useGrid.js';
|
|
|
4
4
|
import { drawLine, drawPoint, drawText, defaultTextStyle, defaultRectStyle } from './useDraw.js';
|
|
5
5
|
import { fabric } from '../utils/index.js';
|
|
6
6
|
import { getIndex, isEffectiveNode } from '../utils/utils.js';
|
|
7
|
-
import
|
|
7
|
+
import { useCommon } from './useCommon.js';
|
|
8
8
|
import { cloneDeep } from 'lodash-es';
|
|
9
9
|
|
|
10
10
|
function useBirthProcess(canvas, propItems, emits) {
|
|
11
11
|
const { cumputedX, cumputedY, getXValue, getYValue } = useBirthProcessCumputedPoint(propItems);
|
|
12
|
-
const { getEqualXTypes } =
|
|
12
|
+
const { getEqualXTypes } = useCommon(canvas);
|
|
13
13
|
const {
|
|
14
14
|
xAxis,
|
|
15
15
|
grid,
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { onMounted, nextTick } from 'vue';
|
|
2
1
|
import { fabric } from '../utils/index.js';
|
|
3
2
|
import { defaultBorderStyle, drawTextGroup, defaultTextStyle, defaultRectStyle, defaultStyle } from './useDraw.js';
|
|
4
3
|
|
|
@@ -86,11 +85,7 @@ function useBottom(canvas, propItems) {
|
|
|
86
85
|
group && group.sendToBack();
|
|
87
86
|
group && canvas.value.add(group);
|
|
88
87
|
}
|
|
89
|
-
|
|
90
|
-
nextTick(() => {
|
|
91
|
-
drawBottom();
|
|
92
|
-
});
|
|
93
|
-
});
|
|
88
|
+
drawBottom();
|
|
94
89
|
}
|
|
95
90
|
|
|
96
91
|
export { useBottom };
|
|
@@ -1,24 +1,10 @@
|
|
|
1
1
|
import { Ref } from 'vue';
|
|
2
2
|
import { fabric } from '../utils';
|
|
3
3
|
import { IPropItems } from '../interface';
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
x: number;
|
|
9
|
-
y: number;
|
|
10
|
-
};
|
|
11
|
-
list: string[];
|
|
12
|
-
};
|
|
13
|
-
pointMenuProps: {
|
|
14
|
-
show: boolean;
|
|
15
|
-
point: {
|
|
16
|
-
x: number;
|
|
17
|
-
y: number;
|
|
18
|
-
};
|
|
19
|
-
list: any[];
|
|
20
|
-
target: any;
|
|
21
|
-
};
|
|
4
|
+
import { AnyObject } from '../../../../../es/shared/types';
|
|
5
|
+
export declare function useCenter(canvas: Ref<fabric.Canvas>, propItems: IPropItems, emits: any, cumputedX: Function, cumputedY: Function, getXValue: Function, getYValue: Function, addRenderItem: Function | undefined, pointTipProps: any, pointMenuProps: any, useCommon: AnyObject): {
|
|
6
|
+
pointTipProps: any;
|
|
7
|
+
pointMenuProps: any;
|
|
22
8
|
clickMenu: ({ item, target }: {
|
|
23
9
|
item: any;
|
|
24
10
|
target: any;
|
|
@@ -1,16 +1,14 @@
|
|
|
1
|
-
import { reactive, onMounted, nextTick } from 'vue';
|
|
2
1
|
import { fabric } from '../utils/index.js';
|
|
3
2
|
import { drawLine, defaultStyle, drawPoint, drawText, drawArrow } from './useDraw.js';
|
|
4
3
|
import useGrid from './useGrid.js';
|
|
5
4
|
import { useShadow } from './useShadow.js';
|
|
6
5
|
import { TEMPERATURE_MENU, PAIN_MENU, OVERLAP } from './constant.js';
|
|
7
|
-
import useCommmon from './useCommon.js';
|
|
8
6
|
import { cloneDeep } from 'lodash-es';
|
|
9
7
|
import { getPointArr, isEffectiveNode, getIndex, deleteProperty } from '../utils/utils.js';
|
|
10
8
|
|
|
11
|
-
function useCenter(canvas, propItems, emits, cumputedX, cumputedY, getXValue, getYValue, addRenderItem) {
|
|
9
|
+
function useCenter(canvas, propItems, emits, cumputedX, cumputedY, getXValue, getYValue, addRenderItem, pointTipProps, pointMenuProps, useCommon) {
|
|
12
10
|
useGrid(canvas, propItems);
|
|
13
|
-
const { getEqualXTypes, repeatTip, maxLimitTip, minLimitTip } =
|
|
11
|
+
const { getEqualXTypes, repeatTip, maxLimitTip, minLimitTip } = useCommon;
|
|
14
12
|
const {
|
|
15
13
|
left,
|
|
16
14
|
xScaleList,
|
|
@@ -27,17 +25,6 @@ function useCenter(canvas, propItems, emits, cumputedX, cumputedY, getXValue, ge
|
|
|
27
25
|
hospitalizationDate,
|
|
28
26
|
config
|
|
29
27
|
} = propItems;
|
|
30
|
-
const pointTipProps = reactive({
|
|
31
|
-
show: false,
|
|
32
|
-
point: { x: 0, y: 0 },
|
|
33
|
-
list: []
|
|
34
|
-
});
|
|
35
|
-
const pointMenuProps = reactive({
|
|
36
|
-
show: false,
|
|
37
|
-
point: { x: 0, y: 0 },
|
|
38
|
-
list: [],
|
|
39
|
-
target: null
|
|
40
|
-
});
|
|
41
28
|
const shadowLinesCache = /* @__PURE__ */ new Set();
|
|
42
29
|
let shadowPointCache = [];
|
|
43
30
|
const maiboPoints = /* @__PURE__ */ new Set();
|
|
@@ -45,11 +32,7 @@ function useCenter(canvas, propItems, emits, cumputedX, cumputedY, getXValue, ge
|
|
|
45
32
|
const prevLines = /* @__PURE__ */ new Set();
|
|
46
33
|
const gridPoints = /* @__PURE__ */ new Set();
|
|
47
34
|
const yScaleValue = cloneDeep(left.yScaleValue);
|
|
48
|
-
|
|
49
|
-
nextTick(() => {
|
|
50
|
-
init();
|
|
51
|
-
});
|
|
52
|
-
});
|
|
35
|
+
init();
|
|
53
36
|
function init() {
|
|
54
37
|
shadowPointCache = [];
|
|
55
38
|
maiboPoints.clear();
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Ref } from 'vue';
|
|
2
2
|
import { fabric } from '../utils';
|
|
3
|
-
export
|
|
3
|
+
export declare function useCommon(canvas: Ref<fabric.Canvas>): {
|
|
4
4
|
getEqualXTypes: (pointX: number, field: string, range?: number) => string[];
|
|
5
5
|
repeatTip: () => void;
|
|
6
6
|
maxLimitTip: () => void;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { useMessage } from 'naive-ui';
|
|
2
2
|
|
|
3
|
-
function
|
|
3
|
+
function useCommon(canvas) {
|
|
4
4
|
const $message = useMessage();
|
|
5
5
|
function getEqualXTypes(pointX, field, range = 6) {
|
|
6
6
|
const types = [];
|
|
@@ -29,4 +29,4 @@ function useCommmon(canvas) {
|
|
|
29
29
|
};
|
|
30
30
|
}
|
|
31
31
|
|
|
32
|
-
export {
|
|
32
|
+
export { useCommon };
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { onMounted, nextTick } from 'vue';
|
|
2
1
|
import { fabric } from '../utils/index.js';
|
|
3
2
|
import { drawLine, defaultBorderStyle } from './useDraw.js';
|
|
4
3
|
|
|
@@ -48,12 +47,8 @@ function useGrid(canvas, propItems, isBirthProcess = false) {
|
|
|
48
47
|
evented: false,
|
|
49
48
|
selectable: false
|
|
50
49
|
});
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
canvas.value.add(group);
|
|
54
|
-
canvas.value.sendToBack(group);
|
|
55
|
-
});
|
|
56
|
-
});
|
|
50
|
+
canvas.value.add(group);
|
|
51
|
+
canvas.value.sendToBack(group);
|
|
57
52
|
}
|
|
58
53
|
|
|
59
54
|
export { useGrid as default };
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { Ref } from 'vue';
|
|
2
2
|
import { fabric } from '../utils';
|
|
3
3
|
import { IPropItems } from '../interface';
|
|
4
|
-
|
|
4
|
+
import { AnyObject } from '../../../../../es/shared/types';
|
|
5
|
+
export declare function useLeft(canvas: Ref<fabric.Canvas>, propItems: IPropItems, emits: any, setPopup: Function, pointTipProps: any, cumputedX: Function, cumputedY: Function, getXValue: Function, getYValue: Function, isAddPoint: Function, updateData: Function, useCommon: AnyObject): {
|
|
5
6
|
drawScaleValue: (yScaleValueList: any[]) => void;
|
|
6
7
|
};
|
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
import { onMounted, nextTick } from 'vue';
|
|
2
1
|
import { fabric } from '../utils/index.js';
|
|
3
2
|
import { defaultBorderStyle, defaultTextStyle, defaultStyle, defaultRectStyle, drawPoint, drawTextGroup } from './useDraw.js';
|
|
4
|
-
import useCommmon from './useCommon.js';
|
|
5
3
|
|
|
6
|
-
function useLeft(canvas, propItems, emits, setPopup, pointTipProps, cumputedX, cumputedY, getXValue, getYValue, isAddPoint, updateData) {
|
|
7
|
-
|
|
4
|
+
function useLeft(canvas, propItems, emits, setPopup, pointTipProps, cumputedX, cumputedY, getXValue, getYValue, isAddPoint, updateData, useCommon) {
|
|
5
|
+
var _a, _b;
|
|
6
|
+
const { getEqualXTypes, repeatTip } = useCommon;
|
|
8
7
|
const {
|
|
9
8
|
originY,
|
|
10
9
|
endY,
|
|
@@ -98,23 +97,23 @@ function useLeft(canvas, propItems, emits, setPopup, pointTipProps, cumputedX, c
|
|
|
98
97
|
canvas.value.add(title, ...list);
|
|
99
98
|
title.sendToBack();
|
|
100
99
|
}
|
|
101
|
-
function drawScaleValue(
|
|
102
|
-
var
|
|
103
|
-
if (!(
|
|
100
|
+
function drawScaleValue(yScaleValueList2) {
|
|
101
|
+
var _a2;
|
|
102
|
+
if (!(yScaleValueList2 == null ? void 0 : yScaleValueList2.length))
|
|
104
103
|
return;
|
|
105
|
-
const { layout } =
|
|
104
|
+
const { layout } = yScaleValueList2[0];
|
|
106
105
|
let start = iconsWidth;
|
|
107
106
|
let end = originX;
|
|
108
107
|
if (layout === "right") {
|
|
109
108
|
start = endX;
|
|
110
|
-
end = endX + ((
|
|
109
|
+
end = endX + ((_a2 = right == null ? void 0 : right.width) != null ? _a2 : 0);
|
|
111
110
|
}
|
|
112
111
|
const groupList = [];
|
|
113
|
-
const column = !painHeight || layout === "right" ?
|
|
112
|
+
const column = !painHeight || layout === "right" ? yScaleValueList2.length : yScaleValueList2.length - 1;
|
|
114
113
|
const colWidth = (end - start) / column;
|
|
115
114
|
const residue = (end - start) % column;
|
|
116
115
|
const firstColWidth = colWidth + residue;
|
|
117
|
-
|
|
116
|
+
yScaleValueList2.forEach((item, index) => {
|
|
118
117
|
if (item.type === "pain") {
|
|
119
118
|
drwaPainScaleValue(item);
|
|
120
119
|
return;
|
|
@@ -309,23 +308,18 @@ function useLeft(canvas, propItems, emits, setPopup, pointTipProps, cumputedX, c
|
|
|
309
308
|
})
|
|
310
309
|
);
|
|
311
310
|
}
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
}
|
|
325
|
-
drawScaleValue(yScaleValueList);
|
|
326
|
-
drawBorder();
|
|
327
|
-
});
|
|
328
|
-
});
|
|
311
|
+
iconsWidth && drawIcons();
|
|
312
|
+
const yScaleValueList = left.yScaleValue.filter((v) => v.layout === "left" && v.type !== "pain" && v.show);
|
|
313
|
+
if ((right == null ? void 0 : right.width) && ((_a = right == null ? void 0 : right.yScaleValue) == null ? void 0 : _a.layout) === "left" && ((_b = right == null ? void 0 : right.yScaleValue) == null ? void 0 : _b.show)) {
|
|
314
|
+
yScaleValueList.push(getRightInfo);
|
|
315
|
+
}
|
|
316
|
+
if (painIndex > 0 && left.yScaleValue[painIndex].show) {
|
|
317
|
+
const painObj = left.yScaleValue[painIndex];
|
|
318
|
+
painIndex === 0 && left.yScaleValue.length > 1 && yScaleValueList.unshift(painObj);
|
|
319
|
+
painIndex == left.yScaleValue.length - 1 && yScaleValueList.push(painObj);
|
|
320
|
+
}
|
|
321
|
+
drawScaleValue(yScaleValueList);
|
|
322
|
+
drawBorder();
|
|
329
323
|
return {
|
|
330
324
|
drawScaleValue
|
|
331
325
|
};
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { onMounted, nextTick } from 'vue';
|
|
2
1
|
import { fabric } from '../utils/index.js';
|
|
3
2
|
import { defaultStyle } from './useDraw.js';
|
|
4
3
|
|
|
@@ -89,11 +88,7 @@ function useOther(canvas, propItems, cumputedX) {
|
|
|
89
88
|
trueHeight: texts.length * yCellHeight
|
|
90
89
|
});
|
|
91
90
|
}
|
|
92
|
-
|
|
93
|
-
nextTick(() => {
|
|
94
|
-
drawOther();
|
|
95
|
-
});
|
|
96
|
-
});
|
|
91
|
+
drawOther();
|
|
97
92
|
}
|
|
98
93
|
|
|
99
94
|
export { useOther };
|
|
@@ -1,27 +1,22 @@
|
|
|
1
|
-
import { onMounted, nextTick } from 'vue';
|
|
2
1
|
import { fabric } from '../utils/index.js';
|
|
3
2
|
import { defaultBorderStyle } from './useDraw.js';
|
|
4
3
|
|
|
5
4
|
function useRight(canvas, propItems, drawScaleValue) {
|
|
5
|
+
var _a, _b;
|
|
6
6
|
const { left, right, getRightInfo, canvasWidth, endY, endX, originY } = propItems;
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
const rightBorderLine2 = new fabric.Line([endX + 1, originY, canvasWidth - 1, originY], {
|
|
17
|
-
...defaultBorderStyle,
|
|
18
|
-
stroke: "#fff"
|
|
19
|
-
});
|
|
20
|
-
canvas.value.add(rightBorderLine, rightBorderLine2);
|
|
21
|
-
}
|
|
22
|
-
drawScaleValue(yScaleValueList);
|
|
7
|
+
const yScaleValueList = left.yScaleValue.filter((v) => v.layout === "right" && v.show);
|
|
8
|
+
if ((right == null ? void 0 : right.width) && ((_a = right == null ? void 0 : right.yScaleValue) == null ? void 0 : _a.layout) === "right" && ((_b = right == null ? void 0 : right.yScaleValue) == null ? void 0 : _b.show)) {
|
|
9
|
+
yScaleValueList.push(getRightInfo);
|
|
10
|
+
}
|
|
11
|
+
if ((right == null ? void 0 : right.width) || yScaleValueList.length > 0) {
|
|
12
|
+
const rightBorderLine = new fabric.Line([canvasWidth - 1, 0, canvasWidth - 1, endY], defaultBorderStyle);
|
|
13
|
+
const rightBorderLine2 = new fabric.Line([endX + 1, originY, canvasWidth - 1, originY], {
|
|
14
|
+
...defaultBorderStyle,
|
|
15
|
+
stroke: "#fff"
|
|
23
16
|
});
|
|
24
|
-
|
|
17
|
+
canvas.value.add(rightBorderLine, rightBorderLine2);
|
|
18
|
+
}
|
|
19
|
+
drawScaleValue(yScaleValueList);
|
|
25
20
|
}
|
|
26
21
|
|
|
27
22
|
export { useRight };
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { Ref } from 'vue';
|
|
2
|
+
import { fabric } from '../utils';
|
|
3
|
+
export default function useTemperatureChart(canvas: Ref<fabric.Canvas>, props: any, emits: any, canvasRef: Ref<any>): {
|
|
4
|
+
propItems: any;
|
|
5
|
+
redrawPoints: Ref<any>;
|
|
6
|
+
select: Ref<any>;
|
|
7
|
+
pointTipProps: {
|
|
8
|
+
show: boolean;
|
|
9
|
+
point: {
|
|
10
|
+
x: number;
|
|
11
|
+
y: number;
|
|
12
|
+
};
|
|
13
|
+
list: string[];
|
|
14
|
+
};
|
|
15
|
+
pointMenuProps: {
|
|
16
|
+
show: boolean;
|
|
17
|
+
point: {
|
|
18
|
+
x: number;
|
|
19
|
+
y: number;
|
|
20
|
+
};
|
|
21
|
+
list: any[];
|
|
22
|
+
target: any;
|
|
23
|
+
};
|
|
24
|
+
clickMenu: Ref<any>;
|
|
25
|
+
};
|
|
@@ -0,0 +1,339 @@
|
|
|
1
|
+
import { ref, reactive, computed, onMounted, nextTick } from 'vue';
|
|
2
|
+
import { defaultBorderStyle } from './useDraw.js';
|
|
3
|
+
import { useCumputedPoint } from './useCumputedPoint.js';
|
|
4
|
+
import { useTop } from './useTop.js';
|
|
5
|
+
import { useLeft } from './useLeft.js';
|
|
6
|
+
import { useRight } from './useRight.js';
|
|
7
|
+
import { useCenter } from './useCenter.js';
|
|
8
|
+
import { useBottom } from './useBottom.js';
|
|
9
|
+
import { useOther } from './useOther.js';
|
|
10
|
+
import { useEvent, useCanvasEvent } from './useEvent.js';
|
|
11
|
+
import '../utils/index.js';
|
|
12
|
+
import { useCommon } from './useCommon.js';
|
|
13
|
+
import 'lodash-es';
|
|
14
|
+
|
|
15
|
+
function useTemperatureChart(canvas, props, emits, canvasRef) {
|
|
16
|
+
const defaultHeight = 15;
|
|
17
|
+
const select = ref();
|
|
18
|
+
const redrawPoints = ref();
|
|
19
|
+
const clickMenu = ref();
|
|
20
|
+
const pointTipProps = reactive({
|
|
21
|
+
show: false,
|
|
22
|
+
point: { x: 0, y: 0 },
|
|
23
|
+
list: []
|
|
24
|
+
});
|
|
25
|
+
const pointMenuProps = reactive({
|
|
26
|
+
show: false,
|
|
27
|
+
point: { x: 0, y: 0 },
|
|
28
|
+
list: [],
|
|
29
|
+
target: null
|
|
30
|
+
});
|
|
31
|
+
const dateHeight = computed(() => {
|
|
32
|
+
const { top } = props.data;
|
|
33
|
+
return top.date.show && (top.date.height || defaultHeight) || 0;
|
|
34
|
+
});
|
|
35
|
+
const hospitalDaysHeight = computed(() => {
|
|
36
|
+
var _a;
|
|
37
|
+
const { top } = props.data;
|
|
38
|
+
return ((_a = top.hospitalDays) == null ? void 0 : _a.show) && (top.hospitalDays.height || defaultHeight) || 0;
|
|
39
|
+
});
|
|
40
|
+
const operationDaysHeight = computed(() => {
|
|
41
|
+
var _a;
|
|
42
|
+
const { top } = props.data;
|
|
43
|
+
return ((_a = top.operationDays) == null ? void 0 : _a.show) && (top.operationDays.height || defaultHeight) || 0;
|
|
44
|
+
});
|
|
45
|
+
const xScalevalueHeight = computed(() => {
|
|
46
|
+
var _a, _b, _c;
|
|
47
|
+
const { top } = props.data;
|
|
48
|
+
const height = ((_a = top.xScalevalue) == null ? void 0 : _a.show) && (top.xScalevalue.height || defaultHeight) || 0;
|
|
49
|
+
const dayHeight = ((_b = top.xScalevalue) == null ? void 0 : _b.show) ? (_c = top.dayHeight) != null ? _c : 0 : 0;
|
|
50
|
+
return height + dayHeight;
|
|
51
|
+
});
|
|
52
|
+
const breathingHeight = computed(() => {
|
|
53
|
+
var _a;
|
|
54
|
+
const { bottom } = props.data;
|
|
55
|
+
return ((_a = bottom == null ? void 0 : bottom.breathing) == null ? void 0 : _a.show) && (bottom.breathing.height || defaultHeight * 2) || 0;
|
|
56
|
+
});
|
|
57
|
+
const gridXNumber = computed(() => {
|
|
58
|
+
const { grid } = props.data;
|
|
59
|
+
return grid.mainXCell * grid.subXCell + grid.surplusXCell;
|
|
60
|
+
});
|
|
61
|
+
const gridYNumber = computed(() => {
|
|
62
|
+
const { grid } = props.data;
|
|
63
|
+
return grid.mainYCell * grid.subYCell + grid.surplusYCell;
|
|
64
|
+
});
|
|
65
|
+
const endX = computed(() => {
|
|
66
|
+
var _a;
|
|
67
|
+
const { width, right = null, top } = props.data;
|
|
68
|
+
if (!right)
|
|
69
|
+
return width;
|
|
70
|
+
const endWidth = (_a = right.width) != null ? _a : 0;
|
|
71
|
+
return width - endWidth;
|
|
72
|
+
});
|
|
73
|
+
const endXLimit = computed(() => {
|
|
74
|
+
const { grid } = props.data;
|
|
75
|
+
return endX.value - grid.surplusXCell * xCellWidth.value;
|
|
76
|
+
});
|
|
77
|
+
const originX = computed(() => {
|
|
78
|
+
const { top, left } = props.data;
|
|
79
|
+
const originX2 = top.titleWidth + iconsWidth.value;
|
|
80
|
+
return originX2;
|
|
81
|
+
});
|
|
82
|
+
const endY = computed(() => {
|
|
83
|
+
const { bottom = null, height } = props.data;
|
|
84
|
+
if (!bottom)
|
|
85
|
+
return height;
|
|
86
|
+
const endHeight = bottom.height || 30;
|
|
87
|
+
return height - endHeight;
|
|
88
|
+
});
|
|
89
|
+
const originY = computed(() => {
|
|
90
|
+
var _a;
|
|
91
|
+
const { top } = props.data;
|
|
92
|
+
const dayHeight = top.xScalevalue.show && ((_a = top.dayHeight) != null ? _a : 0) || 0;
|
|
93
|
+
const xScaleHeight = top.xScalevalue.show && (top.xScalevalue.height || defaultHeight) || 0;
|
|
94
|
+
const topHeight = dateHeight.value + dayHeight + xScaleHeight + hospitalDaysHeight.value + operationDaysHeight.value;
|
|
95
|
+
return topHeight;
|
|
96
|
+
});
|
|
97
|
+
const originYLimit = computed(() => {
|
|
98
|
+
const { grid } = props.data;
|
|
99
|
+
return originY.value + grid.surplusYCell * yCellHeight.value;
|
|
100
|
+
});
|
|
101
|
+
const xCellWidth = computed(() => {
|
|
102
|
+
return (endX.value - originX.value) / gridXNumber.value;
|
|
103
|
+
});
|
|
104
|
+
const yCellHeight = computed(() => {
|
|
105
|
+
return (endY.value - originY.value) / gridYNumber.value;
|
|
106
|
+
});
|
|
107
|
+
const iconsWidth = computed(() => {
|
|
108
|
+
var _a, _b;
|
|
109
|
+
const { left } = props.data;
|
|
110
|
+
return ((_a = left.icons) == null ? void 0 : _a.show) && (((_b = left.icons) == null ? void 0 : _b.width) || 100) || 0;
|
|
111
|
+
});
|
|
112
|
+
const xScaleList = computed(() => {
|
|
113
|
+
const { top } = props.data;
|
|
114
|
+
const dateList = top.date.list;
|
|
115
|
+
const times = top.xScalevalue.times;
|
|
116
|
+
let left = originX.value - xCellWidth.value;
|
|
117
|
+
function getDate(date) {
|
|
118
|
+
const [year = "2022", month = "01", day = "01"] = String(date).match(/\d+/g) || [];
|
|
119
|
+
return `20${year}`.slice(-4) + "-" + `00${month}`.slice(-2) + "-" + `00${day}`.slice(-2);
|
|
120
|
+
}
|
|
121
|
+
const timeList = dateList.map((item) => {
|
|
122
|
+
return times.map((v) => {
|
|
123
|
+
left += xCellWidth.value;
|
|
124
|
+
const start = new Date(`${getDate(item)} ${v.start}`).getTime();
|
|
125
|
+
const end = new Date(`${getDate(item)} ${v.end}`).getTime();
|
|
126
|
+
return {
|
|
127
|
+
start,
|
|
128
|
+
end,
|
|
129
|
+
left,
|
|
130
|
+
center: left + xCellWidth.value / 2,
|
|
131
|
+
scaleCell: (end - start) / xCellWidth.value
|
|
132
|
+
};
|
|
133
|
+
});
|
|
134
|
+
});
|
|
135
|
+
return timeList.flat();
|
|
136
|
+
});
|
|
137
|
+
const breatheYCell = computed(() => {
|
|
138
|
+
return computedYCell("breathe");
|
|
139
|
+
});
|
|
140
|
+
const pulseYCell = computed(() => {
|
|
141
|
+
return computedYCell("pulse");
|
|
142
|
+
});
|
|
143
|
+
const temperatureYCell = computed(() => {
|
|
144
|
+
return computedYCell("temperature");
|
|
145
|
+
});
|
|
146
|
+
const painYCell = computed(() => {
|
|
147
|
+
return computedYCell("pain");
|
|
148
|
+
});
|
|
149
|
+
const event = computed(() => {
|
|
150
|
+
var _a;
|
|
151
|
+
return ((_a = props.data.grid) == null ? void 0 : _a.event) || { selectable: true, evented: true, hovered: true };
|
|
152
|
+
});
|
|
153
|
+
const itemList = computed(() => {
|
|
154
|
+
const { left } = props.data;
|
|
155
|
+
return left.yScaleValue.map((item) => {
|
|
156
|
+
return item.dataList.map((v, dataIndex) => {
|
|
157
|
+
return {
|
|
158
|
+
...v,
|
|
159
|
+
bigType: item.type,
|
|
160
|
+
unit: item.unit,
|
|
161
|
+
dataIndex
|
|
162
|
+
};
|
|
163
|
+
});
|
|
164
|
+
}).flat();
|
|
165
|
+
});
|
|
166
|
+
const painIndex = computed(() => {
|
|
167
|
+
const { left } = props.data;
|
|
168
|
+
return left.yScaleValue.findIndex((v) => v.type === "pain");
|
|
169
|
+
});
|
|
170
|
+
const painHeight = computed(() => {
|
|
171
|
+
const { grid } = props.data;
|
|
172
|
+
return painIndex.value === -1 ? 0 : yCellHeight.value * grid.subYCell;
|
|
173
|
+
});
|
|
174
|
+
const painOriginY = computed(() => {
|
|
175
|
+
const { left } = props.data;
|
|
176
|
+
const obj = {
|
|
177
|
+
originY: endY.value,
|
|
178
|
+
endY: endY.value
|
|
179
|
+
};
|
|
180
|
+
if (painIndex.value === 0 && left.yScaleValue.length > 1) {
|
|
181
|
+
obj.originY = originYLimit.value;
|
|
182
|
+
obj.endY = originYLimit.value + painHeight.value;
|
|
183
|
+
} else if (painIndex.value === left.yScaleValue.length - 1) {
|
|
184
|
+
obj.originY = endY.value - painHeight.value;
|
|
185
|
+
obj.endY = endY.value;
|
|
186
|
+
}
|
|
187
|
+
return obj;
|
|
188
|
+
});
|
|
189
|
+
const vitalSignsOriginY = computed(() => {
|
|
190
|
+
const { left } = props.data;
|
|
191
|
+
const obj = {
|
|
192
|
+
originY: originY.value,
|
|
193
|
+
endY: endY.value
|
|
194
|
+
};
|
|
195
|
+
if (painIndex.value === 0 && left.yScaleValue.length > 1) {
|
|
196
|
+
obj.originY = originYLimit.value + painHeight.value;
|
|
197
|
+
obj.endY = endY.value;
|
|
198
|
+
} else if (painIndex.value === left.yScaleValue.length - 1) {
|
|
199
|
+
obj.originY = originYLimit.value;
|
|
200
|
+
obj.endY = endY.value - painHeight.value;
|
|
201
|
+
}
|
|
202
|
+
return obj;
|
|
203
|
+
});
|
|
204
|
+
const topList = computed(() => {
|
|
205
|
+
const { top } = props.data;
|
|
206
|
+
const topList2 = [];
|
|
207
|
+
for (const i in top) {
|
|
208
|
+
if (top[i].show) {
|
|
209
|
+
topList2.push({
|
|
210
|
+
...top[i],
|
|
211
|
+
key: i
|
|
212
|
+
});
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
return topList2.sort((a, b) => a.seq - b.seq);
|
|
216
|
+
});
|
|
217
|
+
const getRightInfo = computed(() => {
|
|
218
|
+
var _a;
|
|
219
|
+
const { left, right } = props.data;
|
|
220
|
+
const temperatureObj = left.yScaleValue.find((v) => v.type === "temperature");
|
|
221
|
+
const yScaleValue = (right == null ? void 0 : right.yScaleValue) || {};
|
|
222
|
+
if ((_a = temperatureObj == null ? void 0 : temperatureObj.list) == null ? void 0 : _a.length) {
|
|
223
|
+
Object.assign(yScaleValue, {
|
|
224
|
+
list: temperatureObj.list.map((v) => Math.floor((1.8 * v + 32) * 100) / 100),
|
|
225
|
+
spaceGridNumber: temperatureObj.spaceGridNumber
|
|
226
|
+
});
|
|
227
|
+
}
|
|
228
|
+
return yScaleValue;
|
|
229
|
+
});
|
|
230
|
+
const propItems = reactive({
|
|
231
|
+
canvasWidth: props.data.width,
|
|
232
|
+
canvasHeight: props.data.height,
|
|
233
|
+
borderStyle: props.data.borderStyle || defaultBorderStyle,
|
|
234
|
+
selectionStyle: props.data.selectionStyle || {},
|
|
235
|
+
dateHeight: dateHeight.value,
|
|
236
|
+
hospitalDaysHeight: hospitalDaysHeight.value,
|
|
237
|
+
operationDaysHeight: operationDaysHeight.value,
|
|
238
|
+
xScalevalueHeight: xScalevalueHeight.value,
|
|
239
|
+
topList: topList.value,
|
|
240
|
+
breathingHeight: breathingHeight.value,
|
|
241
|
+
hospitalizationDate: props.data.hospitalizationDate,
|
|
242
|
+
grid: props.data.grid,
|
|
243
|
+
top: props.data.top,
|
|
244
|
+
left: props.data.left,
|
|
245
|
+
right: props.data.right,
|
|
246
|
+
bottom: props.data.bottom,
|
|
247
|
+
other: props.data.other,
|
|
248
|
+
painIndex: painIndex.value,
|
|
249
|
+
painHeight: painHeight.value,
|
|
250
|
+
painOriginY: painOriginY.value,
|
|
251
|
+
vitalSignsOriginY: vitalSignsOriginY.value,
|
|
252
|
+
gridXNumber: gridXNumber.value,
|
|
253
|
+
gridYNumber: gridYNumber.value,
|
|
254
|
+
iconsWidth: iconsWidth.value,
|
|
255
|
+
originX: originX.value,
|
|
256
|
+
originY: originY.value,
|
|
257
|
+
originYLimit: originYLimit.value,
|
|
258
|
+
endX: endX.value,
|
|
259
|
+
endXLimit: endXLimit.value,
|
|
260
|
+
endY: endY.value,
|
|
261
|
+
xCellWidth: xCellWidth.value,
|
|
262
|
+
yCellHeight: yCellHeight.value,
|
|
263
|
+
xScaleList: xScaleList.value,
|
|
264
|
+
breatheYCell: breatheYCell.value,
|
|
265
|
+
pulseYCell: pulseYCell.value,
|
|
266
|
+
temperatureYCell: temperatureYCell.value,
|
|
267
|
+
painYCell: painYCell.value,
|
|
268
|
+
event: event.value,
|
|
269
|
+
itemList: itemList.value,
|
|
270
|
+
getRightInfo: getRightInfo.value,
|
|
271
|
+
config: props.data.config || {}
|
|
272
|
+
});
|
|
273
|
+
function computedYCell(type) {
|
|
274
|
+
const { yScaleValue } = props.data.left;
|
|
275
|
+
const item = yScaleValue.find((v) => v.type === type);
|
|
276
|
+
const list = (item == null ? void 0 : item.list) || [];
|
|
277
|
+
if (!list.length)
|
|
278
|
+
return 0;
|
|
279
|
+
return yCellHeight.value / ((list[1] - list[0]) / item.spaceGridNumber);
|
|
280
|
+
}
|
|
281
|
+
const { cumputedX, cumputedY, getXValue, getYValue } = useCumputedPoint(propItems);
|
|
282
|
+
const commonFunc = useCommon(canvas);
|
|
283
|
+
onMounted(() => {
|
|
284
|
+
nextTick(() => {
|
|
285
|
+
useTop(canvas, propItems);
|
|
286
|
+
const {
|
|
287
|
+
setPopup,
|
|
288
|
+
isAddPoint,
|
|
289
|
+
updateData,
|
|
290
|
+
redrawPoints: _redrawPoints,
|
|
291
|
+
clickMenu: _clickMenu
|
|
292
|
+
} = useCenter(
|
|
293
|
+
canvas,
|
|
294
|
+
propItems,
|
|
295
|
+
emits,
|
|
296
|
+
cumputedX,
|
|
297
|
+
cumputedY,
|
|
298
|
+
getXValue,
|
|
299
|
+
getYValue,
|
|
300
|
+
props.addRenderItem,
|
|
301
|
+
pointTipProps,
|
|
302
|
+
pointMenuProps,
|
|
303
|
+
commonFunc
|
|
304
|
+
);
|
|
305
|
+
redrawPoints.value = _redrawPoints;
|
|
306
|
+
clickMenu.value = _clickMenu;
|
|
307
|
+
const { drawScaleValue } = useLeft(
|
|
308
|
+
canvas,
|
|
309
|
+
propItems,
|
|
310
|
+
emits,
|
|
311
|
+
setPopup,
|
|
312
|
+
pointTipProps,
|
|
313
|
+
cumputedX,
|
|
314
|
+
cumputedY,
|
|
315
|
+
getXValue,
|
|
316
|
+
getYValue,
|
|
317
|
+
isAddPoint,
|
|
318
|
+
updateData,
|
|
319
|
+
commonFunc
|
|
320
|
+
);
|
|
321
|
+
useRight(canvas, propItems, drawScaleValue);
|
|
322
|
+
useBottom(canvas, propItems);
|
|
323
|
+
useOther(canvas, propItems, cumputedX);
|
|
324
|
+
useEvent(canvasRef.value);
|
|
325
|
+
const { select: _select } = useCanvasEvent(canvas, propItems, emits);
|
|
326
|
+
select.value = _select;
|
|
327
|
+
});
|
|
328
|
+
});
|
|
329
|
+
return {
|
|
330
|
+
propItems,
|
|
331
|
+
redrawPoints,
|
|
332
|
+
select,
|
|
333
|
+
pointTipProps,
|
|
334
|
+
pointMenuProps,
|
|
335
|
+
clickMenu
|
|
336
|
+
};
|
|
337
|
+
}
|
|
338
|
+
|
|
339
|
+
export { useTemperatureChart as default };
|