@fecp/designer 5.3.6 → 5.3.8
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/designer.css +196 -239
- package/es/node_modules/.pnpm/element-plus@2.13.2_vue@3.5.13_typescript@5.7.3_/node_modules/element-plus/es/components/config-provider/src/hooks/use-global-config.mjs +1 -1
- package/es/packages/designer/package.json.mjs +1 -1
- package/es/packages/designer/src/components/FilterConfigDisplay.vue.mjs +2 -3
- package/es/packages/designer/src/components/FormulaEditorInput.vue.mjs +33 -8
- package/es/packages/designer/src/components/ValueSelectorPopover.vue2.mjs +62 -39
- package/es/packages/designer/src/layout/aside/HiddenFieldDialog.vue.mjs +3 -3
- package/es/packages/designer/src/layout/header/index.vue.mjs +1 -1
- package/es/packages/designer/src/packages/advancedFilter/AdvancedFilter.vue2.mjs +4 -4
- package/es/packages/designer/src/packages/advancedFilter/ValueInput.vue2.mjs +34 -28
- package/es/packages/designer/src/packages/dataLinkage/index.vue.mjs +75 -69
- package/es/packages/designer/src/packages/dialogGlobal/index.vue.mjs +1 -0
- package/es/packages/designer/src/packages/eventFlow/dialog/action/Dialog.vue.mjs +49 -11
- package/es/packages/designer/src/packages/eventFlow/dialog/action/config.mjs +2 -2
- package/es/packages/designer/src/packages/form/aside/index.mjs +1 -0
- package/es/packages/designer/src/packages/form/components/SubForm.vue.mjs +33 -7
- package/es/packages/designer/src/packages/form/index.vue.mjs +15 -2
- package/es/packages/designer/src/packages/form/property/subForm.vue.mjs +53 -11
- package/es/packages/designer/src/packages/formulaEditor/components/FieldVariable.vue2.mjs +3 -2
- package/es/packages/designer/src/packages/table/headerBtn.vue.mjs +1 -0
- package/es/packages/vue/src/components/forms/form/Form.vue.mjs +16 -5
- package/es/packages/vue/src/components/forms/form/validation.mjs +18 -6
- package/es/packages/vue/src/components/forms/subForm/SubForm.vue.mjs +31 -2
- package/es/packages/vue/src/utils/eventFlow/actionHandlers.mjs +2 -0
- package/lib/designer.css +196 -239
- package/lib/packages/designer/package.json.js +1 -1
- package/lib/packages/designer/src/components/FilterConfigDisplay.vue.js +2 -3
- package/lib/packages/designer/src/components/FormulaEditorInput.vue.js +32 -7
- package/lib/packages/designer/src/components/ValueSelectorPopover.vue2.js +68 -45
- package/lib/packages/designer/src/layout/aside/HiddenFieldDialog.vue.js +3 -3
- package/lib/packages/designer/src/layout/header/index.vue.js +1 -1
- package/lib/packages/designer/src/packages/advancedFilter/AdvancedFilter.vue2.js +4 -4
- package/lib/packages/designer/src/packages/advancedFilter/ValueInput.vue2.js +34 -28
- package/lib/packages/designer/src/packages/dataLinkage/index.vue.js +75 -69
- package/lib/packages/designer/src/packages/dialogGlobal/index.vue.js +1 -0
- package/lib/packages/designer/src/packages/eventFlow/dialog/action/Dialog.vue.js +48 -10
- package/lib/packages/designer/src/packages/eventFlow/dialog/action/config.js +2 -2
- package/lib/packages/designer/src/packages/form/aside/index.js +1 -0
- package/lib/packages/designer/src/packages/form/components/SubForm.vue.js +33 -7
- package/lib/packages/designer/src/packages/form/index.vue.js +15 -2
- package/lib/packages/designer/src/packages/form/property/subForm.vue.js +53 -11
- package/lib/packages/designer/src/packages/formulaEditor/components/FieldVariable.vue2.js +3 -2
- package/lib/packages/designer/src/packages/table/headerBtn.vue.js +1 -0
- package/lib/packages/vue/src/components/forms/form/Form.vue.js +28 -17
- package/lib/packages/vue/src/components/forms/form/validation.js +18 -6
- package/lib/packages/vue/src/components/forms/subForm/SubForm.vue.js +30 -1
- package/lib/packages/vue/src/utils/eventFlow/actionHandlers.js +2 -0
- package/package.json +1 -1
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
/* empty css */
|
|
6
6
|
/* empty css */
|
|
7
7
|
/* empty css */
|
|
8
|
-
import { getCurrentInstance, ref, onMounted, onBeforeUnmount,
|
|
8
|
+
import { getCurrentInstance, ref, watch, onMounted, onBeforeUnmount, provide, createBlock, openBlock, withCtx, createCommentVNode, createVNode, unref, normalizeStyle, createElementBlock, Fragment, renderList } from "vue";
|
|
9
9
|
import "../../../../../../node_modules/.pnpm/grid-layout-plus@1.1.1_vue@3.5.13_typescript@5.7.3_/node_modules/grid-layout-plus/es/index.mjs";
|
|
10
10
|
import { getCurrentVueInstance } from "../../../utils/getInstance.mjs";
|
|
11
11
|
import getJsonAsyncUtil from "../../../utils/getJsonAsyncUtil.mjs";
|
|
@@ -34,10 +34,10 @@ import { footer } from "../../details/footer/index.mjs";
|
|
|
34
34
|
import { checkFilterMatch, checkFieldInFilterConfig, checkFieldInResultConfig } from "../../../utils/parseFilterConfig.mjs";
|
|
35
35
|
import hooks from "../../../../../../node_modules/.pnpm/moment@2.30.1/node_modules/moment/dist/moment.mjs";
|
|
36
36
|
/* empty css */
|
|
37
|
+
import { ElMessage } from "../../../../../../node_modules/.pnpm/element-plus@2.13.2_vue@3.5.13_typescript@5.7.3_/node_modules/element-plus/es/components/message/index.mjs";
|
|
37
38
|
import { ElContainer } from "../../../../../../node_modules/.pnpm/element-plus@2.13.2_vue@3.5.13_typescript@5.7.3_/node_modules/element-plus/es/components/container/index.mjs";
|
|
38
39
|
import { ElForm } from "../../../../../../node_modules/.pnpm/element-plus@2.13.2_vue@3.5.13_typescript@5.7.3_/node_modules/element-plus/es/components/form/index.mjs";
|
|
39
40
|
import De from "../../../../../../node_modules/.pnpm/grid-layout-plus@1.1.1_vue@3.5.13_typescript@5.7.3_/node_modules/grid-layout-plus/es/components/grid-layout.vue.mjs";
|
|
40
|
-
import { ElMessage } from "../../../../../../node_modules/.pnpm/element-plus@2.13.2_vue@3.5.13_typescript@5.7.3_/node_modules/element-plus/es/components/message/index.mjs";
|
|
41
41
|
const _hoisted_1 = ["name", "value"];
|
|
42
42
|
const _sfc_main = /* @__PURE__ */ Object.assign({
|
|
43
43
|
inheritAttrs: false
|
|
@@ -119,6 +119,14 @@ const _sfc_main = /* @__PURE__ */ Object.assign({
|
|
|
119
119
|
pageEvents.handleUnmounted();
|
|
120
120
|
}
|
|
121
121
|
const formMode = ref("");
|
|
122
|
+
watch(
|
|
123
|
+
() => props.templateKey,
|
|
124
|
+
(key) => {
|
|
125
|
+
if (key) {
|
|
126
|
+
loadConfig();
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
);
|
|
122
130
|
const loadConfig = async () => {
|
|
123
131
|
if (!props.templateKey) {
|
|
124
132
|
return;
|
|
@@ -182,7 +190,10 @@ const _sfc_main = /* @__PURE__ */ Object.assign({
|
|
|
182
190
|
defaultData[component.fieldName] = defaultValue;
|
|
183
191
|
}
|
|
184
192
|
if (component.fieldName) {
|
|
185
|
-
const fieldRules = generateFieldRules(component
|
|
193
|
+
const fieldRules = generateFieldRules(component, formData, [
|
|
194
|
+
...fieldsData.value,
|
|
195
|
+
...hiddenFields.value
|
|
196
|
+
]);
|
|
186
197
|
if (fieldRules.length > 0) {
|
|
187
198
|
rules[component.fieldName] = fieldRules;
|
|
188
199
|
}
|
|
@@ -780,7 +791,7 @@ const _sfc_main = /* @__PURE__ */ Object.assign({
|
|
|
780
791
|
const rules = {};
|
|
781
792
|
updatedLayoutData.forEach(({ component }) => {
|
|
782
793
|
if (component.fieldName) {
|
|
783
|
-
const fieldRules = generateFieldRules(component);
|
|
794
|
+
const fieldRules = generateFieldRules(component, formData, fields);
|
|
784
795
|
if (fieldRules.length > 0) {
|
|
785
796
|
rules[component.fieldName] = fieldRules;
|
|
786
797
|
}
|
|
@@ -957,7 +968,7 @@ const _sfc_main = /* @__PURE__ */ Object.assign({
|
|
|
957
968
|
};
|
|
958
969
|
}
|
|
959
970
|
});
|
|
960
|
-
const _Form = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-
|
|
971
|
+
const _Form = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-63966ae6"]]);
|
|
961
972
|
export {
|
|
962
973
|
_Form as default
|
|
963
974
|
};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { checkFilterMatch } from "../../../utils/parseFilterConfig.mjs";
|
|
1
2
|
const VALIDATION_RULES = {
|
|
2
3
|
// 身份证
|
|
3
4
|
idCard: {
|
|
@@ -45,7 +46,7 @@ const VALIDATION_RULES = {
|
|
|
45
46
|
message: "请输入正确的联系电话"
|
|
46
47
|
}
|
|
47
48
|
};
|
|
48
|
-
function generateFieldRules(component) {
|
|
49
|
+
function generateFieldRules(component, formData, fields) {
|
|
49
50
|
const rules = [];
|
|
50
51
|
if (!component.fieldName) {
|
|
51
52
|
return rules;
|
|
@@ -58,16 +59,27 @@ function generateFieldRules(component) {
|
|
|
58
59
|
});
|
|
59
60
|
}
|
|
60
61
|
if (component.validationType && component.validationType !== "none") {
|
|
61
|
-
if (component.validationType === "regex" && component.
|
|
62
|
+
if (component.validationType === "regex" && component.validationPattern) {
|
|
62
63
|
try {
|
|
63
|
-
const
|
|
64
|
+
const validator = (_rule, _value, callback) => {
|
|
65
|
+
try {
|
|
66
|
+
const isMatch = checkFilterMatch(component.validationPattern, formData.value, fields);
|
|
67
|
+
if (!isMatch) {
|
|
68
|
+
callback(new Error(component.validationMessage || "校验失败"));
|
|
69
|
+
} else {
|
|
70
|
+
callback();
|
|
71
|
+
}
|
|
72
|
+
} catch (error) {
|
|
73
|
+
console.error("Validation function error:", error);
|
|
74
|
+
callback(new Error(component.validationMessage || "校验函数执行出错"));
|
|
75
|
+
}
|
|
76
|
+
};
|
|
64
77
|
rules.push({
|
|
65
|
-
|
|
66
|
-
message: component.regexMessage || "输入格式不正确",
|
|
78
|
+
validator,
|
|
67
79
|
trigger: "blur"
|
|
68
80
|
});
|
|
69
81
|
} catch (e) {
|
|
70
|
-
console.error("Invalid
|
|
82
|
+
console.error("Invalid validation pattern:", component.validationPattern, e);
|
|
71
83
|
}
|
|
72
84
|
} else if (component.validationType === "custom" && component.customValidator) {
|
|
73
85
|
try {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { inject, createElementBlock, openBlock, Fragment, createCommentVNode, createVNode, createBlock, unref, isRef } from "vue";
|
|
1
|
+
import { inject, computed, createElementBlock, openBlock, Fragment, createCommentVNode, createVNode, createBlock, unref, isRef } from "vue";
|
|
2
2
|
import { Form } from "../form/index.mjs";
|
|
3
3
|
import { SubTitle } from "../subTitle/index.mjs";
|
|
4
4
|
import { H2 } from "../h2/index.mjs";
|
|
@@ -50,6 +50,35 @@ const _sfc_main = /* @__PURE__ */ Object.assign({
|
|
|
50
50
|
inject("rowHeight");
|
|
51
51
|
inject("gridLayout");
|
|
52
52
|
const setFormItemHeight = inject("setFormItemHeight");
|
|
53
|
+
const templateKey = computed(() => {
|
|
54
|
+
if (props.config.formSource == "dynamic") {
|
|
55
|
+
const dynamicSubFormKey = props.config.dynamicSubFormKey;
|
|
56
|
+
if (dynamicSubFormKey) {
|
|
57
|
+
if (typeof dynamicSubFormKey === "object") {
|
|
58
|
+
const fieldId = dynamicSubFormKey.value;
|
|
59
|
+
const fieldsData = props.localConfig.fieldsData.map((item) => {
|
|
60
|
+
return item.component;
|
|
61
|
+
});
|
|
62
|
+
const hiddenFields = props.localConfig.hiddenFields;
|
|
63
|
+
const formItem = [...fieldsData, ...hiddenFields].find(
|
|
64
|
+
(item) => item.id == fieldId
|
|
65
|
+
);
|
|
66
|
+
if (formItem != null) {
|
|
67
|
+
const key = formData.value[formItem.fieldName];
|
|
68
|
+
return key;
|
|
69
|
+
} else {
|
|
70
|
+
return "";
|
|
71
|
+
}
|
|
72
|
+
} else {
|
|
73
|
+
return dynamicSubFormKey;
|
|
74
|
+
}
|
|
75
|
+
} else {
|
|
76
|
+
return "";
|
|
77
|
+
}
|
|
78
|
+
} else {
|
|
79
|
+
return props.config.subFormKey;
|
|
80
|
+
}
|
|
81
|
+
});
|
|
53
82
|
function subFormLoaded(subOption) {
|
|
54
83
|
const fieldsData = subOption.fieldsData;
|
|
55
84
|
console.log("🚀 ~ loaded ~ subOption:", subOption);
|
|
@@ -77,7 +106,7 @@ const _sfc_main = /* @__PURE__ */ Object.assign({
|
|
|
77
106
|
}, null, 8, ["config"])) : createCommentVNode("", true)
|
|
78
107
|
])) : createCommentVNode("", true),
|
|
79
108
|
createVNode(unref(Form), {
|
|
80
|
-
templateKey:
|
|
109
|
+
templateKey: unref(templateKey),
|
|
81
110
|
isSubForm: "",
|
|
82
111
|
onLoaded: subFormLoaded,
|
|
83
112
|
canPageEvent: __props.config.triggerSubFormPageEvent,
|
|
@@ -536,6 +536,8 @@ async function handleDialog(node, data, fields, context) {
|
|
|
536
536
|
} else if (basic.dialogSource == "custom") {
|
|
537
537
|
const dialogList = context.localConfig.dialogs || [];
|
|
538
538
|
dialog = dialogList.find((item) => item.id == (basic == null ? void 0 : basic.dialogId));
|
|
539
|
+
dialog.subFormMode = basic.subFormMode;
|
|
540
|
+
dialog.selectionMode = basic.selectionMode;
|
|
539
541
|
}
|
|
540
542
|
if (!dialog) {
|
|
541
543
|
console.error("ui-dialog: 未找到匹配的弹层配置," + (basic == null ? void 0 : basic.dialogId));
|