@fecp/designer 5.3.6 → 5.3.7
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
|
@@ -26,20 +26,20 @@ const eventFlowHandler = require("../../../utils/eventFlow/eventFlowHandler.js")
|
|
|
26
26
|
;/* empty css */
|
|
27
27
|
;/* empty css */
|
|
28
28
|
const _pluginVue_exportHelper = require("../../../../../../_virtual/_plugin-vue_export-helper.js");
|
|
29
|
-
const index$
|
|
29
|
+
const index$1 = require("../../../api/index.js");
|
|
30
30
|
;/* empty css */
|
|
31
31
|
;/* empty css */
|
|
32
32
|
const usePageEvents = require("../../../composables/usePageEvents.js");
|
|
33
|
-
const index$
|
|
34
|
-
const index$
|
|
35
|
-
const index$
|
|
33
|
+
const index$3 = require("../../details/header/index.js");
|
|
34
|
+
const index$4 = require("../../details/main/index.js");
|
|
35
|
+
const index$6 = require("../../details/footer/index.js");
|
|
36
36
|
const parseFilterConfig = require("../../../utils/parseFilterConfig.js");
|
|
37
37
|
const moment = require("../../../../../../node_modules/.pnpm/moment@2.30.1/node_modules/moment/dist/moment.js");
|
|
38
38
|
;/* empty css */
|
|
39
|
-
const index = require("../../../../../../node_modules/.pnpm/element-plus@2.13.2_vue@3.5.13_typescript@5.7.3_/node_modules/element-plus/es/components/
|
|
40
|
-
const index$
|
|
39
|
+
const index = require("../../../../../../node_modules/.pnpm/element-plus@2.13.2_vue@3.5.13_typescript@5.7.3_/node_modules/element-plus/es/components/message/index.js");
|
|
40
|
+
const index$2 = require("../../../../../../node_modules/.pnpm/element-plus@2.13.2_vue@3.5.13_typescript@5.7.3_/node_modules/element-plus/es/components/container/index.js");
|
|
41
|
+
const index$5 = require("../../../../../../node_modules/.pnpm/element-plus@2.13.2_vue@3.5.13_typescript@5.7.3_/node_modules/element-plus/es/components/form/index.js");
|
|
41
42
|
const gridLayout_vue = require("../../../../../../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.js");
|
|
42
|
-
const index$5 = require("../../../../../../node_modules/.pnpm/element-plus@2.13.2_vue@3.5.13_typescript@5.7.3_/node_modules/element-plus/es/components/message/index.js");
|
|
43
43
|
const _hoisted_1 = ["name", "value"];
|
|
44
44
|
const _sfc_main = /* @__PURE__ */ Object.assign({
|
|
45
45
|
inheritAttrs: false
|
|
@@ -121,6 +121,14 @@ const _sfc_main = /* @__PURE__ */ Object.assign({
|
|
|
121
121
|
pageEvents.handleUnmounted();
|
|
122
122
|
}
|
|
123
123
|
const formMode = vue.ref("");
|
|
124
|
+
vue.watch(
|
|
125
|
+
() => props.templateKey,
|
|
126
|
+
(key) => {
|
|
127
|
+
if (key) {
|
|
128
|
+
loadConfig();
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
);
|
|
124
132
|
const loadConfig = async () => {
|
|
125
133
|
if (!props.templateKey) {
|
|
126
134
|
return;
|
|
@@ -166,7 +174,7 @@ const _sfc_main = /* @__PURE__ */ Object.assign({
|
|
|
166
174
|
}
|
|
167
175
|
} catch (error) {
|
|
168
176
|
console.error("加载配置失败:", error);
|
|
169
|
-
index
|
|
177
|
+
index.ElMessage.error("加载配置失败");
|
|
170
178
|
} finally {
|
|
171
179
|
configLoading.value = false;
|
|
172
180
|
}
|
|
@@ -184,7 +192,10 @@ const _sfc_main = /* @__PURE__ */ Object.assign({
|
|
|
184
192
|
defaultData[component.fieldName] = defaultValue;
|
|
185
193
|
}
|
|
186
194
|
if (component.fieldName) {
|
|
187
|
-
const fieldRules = validation.generateFieldRules(component
|
|
195
|
+
const fieldRules = validation.generateFieldRules(component, formData, [
|
|
196
|
+
...fieldsData.value,
|
|
197
|
+
...hiddenFields.value
|
|
198
|
+
]);
|
|
188
199
|
if (fieldRules.length > 0) {
|
|
189
200
|
rules[component.fieldName] = fieldRules;
|
|
190
201
|
}
|
|
@@ -322,7 +333,7 @@ const _sfc_main = /* @__PURE__ */ Object.assign({
|
|
|
322
333
|
return;
|
|
323
334
|
}
|
|
324
335
|
try {
|
|
325
|
-
const response = await index$
|
|
336
|
+
const response = await index$1.default.getProductData(ctx.$http, prodIdValue);
|
|
326
337
|
productData.value = response;
|
|
327
338
|
console.log("产品数据加载成功:", productData.value);
|
|
328
339
|
} catch (error) {
|
|
@@ -782,7 +793,7 @@ const _sfc_main = /* @__PURE__ */ Object.assign({
|
|
|
782
793
|
const rules = {};
|
|
783
794
|
updatedLayoutData.forEach(({ component }) => {
|
|
784
795
|
if (component.fieldName) {
|
|
785
|
-
const fieldRules = validation.generateFieldRules(component);
|
|
796
|
+
const fieldRules = validation.generateFieldRules(component, formData, fields);
|
|
786
797
|
if (fieldRules.length > 0) {
|
|
787
798
|
rules[component.fieldName] = fieldRules;
|
|
788
799
|
}
|
|
@@ -878,8 +889,8 @@ const _sfc_main = /* @__PURE__ */ Object.assign({
|
|
|
878
889
|
localConfig
|
|
879
890
|
});
|
|
880
891
|
return (_ctx, _cache) => {
|
|
881
|
-
const _component_el_form = index$
|
|
882
|
-
const _component_el_container = index.ElContainer;
|
|
892
|
+
const _component_el_form = index$5.ElForm;
|
|
893
|
+
const _component_el_container = index$2.ElContainer;
|
|
883
894
|
return vue.openBlock(), vue.createBlock(_component_el_container, {
|
|
884
895
|
direction: "vertical",
|
|
885
896
|
class: "fec-form",
|
|
@@ -889,11 +900,11 @@ const _sfc_main = /* @__PURE__ */ Object.assign({
|
|
|
889
900
|
"data-version": "v5"
|
|
890
901
|
}, {
|
|
891
902
|
default: vue.withCtx(() => [
|
|
892
|
-
!configLoading.value && !__props.isSubForm && !__props.isDialog ? (vue.openBlock(), vue.createBlock(vue.unref(index$
|
|
903
|
+
!configLoading.value && !__props.isSubForm && !__props.isDialog ? (vue.openBlock(), vue.createBlock(vue.unref(index$3.header), {
|
|
893
904
|
key: 0,
|
|
894
905
|
pageHeaderConfig: localConfig.value.pageHeaderConfig
|
|
895
906
|
}, null, 8, ["pageHeaderConfig"])) : vue.createCommentVNode("", true),
|
|
896
|
-
vue.createVNode(vue.unref(index$
|
|
907
|
+
vue.createVNode(vue.unref(index$4.main), null, {
|
|
897
908
|
default: vue.withCtx(() => [
|
|
898
909
|
vue.createVNode(_component_el_form, {
|
|
899
910
|
ref_key: "formRef",
|
|
@@ -947,7 +958,7 @@ const _sfc_main = /* @__PURE__ */ Object.assign({
|
|
|
947
958
|
]),
|
|
948
959
|
_: 1
|
|
949
960
|
}),
|
|
950
|
-
!__props.isSubForm && !__props.isDialog ? (vue.openBlock(), vue.createBlock(vue.unref(index$
|
|
961
|
+
!__props.isSubForm && !__props.isDialog ? (vue.openBlock(), vue.createBlock(vue.unref(index$6.footer), {
|
|
951
962
|
key: 1,
|
|
952
963
|
formMode: formMode.value,
|
|
953
964
|
pageFooterConfig: localConfig.value.pageFooterConfig,
|
|
@@ -959,5 +970,5 @@ const _sfc_main = /* @__PURE__ */ Object.assign({
|
|
|
959
970
|
};
|
|
960
971
|
}
|
|
961
972
|
});
|
|
962
|
-
const _Form = /* @__PURE__ */ _pluginVue_exportHelper.default(_sfc_main, [["__scopeId", "data-v-
|
|
973
|
+
const _Form = /* @__PURE__ */ _pluginVue_exportHelper.default(_sfc_main, [["__scopeId", "data-v-63966ae6"]]);
|
|
963
974
|
exports.default = _Form;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const parseFilterConfig = require("../../../utils/parseFilterConfig.js");
|
|
3
4
|
const VALIDATION_RULES = {
|
|
4
5
|
// 身份证
|
|
5
6
|
idCard: {
|
|
@@ -47,7 +48,7 @@ const VALIDATION_RULES = {
|
|
|
47
48
|
message: "请输入正确的联系电话"
|
|
48
49
|
}
|
|
49
50
|
};
|
|
50
|
-
function generateFieldRules(component) {
|
|
51
|
+
function generateFieldRules(component, formData, fields) {
|
|
51
52
|
const rules = [];
|
|
52
53
|
if (!component.fieldName) {
|
|
53
54
|
return rules;
|
|
@@ -60,16 +61,27 @@ function generateFieldRules(component) {
|
|
|
60
61
|
});
|
|
61
62
|
}
|
|
62
63
|
if (component.validationType && component.validationType !== "none") {
|
|
63
|
-
if (component.validationType === "regex" && component.
|
|
64
|
+
if (component.validationType === "regex" && component.validationPattern) {
|
|
64
65
|
try {
|
|
65
|
-
const
|
|
66
|
+
const validator = (_rule, _value, callback) => {
|
|
67
|
+
try {
|
|
68
|
+
const isMatch = parseFilterConfig.checkFilterMatch(component.validationPattern, formData.value, fields);
|
|
69
|
+
if (!isMatch) {
|
|
70
|
+
callback(new Error(component.validationMessage || "校验失败"));
|
|
71
|
+
} else {
|
|
72
|
+
callback();
|
|
73
|
+
}
|
|
74
|
+
} catch (error) {
|
|
75
|
+
console.error("Validation function error:", error);
|
|
76
|
+
callback(new Error(component.validationMessage || "校验函数执行出错"));
|
|
77
|
+
}
|
|
78
|
+
};
|
|
66
79
|
rules.push({
|
|
67
|
-
|
|
68
|
-
message: component.regexMessage || "输入格式不正确",
|
|
80
|
+
validator,
|
|
69
81
|
trigger: "blur"
|
|
70
82
|
});
|
|
71
83
|
} catch (e) {
|
|
72
|
-
console.error("Invalid
|
|
84
|
+
console.error("Invalid validation pattern:", component.validationPattern, e);
|
|
73
85
|
}
|
|
74
86
|
} else if (component.validationType === "custom" && component.customValidator) {
|
|
75
87
|
try {
|
|
@@ -52,6 +52,35 @@ const _sfc_main = /* @__PURE__ */ Object.assign({
|
|
|
52
52
|
vue.inject("rowHeight");
|
|
53
53
|
vue.inject("gridLayout");
|
|
54
54
|
const setFormItemHeight = vue.inject("setFormItemHeight");
|
|
55
|
+
const templateKey = vue.computed(() => {
|
|
56
|
+
if (props.config.formSource == "dynamic") {
|
|
57
|
+
const dynamicSubFormKey = props.config.dynamicSubFormKey;
|
|
58
|
+
if (dynamicSubFormKey) {
|
|
59
|
+
if (typeof dynamicSubFormKey === "object") {
|
|
60
|
+
const fieldId = dynamicSubFormKey.value;
|
|
61
|
+
const fieldsData = props.localConfig.fieldsData.map((item) => {
|
|
62
|
+
return item.component;
|
|
63
|
+
});
|
|
64
|
+
const hiddenFields = props.localConfig.hiddenFields;
|
|
65
|
+
const formItem = [...fieldsData, ...hiddenFields].find(
|
|
66
|
+
(item) => item.id == fieldId
|
|
67
|
+
);
|
|
68
|
+
if (formItem != null) {
|
|
69
|
+
const key = formData.value[formItem.fieldName];
|
|
70
|
+
return key ? key + "V5" : "";
|
|
71
|
+
} else {
|
|
72
|
+
return "";
|
|
73
|
+
}
|
|
74
|
+
} else {
|
|
75
|
+
return dynamicSubFormKey;
|
|
76
|
+
}
|
|
77
|
+
} else {
|
|
78
|
+
return "";
|
|
79
|
+
}
|
|
80
|
+
} else {
|
|
81
|
+
return props.config.subFormKey;
|
|
82
|
+
}
|
|
83
|
+
});
|
|
55
84
|
function subFormLoaded(subOption) {
|
|
56
85
|
const fieldsData = subOption.fieldsData;
|
|
57
86
|
console.log("🚀 ~ loaded ~ subOption:", subOption);
|
|
@@ -79,7 +108,7 @@ const _sfc_main = /* @__PURE__ */ Object.assign({
|
|
|
79
108
|
}, null, 8, ["config"])) : vue.createCommentVNode("", true)
|
|
80
109
|
])) : vue.createCommentVNode("", true),
|
|
81
110
|
vue.createVNode(vue.unref(index$2.Form), {
|
|
82
|
-
templateKey:
|
|
111
|
+
templateKey: vue.unref(templateKey),
|
|
83
112
|
isSubForm: "",
|
|
84
113
|
onLoaded: subFormLoaded,
|
|
85
114
|
canPageEvent: __props.config.triggerSubFormPageEvent,
|
|
@@ -538,6 +538,8 @@ async function handleDialog(node, data, fields, context) {
|
|
|
538
538
|
} else if (basic.dialogSource == "custom") {
|
|
539
539
|
const dialogList = context.localConfig.dialogs || [];
|
|
540
540
|
dialog = dialogList.find((item) => item.id == (basic == null ? void 0 : basic.dialogId));
|
|
541
|
+
dialog.subFormMode = basic.subFormMode;
|
|
542
|
+
dialog.selectionMode = basic.selectionMode;
|
|
541
543
|
}
|
|
542
544
|
if (!dialog) {
|
|
543
545
|
console.error("ui-dialog: 未找到匹配的弹层配置," + (basic == null ? void 0 : basic.dialogId));
|