cnhis-design-vue 3.1.14-beta.0 → 3.1.14-beta.11
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 +1 -1
- package/es/packages/annotation-edit/index.d.ts +17 -0
- package/es/packages/annotation-edit/index.js +10 -0
- package/es/packages/annotation-edit/src/AnnotationEdit.d.ts +16 -0
- package/es/packages/annotation-edit/src/AnnotationEdit.js +119 -0
- package/es/packages/annotation-edit/style/index.css +15 -0
- package/es/packages/big-table/index.d.ts +2 -9
- package/es/packages/big-table/src/BigTable.vue.d.ts +30 -18
- package/es/packages/big-table/src/BigTable.vue_vue_type_script_setup_true_lang.js +53 -25
- package/es/packages/big-table/src/bigTableEmits.js +1 -1
- package/es/packages/big-table/src/components/edit-form/edit-separate.vue.d.ts +25 -8
- package/es/packages/big-table/src/components/edit-form/edit-separate.vue_vue_type_script_setup_true_lang.js +29 -9
- package/es/packages/big-table/src/components/separate.vue.d.ts +3 -4
- package/es/packages/big-table/src/components/separate.vue_vue_type_script_setup_true_lang.js +7 -3
- package/es/packages/big-table/src/hooks/useColumnConfigAdaptor.js +8 -4
- package/es/packages/big-table/src/hooks/useEdit.d.ts +25 -7
- package/es/packages/big-table/src/hooks/useSeparateRow.d.ts +1 -1
- package/es/packages/big-table/src/hooks/useSeparateRow.js +14 -10
- package/es/packages/big-table/src/utils.js +3 -3
- package/es/packages/big-table/style/index.css +15 -2
- package/es/packages/button-print/index.d.ts +1 -0
- package/es/packages/button-print/index.js +1 -0
- package/es/packages/button-print/src/ButtonPrint.vue_vue_type_script_setup_true_lang.js +5 -1
- package/es/packages/button-print/src/utils/index.d.ts +1 -0
- package/es/packages/button-print/src/utils/index.js +1 -0
- package/es/packages/button-print/src/utils/print.d.ts +1 -1
- package/es/packages/button-print/src/utils/print.js +1 -1
- package/es/packages/fabric-chart/index.d.ts +7 -2
- package/es/packages/fabric-chart/src/FabricChart.vue.d.ts +8 -3
- package/es/packages/fabric-chart/src/FabricChart.vue_vue_type_script_setup_true_lang.js +41 -9
- package/es/packages/fabric-chart/src/hooks/index.d.ts +1 -1
- package/es/packages/fabric-chart/src/hooks/index.js +2 -2
- package/es/packages/fabric-chart/src/hooks/useCenter.js +54 -33
- package/es/packages/fabric-chart/src/hooks/useDraw.js +1 -0
- package/es/packages/fabric-chart/src/hooks/useEvent.d.ts +6 -0
- package/es/packages/fabric-chart/src/hooks/useEvent.js +68 -1
- package/es/packages/fabric-chart/src/hooks/useLeft.js +14 -14
- package/es/packages/fabric-chart/src/hooks/useRight.js +2 -13
- package/es/packages/fabric-chart/src/hooks/useTop.js +10 -20
- package/es/packages/fabric-chart/src/interface.d.ts +7 -0
- package/es/packages/form-render/index.d.ts +1 -1
- package/es/packages/form-render/src/FormRender.vue.d.ts +1 -1
- package/es/packages/form-render/src/components/renderer/cascader.d.ts +3 -3
- package/es/packages/form-render/src/components/renderer/cascader.js +41 -52
- package/es/packages/form-render/src/components/renderer/formItem.js +8 -92
- package/es/packages/form-render/src/components/renderer/input.js +5 -16
- package/es/packages/form-render/src/components/renderer/inputNumber.d.ts +12 -0
- package/es/packages/form-render/src/components/renderer/inputNumber.js +11 -4
- package/es/packages/form-render/src/components/renderer/select.js +16 -10
- package/es/packages/form-render/src/components/renderer/simpleComponent.d.ts +15 -2
- package/es/packages/form-render/src/components/renderer/simpleComponent.js +16 -15
- package/es/packages/form-render/src/hooks/useAnchor.d.ts +1 -1
- package/es/packages/form-render/src/hooks/useAnchor.js +3 -3
- package/es/packages/form-render/src/hooks/useAsyncQueue.js +1 -1
- package/es/packages/form-render/src/hooks/useFieldListAdaptor.js +11 -7
- package/es/packages/form-render/src/hooks/useFormItemDeps.d.ts +2 -2
- package/es/packages/form-render/src/hooks/useFormItemDeps.js +5 -6
- package/es/packages/form-render/src/types/fieldItem.d.ts +2 -1
- package/es/packages/form-render/src/utils/index.d.ts +9 -2
- package/es/packages/form-render/src/utils/index.js +43 -14
- package/es/packages/form-render/style/index.css +17 -15
- package/es/packages/index.css +32 -17
- package/es/packages/index.d.ts +1 -0
- package/es/packages/index.js +1 -0
- package/es/packages/info-header/index.d.ts +1375 -358
- package/es/packages/info-header/src/HiddenContent.vue.d.ts +689 -178
- package/es/packages/info-header/src/HiddenContent.vue_vue_type_script_setup_true_lang.js +11 -13
- package/es/packages/info-header/src/InfoEllipsis.js +4 -0
- package/es/packages/info-header/src/InfoEllipsis.vue.d.ts +833 -0
- package/es/packages/info-header/src/InfoEllipsis.vue_vue_type_script_setup_true_lang.js +41 -0
- package/es/packages/info-header/src/InfoHeader.vue.d.ts +1375 -358
- package/es/packages/info-header/src/InfoHeader.vue_vue_type_script_setup_true_lang.js +9 -13
- package/es/{packages/info-header/src → src/components/SlotRender}/SlotRender.d.ts +3 -5
- package/es/{packages/info-header/src → src/components/SlotRender}/SlotRender.js +9 -9
- package/es/src/components/SlotRender/index.d.ts +2 -0
- package/es/src/components/SlotRender/index.js +2 -0
- package/global.d.ts +8 -8
- 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 =
|
|
181
|
-
obj.endY =
|
|
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 =
|
|
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 =
|
|
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,17 @@ 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
|
+
canvas
|
|
292
|
+
});
|
|
261
293
|
return (_ctx, _cache) => {
|
|
262
294
|
return openBlock(), createElementBlock(Fragment, null, [
|
|
263
295
|
createElementVNode("canvas", {
|
|
@@ -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';
|
|
@@ -38,6 +38,7 @@ function useCenter(canvas, propItems, emits, cumputedX, cumputedY, getXValue, ge
|
|
|
38
38
|
const shadowLinesCache = /* @__PURE__ */ new Set();
|
|
39
39
|
const maiboPoints = /* @__PURE__ */ new Set();
|
|
40
40
|
const otherPoints = /* @__PURE__ */ new Set();
|
|
41
|
+
const prevLines = /* @__PURE__ */ new Set();
|
|
41
42
|
onMounted(() => {
|
|
42
43
|
nextTick(() => {
|
|
43
44
|
init();
|
|
@@ -47,6 +48,7 @@ function useCenter(canvas, propItems, emits, cumputedX, cumputedY, getXValue, ge
|
|
|
47
48
|
drawShaDow();
|
|
48
49
|
maiboPoints.clear();
|
|
49
50
|
otherPoints.clear();
|
|
51
|
+
prevLines.clear();
|
|
50
52
|
left.yScaleValue.forEach((scaleValue) => {
|
|
51
53
|
drawPositionLine(scaleValue);
|
|
52
54
|
scaleValue.dataList.forEach((item, dataIndex) => {
|
|
@@ -88,19 +90,25 @@ function useCenter(canvas, propItems, emits, cumputedX, cumputedY, getXValue, ge
|
|
|
88
90
|
}
|
|
89
91
|
const [data1, data2] = copyDataList;
|
|
90
92
|
const getPoint = (item) => {
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
93
|
+
if (item.x && item.y) {
|
|
94
|
+
return {
|
|
95
|
+
x: item.x,
|
|
96
|
+
y: item.y
|
|
97
|
+
};
|
|
98
|
+
}
|
|
99
|
+
const point = getPointer(item, pulseObj);
|
|
100
|
+
if (point == null ? void 0 : point.length) {
|
|
101
|
+
return {
|
|
102
|
+
x: point[0],
|
|
103
|
+
y: point[1]
|
|
104
|
+
};
|
|
105
|
+
}
|
|
98
106
|
};
|
|
99
107
|
data1.list.forEach((item, index) => {
|
|
100
108
|
const point1 = getPoint(item);
|
|
101
109
|
const item2 = data2.list[index];
|
|
102
110
|
const point2 = item2 ? getPoint(item2) : null;
|
|
103
|
-
if (point2 && point1.x === point2.x && point1.y !== point2.y) {
|
|
111
|
+
if (point1 && point2 && point1.x === point2.x && point1.y !== point2.y) {
|
|
104
112
|
points1.push(point1);
|
|
105
113
|
points2.push(point2);
|
|
106
114
|
const itemPrev = data1.list[index - 1];
|
|
@@ -108,12 +116,12 @@ function useCenter(canvas, propItems, emits, cumputedX, cumputedY, getXValue, ge
|
|
|
108
116
|
const itemNext2 = data2.list[index + 1];
|
|
109
117
|
if (itemPrev && points1.length === 1) {
|
|
110
118
|
const point = getPoint(itemPrev);
|
|
111
|
-
points1.unshift(point);
|
|
119
|
+
point && points1.unshift(point);
|
|
112
120
|
}
|
|
113
121
|
if (itemNext && itemNext2) {
|
|
114
122
|
const pointNext = getPoint(itemNext);
|
|
115
123
|
const pointNext2 = getPoint(itemNext2);
|
|
116
|
-
if (pointNext.x === pointNext2.x && pointNext.y === pointNext2.y) {
|
|
124
|
+
if (pointNext && pointNext2 && pointNext.x === pointNext2.x && pointNext.y === pointNext2.y) {
|
|
117
125
|
points1.push(pointNext);
|
|
118
126
|
}
|
|
119
127
|
} else {
|
|
@@ -271,24 +279,10 @@ function useCenter(canvas, propItems, emits, cumputedX, cumputedY, getXValue, ge
|
|
|
271
279
|
const lineList = [];
|
|
272
280
|
const otherList = [];
|
|
273
281
|
item.list.forEach((v, index) => {
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
if (isEffectiveNode(v)) {
|
|
277
|
-
const x = cumputedX(v.time);
|
|
278
|
-
const y = cumputedY(scaleValue.type, scaleValue.list, v.value);
|
|
279
|
-
if (isLimit(v.time)) {
|
|
280
|
-
points = [x, y < newY.originY ? newY.originY : y > newY.endY ? newY.endY : y];
|
|
281
|
-
}
|
|
282
|
-
}
|
|
282
|
+
var _a;
|
|
283
|
+
const points = getPointer(v, scaleValue);
|
|
283
284
|
const nextV = item.list[index + 1];
|
|
284
|
-
|
|
285
|
-
if (isEffectiveNode(nextV)) {
|
|
286
|
-
const nextX = cumputedX(nextV.time);
|
|
287
|
-
const nextY = cumputedY(scaleValue.type, scaleValue.list, nextV.value);
|
|
288
|
-
if (isLimit(nextV.time)) {
|
|
289
|
-
nextPoint = [nextX, nextY < newY.originY ? newY.originY : nextY > newY.endY ? newY.endY : nextY];
|
|
290
|
-
}
|
|
291
|
-
}
|
|
285
|
+
const nextPoint = getPointer(nextV, scaleValue);
|
|
292
286
|
let coolLine, coolPoint, noRiseText, arrowGroup, verifiedText;
|
|
293
287
|
if (points && scaleValue.type === "temperature") {
|
|
294
288
|
if (v.noRise) {
|
|
@@ -349,13 +343,24 @@ function useCenter(canvas, propItems, emits, cumputedX, cumputedY, getXValue, ge
|
|
|
349
343
|
coolPoint && otherList.push(coolPoint);
|
|
350
344
|
}
|
|
351
345
|
}
|
|
352
|
-
let line;
|
|
353
346
|
let point;
|
|
354
|
-
let
|
|
355
|
-
|
|
356
|
-
...
|
|
357
|
-
|
|
358
|
-
|
|
347
|
+
let line;
|
|
348
|
+
if (points && nextPoint && !v.breakpoint) {
|
|
349
|
+
line = drawLine([...points, ...nextPoint], {
|
|
350
|
+
...lineAttr
|
|
351
|
+
});
|
|
352
|
+
} else if (points && !nextPoint && !v.breakpoint && scaleValue.type === "temperature" && dataIndex < scaleValue.dataList.length - 1 && index === item.list.length - 1) {
|
|
353
|
+
const nextV2 = (_a = scaleValue.dataList[dataIndex + 1].list) == null ? void 0 : _a[0];
|
|
354
|
+
const nextLinePoint = getPointer(nextV2, scaleValue);
|
|
355
|
+
line = nextLinePoint ? drawLine([...points, ...nextLinePoint], {
|
|
356
|
+
...lineAttr
|
|
357
|
+
}) : null;
|
|
358
|
+
nextLinePoint && prevLines.add({
|
|
359
|
+
dataIndex,
|
|
360
|
+
line
|
|
361
|
+
});
|
|
362
|
+
}
|
|
363
|
+
const previousLine = lineList[index - 1];
|
|
359
364
|
const pointAttrNew = {
|
|
360
365
|
origin: {
|
|
361
366
|
data: v,
|
|
@@ -385,6 +390,12 @@ function useCenter(canvas, propItems, emits, cumputedX, cumputedY, getXValue, ge
|
|
|
385
390
|
} else {
|
|
386
391
|
if (points) {
|
|
387
392
|
pointAttrNew.leftLine = null;
|
|
393
|
+
if (scaleValue.type === "temperature" && index === 0) {
|
|
394
|
+
const objLine = [...prevLines].find((v2) => v2.dataIndex === dataIndex - 1);
|
|
395
|
+
if (objLine) {
|
|
396
|
+
pointAttrNew.leftLine = objLine.line;
|
|
397
|
+
}
|
|
398
|
+
}
|
|
388
399
|
point = drawPoint(type, {
|
|
389
400
|
left: points[0],
|
|
390
401
|
top: points[1],
|
|
@@ -516,6 +527,16 @@ function useCenter(canvas, propItems, emits, cumputedX, cumputedY, getXValue, ge
|
|
|
516
527
|
const getTime = new Date(time).getTime();
|
|
517
528
|
return getTime >= minMinute && getTime <= maxMinute;
|
|
518
529
|
}
|
|
530
|
+
function getPointer(v, scaleValue) {
|
|
531
|
+
let points;
|
|
532
|
+
const objOriginY = scaleValue.type === "pain" ? painOriginY : vitalSignsOriginY;
|
|
533
|
+
if (isEffectiveNode(v) && isLimit(v.time)) {
|
|
534
|
+
const x = cumputedX(v.time);
|
|
535
|
+
const y = cumputedY(scaleValue.type, scaleValue.list, v.value);
|
|
536
|
+
points = [x, y < objOriginY.originY ? objOriginY.originY : y > objOriginY.endY ? objOriginY.endY : y];
|
|
537
|
+
}
|
|
538
|
+
return points;
|
|
539
|
+
}
|
|
519
540
|
function clickMenu({ item, target }) {
|
|
520
541
|
if (!target) {
|
|
521
542
|
emits("add", {
|
|
@@ -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,71 @@ 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
|
+
hasControls: false,
|
|
27
|
+
...selectionStyle
|
|
28
|
+
});
|
|
29
|
+
canvas.value.add(rect);
|
|
30
|
+
rect.on("mousedown", () => {
|
|
31
|
+
emits("select", key);
|
|
32
|
+
});
|
|
33
|
+
return rect;
|
|
34
|
+
}
|
|
35
|
+
function initSelection() {
|
|
36
|
+
if (typeof (selectionStyle == null ? void 0 : selectionStyle.evented) === "boolean" && !(selectionStyle == null ? void 0 : selectionStyle.evented))
|
|
37
|
+
return;
|
|
38
|
+
const selections2 = [];
|
|
39
|
+
selections2.push(drawRect({
|
|
40
|
+
left: iconsWidth,
|
|
41
|
+
top: originY + 1,
|
|
42
|
+
width: originX - iconsWidth,
|
|
43
|
+
height: endY - originY - 3
|
|
44
|
+
}, "left"));
|
|
45
|
+
let topY = 0;
|
|
46
|
+
topList.forEach((item, index) => {
|
|
47
|
+
if (index > 0) {
|
|
48
|
+
topY += propItems[`${topList[index - 1].key}Height`];
|
|
49
|
+
}
|
|
50
|
+
selections2.push(drawRect({
|
|
51
|
+
left: iconsWidth,
|
|
52
|
+
top: topY + 1,
|
|
53
|
+
width: endX - iconsWidth,
|
|
54
|
+
height: propItems[`${item.key}Height`] - 1
|
|
55
|
+
}, item.key));
|
|
56
|
+
});
|
|
57
|
+
selections2.push(drawRect({
|
|
58
|
+
left: originX,
|
|
59
|
+
top: originY + 1,
|
|
60
|
+
width: endX - originX,
|
|
61
|
+
height: endY - originY - 3
|
|
62
|
+
}, "grid"));
|
|
63
|
+
canvas.value.renderAll();
|
|
64
|
+
return selections2;
|
|
65
|
+
}
|
|
66
|
+
const selections = initSelection();
|
|
67
|
+
function select(key) {
|
|
68
|
+
canvas.value.discardActiveObject();
|
|
69
|
+
canvas.value.renderAll();
|
|
70
|
+
const obj = selections == null ? void 0 : selections.find((obj2) => obj2.key === key);
|
|
71
|
+
obj == null ? void 0 : obj.bringToFront();
|
|
72
|
+
obj && canvas.value.setActiveObject(obj);
|
|
73
|
+
}
|
|
74
|
+
return { select };
|
|
75
|
+
}
|
|
9
76
|
|
|
10
|
-
export { useEvent };
|
|
77
|
+
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
167
|
+
const list = JSON.parse(JSON.stringify(itemList));
|
|
168
168
|
let topY = endY;
|
|
169
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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: () =>
|
|
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: () =>
|
|
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
|
};
|
|
@@ -17,7 +17,7 @@ export declare const SEARCH_CASCADE: import("vue").DefineComponent<{
|
|
|
17
17
|
type: PropType<AnyObject[]>;
|
|
18
18
|
default: () => never[];
|
|
19
19
|
};
|
|
20
|
-
|
|
20
|
+
depth: {
|
|
21
21
|
type: (NumberConstructor | StringConstructor)[];
|
|
22
22
|
required: true;
|
|
23
23
|
};
|
|
@@ -34,7 +34,7 @@ export declare const SEARCH_CASCADE: import("vue").DefineComponent<{
|
|
|
34
34
|
type: PropType<AnyObject[]>;
|
|
35
35
|
default: () => never[];
|
|
36
36
|
};
|
|
37
|
-
|
|
37
|
+
depth: {
|
|
38
38
|
type: (NumberConstructor | StringConstructor)[];
|
|
39
39
|
required: true;
|
|
40
40
|
};
|