cnhis-design-vue 3.1.17-beta.0 → 3.1.17-beta.3
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/index.d.ts +115 -1
- package/es/packages/form-config/src/FormConfig.js +11 -17
- package/es/packages/form-config/src/FormConfig.vue.d.ts +115 -1
- package/es/packages/form-config/src/components/CloseButton.js +45 -0
- package/es/packages/form-config/src/components/CloseButton.vue.d.ts +1499 -0
- package/es/packages/form-config/src/components/ComplexNode.js +45 -0
- package/es/packages/form-config/src/components/ComplexNode.vue.d.ts +1661 -0
- package/es/packages/form-config/src/components/DefaultNode.js +54 -0
- package/es/packages/form-config/src/components/DefaultNode.vue.d.ts +1543 -0
- package/es/packages/form-config/src/components/FormConfigCreator.js +3 -1
- package/es/packages/form-config/src/components/FormConfigDragDisplay.js +43 -0
- package/es/packages/form-config/src/components/FormConfigDragDisplay.vue.d.ts +114 -0
- package/es/packages/form-config/src/components/FormConfigEdit.js +1 -0
- package/es/packages/form-config/src/components/FormConfigEdit.vue.d.ts +2 -0
- package/es/packages/form-config/src/constants/index.d.ts +2 -0
- package/es/packages/form-config/src/constants/index.js +5 -2
- package/es/packages/form-config/src/hooks/useConfigurationField.js +9 -9
- package/es/packages/form-config/src/hooks/usePresetRenderer.d.ts +2 -2
- package/es/packages/form-config/src/hooks/usePresetRenderer.js +6 -84
- package/es/packages/form-config/src/hooks/useSortable.js +3 -7
- package/es/packages/form-config/src/types/index.d.ts +2 -1
- package/es/packages/form-config/src/utils/index.d.ts +8 -1
- package/es/packages/form-config/src/utils/index.js +23 -9
- package/es/packages/form-config/style/index.css +26 -5
- 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.css +26 -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;
|
|
@@ -42,6 +42,7 @@ declare const FormConfig: SFCWithInstall<import("vue").DefineComponent<{
|
|
|
42
42
|
notes?: string | undefined;
|
|
43
43
|
desc?: string | undefined;
|
|
44
44
|
children?: any[] | undefined;
|
|
45
|
+
__new?: boolean | undefined;
|
|
45
46
|
}[]>;
|
|
46
47
|
materialListRef: import("vue").Ref<{
|
|
47
48
|
key: string;
|
|
@@ -57,9 +58,10 @@ declare const FormConfig: SFCWithInstall<import("vue").DefineComponent<{
|
|
|
57
58
|
notes?: string | undefined;
|
|
58
59
|
desc?: string | undefined;
|
|
59
60
|
children?: any[] | undefined;
|
|
61
|
+
__new?: boolean | undefined;
|
|
60
62
|
}[]>;
|
|
61
63
|
addItem: (fieldItem: import("./src/types").FormConfigItem) => void;
|
|
62
|
-
|
|
64
|
+
parsedTextFormatter: import("./src/types").FormConfigTextFormatter;
|
|
63
65
|
getRenderer: (fieldItem: import("./src/types").FormConfigItem) => import("vue").Component<any, any, any, import("vue").ComputedOptions, import("vue").MethodOptions> | import("vue").FunctionalComponent<{}, {}>;
|
|
64
66
|
currentEditField: import("vue").Ref<import("./src/types").FormConfigItem | undefined>;
|
|
65
67
|
formConfigEditRef: import("vue").Ref<{
|
|
@@ -138,6 +140,116 @@ declare const FormConfig: SFCWithInstall<import("vue").DefineComponent<{
|
|
|
138
140
|
modelValue: unknown[];
|
|
139
141
|
componentData: Record<string, any>;
|
|
140
142
|
}>;
|
|
143
|
+
FormConfigDragDisplay: import("vue").DefineComponent<{
|
|
144
|
+
fieldItem: {
|
|
145
|
+
type: import("vue").PropType<import("./src/types").FormConfigItem>;
|
|
146
|
+
};
|
|
147
|
+
getRenderer: {
|
|
148
|
+
type: import("../../../es/src/types").Func<any[], any>;
|
|
149
|
+
require: boolean;
|
|
150
|
+
};
|
|
151
|
+
textFormatter: {
|
|
152
|
+
type: import("vue").PropType<import("./src/types").FormConfigTextFormatter>;
|
|
153
|
+
required: true;
|
|
154
|
+
};
|
|
155
|
+
}, {
|
|
156
|
+
getItemColumnStyle: (fieldItem?: import("./src/types").FormConfigItem | undefined) => {
|
|
157
|
+
'--item-column': number;
|
|
158
|
+
};
|
|
159
|
+
commonConfig: {
|
|
160
|
+
onMove: ({ to, from }: import("sortablejs").SortableEvent) => void;
|
|
161
|
+
onChoose: ({ target, item }: import("sortablejs").SortableEvent) => void;
|
|
162
|
+
onUnchoose: ({ from, to, target, item }: import("sortablejs").SortableEvent) => void;
|
|
163
|
+
tag: string;
|
|
164
|
+
animation: string;
|
|
165
|
+
'item-key': string;
|
|
166
|
+
};
|
|
167
|
+
Draggable: import("vue").DefineComponent<{
|
|
168
|
+
list: {
|
|
169
|
+
type: ArrayConstructor;
|
|
170
|
+
required: boolean;
|
|
171
|
+
default: any;
|
|
172
|
+
};
|
|
173
|
+
modelValue: {
|
|
174
|
+
type: ArrayConstructor;
|
|
175
|
+
required: boolean;
|
|
176
|
+
default: any;
|
|
177
|
+
};
|
|
178
|
+
itemKey: {
|
|
179
|
+
type: (StringConstructor | FunctionConstructor)[];
|
|
180
|
+
required: boolean;
|
|
181
|
+
};
|
|
182
|
+
clone: {
|
|
183
|
+
type: FunctionConstructor;
|
|
184
|
+
default: (original: any) => any;
|
|
185
|
+
};
|
|
186
|
+
tag: {
|
|
187
|
+
type: StringConstructor;
|
|
188
|
+
default: string;
|
|
189
|
+
};
|
|
190
|
+
move: {
|
|
191
|
+
type: FunctionConstructor;
|
|
192
|
+
default: any;
|
|
193
|
+
};
|
|
194
|
+
componentData: {
|
|
195
|
+
type: ObjectConstructor;
|
|
196
|
+
required: boolean;
|
|
197
|
+
default: any;
|
|
198
|
+
};
|
|
199
|
+
}, unknown, {
|
|
200
|
+
error: boolean;
|
|
201
|
+
}, {
|
|
202
|
+
realList(): any;
|
|
203
|
+
getKey(): any;
|
|
204
|
+
}, {
|
|
205
|
+
getUnderlyingVm(domElement: any): any;
|
|
206
|
+
getUnderlyingPotencialDraggableComponent(htmElement: any): any;
|
|
207
|
+
emitChanges(evt: any): void;
|
|
208
|
+
alterList(onList: any): void;
|
|
209
|
+
spliceList(): void;
|
|
210
|
+
updatePosition(oldIndex: any, newIndex: any): void;
|
|
211
|
+
getRelatedContextFromMoveEvent({ to, related }: {
|
|
212
|
+
to: any;
|
|
213
|
+
related: any;
|
|
214
|
+
}): any;
|
|
215
|
+
getVmIndexFromDomIndex(domIndex: any): any;
|
|
216
|
+
onDragStart(evt: any): void;
|
|
217
|
+
onDragAdd(evt: any): void;
|
|
218
|
+
onDragRemove(evt: any): void;
|
|
219
|
+
onDragUpdate(evt: any): void;
|
|
220
|
+
computeFutureIndex(relatedContext: any, evt: any): any;
|
|
221
|
+
onDragMove(evt: any, originalEvent: any): any;
|
|
222
|
+
onDragEnd(): void;
|
|
223
|
+
}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, any[], any, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<{
|
|
224
|
+
move: Function;
|
|
225
|
+
tag: string;
|
|
226
|
+
clone: Function;
|
|
227
|
+
list: unknown[];
|
|
228
|
+
modelValue: unknown[];
|
|
229
|
+
componentData: Record<string, any>;
|
|
230
|
+
} & {
|
|
231
|
+
itemKey?: string | Function | undefined;
|
|
232
|
+
}>, {
|
|
233
|
+
move: Function;
|
|
234
|
+
tag: string;
|
|
235
|
+
clone: Function;
|
|
236
|
+
list: unknown[];
|
|
237
|
+
modelValue: unknown[];
|
|
238
|
+
componentData: Record<string, any>;
|
|
239
|
+
}>;
|
|
240
|
+
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, Record<string, any>, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
241
|
+
fieldItem: {
|
|
242
|
+
type: import("vue").PropType<import("./src/types").FormConfigItem>;
|
|
243
|
+
};
|
|
244
|
+
getRenderer: {
|
|
245
|
+
type: import("../../../es/src/types").Func<any[], any>;
|
|
246
|
+
require: boolean;
|
|
247
|
+
};
|
|
248
|
+
textFormatter: {
|
|
249
|
+
type: import("vue").PropType<import("./src/types").FormConfigTextFormatter>;
|
|
250
|
+
required: true;
|
|
251
|
+
};
|
|
252
|
+
}>>, {}>;
|
|
141
253
|
layoutWidthEnum2Column: typeof import("./src/utils").layoutWidthEnum2Column;
|
|
142
254
|
FormConfigEdit: import("vue").DefineComponent<{}, {
|
|
143
255
|
key: import("vue").Ref<number>;
|
|
@@ -1824,7 +1936,9 @@ declare const FormConfig: SFCWithInstall<import("vue").DefineComponent<{
|
|
|
1824
1936
|
notes?: string | undefined;
|
|
1825
1937
|
desc?: string | undefined;
|
|
1826
1938
|
children?: any[] | undefined;
|
|
1939
|
+
__new?: boolean | undefined;
|
|
1827
1940
|
}[] | undefined;
|
|
1941
|
+
__new?: boolean | undefined;
|
|
1828
1942
|
}>;
|
|
1829
1943
|
generateFieldListByFieldItem: (fieldItem: import("./src/types").FormConfigItem) => import("..").FieldItem[];
|
|
1830
1944
|
showModal: import("vue").Ref<boolean>;
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import { defineComponent, ref, provide, toRaw, openBlock, createElementBlock, normalizeStyle, createElementVNode, createVNode, unref, mergeProps, withCtx, toDisplayString,
|
|
1
|
+
import { defineComponent, ref, provide, toRaw, openBlock, createElementBlock, normalizeStyle, createElementVNode, createVNode, unref, mergeProps, withCtx, toDisplayString, createTextVNode } from 'vue';
|
|
2
2
|
import { cloneDeep, isFunction } from 'lodash-es';
|
|
3
3
|
import Draggable from 'vuedraggable';
|
|
4
|
+
import FormConfigDragDisplay from '../../../packages/form-config/src/components/FormConfigDragDisplay';
|
|
4
5
|
import { layoutWidthEnum2Column } from '../../../packages/form-config/src/utils';
|
|
5
6
|
import FormConfigEdit from './components/FormConfigEdit.js';
|
|
6
7
|
import FormConfigCreator from './components/FormConfigCreator.js';
|
|
7
|
-
import { InjectionActiveFieldItem } from '../../../packages/form-config/src/constants';
|
|
8
|
+
import { InjectionFieldList, InjectionMaterialList, InjectionActiveFieldItem } from '../../../packages/form-config/src/constants';
|
|
8
9
|
import { useSortable, usePresetRenderer } from '../../../packages/form-config/src/hooks';
|
|
9
10
|
import _export_sfc from '../../../_virtual/plugin-vue_export-helper.js';
|
|
10
11
|
|
|
@@ -27,17 +28,19 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
27
28
|
const { commonConfig } = useSortable();
|
|
28
29
|
const fieldListRef = ref([]);
|
|
29
30
|
const materialListRef = ref([]);
|
|
31
|
+
provide(InjectionFieldList, fieldListRef);
|
|
32
|
+
provide(InjectionMaterialList, materialListRef);
|
|
30
33
|
function addItem(fieldItem) {
|
|
31
34
|
if (fieldListRef.value.some((field) => field.key === fieldItem.key))
|
|
32
35
|
return;
|
|
33
36
|
fieldListRef.value.push(fieldItem);
|
|
34
37
|
}
|
|
35
|
-
const
|
|
38
|
+
const parsedTextFormatter = (fieldItem, parsedText) => {
|
|
36
39
|
if (!isFunction(props.textFormatter))
|
|
37
40
|
return parsedText;
|
|
38
41
|
return props.textFormatter(fieldItem, parsedText);
|
|
39
42
|
};
|
|
40
|
-
const { getRenderer } = usePresetRenderer(
|
|
43
|
+
const { getRenderer } = usePresetRenderer();
|
|
41
44
|
const currentEditField = ref();
|
|
42
45
|
provide(InjectionActiveFieldItem, currentEditField);
|
|
43
46
|
const formConfigEditRef = ref();
|
|
@@ -86,22 +89,13 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
86
89
|
_hoisted_5,
|
|
87
90
|
createVNode(FormConfigCreator, { onSubmit: addItem })
|
|
88
91
|
]),
|
|
89
|
-
createVNode(
|
|
90
|
-
group: "__display",
|
|
92
|
+
createVNode(FormConfigDragDisplay, {
|
|
91
93
|
class: "form-config__displayContent",
|
|
94
|
+
"text-formatter": parsedTextFormatter,
|
|
95
|
+
"get-renderer": unref(getRenderer),
|
|
92
96
|
modelValue: fieldListRef.value,
|
|
93
97
|
"onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => fieldListRef.value = $event)
|
|
94
|
-
}
|
|
95
|
-
item: withCtx(({ element }) => [
|
|
96
|
-
createElementVNode("section", {
|
|
97
|
-
class: "form-config__displayContentItem",
|
|
98
|
-
style: normalizeStyle({ "--item-column": unref(layoutWidthEnum2Column)(element.layoutWidthEnum) })
|
|
99
|
-
}, [
|
|
100
|
-
(openBlock(), createBlock(resolveDynamicComponent(unref(getRenderer)(element)), { fieldItem: element }, null, 8, ["fieldItem"]))
|
|
101
|
-
], 4)
|
|
102
|
-
]),
|
|
103
|
-
_: 1
|
|
104
|
-
}, 16, ["modelValue"])
|
|
98
|
+
}, null, 8, ["get-renderer", "modelValue"])
|
|
105
99
|
]),
|
|
106
100
|
createElementVNode("section", _hoisted_6, [
|
|
107
101
|
_hoisted_7,
|