@fecp/designer 5.4.5 → 5.4.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/package.json.mjs +1 -1
- package/es/designer/src/components/ParamsConfig.vue2.mjs +1 -1
- package/es/designer/src/layout/aside/HiddenFieldDialog.vue.mjs +1 -1
- package/es/designer/src/packages/advancedFilter/ValueInput.vue2.mjs +1 -1
- package/es/designer/src/packages/dataLinkage/index.vue.mjs +1 -1
- package/es/designer/src/packages/dialogGlobal/index.vue.mjs +1 -1
- package/es/designer/src/packages/form/property/approvalHistory.vue.mjs +1 -1
- package/es/designer/src/packages/form/property/subForm.vue.mjs +1 -1
- package/es/designer/src/packages/prod/index.vue.mjs +1 -1
- package/es/designer/src/packages/table/headerBtn.vue.mjs +1 -1
- package/es/designer/src/packages/table/index.vue.mjs +1 -1
- package/es/designer.css +78 -72
- package/es/packages/vue/src/components/forms/form/Form.vue.mjs +36 -11
- package/es/packages/vue/src/components/forms/formItem/FormItem.vue.mjs +1 -2
- package/es/packages/vue/src/components/forms/subForm/SubForm.vue.mjs +8 -2
- package/es/packages/vue/src/components/forms/textarea/Textarea.vue.mjs +1 -2
- package/es/packages/vue/src/utils/datasource.mjs +6 -2
- package/lib/designer/package.json.js +1 -1
- package/lib/designer/src/components/ParamsConfig.vue2.js +1 -1
- package/lib/designer/src/layout/aside/HiddenFieldDialog.vue.js +1 -1
- package/lib/designer/src/packages/advancedFilter/ValueInput.vue2.js +1 -1
- package/lib/designer/src/packages/dataLinkage/index.vue.js +1 -1
- package/lib/designer/src/packages/dialogGlobal/index.vue.js +1 -1
- package/lib/designer/src/packages/form/property/approvalHistory.vue.js +1 -1
- package/lib/designer/src/packages/form/property/subForm.vue.js +1 -1
- package/lib/designer/src/packages/prod/index.vue.js +1 -1
- package/lib/designer/src/packages/table/headerBtn.vue.js +1 -1
- package/lib/designer/src/packages/table/index.vue.js +1 -1
- package/lib/designer.css +78 -72
- package/lib/packages/vue/src/components/forms/form/Form.vue.js +35 -10
- package/lib/packages/vue/src/components/forms/formItem/FormItem.vue.js +1 -2
- package/lib/packages/vue/src/components/forms/subForm/SubForm.vue.js +7 -1
- package/lib/packages/vue/src/components/forms/textarea/Textarea.vue.js +1 -2
- package/lib/packages/vue/src/utils/datasource.js +6 -2
- package/package.json +1 -1
|
@@ -162,22 +162,26 @@ const _sfc_main = /* @__PURE__ */ Object.assign({
|
|
|
162
162
|
return item.component;
|
|
163
163
|
});
|
|
164
164
|
hiddenFields.value = option.hiddenFields || [];
|
|
165
|
-
await loadFieldDataSources();
|
|
166
|
-
await loadProductData();
|
|
167
|
-
applyProductConfigToForm();
|
|
168
|
-
mergeOptionsToFields();
|
|
169
165
|
loadFormData();
|
|
170
166
|
loadEventFlow();
|
|
171
|
-
initGridLayoutDataConfig();
|
|
172
167
|
if (pageEvents && localConfig.value.pageEventConfig) {
|
|
173
168
|
const onCreatedEvent = localConfig.value.pageEventConfig.find(
|
|
174
169
|
(e) => e.name === "onCreated"
|
|
175
170
|
);
|
|
176
171
|
if (onCreatedEvent) {
|
|
177
172
|
console.log("🚀 页面 onCreated 事件触发");
|
|
178
|
-
|
|
173
|
+
try {
|
|
174
|
+
await pageEvents.executeEvent("onCreated");
|
|
175
|
+
} catch (error) {
|
|
176
|
+
}
|
|
179
177
|
}
|
|
180
178
|
}
|
|
179
|
+
await loadFieldDataSources();
|
|
180
|
+
await loadProductData();
|
|
181
|
+
applyProductConfigToForm();
|
|
182
|
+
mergeOptionsToFields();
|
|
183
|
+
initGridLayoutDataConfig();
|
|
184
|
+
initLinkage();
|
|
181
185
|
emit("loaded", option);
|
|
182
186
|
} catch (error) {
|
|
183
187
|
console.error("加载配置失败:", error);
|
|
@@ -253,7 +257,9 @@ const _sfc_main = /* @__PURE__ */ Object.assign({
|
|
|
253
257
|
http: ctx.$http,
|
|
254
258
|
dataSources: localConfig.value.dataSources,
|
|
255
259
|
currentDataSourceId: dataSourceId,
|
|
256
|
-
pagination: false
|
|
260
|
+
pagination: false,
|
|
261
|
+
data: formData.value,
|
|
262
|
+
fields: [...fieldsData.value, ...hiddenFields.value]
|
|
257
263
|
});
|
|
258
264
|
const data = await dsManager.fetch();
|
|
259
265
|
let options = [];
|
|
@@ -599,7 +605,14 @@ const _sfc_main = /* @__PURE__ */ Object.assign({
|
|
|
599
605
|
};
|
|
600
606
|
const validate = () => {
|
|
601
607
|
var _a;
|
|
602
|
-
|
|
608
|
+
const subFormComps = gridLayoutFieldsData.value.filter((item) => item.component.fieldType == "subForm").map((item) => item.component);
|
|
609
|
+
const subFormPromises = subFormComps.map((subForm) => {
|
|
610
|
+
var _a2, _b;
|
|
611
|
+
const subFormRef = getFormItemRef(String(subForm.id));
|
|
612
|
+
return ((_b = (_a2 = subFormRef == null ? void 0 : subFormRef.subFormRef) == null ? void 0 : _a2.validate) == null ? void 0 : _b.call(_a2)) || Promise.resolve();
|
|
613
|
+
});
|
|
614
|
+
subFormPromises.push((_a = formRef.value) == null ? void 0 : _a.validate());
|
|
615
|
+
return Promise.all(subFormPromises);
|
|
603
616
|
};
|
|
604
617
|
const resetFields = () => {
|
|
605
618
|
var _a, _b;
|
|
@@ -713,7 +726,7 @@ const _sfc_main = /* @__PURE__ */ Object.assign({
|
|
|
713
726
|
});
|
|
714
727
|
}
|
|
715
728
|
if (flag) {
|
|
716
|
-
return processedData;
|
|
729
|
+
return common.removeEmptyValues(processedData);
|
|
717
730
|
}
|
|
718
731
|
Object.assign(formData.value, processedData);
|
|
719
732
|
};
|
|
@@ -896,9 +909,21 @@ const _sfc_main = /* @__PURE__ */ Object.assign({
|
|
|
896
909
|
gridLayoutFieldsData.value = updatedLayoutData.filter((item) => !item.hidden);
|
|
897
910
|
(_a = gridLayout == null ? void 0 : gridLayout.value) == null ? void 0 : _a.resizeEvent();
|
|
898
911
|
};
|
|
912
|
+
let linkaged = false;
|
|
913
|
+
function initLinkage() {
|
|
914
|
+
const changedFields = findChangedFields(formData.value, prevFormData.value);
|
|
915
|
+
if (changedFields.length > 0) {
|
|
916
|
+
applyLinkageEffectsForChangedFields(changedFields);
|
|
917
|
+
}
|
|
918
|
+
prevFormData.value = { ...formData.value };
|
|
919
|
+
linkaged = true;
|
|
920
|
+
}
|
|
899
921
|
vue.watch(
|
|
900
922
|
formData,
|
|
901
923
|
(newVal, oldVal) => {
|
|
924
|
+
if (!linkaged) {
|
|
925
|
+
return;
|
|
926
|
+
}
|
|
902
927
|
const changedFields = findChangedFields(newVal, prevFormData.value);
|
|
903
928
|
if (changedFields.length > 0) {
|
|
904
929
|
applyLinkageEffectsForChangedFields(changedFields);
|
|
@@ -1029,5 +1054,5 @@ const _sfc_main = /* @__PURE__ */ Object.assign({
|
|
|
1029
1054
|
};
|
|
1030
1055
|
}
|
|
1031
1056
|
});
|
|
1032
|
-
const _Form = /* @__PURE__ */ _pluginVue_exportHelper.default(_sfc_main, [["__scopeId", "data-v-
|
|
1057
|
+
const _Form = /* @__PURE__ */ _pluginVue_exportHelper.default(_sfc_main, [["__scopeId", "data-v-8baf793f"]]);
|
|
1033
1058
|
exports.default = _Form;
|
|
@@ -102,7 +102,6 @@ const _sfc_main = /* @__PURE__ */ Object.assign({
|
|
|
102
102
|
}
|
|
103
103
|
});
|
|
104
104
|
const getInnerComponentRef = () => {
|
|
105
|
-
debugger;
|
|
106
105
|
return innerComponentRef.value;
|
|
107
106
|
};
|
|
108
107
|
__expose({
|
|
@@ -191,5 +190,5 @@ const _sfc_main = /* @__PURE__ */ Object.assign({
|
|
|
191
190
|
};
|
|
192
191
|
}
|
|
193
192
|
});
|
|
194
|
-
const _FormItem = /* @__PURE__ */ _pluginVue_exportHelper.default(_sfc_main, [["__scopeId", "data-v-
|
|
193
|
+
const _FormItem = /* @__PURE__ */ _pluginVue_exportHelper.default(_sfc_main, [["__scopeId", "data-v-df2a70b8"]]);
|
|
195
194
|
exports.default = _FormItem;
|
|
@@ -47,7 +47,7 @@ const _sfc_main = /* @__PURE__ */ Object.assign({
|
|
|
47
47
|
// default: false,
|
|
48
48
|
// },
|
|
49
49
|
},
|
|
50
|
-
setup(__props) {
|
|
50
|
+
setup(__props, { expose: __expose }) {
|
|
51
51
|
const props = __props;
|
|
52
52
|
const formData = vue.inject("formData");
|
|
53
53
|
vue.inject("rowHeight");
|
|
@@ -107,6 +107,10 @@ const _sfc_main = /* @__PURE__ */ Object.assign({
|
|
|
107
107
|
setFormItemHeight(props.config.id, true, maxY + maxYH + titleHeight);
|
|
108
108
|
}
|
|
109
109
|
}
|
|
110
|
+
const formRef = vue.ref();
|
|
111
|
+
__expose({
|
|
112
|
+
subFormRef: formRef
|
|
113
|
+
});
|
|
110
114
|
return (_ctx, _cache) => {
|
|
111
115
|
return vue.openBlock(), vue.createElementBlock(vue.Fragment, null, [
|
|
112
116
|
__props.config.titleMode != "none" ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_1, [
|
|
@@ -119,6 +123,8 @@ const _sfc_main = /* @__PURE__ */ Object.assign({
|
|
|
119
123
|
}, null, 8, ["config"])) : vue.createCommentVNode("", true)
|
|
120
124
|
])) : vue.createCommentVNode("", true),
|
|
121
125
|
vue.createVNode(vue.unref(index$2.Form), {
|
|
126
|
+
ref_key: "formRef",
|
|
127
|
+
ref: formRef,
|
|
122
128
|
templateKey: vue.unref(templateKey),
|
|
123
129
|
isSubForm: "",
|
|
124
130
|
onLayoutUpdated: subFormLoaded,
|
|
@@ -78,7 +78,6 @@ const _sfc_main = /* @__PURE__ */ Object.assign({
|
|
|
78
78
|
"show-word-limit": __props.showWordCount,
|
|
79
79
|
rows: __props.rows,
|
|
80
80
|
autosize: __props.autosize,
|
|
81
|
-
clearable: "",
|
|
82
81
|
resize: "none",
|
|
83
82
|
onChange: handleChange
|
|
84
83
|
}), null, 16, ["modelValue", "placeholder", "disabled", "readonly", "maxlength", "show-word-limit", "rows", "autosize"])
|
|
@@ -86,5 +85,5 @@ const _sfc_main = /* @__PURE__ */ Object.assign({
|
|
|
86
85
|
};
|
|
87
86
|
}
|
|
88
87
|
});
|
|
89
|
-
const _Textarea = /* @__PURE__ */ _pluginVue_exportHelper.default(_sfc_main, [["__scopeId", "data-v-
|
|
88
|
+
const _Textarea = /* @__PURE__ */ _pluginVue_exportHelper.default(_sfc_main, [["__scopeId", "data-v-34bc3c06"]]);
|
|
90
89
|
exports.default = _Textarea;
|
|
@@ -19,7 +19,9 @@ class DataSourceManager {
|
|
|
19
19
|
this.currentDataSourceId = options.currentDataSourceId;
|
|
20
20
|
this.pagination = options.pagination || false;
|
|
21
21
|
this.sortRules = vue.reactive(options.sortRules || []);
|
|
22
|
-
this.originalSortRules = JSON.parse(
|
|
22
|
+
this.originalSortRules = JSON.parse(
|
|
23
|
+
JSON.stringify(options.sortRules || [])
|
|
24
|
+
);
|
|
23
25
|
this.showSuccessMessage = options.showSuccessMessage || false;
|
|
24
26
|
this.loading = false;
|
|
25
27
|
this.error = null;
|
|
@@ -255,7 +257,9 @@ class DataSourceManager {
|
|
|
255
257
|
* 更新排序
|
|
256
258
|
*/
|
|
257
259
|
updateSort(field, order) {
|
|
258
|
-
const existingIndex = this.sortRules.findIndex(
|
|
260
|
+
const existingIndex = this.sortRules.findIndex(
|
|
261
|
+
(rule) => rule.field === field
|
|
262
|
+
);
|
|
259
263
|
if (!order) {
|
|
260
264
|
if (existingIndex > -1) {
|
|
261
265
|
this.sortRules.splice(existingIndex, 1);
|