cnhis-design-vue 3.1.16-beta.9 → 3.1.16
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/BigTable.vue.d.ts +6 -1
- package/es/packages/big-table/src/BigTable.vue_vue_type_script_setup_true_lang.js +2 -2
- package/es/packages/big-table/src/components/edit-form/edit-date.js +13 -3
- package/es/packages/big-table/src/components/edit-form/edit-time.js +1 -0
- package/es/packages/big-table/src/hooks/useSeparateRow.js +5 -2
- package/es/packages/button-print/index.d.ts +4 -1
- package/es/packages/button-print/src/ButtonPrint.vue.d.ts +4 -1
- package/es/packages/button-print/src/components/IdentityVerification.js +5 -7
- package/es/packages/button-print/src/components/IdentityVerification.vue.d.ts +4 -1
- package/es/packages/fabric-chart/src/FabricChart.js +1 -1
- package/es/packages/fabric-chart/src/components/PopupTip.js +2 -2
- package/es/packages/fabric-chart/src/hooks/constant.js +1 -1
- package/es/packages/fabric-chart/src/hooks/useCenter.js +11 -2
- package/es/packages/fabric-chart/src/hooks/useOther.js +63 -13
- package/es/packages/form-config/index.d.ts +7 -2
- package/es/packages/form-config/src/FormConfig.vue.d.ts +7 -2
- package/es/packages/form-config/src/components/FormConfigCreator.vue.d.ts +3 -1
- package/es/packages/form-config/src/components/FormConfigEdit.vue.d.ts +4 -1
- package/es/packages/form-config/src/types/index.d.ts +1 -0
- package/es/packages/form-config/style/index.css +1 -1
- package/es/packages/form-render/index.d.ts +3 -1
- package/es/packages/form-render/index.js +0 -1
- package/es/packages/form-render/src/FormRender.js +7 -8
- package/es/packages/form-render/src/FormRender.vue.d.ts +3 -1
- package/es/packages/form-render/src/components/renderer/{combination/index.d.ts → combination.d.ts} +3 -3
- package/es/packages/form-render/src/components/renderer/combination.js +92 -0
- package/es/packages/form-render/src/components/renderer/date.js +12 -4
- package/es/packages/form-render/src/components/renderer/formItem.js +11 -3
- package/es/packages/form-render/src/components/renderer/index.d.ts +1 -0
- package/es/packages/form-render/src/components/renderer/index.js +2 -1
- package/es/packages/form-render/src/components/renderer/{combination → jsonCombination}/hooks/useDeepValidate.d.ts +0 -0
- package/es/packages/form-render/src/components/renderer/{combination → jsonCombination}/hooks/useDeepValidate.js +0 -0
- package/es/packages/form-render/src/components/renderer/jsonCombination/index.d.ts +44 -0
- package/es/packages/form-render/src/components/renderer/{combination → jsonCombination}/index.js +29 -14
- package/es/packages/form-render/src/hooks/index.d.ts +0 -1
- package/es/packages/form-render/src/hooks/index.js +0 -1
- package/es/packages/form-render/src/hooks/useFieldListAdaptor.d.ts +1 -1
- package/es/packages/form-render/src/hooks/useFieldListAdaptor.js +7 -3
- package/es/packages/form-render/src/hooks/useTypeNormalize.js +2 -1
- package/es/packages/form-render/src/types/fieldItem.d.ts +4 -0
- package/es/packages/form-render/src/types/index.d.ts +2 -2
- package/es/packages/form-render/src/utils/index.js +3 -2
- package/es/packages/form-render/src/utils/schema.d.ts +60 -0
- package/es/packages/form-render/src/utils/schema.js +5 -2
- package/es/packages/form-render/style/index.css +11 -8
- package/es/packages/index.css +12 -9
- package/es/packages/index.js +0 -1
- package/es/packages/shortcut-provider/src/hooks/useShortcuts.js +1 -0
- package/es/packages/shortcut-setter/index.d.ts +4 -1
- package/es/packages/shortcut-setter/src/ShortcutSetter.vue.d.ts +4 -1
- package/es/src/utils/index.d.ts +1 -0
- package/es/src/utils/index.js +11 -1
- package/package.json +4 -4
- package/es/packages/form-render/src/hooks/useInitialData.d.ts +0 -5
- package/es/packages/form-render/src/hooks/useInitialData.js +0 -16
|
@@ -1126,7 +1126,12 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
1126
1126
|
textColorGhostHoverWarning: string;
|
|
1127
1127
|
textColorGhostPressedWarning: string;
|
|
1128
1128
|
textColorGhostFocusWarning: string;
|
|
1129
|
-
textColorGhostDisabledWarning: string;
|
|
1129
|
+
textColorGhostDisabledWarning: string; /**
|
|
1130
|
+
* 判断是否渲染EditForm
|
|
1131
|
+
* @param {*} row
|
|
1132
|
+
* @param {*} column
|
|
1133
|
+
* @returns
|
|
1134
|
+
*/
|
|
1130
1135
|
borderWarning: string;
|
|
1131
1136
|
borderHoverWarning: string;
|
|
1132
1137
|
borderPressedWarning: string;
|
|
@@ -354,10 +354,10 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
354
354
|
showSeq = true
|
|
355
355
|
} = map;
|
|
356
356
|
if (isEdit) {
|
|
357
|
-
|
|
357
|
+
Object.assign(state.editConfig, editConfig);
|
|
358
358
|
state.rowConfig.height = 48;
|
|
359
359
|
}
|
|
360
|
-
|
|
360
|
+
Object.assign(state.rowConfig, rowConfig);
|
|
361
361
|
state.rowConfig.keyField = handleRowId.value;
|
|
362
362
|
if (selectType) {
|
|
363
363
|
isBatchSelect = 1;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { defineComponent, createVNode, mergeProps } from 'vue';
|
|
1
|
+
import { defineComponent, computed, createVNode, mergeProps } from 'vue';
|
|
2
|
+
import { generateTimeFormat } from '../../../../../src/utils';
|
|
2
3
|
import { isFunction } from 'lodash-es';
|
|
3
4
|
import { NDatePicker } from 'naive-ui';
|
|
4
5
|
|
|
@@ -25,7 +26,6 @@ var EditDate = defineComponent({
|
|
|
25
26
|
emits: ["formChange"],
|
|
26
27
|
setup(props, {
|
|
27
28
|
attrs,
|
|
28
|
-
slots,
|
|
29
29
|
emit
|
|
30
30
|
}) {
|
|
31
31
|
const onConfirm = (value) => {
|
|
@@ -102,11 +102,21 @@ var EditDate = defineComponent({
|
|
|
102
102
|
return customDateDisabled(ts, props.row);
|
|
103
103
|
};
|
|
104
104
|
}
|
|
105
|
+
const formatConfig = computed(() => {
|
|
106
|
+
const valueFormat = props.col.valueFormat || "yyyy-MM-dd HH:mm:ss";
|
|
107
|
+
return {
|
|
108
|
+
valueFormat,
|
|
109
|
+
format: valueFormat,
|
|
110
|
+
timePickerProps: {
|
|
111
|
+
format: generateTimeFormat(valueFormat)
|
|
112
|
+
}
|
|
113
|
+
};
|
|
114
|
+
});
|
|
105
115
|
const config = {
|
|
106
116
|
type: props.col.type || props.col.dateType || "datetime",
|
|
107
117
|
clearable: props.col.clearable || true,
|
|
108
118
|
disabled: props.col.disabled || false,
|
|
109
|
-
|
|
119
|
+
...formatConfig.value,
|
|
110
120
|
isDateDisabled: customDateDisabledDecorator(props.col.isDateDisabled) || isDateDisabled,
|
|
111
121
|
placeholder: props.col.placeholder || "\u8BF7\u9009\u62E9",
|
|
112
122
|
...props.col.componentProps || {}
|
|
@@ -41,6 +41,7 @@ var editTime = defineComponent({
|
|
|
41
41
|
const config = {
|
|
42
42
|
placeholder: props.col.placeholder || "\u8BF7\u9009\u62E9",
|
|
43
43
|
valueFormat: props.col.valueFormat || "HH:mm",
|
|
44
|
+
format: props.col.valueFormat || "yyyy-MM-dd HH:mm:ss",
|
|
44
45
|
...props.col.componentProps || {}
|
|
45
46
|
};
|
|
46
47
|
return () => createVNode(NTimePicker, mergeProps(attrs, config, {
|
|
@@ -84,13 +84,15 @@ function useSeparateRow(getColumnConfig, getFieldItem, $VXETable) {
|
|
|
84
84
|
});
|
|
85
85
|
}
|
|
86
86
|
(await res).push(...Array.from({ length: getColumnInfoMaxLength(parsedRowData) }).map((_, index) => {
|
|
87
|
+
const separateData = getSeparateRowData(parsedRowData, index);
|
|
87
88
|
if (index === 0) {
|
|
88
89
|
separateDataMap.value.set(row, {
|
|
89
90
|
row,
|
|
90
91
|
rawRow: rawData[dataIndex],
|
|
91
92
|
index,
|
|
92
|
-
separateData
|
|
93
|
+
separateData
|
|
93
94
|
});
|
|
95
|
+
row.$__SEPARATE_DATA = [separateData];
|
|
94
96
|
return row;
|
|
95
97
|
}
|
|
96
98
|
const data2 = { $__SEPARATE: true };
|
|
@@ -98,8 +100,9 @@ function useSeparateRow(getColumnConfig, getFieldItem, $VXETable) {
|
|
|
98
100
|
row: data2,
|
|
99
101
|
rawRow: rawData[dataIndex],
|
|
100
102
|
index,
|
|
101
|
-
separateData
|
|
103
|
+
separateData
|
|
102
104
|
});
|
|
105
|
+
row.$__SEPARATE_DATA.push(separateData);
|
|
103
106
|
return data2;
|
|
104
107
|
}));
|
|
105
108
|
return res;
|
|
@@ -2537,7 +2537,10 @@ declare const ButtonPrint: SFCWithInstall<import("vue").DefineComponent<{
|
|
|
2537
2537
|
modelValue: boolean;
|
|
2538
2538
|
};
|
|
2539
2539
|
emit: (event: "success" | "update:modelValue", ...args: any[]) => void;
|
|
2540
|
-
form:
|
|
2540
|
+
form: {
|
|
2541
|
+
account: string;
|
|
2542
|
+
password: string;
|
|
2543
|
+
};
|
|
2541
2544
|
rules: import("naive-ui").FormRules;
|
|
2542
2545
|
style: {
|
|
2543
2546
|
width: string;
|
|
@@ -2541,7 +2541,10 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
2541
2541
|
modelValue: boolean;
|
|
2542
2542
|
};
|
|
2543
2543
|
emit: (event: "success" | "update:modelValue", ...args: any[]) => void;
|
|
2544
|
-
form:
|
|
2544
|
+
form: {
|
|
2545
|
+
account: string;
|
|
2546
|
+
password: string;
|
|
2547
|
+
};
|
|
2545
2548
|
rules: import("naive-ui").FormRules;
|
|
2546
2549
|
style: {
|
|
2547
2550
|
width: string;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent, reactive, ref,
|
|
1
|
+
import { defineComponent, reactive, ref, watch, openBlock, createBlock, unref, normalizeStyle, withCtx, createElementVNode, createVNode, createTextVNode } from 'vue';
|
|
2
2
|
import { useMessage, NModal, NForm, NFormItem, NInput, NButton } from 'naive-ui';
|
|
3
3
|
import _export_sfc from '../../../../_virtual/plugin-vue_export-helper.js';
|
|
4
4
|
|
|
@@ -19,7 +19,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
19
19
|
account: "",
|
|
20
20
|
password: ""
|
|
21
21
|
};
|
|
22
|
-
let form = reactive(
|
|
22
|
+
let form = reactive({ ...DEFAULT_FORM });
|
|
23
23
|
const rules = {
|
|
24
24
|
account: { required: true, message: "\u8BF7\u8F93\u5165\u8D26\u53F7" },
|
|
25
25
|
password: { required: true, message: "\u8BF7\u8F93\u5165\u5BC6\u7801" }
|
|
@@ -33,9 +33,9 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
33
33
|
};
|
|
34
34
|
const submit = async () => {
|
|
35
35
|
var _a;
|
|
36
|
-
const { data = {} } = await props.verifyUser(form);
|
|
36
|
+
const { data = {} } = await props.verifyUser(form) || {};
|
|
37
37
|
if (data.result !== "SUCCESS") {
|
|
38
|
-
$message.error(data.resultMsg);
|
|
38
|
+
$message.error(data.resultMsg || "\u8BF7\u6DFB\u52A0\u8EAB\u4EFD\u6821\u9A8C\u63A5\u53E3\u914D\u7F6E");
|
|
39
39
|
return false;
|
|
40
40
|
}
|
|
41
41
|
emit("success", (_a = data.map) == null ? void 0 : _a.token);
|
|
@@ -51,12 +51,10 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
51
51
|
}
|
|
52
52
|
});
|
|
53
53
|
};
|
|
54
|
-
onMounted(() => {
|
|
55
|
-
});
|
|
56
54
|
watch(() => props.modelValue, (val) => {
|
|
57
55
|
if (val)
|
|
58
56
|
return;
|
|
59
|
-
form
|
|
57
|
+
Object.assign(form, DEFAULT_FORM);
|
|
60
58
|
});
|
|
61
59
|
return (_ctx, _cache) => {
|
|
62
60
|
return openBlock(), createBlock(unref(NModal), {
|
|
@@ -26,7 +26,10 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
26
26
|
modelValue: boolean;
|
|
27
27
|
};
|
|
28
28
|
emit: (event: "success" | "update:modelValue", ...args: any[]) => void;
|
|
29
|
-
form:
|
|
29
|
+
form: {
|
|
30
|
+
account: string;
|
|
31
|
+
password: string;
|
|
32
|
+
};
|
|
30
33
|
rules: FormRules;
|
|
31
34
|
style: {
|
|
32
35
|
width: string;
|
|
@@ -260,7 +260,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
260
260
|
const list = (item == null ? void 0 : item.list) || [];
|
|
261
261
|
if (!list.length)
|
|
262
262
|
return 0;
|
|
263
|
-
return yCellHeight.value / ((
|
|
263
|
+
return yCellHeight.value / ((list[1] - list[0]) / item.spaceGridNumber);
|
|
264
264
|
}
|
|
265
265
|
const { cumputedX, cumputedY, getXValue, getYValue } = useCumputedPoint(propItems);
|
|
266
266
|
useTop(canvas, propItems);
|
|
@@ -20,8 +20,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
20
20
|
style: normalizeStyle(unref(pointStyle))
|
|
21
21
|
}, [
|
|
22
22
|
(openBlock(true), createElementBlock(Fragment, null, renderList(__props.list, (item) => {
|
|
23
|
-
return openBlock(), createElementBlock("li",
|
|
24
|
-
}),
|
|
23
|
+
return openBlock(), createElementBlock("li", { key: item }, toDisplayString(item), 1);
|
|
24
|
+
}), 128))
|
|
25
25
|
], 4), [
|
|
26
26
|
[vShow, __props.show]
|
|
27
27
|
])
|
|
@@ -430,9 +430,18 @@ function useCenter(canvas, propItems, emits, cumputedX, cumputedY, getXValue, ge
|
|
|
430
430
|
x: point.left,
|
|
431
431
|
y: point.top
|
|
432
432
|
};
|
|
433
|
-
|
|
434
|
-
pointTipProps.list = [`${title} ${yValue}${unit || ""}`, `\u65F6\u95F4 ${((data == null ? void 0 : data.time) || getXValue(point.left)).slice(-5)}`];
|
|
433
|
+
pointTipProps.list = [getListValue(), `\u65F6\u95F4 ${((data == null ? void 0 : data.time) || getXValue(point.left)).slice(-5)}`];
|
|
435
434
|
pointTipProps.show = true;
|
|
435
|
+
function getListValue() {
|
|
436
|
+
const { value, drugReduce, physicsReduce } = data;
|
|
437
|
+
if (drugReduce) {
|
|
438
|
+
return `\u836F\u7269\u964D${type == "pain" ? "\u75DB" : "\u6E29"} ${value}\u2014>${drugReduce}${unit || ""}`;
|
|
439
|
+
}
|
|
440
|
+
if (physicsReduce) {
|
|
441
|
+
return `\u7269\u7406\u964D${type == "pain" ? "\u75DB" : "\u6E29"} ${value}\u2014>${physicsReduce}${unit || ""}`;
|
|
442
|
+
}
|
|
443
|
+
return `${title} ${value}${unit || ""}`;
|
|
444
|
+
}
|
|
436
445
|
}
|
|
437
446
|
function moveLimit(point) {
|
|
438
447
|
point.setCoords();
|
|
@@ -3,25 +3,75 @@ import { fabric } from '../utils/index.js';
|
|
|
3
3
|
import { defaultStyle } from './useDraw.js';
|
|
4
4
|
|
|
5
5
|
function useOther(canvas, propItems, cumputedX) {
|
|
6
|
-
const {
|
|
6
|
+
const { other, vitalSignsOriginY } = propItems;
|
|
7
7
|
function drawOther() {
|
|
8
|
-
if (!other
|
|
8
|
+
if (!(other == null ? void 0 : other.list))
|
|
9
9
|
return false;
|
|
10
10
|
const list = [];
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
const
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
11
|
+
const otherList = [];
|
|
12
|
+
other.list.forEach((item) => {
|
|
13
|
+
const align = item.align || "vertical";
|
|
14
|
+
const left = cumputedX(item.time);
|
|
15
|
+
const obj = otherList.find((v) => v.left == left);
|
|
16
|
+
if (obj) {
|
|
17
|
+
obj[align].push(item);
|
|
18
|
+
} else {
|
|
19
|
+
const initObj = {
|
|
20
|
+
left,
|
|
21
|
+
vertical: [],
|
|
22
|
+
horizontal: []
|
|
23
|
+
};
|
|
24
|
+
initObj[align].push(item);
|
|
25
|
+
otherList.push(initObj);
|
|
26
|
+
}
|
|
27
|
+
});
|
|
28
|
+
let textWidth = 0;
|
|
29
|
+
otherList.forEach((item) => {
|
|
30
|
+
let topY = vitalSignsOriginY.originY;
|
|
31
|
+
let leftX = item.left;
|
|
32
|
+
let textHeight = 0;
|
|
33
|
+
item.vertical.forEach((v) => {
|
|
34
|
+
const { commonOptions, value } = getTextData(v);
|
|
35
|
+
topY += (v.baseTop || 0) + textHeight;
|
|
36
|
+
const text = new fabric.Text(value, {
|
|
37
|
+
top: topY,
|
|
38
|
+
left: item.left,
|
|
39
|
+
...commonOptions
|
|
40
|
+
});
|
|
41
|
+
textHeight = text.height || 0;
|
|
42
|
+
setTextWidth(text);
|
|
43
|
+
});
|
|
44
|
+
item.horizontal.forEach((v, i) => {
|
|
45
|
+
if (i > 0 || item.vertical.length) {
|
|
46
|
+
leftX += textWidth;
|
|
47
|
+
}
|
|
48
|
+
const { commonOptions, value } = getTextData(v);
|
|
49
|
+
const text = new fabric.Text(value, {
|
|
50
|
+
top: vitalSignsOriginY.originY,
|
|
51
|
+
left: leftX,
|
|
52
|
+
...commonOptions
|
|
53
|
+
});
|
|
54
|
+
setTextWidth(text);
|
|
20
55
|
});
|
|
21
|
-
list.push(text);
|
|
22
56
|
});
|
|
57
|
+
function setTextWidth(text) {
|
|
58
|
+
if (!textWidth) {
|
|
59
|
+
textWidth = text.width || 0;
|
|
60
|
+
}
|
|
61
|
+
list.push(text);
|
|
62
|
+
}
|
|
63
|
+
function getTextData(v) {
|
|
64
|
+
return {
|
|
65
|
+
commonOptions: {
|
|
66
|
+
originX: "center",
|
|
67
|
+
textAlign: "center",
|
|
68
|
+
...defaultStyle,
|
|
69
|
+
...v.style || {}
|
|
70
|
+
},
|
|
71
|
+
value: String(v.value.toString().split("").join("\n"))
|
|
72
|
+
};
|
|
73
|
+
}
|
|
23
74
|
const group = list.length > 0 ? new fabric.Group([...list], { ...defaultStyle }) : null;
|
|
24
|
-
group && group.sendToBack();
|
|
25
75
|
group && canvas.value.add(group);
|
|
26
76
|
}
|
|
27
77
|
onMounted(() => {
|
|
@@ -229,6 +229,7 @@ declare const FormConfig: SFCWithInstall<import("vue").DefineComponent<{
|
|
|
229
229
|
content?: string | import("..").FormRenderer | Record<string, import("..").FormRenderer> | undefined;
|
|
230
230
|
lazyRequest?: boolean | undefined;
|
|
231
231
|
maxGroupNum?: number | undefined;
|
|
232
|
+
jsonCombination?: boolean | undefined;
|
|
232
233
|
children?: any[] | undefined;
|
|
233
234
|
properties?: any[] | undefined;
|
|
234
235
|
componentProps?: import("../../../es/src/types").AnyObject | undefined;
|
|
@@ -3988,7 +3989,9 @@ declare const FormConfig: SFCWithInstall<import("vue").DefineComponent<{
|
|
|
3988
3989
|
}>>;
|
|
3989
3990
|
emit: (event: "formChange", ...args: any[]) => void;
|
|
3990
3991
|
nuiThemeOverrides: import("naive-ui").GlobalThemeOverrides;
|
|
3991
|
-
formModel: import("@formily/core").Form<
|
|
3992
|
+
formModel: import("@formily/core").Form<{
|
|
3993
|
+
[x: string]: any;
|
|
3994
|
+
}>;
|
|
3992
3995
|
SchemaField: import("vue").Component<any, any, any, import("vue").ComputedOptions, import("vue").MethodOptions>;
|
|
3993
3996
|
businessCollector: import("..").BusinessCollector;
|
|
3994
3997
|
formItemDepsCollector: import("..").FormItemDepsCollector;
|
|
@@ -9074,7 +9077,9 @@ declare const FormConfig: SFCWithInstall<import("vue").DefineComponent<{
|
|
|
9074
9077
|
}>>;
|
|
9075
9078
|
emit: (event: "formChange", ...args: any[]) => void;
|
|
9076
9079
|
nuiThemeOverrides: import("naive-ui").GlobalThemeOverrides;
|
|
9077
|
-
formModel: import("@formily/core").Form<
|
|
9080
|
+
formModel: import("@formily/core").Form<{
|
|
9081
|
+
[x: string]: any;
|
|
9082
|
+
}>;
|
|
9078
9083
|
SchemaField: import("vue").Component<any, any, any, import("vue").ComputedOptions, import("vue").MethodOptions>;
|
|
9079
9084
|
businessCollector: import("..").BusinessCollector;
|
|
9080
9085
|
formItemDepsCollector: import("..").FormItemDepsCollector;
|
|
@@ -231,6 +231,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
231
231
|
content?: string | import("../..").FormRenderer | Record<string, import("../..").FormRenderer> | undefined;
|
|
232
232
|
lazyRequest?: boolean | undefined;
|
|
233
233
|
maxGroupNum?: number | undefined;
|
|
234
|
+
jsonCombination?: boolean | undefined;
|
|
234
235
|
children?: any[] | undefined;
|
|
235
236
|
properties?: any[] | undefined;
|
|
236
237
|
componentProps?: import("../../../../es/src/types").AnyObject | undefined;
|
|
@@ -3990,7 +3991,9 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
3990
3991
|
}>>;
|
|
3991
3992
|
emit: (event: "formChange", ...args: any[]) => void;
|
|
3992
3993
|
nuiThemeOverrides: import("naive-ui").GlobalThemeOverrides;
|
|
3993
|
-
formModel: import("@formily/core").Form<
|
|
3994
|
+
formModel: import("@formily/core").Form<{
|
|
3995
|
+
[x: string]: any;
|
|
3996
|
+
}>;
|
|
3994
3997
|
SchemaField: import("vue").Component<any, any, any, import("vue").ComputedOptions, import("vue").MethodOptions>;
|
|
3995
3998
|
businessCollector: import("../..").BusinessCollector;
|
|
3996
3999
|
formItemDepsCollector: import("../..").FormItemDepsCollector;
|
|
@@ -9076,7 +9079,9 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
9076
9079
|
}>>;
|
|
9077
9080
|
emit: (event: "formChange", ...args: any[]) => void;
|
|
9078
9081
|
nuiThemeOverrides: import("naive-ui").GlobalThemeOverrides;
|
|
9079
|
-
formModel: import("@formily/core").Form<
|
|
9082
|
+
formModel: import("@formily/core").Form<{
|
|
9083
|
+
[x: string]: any;
|
|
9084
|
+
}>;
|
|
9080
9085
|
SchemaField: import("vue").Component<any, any, any, import("vue").ComputedOptions, import("vue").MethodOptions>;
|
|
9081
9086
|
businessCollector: import("../..").BusinessCollector;
|
|
9082
9087
|
formItemDepsCollector: import("../..").FormItemDepsCollector;
|
|
@@ -3580,7 +3580,9 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
|
3580
3580
|
}>>;
|
|
3581
3581
|
emit: (event: "formChange", ...args: any[]) => void;
|
|
3582
3582
|
nuiThemeOverrides: import("naive-ui").GlobalThemeOverrides;
|
|
3583
|
-
formModel: import("@formily/core").Form<
|
|
3583
|
+
formModel: import("@formily/core").Form<{
|
|
3584
|
+
[x: string]: any;
|
|
3585
|
+
}>;
|
|
3584
3586
|
SchemaField: import("vue").Component<any, any, any, import("vue").ComputedOptions, import("vue").MethodOptions>;
|
|
3585
3587
|
businessCollector: import("../../../../../es/packages/form-render").BusinessCollector;
|
|
3586
3588
|
formItemDepsCollector: import("../../../../../es/packages/form-render").FormItemDepsCollector;
|
|
@@ -92,6 +92,7 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
|
92
92
|
content?: string | import("../../../../../es/packages/form-render").FormRenderer | Record<string, import("../../../../../es/packages/form-render").FormRenderer> | undefined;
|
|
93
93
|
lazyRequest?: boolean | undefined;
|
|
94
94
|
maxGroupNum?: number | undefined;
|
|
95
|
+
jsonCombination?: boolean | undefined;
|
|
95
96
|
children?: any[] | undefined;
|
|
96
97
|
properties?: any[] | undefined;
|
|
97
98
|
componentProps?: import("../../../../../es/src/types").AnyObject | undefined;
|
|
@@ -3851,7 +3852,9 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
|
3851
3852
|
}>>;
|
|
3852
3853
|
emit: (event: "formChange", ...args: any[]) => void;
|
|
3853
3854
|
nuiThemeOverrides: import("naive-ui").GlobalThemeOverrides;
|
|
3854
|
-
formModel: import("@formily/core").Form<
|
|
3855
|
+
formModel: import("@formily/core").Form<{
|
|
3856
|
+
[x: string]: any;
|
|
3857
|
+
}>;
|
|
3855
3858
|
SchemaField: import("vue").Component<any, any, any, import("vue").ComputedOptions, import("vue").MethodOptions>;
|
|
3856
3859
|
businessCollector: import("../../../../../es/packages/form-render").BusinessCollector;
|
|
3857
3860
|
formItemDepsCollector: import("../../../../../es/packages/form-render").FormItemDepsCollector;
|
|
@@ -30,6 +30,7 @@ export interface FormConfigTextFormatter {
|
|
|
30
30
|
}
|
|
31
31
|
export interface FormConfigExpose {
|
|
32
32
|
loadData(payload: Record<'fieldList', FormConfigItem[]>): void;
|
|
33
|
+
validate(): Promise<unknown>;
|
|
33
34
|
getData(): Record<'fieldList' | 'materialList', FormConfigItem[]>;
|
|
34
35
|
}
|
|
35
36
|
export {};
|
|
@@ -236,7 +236,9 @@ declare const FormRender: SFCWithInstall<import("vue").DefineComponent<{
|
|
|
236
236
|
}>>;
|
|
237
237
|
emit: (event: "formChange", ...args: any[]) => void;
|
|
238
238
|
nuiThemeOverrides: import("naive-ui").GlobalThemeOverrides;
|
|
239
|
-
formModel: import("@formily/core").Form<
|
|
239
|
+
formModel: import("@formily/core").Form<{
|
|
240
|
+
[x: string]: any;
|
|
241
|
+
}>;
|
|
240
242
|
SchemaField: import("vue").Component<any, any, any, import("vue").ComputedOptions, import("vue").MethodOptions>;
|
|
241
243
|
businessCollector: import("./src/hooks").BusinessCollector;
|
|
242
244
|
formItemDepsCollector: import("./src/hooks").FormItemDepsCollector;
|
|
@@ -12,7 +12,6 @@ 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';
|
|
14
14
|
export { FormItemDepsCollector, useFormItemDeps } from './src/hooks/useFormItemDeps.js';
|
|
15
|
-
export { useInitialData } from './src/hooks/useInitialData.js';
|
|
16
15
|
export { useAnchor } from './src/hooks/useAnchor.js';
|
|
17
16
|
export { useFormContext } from './src/hooks/useFormContext.js';
|
|
18
17
|
|
|
@@ -6,10 +6,9 @@ import { cloneDeep, isArray } from 'lodash-es';
|
|
|
6
6
|
import { NForm, NTabs, NTabPane, NConfigProvider } from 'naive-ui';
|
|
7
7
|
import { FormItemLineBarDepKeyPrepend } from '../../../packages/form-render/src/constants';
|
|
8
8
|
import { useFormRenderLifeCycle } from '../../../packages/form-render/src/hooks/useFormRenderLifeCycle';
|
|
9
|
-
import { arrayed, queryDecorator, queryInput, getParentLinebar } from '../../../packages/form-render/src/utils';
|
|
9
|
+
import { createObjSchema, arrayed, queryDecorator, queryInput, getParentLinebar } from '../../../packages/form-render/src/utils';
|
|
10
10
|
import { useNuiThemeOverrides } from '../../../packages/form-table/src/hooks/useNuiThemeOverrides';
|
|
11
11
|
import _export_sfc from '../../../_virtual/plugin-vue_export-helper.js';
|
|
12
|
-
import { useInitialData } from './hooks/useInitialData.js';
|
|
13
12
|
import { useFormContext } from './hooks/useFormContext.js';
|
|
14
13
|
import { useFieldListAdaptor } from './hooks/useFieldListAdaptor.js';
|
|
15
14
|
import { useFieldVisitor } from './hooks/useFieldVisitor.js';
|
|
@@ -50,10 +49,12 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
50
49
|
const { nuiThemeOverrides } = useNuiThemeOverrides();
|
|
51
50
|
useFormRenderLifeCycle(props).callLifeCycle("onSetup");
|
|
52
51
|
const formModel = createForm({
|
|
53
|
-
initialValues:
|
|
52
|
+
initialValues: props.initialData,
|
|
54
53
|
effects() {
|
|
55
54
|
onFieldValueChange("*", async (field) => {
|
|
56
55
|
const fieldKey = field.props.name.toString();
|
|
56
|
+
businessCollector.trigger(fieldKey);
|
|
57
|
+
formItemDepsCollector.trigger(fieldKey);
|
|
57
58
|
emit("formChange", {
|
|
58
59
|
fieldInstance: field,
|
|
59
60
|
fieldKey,
|
|
@@ -61,23 +62,21 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
61
62
|
value: field.value,
|
|
62
63
|
context: await changeContextCollector.getContext(fieldKey)
|
|
63
64
|
});
|
|
64
|
-
businessCollector.trigger(fieldKey);
|
|
65
|
-
formItemDepsCollector.trigger(fieldKey);
|
|
66
65
|
});
|
|
67
66
|
}
|
|
68
67
|
});
|
|
69
68
|
const { SchemaField, businessCollector, formItemDepsCollector, changeContextCollector, formUUID } = useFormContext(props, formModel);
|
|
70
69
|
const scrollbarRef = ref();
|
|
71
|
-
const { schemaAdaptor } = useFieldListAdaptor(businessCollector
|
|
70
|
+
const { schemaAdaptor } = useFieldListAdaptor(businessCollector);
|
|
72
71
|
const parsedSchema = computed(() => {
|
|
73
72
|
if (props.schema) {
|
|
74
73
|
return props.schema;
|
|
75
74
|
}
|
|
76
75
|
if (props.fieldList) {
|
|
77
76
|
const _fieldList = useFieldVisitor().traverse(cloneDeep(props.fieldList), props.fieldVisitor);
|
|
78
|
-
return
|
|
77
|
+
return createObjSchema(schemaAdaptor(_fieldList));
|
|
79
78
|
}
|
|
80
|
-
return {
|
|
79
|
+
return createObjSchema({});
|
|
81
80
|
});
|
|
82
81
|
const { currentAnchor, generateAnchorList, anchorIdList, formHeight, onScroll } = useAnchor(props, scrollbarRef, formItemDepsCollector);
|
|
83
82
|
watch(parsedSchema, generateAnchorList, { immediate: true });
|
|
@@ -236,7 +236,9 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
236
236
|
}>>;
|
|
237
237
|
emit: (event: "formChange", ...args: any[]) => void;
|
|
238
238
|
nuiThemeOverrides: import("naive-ui").GlobalThemeOverrides;
|
|
239
|
-
formModel: import("@formily/core").Form<
|
|
239
|
+
formModel: import("@formily/core").Form<{
|
|
240
|
+
[x: string]: any;
|
|
241
|
+
}>;
|
|
240
242
|
SchemaField: Component<any, any, any, import("vue").ComputedOptions, import("vue").MethodOptions>;
|
|
241
243
|
businessCollector: import("./hooks").BusinessCollector;
|
|
242
244
|
formItemDepsCollector: import("./hooks").FormItemDepsCollector;
|
package/es/packages/form-render/src/components/renderer/{combination/index.d.ts → combination.d.ts}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { FieldItem } from '
|
|
1
|
+
import { FieldItem } from '../../../../../../es/packages/form-render';
|
|
2
2
|
import { PropType } from 'vue';
|
|
3
3
|
export declare const COMBINATION: import("vue").DefineComponent<{
|
|
4
4
|
title: {
|
|
@@ -6,7 +6,7 @@ export declare const COMBINATION: import("vue").DefineComponent<{
|
|
|
6
6
|
default: string;
|
|
7
7
|
};
|
|
8
8
|
value: {
|
|
9
|
-
type:
|
|
9
|
+
type: ArrayConstructor;
|
|
10
10
|
};
|
|
11
11
|
maxGroupNum: {
|
|
12
12
|
type: NumberConstructor;
|
|
@@ -24,7 +24,7 @@ export declare const COMBINATION: import("vue").DefineComponent<{
|
|
|
24
24
|
default: string;
|
|
25
25
|
};
|
|
26
26
|
value: {
|
|
27
|
-
type:
|
|
27
|
+
type: ArrayConstructor;
|
|
28
28
|
};
|
|
29
29
|
maxGroupNum: {
|
|
30
30
|
type: NumberConstructor;
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import { defineComponent, ref, computed, inject, createVNode } from 'vue';
|
|
2
|
+
import { isNumber } from 'lodash-es';
|
|
3
|
+
import { useFieldListAdaptor } from '../../../../../packages/form-render';
|
|
4
|
+
import { useField, RecursionField, connect } from '@formily/vue';
|
|
5
|
+
import { NButton, NIcon } from 'naive-ui';
|
|
6
|
+
import { InjectionBusinessCollector } from '../../../../../packages/form-render/src/constants';
|
|
7
|
+
import { createObjSchema } from '../../../../../packages/form-render/src/utils';
|
|
8
|
+
import { AddCircleOutline, RemoveCircle } from '@vicons/ionicons5';
|
|
9
|
+
|
|
10
|
+
const script = defineComponent({
|
|
11
|
+
name: "FormCombination",
|
|
12
|
+
props: {
|
|
13
|
+
title: {
|
|
14
|
+
type: String,
|
|
15
|
+
default: ""
|
|
16
|
+
},
|
|
17
|
+
value: {
|
|
18
|
+
type: Array
|
|
19
|
+
},
|
|
20
|
+
maxGroupNum: {
|
|
21
|
+
type: Number
|
|
22
|
+
},
|
|
23
|
+
getProperties: {
|
|
24
|
+
type: Function,
|
|
25
|
+
default: () => []
|
|
26
|
+
},
|
|
27
|
+
onInput: {},
|
|
28
|
+
onBlur: {},
|
|
29
|
+
onChange: {}
|
|
30
|
+
},
|
|
31
|
+
emits: ["update:value"],
|
|
32
|
+
setup(props) {
|
|
33
|
+
const field = useField();
|
|
34
|
+
const currentGroupNum = ref(1);
|
|
35
|
+
const maxGroupNum = computed(() => {
|
|
36
|
+
if (!isNumber(props.maxGroupNum))
|
|
37
|
+
return Infinity;
|
|
38
|
+
if (props.maxGroupNum < 1)
|
|
39
|
+
return 0;
|
|
40
|
+
return ~~props.maxGroupNum;
|
|
41
|
+
});
|
|
42
|
+
function addGroup() {
|
|
43
|
+
currentGroupNum.value++;
|
|
44
|
+
}
|
|
45
|
+
async function removeGroup(idx) {
|
|
46
|
+
currentGroupNum.value--;
|
|
47
|
+
await field.value.remove(idx);
|
|
48
|
+
}
|
|
49
|
+
const collector = inject(InjectionBusinessCollector);
|
|
50
|
+
const {
|
|
51
|
+
schemaAdaptor
|
|
52
|
+
} = useFieldListAdaptor(collector);
|
|
53
|
+
return () => {
|
|
54
|
+
return createVNode("section", {
|
|
55
|
+
"class": "form-render__combination"
|
|
56
|
+
}, [createVNode("header", {
|
|
57
|
+
"class": "form-render__combinationHeader"
|
|
58
|
+
}, [createVNode("div", {
|
|
59
|
+
"class": "form-render__combinationHeaderText"
|
|
60
|
+
}, [props.title]), createVNode(NButton, {
|
|
61
|
+
"onClick": addGroup,
|
|
62
|
+
"type": "info",
|
|
63
|
+
"text": true,
|
|
64
|
+
"disabled": currentGroupNum.value >= maxGroupNum.value
|
|
65
|
+
}, {
|
|
66
|
+
icon: () => createVNode(NIcon, {
|
|
67
|
+
"component": AddCircleOutline
|
|
68
|
+
}, null),
|
|
69
|
+
default: () => "\u65B0\u589E"
|
|
70
|
+
})]), Array.from({
|
|
71
|
+
length: currentGroupNum.value
|
|
72
|
+
}).map((_, idx) => createVNode("section", {
|
|
73
|
+
"class": "form-render__combinationContent"
|
|
74
|
+
}, [createVNode(RecursionField, {
|
|
75
|
+
"schema": createObjSchema(schemaAdaptor(props.getProperties())),
|
|
76
|
+
"name": idx
|
|
77
|
+
}, null), idx === 0 ? null : createVNode(NButton, {
|
|
78
|
+
"text": true,
|
|
79
|
+
"type": "error",
|
|
80
|
+
"class": "form-render__combinationClose",
|
|
81
|
+
"onClick": () => removeGroup(idx)
|
|
82
|
+
}, {
|
|
83
|
+
icon: () => createVNode(NIcon, {
|
|
84
|
+
"component": RemoveCircle
|
|
85
|
+
}, null)
|
|
86
|
+
})]))]);
|
|
87
|
+
};
|
|
88
|
+
}
|
|
89
|
+
});
|
|
90
|
+
const COMBINATION = connect(script);
|
|
91
|
+
|
|
92
|
+
export { COMBINATION };
|