@fecp/designer 5.3.15 → 5.3.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/designer.css +93 -87
- package/es/packages/designer/package.json.mjs +1 -1
- package/es/packages/designer/src/layout/header/index.vue.mjs +1 -0
- package/es/packages/designer/src/packages/dialog/index.vue.mjs +44 -32
- package/es/packages/designer/src/packages/dialogGlobal/index.vue.mjs +1 -0
- package/es/packages/designer/src/packages/eventFlow/dialog/action/TableChildSelection.vue2.mjs +100 -0
- package/es/packages/designer/src/packages/eventFlow/dialog/action/config.mjs +4 -0
- package/es/packages/designer/src/packages/table/headerBtn.vue.mjs +1 -0
- package/es/packages/designer/src/packages/table/property/widgets.vue.mjs +8 -1
- package/es/packages/designer/src/packages/table/tableSetting.vue.mjs +72 -16
- package/es/packages/vue/src/components/dialog/DialogRenderer.vue2.mjs +5 -1
- package/es/packages/vue/src/components/forms/subTable/SubTable.vue.mjs +5 -5
- package/es/packages/vue/src/components/table/Table.vue.mjs +6 -3
- package/es/packages/vue/src/utils/eventFlow/actionHandlers.mjs +62 -0
- package/lib/designer.css +93 -87
- package/lib/packages/designer/package.json.js +1 -1
- package/lib/packages/designer/src/layout/header/index.vue.js +1 -0
- package/lib/packages/designer/src/packages/dialog/index.vue.js +44 -32
- package/lib/packages/designer/src/packages/dialogGlobal/index.vue.js +1 -0
- package/lib/packages/designer/src/packages/eventFlow/dialog/action/TableChildSelection.vue2.js +100 -0
- package/lib/packages/designer/src/packages/eventFlow/dialog/action/config.js +4 -0
- package/lib/packages/designer/src/packages/table/headerBtn.vue.js +1 -0
- package/lib/packages/designer/src/packages/table/property/widgets.vue.js +8 -1
- package/lib/packages/designer/src/packages/table/tableSetting.vue.js +71 -15
- package/lib/packages/vue/src/components/dialog/DialogRenderer.vue2.js +5 -1
- package/lib/packages/vue/src/components/forms/subTable/SubTable.vue.js +5 -5
- package/lib/packages/vue/src/components/table/Table.vue.js +6 -3
- package/lib/packages/vue/src/utils/eventFlow/actionHandlers.js +62 -0
- package/package.json +1 -1
|
@@ -313,6 +313,66 @@ async function handleTableChildRefresh(node, data, fields, context) {
|
|
|
313
313
|
};
|
|
314
314
|
}
|
|
315
315
|
}
|
|
316
|
+
async function handleTableChildSelection(node, data, fields, context) {
|
|
317
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
318
|
+
console.log("[EventFlow] 执行子表格选择赋值:", node.basic);
|
|
319
|
+
const basic = node.basic || {};
|
|
320
|
+
const formComponent = (_a = context.components) == null ? void 0 : _a.form;
|
|
321
|
+
const getFormDataMethod = (_c = (_b = formComponent == null ? void 0 : formComponent.$) == null ? void 0 : _b.exposed) == null ? void 0 : _c.getFormData;
|
|
322
|
+
const setFormDataMethod = (_e = (_d = formComponent == null ? void 0 : formComponent.$) == null ? void 0 : _d.exposed) == null ? void 0 : _e.setFormData;
|
|
323
|
+
const getFormItemRefMethod = (_g = (_f = formComponent == null ? void 0 : formComponent.$) == null ? void 0 : _f.exposed) == null ? void 0 : _g.getFormItemRef;
|
|
324
|
+
if (typeof getFormItemRefMethod === "function") {
|
|
325
|
+
const subTableRef = getFormItemRefMethod(String(basic.selectSubTableFieldId));
|
|
326
|
+
const getSelectionMethod = (_h = subTableRef == null ? void 0 : subTableRef.subTableRef) == null ? void 0 : _h.getSelection;
|
|
327
|
+
if (typeof getSelectionMethod === "function") {
|
|
328
|
+
const rows = await getSelectionMethod();
|
|
329
|
+
const fieldMapping = basic.subTableSelectionFieldMapping;
|
|
330
|
+
if (fieldMapping && Array.isArray(fieldMapping)) {
|
|
331
|
+
let formData = getFormDataMethod();
|
|
332
|
+
fieldMapping.forEach((mapping) => {
|
|
333
|
+
const { field, value } = mapping;
|
|
334
|
+
const targetField = fields.find((item) => item.id == field);
|
|
335
|
+
if (!targetField) {
|
|
336
|
+
return {
|
|
337
|
+
success: false,
|
|
338
|
+
message: `未找到字段: ${field}`
|
|
339
|
+
};
|
|
340
|
+
}
|
|
341
|
+
const values = rows.map((row) => row[value]);
|
|
342
|
+
formData[targetField.fieldName] = values.join(",");
|
|
343
|
+
});
|
|
344
|
+
if (typeof setFormDataMethod === "function") {
|
|
345
|
+
setFormDataMethod(formData);
|
|
346
|
+
return {
|
|
347
|
+
success: true,
|
|
348
|
+
message: "赋值成功"
|
|
349
|
+
};
|
|
350
|
+
} else {
|
|
351
|
+
console.error("未找到表单组件的 setFormData 方法");
|
|
352
|
+
return {
|
|
353
|
+
success: false,
|
|
354
|
+
message: "表单组件未正确配置或 setFormData 方法未暴露",
|
|
355
|
+
shouldShowError: true
|
|
356
|
+
};
|
|
357
|
+
}
|
|
358
|
+
}
|
|
359
|
+
} else {
|
|
360
|
+
console.error("[EventFlow] 未找到子列表组件的 getSelection 方法");
|
|
361
|
+
return {
|
|
362
|
+
success: false,
|
|
363
|
+
message: "子列表组件未正确配置或 getSelection 方法未暴露",
|
|
364
|
+
shouldShowError: true
|
|
365
|
+
};
|
|
366
|
+
}
|
|
367
|
+
} else {
|
|
368
|
+
console.error("[EventFlow] 未找到表单组件的 getFormItemRef 方法");
|
|
369
|
+
return {
|
|
370
|
+
success: false,
|
|
371
|
+
message: "表单组件未正确配置或 getFormItemRef 方法未暴露",
|
|
372
|
+
shouldShowError: true
|
|
373
|
+
};
|
|
374
|
+
}
|
|
375
|
+
}
|
|
316
376
|
async function handleTableRowDelete(node, data, fields, context) {
|
|
317
377
|
var _a, _b, _c;
|
|
318
378
|
console.log("[EventFlow] 执行表格行删除:", node.basic);
|
|
@@ -673,6 +733,7 @@ const defaultActionHandlers = {
|
|
|
673
733
|
"table-refresh": handleTableRefresh,
|
|
674
734
|
"table-row-delete": handleTableRowDelete,
|
|
675
735
|
"table-child-refresh": handleTableChildRefresh,
|
|
736
|
+
"table-child-selection": handleTableChildSelection,
|
|
676
737
|
"form-setValue": handleFormSetValue,
|
|
677
738
|
"form-submit": handleFormSubmit,
|
|
678
739
|
"custom": handleCustomAction,
|
|
@@ -690,6 +751,7 @@ export {
|
|
|
690
751
|
handlePageGoBack,
|
|
691
752
|
handlePageJump,
|
|
692
753
|
handleTableChildRefresh,
|
|
754
|
+
handleTableChildSelection,
|
|
693
755
|
handleTableRefresh,
|
|
694
756
|
handleTableRowDelete,
|
|
695
757
|
handleUpload
|