cnhis-design-vue 3.1.17-beta.0 → 3.1.17-beta.1
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/components/separate.js +1 -1
- package/es/packages/big-table/src/hooks/useSeparateRow.js +2 -2
- package/es/packages/fabric-chart/index.d.ts +2 -0
- package/es/packages/fabric-chart/src/FabricChart.js +20 -5
- package/es/packages/fabric-chart/src/FabricChart.vue.d.ts +2 -0
- package/es/packages/fabric-chart/src/hooks/useCenter.js +19 -18
- package/es/packages/fabric-chart/src/hooks/useLeft.d.ts +3 -1
- package/es/packages/fabric-chart/src/hooks/useLeft.js +30 -12
- package/es/packages/fabric-chart/src/hooks/useRight.d.ts +1 -1
- package/es/packages/fabric-chart/src/hooks/useRight.js +11 -69
- package/es/packages/fabric-chart/src/interface.d.ts +3 -0
- package/es/packages/form-config/src/components/FormConfigCreator.js +2 -0
- package/es/packages/form-config/src/components/FormConfigEdit.js +1 -0
- package/es/packages/form-config/src/hooks/useConfigurationField.js +9 -9
- package/es/packages/form-render/index.js +1 -1
- package/es/packages/form-render/src/hooks/index.d.ts +1 -1
- package/es/packages/form-render/src/hooks/index.js +1 -1
- package/es/packages/form-render/src/hooks/useBusinessBinding.d.ts +5 -6
- package/es/packages/form-render/src/hooks/useBusinessBinding.js +22 -20
- package/es/packages/form-render/src/hooks/useFieldListAdaptor.js +4 -4
- package/es/packages/form-render/src/hooks/useFieldNormalize.d.ts +5 -0
- package/es/packages/form-render/src/hooks/useFieldNormalize.js +58 -0
- package/es/packages/form-render/src/hooks/useFieldVisitor.js +1 -5
- package/es/packages/index.js +1 -1
- package/es/src/utils/tapable/AsyncParallelBailHook.d.ts +3 -0
- package/es/src/utils/tapable/AsyncParallelBailHook.js +78 -0
- package/es/src/utils/tapable/AsyncParallelHook.d.ts +3 -0
- package/es/src/utils/tapable/AsyncParallelHook.js +27 -0
- package/es/src/utils/tapable/AsyncSeriesBailHook.d.ts +3 -0
- package/es/src/utils/tapable/AsyncSeriesBailHook.js +33 -0
- package/es/src/utils/tapable/AsyncSeriesHook.d.ts +3 -0
- package/es/src/utils/tapable/AsyncSeriesHook.js +27 -0
- package/es/src/utils/tapable/AsyncSeriesLoopHook.d.ts +3 -0
- package/es/src/utils/tapable/AsyncSeriesLoopHook.js +27 -0
- package/es/src/utils/tapable/AsyncSeriesWaterfallHook.d.ts +3 -0
- package/es/src/utils/tapable/AsyncSeriesWaterfallHook.js +40 -0
- package/es/src/utils/tapable/Hook.d.ts +50 -0
- package/es/src/utils/tapable/Hook.js +140 -0
- package/es/src/utils/tapable/HookCodeFactory.d.ts +58 -0
- package/es/src/utils/tapable/HookCodeFactory.js +444 -0
- package/es/src/utils/tapable/HookMap.d.ts +11 -0
- package/es/src/utils/tapable/HookMap.js +32 -0
- package/es/src/utils/tapable/MultiHook.d.ts +12 -0
- package/es/src/utils/tapable/MultiHook.js +38 -0
- package/es/src/utils/tapable/SyncBailHook.d.ts +3 -0
- package/es/src/utils/tapable/SyncBailHook.js +40 -0
- package/es/src/utils/tapable/SyncHook.d.ts +3 -0
- package/es/src/utils/tapable/SyncHook.js +34 -0
- package/es/src/utils/tapable/SyncLoopHook.d.ts +3 -0
- package/es/src/utils/tapable/SyncLoopHook.js +34 -0
- package/es/src/utils/tapable/SyncWaterfallHook.d.ts +3 -0
- package/es/src/utils/tapable/SyncWaterfallHook.js +48 -0
- package/es/src/utils/tapable/index.d.ts +139 -0
- package/es/src/utils/tapable/index.js +12 -0
- package/package.json +1 -1
- package/es/packages/form-render/src/hooks/useTypeNormalize.d.ts +0 -4
- package/es/packages/form-render/src/hooks/useTypeNormalize.js +0 -46
|
@@ -3,7 +3,7 @@ import { useSeparateMap } from '../../../../packages/big-table/src/hooks/useSepa
|
|
|
3
3
|
import _export_sfc from '../../../../_virtual/plugin-vue_export-helper.js';
|
|
4
4
|
|
|
5
5
|
const _hoisted_1 = { class: "big-table__separate" };
|
|
6
|
-
const _hoisted_2 = /* @__PURE__ */ createElementVNode("span", { class: "big-table__separatePlaceholder" },
|
|
6
|
+
const _hoisted_2 = /* @__PURE__ */ createElementVNode("span", { class: "big-table__separatePlaceholder" }, /* @__PURE__ */ toDisplayString(` `), -1);
|
|
7
7
|
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
8
8
|
__name: "separate",
|
|
9
9
|
props: {
|
|
@@ -89,7 +89,7 @@ function useSeparateRow(getColumnConfig, getFieldItem, $VXETable) {
|
|
|
89
89
|
separateDataMap.value.set(row, {
|
|
90
90
|
row,
|
|
91
91
|
rawRow: rawData[dataIndex],
|
|
92
|
-
index,
|
|
92
|
+
index: dataIndex,
|
|
93
93
|
separateData
|
|
94
94
|
});
|
|
95
95
|
row.$__SEPARATE_DATA = [separateData];
|
|
@@ -99,7 +99,7 @@ function useSeparateRow(getColumnConfig, getFieldItem, $VXETable) {
|
|
|
99
99
|
separateDataMap.value.set(data2, {
|
|
100
100
|
row: data2,
|
|
101
101
|
rawRow: rawData[dataIndex],
|
|
102
|
-
index,
|
|
102
|
+
index: dataIndex,
|
|
103
103
|
separateData
|
|
104
104
|
});
|
|
105
105
|
row.$__SEPARATE_DATA.push(separateData);
|
|
@@ -52,6 +52,7 @@ declare const FabricChart: SFCWithInstall<import("vue").DefineComponent<{
|
|
|
52
52
|
endY: number;
|
|
53
53
|
}>;
|
|
54
54
|
topList: import("vue").ComputedRef<import("./src/interface").IDate[]>;
|
|
55
|
+
getRightInfo: import("vue").ComputedRef<any>;
|
|
55
56
|
propItems: any;
|
|
56
57
|
computedYCell: (type: import("./src/interface").IPointType) => number;
|
|
57
58
|
cumputedX: (value: string | number) => any;
|
|
@@ -81,6 +82,7 @@ declare const FabricChart: SFCWithInstall<import("vue").DefineComponent<{
|
|
|
81
82
|
}) => void;
|
|
82
83
|
setPopup: (point: any) => void;
|
|
83
84
|
getEqualXTypes: (pointX: number) => import("./src/interface").IPointType[];
|
|
85
|
+
drawScaleValue: (yScaleValueList: any[]) => void;
|
|
84
86
|
PopupTip: import("vue").DefineComponent<{
|
|
85
87
|
show: {
|
|
86
88
|
type: BooleanConstructor;
|
|
@@ -65,10 +65,11 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
65
65
|
return grid.mainYCell * grid.subYCell + grid.surplusYCell;
|
|
66
66
|
});
|
|
67
67
|
const endX = computed(() => {
|
|
68
|
+
var _a;
|
|
68
69
|
const { width, right = null, top } = props.data;
|
|
69
70
|
if (!right)
|
|
70
71
|
return width;
|
|
71
|
-
const endWidth = right.width
|
|
72
|
+
const endWidth = (_a = right.width) != null ? _a : 0;
|
|
72
73
|
return width - endWidth;
|
|
73
74
|
});
|
|
74
75
|
const endXLimit = computed(() => {
|
|
@@ -148,7 +149,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
148
149
|
});
|
|
149
150
|
const event = computed(() => {
|
|
150
151
|
var _a;
|
|
151
|
-
return ((_a = props.data.grid) == null ? void 0 : _a.event) || { selectable: true, evented: true };
|
|
152
|
+
return ((_a = props.data.grid) == null ? void 0 : _a.event) || { selectable: true, evented: true, hovered: true };
|
|
152
153
|
});
|
|
153
154
|
const itemList = computed(() => {
|
|
154
155
|
const { left } = props.data;
|
|
@@ -214,6 +215,19 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
214
215
|
}
|
|
215
216
|
return topList2.sort((a, b) => a.seq - b.seq);
|
|
216
217
|
});
|
|
218
|
+
const getRightInfo = computed(() => {
|
|
219
|
+
var _a;
|
|
220
|
+
const { left, right } = props.data;
|
|
221
|
+
const temperatureObj = left.yScaleValue.find((v) => v.type === "temperature");
|
|
222
|
+
const yScaleValue = (right == null ? void 0 : right.yScaleValue) || {};
|
|
223
|
+
if ((_a = temperatureObj == null ? void 0 : temperatureObj.list) == null ? void 0 : _a.length) {
|
|
224
|
+
Object.assign(yScaleValue, {
|
|
225
|
+
list: temperatureObj.list.map((v) => Math.floor((1.8 * v + 32) * 100) / 100),
|
|
226
|
+
spaceGridNumber: temperatureObj.spaceGridNumber
|
|
227
|
+
});
|
|
228
|
+
}
|
|
229
|
+
return yScaleValue;
|
|
230
|
+
});
|
|
217
231
|
const propItems = reactive({
|
|
218
232
|
canvasWidth: props.data.width,
|
|
219
233
|
canvasHeight: props.data.height,
|
|
@@ -252,7 +266,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
252
266
|
temperatureYCell: temperatureYCell.value,
|
|
253
267
|
painYCell: painYCell.value,
|
|
254
268
|
event: event.value,
|
|
255
|
-
itemList: itemList.value
|
|
269
|
+
itemList: itemList.value,
|
|
270
|
+
getRightInfo: getRightInfo.value
|
|
256
271
|
});
|
|
257
272
|
function computedYCell(type) {
|
|
258
273
|
const { yScaleValue } = props.data.left;
|
|
@@ -265,8 +280,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
265
280
|
const { cumputedX, cumputedY, getXValue, getYValue } = useCumputedPoint(propItems);
|
|
266
281
|
useTop(canvas, propItems);
|
|
267
282
|
const { pointTipProps, pointMenuProps, clickMenu, setPopup, getEqualXTypes } = useCenter(canvas, propItems, emits, cumputedX, cumputedY, getXValue, getYValue, props.addRenderItem);
|
|
268
|
-
useLeft(canvas, propItems, emits, setPopup, pointTipProps, getXValue, getYValue, getEqualXTypes);
|
|
269
|
-
useRight(canvas, propItems);
|
|
283
|
+
const { drawScaleValue } = useLeft(canvas, propItems, emits, setPopup, pointTipProps, getXValue, getYValue, getEqualXTypes);
|
|
284
|
+
useRight(canvas, propItems, drawScaleValue);
|
|
270
285
|
useBottom(canvas, propItems);
|
|
271
286
|
useOther(canvas, propItems, cumputedX);
|
|
272
287
|
onMounted(() => {
|
|
@@ -53,6 +53,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
53
53
|
endY: number;
|
|
54
54
|
}>;
|
|
55
55
|
topList: import("vue").ComputedRef<IDate[]>;
|
|
56
|
+
getRightInfo: import("vue").ComputedRef<any>;
|
|
56
57
|
propItems: any;
|
|
57
58
|
computedYCell: (type: IPointType) => number;
|
|
58
59
|
cumputedX: (value: string | number) => any;
|
|
@@ -82,6 +83,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
82
83
|
}) => void;
|
|
83
84
|
setPopup: (point: any) => void;
|
|
84
85
|
getEqualXTypes: (pointX: number) => IPointType[];
|
|
86
|
+
drawScaleValue: (yScaleValueList: any[]) => void;
|
|
85
87
|
PopupTip: import("vue").DefineComponent<{
|
|
86
88
|
show: {
|
|
87
89
|
type: BooleanConstructor;
|
|
@@ -31,8 +31,7 @@ function useCenter(canvas, propItems, emits, cumputedX, cumputedY, getXValue, ge
|
|
|
31
31
|
originY,
|
|
32
32
|
endY,
|
|
33
33
|
itemList,
|
|
34
|
-
|
|
35
|
-
painHeight,
|
|
34
|
+
event,
|
|
36
35
|
vitalSignsOriginY,
|
|
37
36
|
painOriginY
|
|
38
37
|
} = propItems;
|
|
@@ -131,23 +130,23 @@ function useCenter(canvas, propItems, emits, cumputedX, cumputedY, getXValue, ge
|
|
|
131
130
|
function setCanvasEvent() {
|
|
132
131
|
if (!propItems.event.evented)
|
|
133
132
|
return;
|
|
134
|
-
canvas.value.on("mouse:up", (
|
|
133
|
+
canvas.value.on("mouse:up", (event2) => {
|
|
135
134
|
var _a;
|
|
136
|
-
if (
|
|
137
|
-
const { x = 0, y = 0 } =
|
|
135
|
+
if (event2.button === 3) {
|
|
136
|
+
const { x = 0, y = 0 } = event2.pointer || {};
|
|
138
137
|
if (x >= originX && x <= endX && y >= originY && y <= endY) {
|
|
139
138
|
pointTipProps.show = false;
|
|
140
139
|
pointMenuProps.point = { x, y };
|
|
141
140
|
pointMenuProps.show = true;
|
|
142
|
-
const { type } = ((_a =
|
|
143
|
-
if (
|
|
141
|
+
const { type } = ((_a = event2.target) == null ? void 0 : _a.origin) || {};
|
|
142
|
+
if (event2.target && (type === "temperature" || type === "pain")) {
|
|
144
143
|
if (type === "temperature") {
|
|
145
144
|
pointMenuProps.list = [...TEMPERATURE_MENU];
|
|
146
145
|
}
|
|
147
146
|
if (type === "pain") {
|
|
148
147
|
pointMenuProps.list = [...PAIN_MENU];
|
|
149
148
|
}
|
|
150
|
-
pointMenuProps.target =
|
|
149
|
+
pointMenuProps.target = event2.target;
|
|
151
150
|
} else {
|
|
152
151
|
pointMenuProps.target = null;
|
|
153
152
|
pointMenuProps.list = ["\u65B0\u589E\u8282\u70B9"];
|
|
@@ -162,7 +161,7 @@ function useCenter(canvas, propItems, emits, cumputedX, cumputedY, getXValue, ge
|
|
|
162
161
|
dataIndex: v.dataIndex,
|
|
163
162
|
key: v.key
|
|
164
163
|
},
|
|
165
|
-
pointer:
|
|
164
|
+
pointer: event2.pointer
|
|
166
165
|
});
|
|
167
166
|
}
|
|
168
167
|
});
|
|
@@ -397,21 +396,23 @@ function useCenter(canvas, propItems, emits, cumputedX, cumputedY, getXValue, ge
|
|
|
397
396
|
});
|
|
398
397
|
}
|
|
399
398
|
function setPointEvent(point) {
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
399
|
+
if (event.hovered) {
|
|
400
|
+
point.on("mouseover", () => {
|
|
401
|
+
setPopup(point);
|
|
402
|
+
});
|
|
403
|
+
point.on("mouseout", () => {
|
|
404
|
+
pointTipProps.show = false;
|
|
405
|
+
});
|
|
406
|
+
}
|
|
406
407
|
point.on("moving", () => {
|
|
407
408
|
moveLimit(point);
|
|
408
409
|
updateLine(point);
|
|
409
410
|
canvas.value.renderAll();
|
|
410
|
-
setPopup(point);
|
|
411
|
+
event.hovered && setPopup(point);
|
|
411
412
|
});
|
|
412
|
-
point.on("mouseup:before", (
|
|
413
|
+
point.on("mouseup:before", (event2) => {
|
|
413
414
|
pointTipProps.show = false;
|
|
414
|
-
if (
|
|
415
|
+
if (event2.e.button === 0) {
|
|
415
416
|
const { type } = point.origin;
|
|
416
417
|
const value = getYValue(type, point.top);
|
|
417
418
|
emits("change", {
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import { Ref } from 'vue';
|
|
2
2
|
import { fabric } from '../utils';
|
|
3
3
|
import { IPropItems } from '../interface';
|
|
4
|
-
export declare function useLeft(canvas: Ref<fabric.Canvas>, propItems: IPropItems, emits: any, setPopup: Function, pointTipProps: any, getXValue: Function, getYValue: Function, getEqualXTypes: Function):
|
|
4
|
+
export declare function useLeft(canvas: Ref<fabric.Canvas>, propItems: IPropItems, emits: any, setPopup: Function, pointTipProps: any, getXValue: Function, getYValue: Function, getEqualXTypes: Function): {
|
|
5
|
+
drawScaleValue: (yScaleValueList: any[]) => void;
|
|
6
|
+
};
|
|
@@ -16,8 +16,8 @@ function useLeft(canvas, propItems, emits, setPopup, pointTipProps, getXValue, g
|
|
|
16
16
|
iconsWidth,
|
|
17
17
|
itemList,
|
|
18
18
|
painIndex,
|
|
19
|
-
|
|
20
|
-
|
|
19
|
+
right,
|
|
20
|
+
getRightInfo
|
|
21
21
|
} = propItems;
|
|
22
22
|
const mainScaleWidth = 9;
|
|
23
23
|
const subScaleWidth = 5;
|
|
@@ -88,13 +88,23 @@ function useLeft(canvas, propItems, emits, setPopup, pointTipProps, getXValue, g
|
|
|
88
88
|
canvas.value.add(title, ...list);
|
|
89
89
|
title.sendToBack();
|
|
90
90
|
}
|
|
91
|
-
function drawScaleValue() {
|
|
91
|
+
function drawScaleValue(yScaleValueList) {
|
|
92
|
+
var _a;
|
|
93
|
+
if (!(yScaleValueList == null ? void 0 : yScaleValueList.length))
|
|
94
|
+
return;
|
|
95
|
+
const { layout } = yScaleValueList[0];
|
|
96
|
+
let start = iconsWidth;
|
|
97
|
+
let end = originX;
|
|
98
|
+
if (layout === "right") {
|
|
99
|
+
start = endX;
|
|
100
|
+
end = endX + ((_a = right == null ? void 0 : right.width) != null ? _a : 0);
|
|
101
|
+
}
|
|
92
102
|
const groupList = [];
|
|
93
|
-
const column = !painHeight ?
|
|
94
|
-
const colWidth = (
|
|
95
|
-
const residue = (
|
|
103
|
+
const column = !painHeight || layout === "right" ? yScaleValueList.length : yScaleValueList.length - 1;
|
|
104
|
+
const colWidth = (end - start) / column;
|
|
105
|
+
const residue = (end - start) % column;
|
|
96
106
|
const firstColWidth = colWidth + residue;
|
|
97
|
-
|
|
107
|
+
yScaleValueList.forEach((item, index) => {
|
|
98
108
|
if (item.type === "pain") {
|
|
99
109
|
drwaPainScaleValue(item);
|
|
100
110
|
return;
|
|
@@ -108,7 +118,7 @@ function useLeft(canvas, propItems, emits, setPopup, pointTipProps, getXValue, g
|
|
|
108
118
|
list.push(line2);
|
|
109
119
|
}
|
|
110
120
|
const rectWidth = index === 0 ? firstColWidth : colWidth;
|
|
111
|
-
const rectLeft = index === 0 ?
|
|
121
|
+
const rectLeft = index === 0 ? start : firstColWidth + start + (index - 1) * colWidth;
|
|
112
122
|
const line = index > 0 ? new fabric.Line([rectLeft, painIndex == 0 ? vitalSignsOriginY.originY : originY, rectLeft, vitalSignsOriginY.endY], {
|
|
113
123
|
...defaultBorderStyle
|
|
114
124
|
}) : null;
|
|
@@ -157,9 +167,9 @@ function useLeft(canvas, propItems, emits, setPopup, pointTipProps, getXValue, g
|
|
|
157
167
|
});
|
|
158
168
|
groupList.push(new fabric.Rect({
|
|
159
169
|
...defaultRectStyle,
|
|
160
|
-
width:
|
|
161
|
-
height: endY - originY,
|
|
162
|
-
left:
|
|
170
|
+
width: layout === "right" ? end - start - 1 : end - start,
|
|
171
|
+
height: layout === "right" ? endY - originY - 1 : endY - originY,
|
|
172
|
+
left: start,
|
|
163
173
|
top: originY,
|
|
164
174
|
originX: "left",
|
|
165
175
|
originY: "top"
|
|
@@ -249,11 +259,19 @@ function useLeft(canvas, propItems, emits, setPopup, pointTipProps, getXValue, g
|
|
|
249
259
|
}
|
|
250
260
|
onMounted(() => {
|
|
251
261
|
nextTick(() => {
|
|
262
|
+
var _a;
|
|
252
263
|
iconsWidth && drawIcons();
|
|
253
|
-
|
|
264
|
+
const yScaleValueList = left.yScaleValue.filter((v) => v.layout === "left" || v.type === "pain");
|
|
265
|
+
if ((right == null ? void 0 : right.width) && ((_a = right == null ? void 0 : right.yScaleValue) == null ? void 0 : _a.layout) === "left") {
|
|
266
|
+
yScaleValueList.push(getRightInfo);
|
|
267
|
+
}
|
|
268
|
+
drawScaleValue(yScaleValueList);
|
|
254
269
|
canvas.value.renderAll();
|
|
255
270
|
});
|
|
256
271
|
});
|
|
272
|
+
return {
|
|
273
|
+
drawScaleValue
|
|
274
|
+
};
|
|
257
275
|
}
|
|
258
276
|
|
|
259
277
|
export { useLeft };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { Ref } from 'vue';
|
|
2
2
|
import { fabric } from '../utils';
|
|
3
3
|
import { IPropItems } from '../interface';
|
|
4
|
-
export declare function useRight(canvas: Ref<fabric.Canvas>, propItems: IPropItems): void;
|
|
4
|
+
export declare function useRight(canvas: Ref<fabric.Canvas>, propItems: IPropItems, drawScaleValue: Function): void;
|
|
@@ -1,77 +1,19 @@
|
|
|
1
1
|
import { onMounted, nextTick } from 'vue';
|
|
2
2
|
import { fabric } from '../utils/index.js';
|
|
3
|
-
import { defaultBorderStyle
|
|
3
|
+
import { defaultBorderStyle } from './useDraw.js';
|
|
4
4
|
|
|
5
|
-
function useRight(canvas, propItems) {
|
|
6
|
-
const {
|
|
7
|
-
function drawScaleValue() {
|
|
8
|
-
var _a, _b, _c;
|
|
9
|
-
if (!right) {
|
|
10
|
-
canvas.value.add(new fabric.Line([canvasWidth - 1, 0, canvasWidth - 1, canvasHeight], defaultBorderStyle));
|
|
11
|
-
return false;
|
|
12
|
-
}
|
|
13
|
-
const list = [];
|
|
14
|
-
list.push(new fabric.Rect({
|
|
15
|
-
...defaultRectStyle,
|
|
16
|
-
width: canvasWidth - endX - 1,
|
|
17
|
-
height: endY + breathingHeight - 1,
|
|
18
|
-
left: endX,
|
|
19
|
-
top: 0,
|
|
20
|
-
originX: "left",
|
|
21
|
-
originY: "top"
|
|
22
|
-
}));
|
|
23
|
-
const difVal = 6;
|
|
24
|
-
const spaceScaleNumber = right.yScaleValue.spaceScaleNumber || 5;
|
|
25
|
-
const mainScaleWidth = 9;
|
|
26
|
-
const subScaleWidth = 5;
|
|
27
|
-
const cList = left.yScaleValue.find((v) => v.type === "temperature").list;
|
|
28
|
-
const minC = Math.min(...cList);
|
|
29
|
-
const h1 = right.yScaleValue.list[1];
|
|
30
|
-
const h0 = right.yScaleValue.list[0];
|
|
31
|
-
const c1 = 5 * (h1 - 32) / 9;
|
|
32
|
-
const c0 = 5 * (h0 - 32) / 9;
|
|
33
|
-
const top1 = vitalSignsOriginY.endY - (c1 - minC) * temperatureYCell - difVal;
|
|
34
|
-
const top0 = vitalSignsOriginY.endY - (c0 - minC) * temperatureYCell - difVal;
|
|
35
|
-
const spaceHVaule = (top0 - top1) / spaceScaleNumber;
|
|
36
|
-
let endTop = 0;
|
|
37
|
-
right.yScaleValue.list.forEach((v, i) => {
|
|
38
|
-
var _a2;
|
|
39
|
-
const c = 5 * (+v - 32) / 9;
|
|
40
|
-
const top = vitalSignsOriginY.endY - (c - minC) * temperatureYCell - difVal;
|
|
41
|
-
if (i === right.yScaleValue.list.length - 1)
|
|
42
|
-
endTop = top;
|
|
43
|
-
const text = new fabric.Text(`${v}\xB0`, {
|
|
44
|
-
left: endX + mainScaleWidth,
|
|
45
|
-
top: i === 0 ? vitalSignsOriginY.endY - 5 : top - 5,
|
|
46
|
-
originX: "left",
|
|
47
|
-
...((_a2 = right.yScaleValue) == null ? void 0 : _a2.style) || {}
|
|
48
|
-
});
|
|
49
|
-
list.push(text);
|
|
50
|
-
const spaceHVaule0 = (vitalSignsOriginY.endY - top1) / spaceScaleNumber;
|
|
51
|
-
for (let k = 0; k < spaceScaleNumber; k++) {
|
|
52
|
-
const scaleTop = i === 0 ? vitalSignsOriginY.endY - k * spaceHVaule0 : top - k * spaceHVaule;
|
|
53
|
-
const line = new fabric.Line([endX, scaleTop, k > 0 ? endX + subScaleWidth : endX + mainScaleWidth, scaleTop], {
|
|
54
|
-
...defaultBorderStyle
|
|
55
|
-
});
|
|
56
|
-
list.push(line);
|
|
57
|
-
}
|
|
58
|
-
});
|
|
59
|
-
const width = canvasWidth - endX;
|
|
60
|
-
const unit = right.yScaleValue.unit ? new fabric.Text((_b = (_a = right.yScaleValue) == null ? void 0 : _a.unit) == null ? void 0 : _b.split("").join("\n"), {
|
|
61
|
-
left: endX + width / 2,
|
|
62
|
-
top: endTop / 2,
|
|
63
|
-
originX: "center",
|
|
64
|
-
...((_c = right.yScaleValue) == null ? void 0 : _c.style) || {}
|
|
65
|
-
}) : null;
|
|
66
|
-
unit && list.push(unit);
|
|
67
|
-
const group = list.length > 0 ? new fabric.Group([...list], { ...defaultStyle }) : null;
|
|
68
|
-
group && canvas.value.add(group);
|
|
69
|
-
group && group.sendToBack();
|
|
70
|
-
}
|
|
5
|
+
function useRight(canvas, propItems, drawScaleValue) {
|
|
6
|
+
const { left, right, getRightInfo, canvasWidth, endY } = propItems;
|
|
71
7
|
onMounted(() => {
|
|
72
8
|
nextTick(() => {
|
|
73
|
-
|
|
74
|
-
|
|
9
|
+
var _a;
|
|
10
|
+
const yScaleValueList = left.yScaleValue.filter((v) => v.layout === "right");
|
|
11
|
+
if ((right == null ? void 0 : right.width) && ((_a = right == null ? void 0 : right.yScaleValue) == null ? void 0 : _a.layout) === "right") {
|
|
12
|
+
yScaleValueList.push(getRightInfo);
|
|
13
|
+
const rightBorderLine = new fabric.Line([canvasWidth - 1, 0, canvasWidth - 1, endY], defaultBorderStyle);
|
|
14
|
+
canvas.value.add(rightBorderLine);
|
|
15
|
+
}
|
|
16
|
+
drawScaleValue(yScaleValueList);
|
|
75
17
|
});
|
|
76
18
|
});
|
|
77
19
|
}
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import { InjectionKey, Ref } from 'vue';
|
|
2
2
|
import { fabric } from './utils';
|
|
3
|
+
import { AnyObject } from '../../../../es/src/types';
|
|
3
4
|
interface IEvent {
|
|
4
5
|
selectable: boolean;
|
|
5
6
|
evented: boolean;
|
|
7
|
+
hovered: boolean;
|
|
6
8
|
}
|
|
7
9
|
interface ImainLineStyle {
|
|
8
10
|
x: fabric.ILineOptions;
|
|
@@ -60,6 +62,7 @@ export interface IPropItems {
|
|
|
60
62
|
painYCell: number;
|
|
61
63
|
event: Partial<IEvent>;
|
|
62
64
|
itemList: Array<any>;
|
|
65
|
+
getRightInfo: AnyObject;
|
|
63
66
|
}
|
|
64
67
|
export interface IPoint {
|
|
65
68
|
time: string;
|
|
@@ -50,6 +50,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
50
50
|
]),
|
|
51
51
|
default: withCtx(() => [
|
|
52
52
|
createVNode(unref(FormRender), {
|
|
53
|
+
column: "12",
|
|
53
54
|
ref_key: "lineBreakFormRef",
|
|
54
55
|
ref: lineBreakFormRef,
|
|
55
56
|
"initial-data": unref(pick)(initialData, ["layoutWidthEnum"]),
|
|
@@ -77,6 +78,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
77
78
|
]),
|
|
78
79
|
default: withCtx(() => [
|
|
79
80
|
createVNode(unref(FormRender), {
|
|
81
|
+
column: "12",
|
|
80
82
|
ref_key: "linebarFormRef",
|
|
81
83
|
ref: linebarFormRef,
|
|
82
84
|
"initial-data": initialData,
|
|
@@ -54,6 +54,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
54
54
|
return openBlock(), createElementBlock(Fragment, null, [
|
|
55
55
|
(openBlock(), createBlock(unref(CFormRender), {
|
|
56
56
|
key: key.value,
|
|
57
|
+
column: "12",
|
|
57
58
|
ref_key: "formRenderRef",
|
|
58
59
|
ref: formRenderRef,
|
|
59
60
|
size: "small",
|
|
@@ -2,24 +2,24 @@ import { EditAbleField, widgetWidthOptionConfig, isShowOptionConfig, isNotFoldOp
|
|
|
2
2
|
|
|
3
3
|
function useConfigurationField() {
|
|
4
4
|
const fieldMap = /* @__PURE__ */ new Map([
|
|
5
|
-
[EditAbleField.NAME, { alias: "\u540D\u79F0", elem_width:
|
|
6
|
-
[EditAbleField.NOTES, { alias: "\u95EE\u53F7\u63D0\u793A", elem_width:
|
|
5
|
+
[EditAbleField.NAME, { alias: "\u540D\u79F0", elem_width: 6, is_null: "0", html_type: "INPUT" }],
|
|
6
|
+
[EditAbleField.NOTES, { alias: "\u95EE\u53F7\u63D0\u793A", elem_width: 6, html_type: "INPUT" }],
|
|
7
7
|
[
|
|
8
8
|
EditAbleField.DEFAULT_VALUE,
|
|
9
|
-
{ alias: "\u9ED8\u8BA4\u503C", elem_width:
|
|
9
|
+
{ alias: "\u9ED8\u8BA4\u503C", elem_width: 6, html_type: "INPUT", validate: { max_length: 20 } }
|
|
10
10
|
],
|
|
11
11
|
[
|
|
12
12
|
EditAbleField.LAYOUT_WIDTH_ENUM,
|
|
13
|
-
{ alias: "\u5BBD\u5EA6", fieldType: "number", html_type: "SELECT", elem_width:
|
|
13
|
+
{ alias: "\u5BBD\u5EA6", fieldType: "number", html_type: "SELECT", elem_width: 6, ...widgetWidthOptionConfig() }
|
|
14
14
|
],
|
|
15
|
-
[EditAbleField.DESC, { alias: "\u8BF4\u660E\u6587\u672C", elem_width:
|
|
15
|
+
[EditAbleField.DESC, { alias: "\u8BF4\u660E\u6587\u672C", elem_width: 6, html_type: "INPUT", validate: { max_length: 30 } }],
|
|
16
16
|
[
|
|
17
17
|
EditAbleField.DEFAULT_EXPAND,
|
|
18
|
-
{ alias: "\u662F\u5426\u9ED8\u8BA4\u5C55\u5F00", html_type: "SWITCH", elem_width:
|
|
18
|
+
{ alias: "\u662F\u5426\u9ED8\u8BA4\u5C55\u5F00", html_type: "SWITCH", elem_width: 6, ...isShowOptionConfig() }
|
|
19
19
|
],
|
|
20
|
-
[EditAbleField.FOLD, { alias: "\u662F\u5426\u53EF\u6298\u53E0", html_type: "SWITCH", elem_width:
|
|
21
|
-
[EditAbleField.EDITABLE, { alias: "\u662F\u5426\u53EF\u7F16\u8F91", html_type: "SWITCH", elem_width:
|
|
22
|
-
[EditAbleField.REQUIRED, { alias: "\u662F\u5426\u5FC5\u586B", html_type: "SWITCH", elem_width:
|
|
20
|
+
[EditAbleField.FOLD, { alias: "\u662F\u5426\u53EF\u6298\u53E0", html_type: "SWITCH", elem_width: 6, ...isNotFoldOptionConfig() }],
|
|
21
|
+
[EditAbleField.EDITABLE, { alias: "\u662F\u5426\u53EF\u7F16\u8F91", html_type: "SWITCH", elem_width: 6, ...isEditOptionConfig() }],
|
|
22
|
+
[EditAbleField.REQUIRED, { alias: "\u662F\u5426\u5FC5\u586B", html_type: "SWITCH", elem_width: 6, ...isNullOptionConfig() }]
|
|
23
23
|
]);
|
|
24
24
|
function generateFieldListByKeys(keyList) {
|
|
25
25
|
return keyList.map((key) => {
|
|
@@ -7,7 +7,7 @@ export { useCommonLog } from './src/hooks/useCommonLog.js';
|
|
|
7
7
|
export { useFormField } from './src/hooks/useFormField.js';
|
|
8
8
|
export { AsyncQueue, useAsyncQueue } from './src/hooks/useAsyncQueue.js';
|
|
9
9
|
export { useFieldVisitor } from './src/hooks/useFieldVisitor.js';
|
|
10
|
-
export {
|
|
10
|
+
export { useFieldNormalize } from './src/hooks/useFieldNormalize.js';
|
|
11
11
|
export { useFormValidator } from './src/hooks/useFormValidator.js';
|
|
12
12
|
export { BusinessCollector, useBusinessBinding } from './src/hooks/useBusinessBinding.js';
|
|
13
13
|
export { ContextCollector, useChangeContext } from './src/hooks/useChangeContext.js';
|
|
@@ -4,7 +4,7 @@ export * from './useCommonLog';
|
|
|
4
4
|
export * from './useFormField';
|
|
5
5
|
export * from './useAsyncQueue';
|
|
6
6
|
export * from './useFieldVisitor';
|
|
7
|
-
export * from './
|
|
7
|
+
export * from './useFieldNormalize';
|
|
8
8
|
export * from './useFormValidator';
|
|
9
9
|
export * from './useBusinessBinding';
|
|
10
10
|
export * from './useChangeContext';
|
|
@@ -4,7 +4,7 @@ export { useCommonLog } from './useCommonLog.js';
|
|
|
4
4
|
export { useFormField } from './useFormField.js';
|
|
5
5
|
export { AsyncQueue, useAsyncQueue } from './useAsyncQueue.js';
|
|
6
6
|
export { useFieldVisitor } from './useFieldVisitor.js';
|
|
7
|
-
export {
|
|
7
|
+
export { useFieldNormalize } from './useFieldNormalize.js';
|
|
8
8
|
export { useFormValidator } from './useFormValidator.js';
|
|
9
9
|
export { BusinessCollector, useBusinessBinding } from './useBusinessBinding.js';
|
|
10
10
|
export { ContextCollector, useChangeContext } from './useChangeContext.js';
|
|
@@ -12,12 +12,11 @@ export declare class BusinessCollector {
|
|
|
12
12
|
private getField;
|
|
13
13
|
private getType;
|
|
14
14
|
private getValueByField;
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
private
|
|
20
|
-
private handlerChangeMap;
|
|
15
|
+
getValueByType(type: FIELD_BUSINESS_TYPE): unknown;
|
|
16
|
+
setValueByType(type: FIELD_BUSINESS_TYPE, value: unknown, force?: boolean): void;
|
|
17
|
+
registerChangeBusiness(type: FIELD_BUSINESS_TYPE, handler: () => void): this;
|
|
18
|
+
registerBlurBusiness(type: FIELD_BUSINESS_TYPE, handler: () => void): this;
|
|
19
|
+
private changeHandlerMap;
|
|
21
20
|
private blurHandlerMap;
|
|
22
21
|
trigger(fieldName: string, triggerType?: 'change' | 'blur'): void;
|
|
23
22
|
}
|
|
@@ -10,14 +10,8 @@ class BusinessCollector {
|
|
|
10
10
|
this.businessFormatter = businessFormatter;
|
|
11
11
|
this.typeCollector = /* @__PURE__ */ new Map();
|
|
12
12
|
this.fieldNameCollector = /* @__PURE__ */ new Map();
|
|
13
|
-
this.
|
|
14
|
-
|
|
15
|
-
[FIELD_BUSINESS_TYPE.AGE_UNIT, this.handlerAgeType.bind(this)]
|
|
16
|
-
]);
|
|
17
|
-
this.blurHandlerMap = /* @__PURE__ */ new Map([
|
|
18
|
-
[FIELD_BUSINESS_TYPE.BIRTHDAY, this.handlerBirthdayType.bind(this)],
|
|
19
|
-
[FIELD_BUSINESS_TYPE.AGE, this.handlerAgeType.bind(this)]
|
|
20
|
-
]);
|
|
13
|
+
this.changeHandlerMap = /* @__PURE__ */ new Map([]);
|
|
14
|
+
this.blurHandlerMap = /* @__PURE__ */ new Map([]);
|
|
21
15
|
}
|
|
22
16
|
formatter(...args) {
|
|
23
17
|
return isFunction(this.businessFormatter) ? this.businessFormatter(...args) : args[0].value;
|
|
@@ -48,7 +42,23 @@ class BusinessCollector {
|
|
|
48
42
|
state.value = this.formatter({ value, type, fieldKey: field });
|
|
49
43
|
});
|
|
50
44
|
}
|
|
51
|
-
|
|
45
|
+
registerChangeBusiness(type, handler) {
|
|
46
|
+
this.changeHandlerMap.set(type, handler);
|
|
47
|
+
return this;
|
|
48
|
+
}
|
|
49
|
+
registerBlurBusiness(type, handler) {
|
|
50
|
+
this.blurHandlerMap.set(type, handler);
|
|
51
|
+
return this;
|
|
52
|
+
}
|
|
53
|
+
trigger(fieldName, triggerType = "change") {
|
|
54
|
+
var _a, _b;
|
|
55
|
+
const type = this.getType(fieldName);
|
|
56
|
+
const handlerMaps = { change: this.changeHandlerMap, blur: this.blurHandlerMap };
|
|
57
|
+
type && ((_b = (_a = handlerMaps[triggerType]) == null ? void 0 : _a.get(type)) == null ? void 0 : _b.call(this));
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
function useBusinessBinding() {
|
|
61
|
+
function handlerIdCardType() {
|
|
52
62
|
const idCard = this.getValueByType(FIELD_BUSINESS_TYPE.ID_CARD);
|
|
53
63
|
if (!idCard || !isString(idCard) || !isIdCard(idCard))
|
|
54
64
|
return;
|
|
@@ -59,7 +69,7 @@ class BusinessCollector {
|
|
|
59
69
|
this.setValueByType(FIELD_BUSINESS_TYPE.SEX, info.sex);
|
|
60
70
|
this.setValueByType(FIELD_BUSINESS_TYPE.BIRTHDAY, info.birthday);
|
|
61
71
|
}
|
|
62
|
-
handlerBirthdayType() {
|
|
72
|
+
function handlerBirthdayType() {
|
|
63
73
|
const birthday = this.getValueByType(FIELD_BUSINESS_TYPE.BIRTHDAY);
|
|
64
74
|
if (!isString(birthday))
|
|
65
75
|
return;
|
|
@@ -67,7 +77,7 @@ class BusinessCollector {
|
|
|
67
77
|
this.setValueByType(FIELD_BUSINESS_TYPE.AGE_UNIT, ageUnit);
|
|
68
78
|
this.setValueByType(FIELD_BUSINESS_TYPE.AGE, age);
|
|
69
79
|
}
|
|
70
|
-
handlerAgeType() {
|
|
80
|
+
function handlerAgeType() {
|
|
71
81
|
const age = this.getValueByType(FIELD_BUSINESS_TYPE.AGE);
|
|
72
82
|
const ageUnit = this.getValueByType(FIELD_BUSINESS_TYPE.AGE_UNIT);
|
|
73
83
|
if (!isString(age) && !isNumber(age) || age === "")
|
|
@@ -76,16 +86,8 @@ class BusinessCollector {
|
|
|
76
86
|
return;
|
|
77
87
|
this.setValueByType(FIELD_BUSINESS_TYPE.BIRTHDAY, parseAge2Birthday(+age, ageUnit), false);
|
|
78
88
|
}
|
|
79
|
-
trigger(fieldName, triggerType = "change") {
|
|
80
|
-
var _a;
|
|
81
|
-
const type = this.getType(fieldName);
|
|
82
|
-
const handler = triggerType === "change" ? this.handlerChangeMap : triggerType === "blur" ? this.blurHandlerMap : null;
|
|
83
|
-
type && ((_a = handler == null ? void 0 : handler.get(type)) == null ? void 0 : _a());
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
function useBusinessBinding() {
|
|
87
89
|
function create(formModel, formatter) {
|
|
88
|
-
return new BusinessCollector(formModel, formatter);
|
|
90
|
+
return new BusinessCollector(formModel, formatter).registerChangeBusiness(FIELD_BUSINESS_TYPE.ID_CARD, handlerIdCardType).registerChangeBusiness(FIELD_BUSINESS_TYPE.AGE_UNIT, handlerAgeType).registerBlurBusiness(FIELD_BUSINESS_TYPE.BIRTHDAY, handlerBirthdayType).registerBlurBusiness(FIELD_BUSINESS_TYPE.AGE, handlerAgeType);
|
|
89
91
|
}
|
|
90
92
|
return { create };
|
|
91
93
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { isObject } from '@vueuse/core';
|
|
2
|
-
import { pick } from 'lodash-es';
|
|
3
|
-
import { useFormValidator,
|
|
2
|
+
import { cloneDeep, pick } from 'lodash-es';
|
|
3
|
+
import { useFormValidator, useFieldNormalize } from '../../../../packages/form-render';
|
|
4
4
|
import { arrayed, parseNumberFromMaybeString, formRenderLog } from '../utils/index.js';
|
|
5
5
|
import { fieldKeyEscape, createLinebarId } from '../utils/schema.js';
|
|
6
6
|
import { transformDateFormat } from '../utils/business.js';
|
|
@@ -208,12 +208,12 @@ function useFieldListAdaptor(collector) {
|
|
|
208
208
|
properties: schemaAdaptor(fieldList)
|
|
209
209
|
};
|
|
210
210
|
};
|
|
211
|
-
const {
|
|
211
|
+
const { FieldNormalizeWaterfallHook } = useFieldNormalize();
|
|
212
212
|
function schemaAdaptor(fieldList) {
|
|
213
213
|
let prevLinebar = null;
|
|
214
214
|
return fieldList.reduce((fin, cur, idx) => {
|
|
215
215
|
var _a;
|
|
216
|
-
|
|
216
|
+
cur = FieldNormalizeWaterfallHook.call(cloneDeep(cur));
|
|
217
217
|
const obj_type = (_a = cur.validate) == null ? void 0 : _a.obj_type;
|
|
218
218
|
obj_type && collector.collect(obj_type, cur.val_key);
|
|
219
219
|
if (cur.html_type === "LINEBAR") {
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { SyncWaterfallHook } from '../../../../../es/src/utils/tapable';
|
|
2
|
+
import { FieldItem } from '../types';
|
|
3
|
+
export declare function useFieldNormalize(): {
|
|
4
|
+
FieldNormalizeWaterfallHook: SyncWaterfallHook<FieldItem, import("../../../../../es/src/utils/tapable").UnsetAdditionalOptions>;
|
|
5
|
+
};
|