@fecp/designer 5.3.4 → 5.3.5
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 +208 -179
- package/es/packages/designer/package.json.mjs +1 -1
- package/es/packages/designer/src/components/FilterConfigDisplay.vue.mjs +5 -3
- package/es/packages/designer/src/packages/advancedFilter/ValueInput.vue2.mjs +2 -2
- package/es/packages/designer/src/packages/dataLinkage/index.vue.mjs +85 -75
- package/es/packages/designer/src/packages/dialogGlobal/index.vue.mjs +2 -0
- package/es/packages/designer/src/packages/eventFlow/dialog/action/TableChildRefresh.vue2.mjs +94 -0
- package/es/packages/designer/src/packages/eventFlow/dialog/action/TableRowDelete.vue2.mjs +54 -0
- package/es/packages/designer/src/packages/eventFlow/dialog/action/config.mjs +12 -1
- package/es/packages/designer/src/packages/formulaEditor/index.vue2.mjs +10 -1
- package/es/packages/designer/src/packages/table/headerBtn.vue.mjs +2 -0
- package/es/packages/designer/src/packages/table/queryModule/DynamicModeConfig.vue.mjs +12 -5
- package/es/packages/designer/src/packages/table/queryModule/index.vue.mjs +11 -16
- package/es/packages/vue/src/components/bus/approvalHistory/ApprovalHistory.vue.mjs +5 -4
- package/es/packages/vue/src/components/forms/form/Form.vue.mjs +234 -139
- package/es/packages/vue/src/components/forms/formItem/FormItem.vue.mjs +20 -3
- package/es/packages/vue/src/components/forms/subForm/SubForm.vue.mjs +4 -4
- package/es/packages/vue/src/components/forms/subTable/SubTable.vue.mjs +11 -5
- package/es/packages/vue/src/components/table/CustomButtons.vue.mjs +11 -3
- package/es/packages/vue/src/components/table/DynamicQuery.vue.mjs +16 -8
- package/es/packages/vue/src/components/table/Table.vue.mjs +7 -5
- package/es/packages/vue/src/utils/eventFlow/actionHandlers.mjs +86 -5
- package/es/packages/vue/src/utils/parseFilterConfig.mjs +44 -0
- package/lib/designer.css +208 -179
- package/lib/packages/designer/package.json.js +1 -1
- package/lib/packages/designer/src/components/FilterConfigDisplay.vue.js +5 -3
- package/lib/packages/designer/src/packages/advancedFilter/ValueInput.vue2.js +2 -2
- package/lib/packages/designer/src/packages/dataLinkage/index.vue.js +93 -83
- package/lib/packages/designer/src/packages/dialogGlobal/index.vue.js +2 -0
- package/lib/packages/designer/src/packages/eventFlow/dialog/action/TableChildRefresh.vue2.js +94 -0
- package/lib/packages/designer/src/packages/eventFlow/dialog/action/TableRowDelete.vue2.js +54 -0
- package/lib/packages/designer/src/packages/eventFlow/dialog/action/config.js +12 -1
- package/lib/packages/designer/src/packages/formulaEditor/index.vue2.js +10 -1
- package/lib/packages/designer/src/packages/table/headerBtn.vue.js +2 -0
- package/lib/packages/designer/src/packages/table/queryModule/DynamicModeConfig.vue.js +12 -5
- package/lib/packages/designer/src/packages/table/queryModule/index.vue.js +11 -16
- package/lib/packages/vue/src/components/bus/approvalHistory/ApprovalHistory.vue.js +5 -4
- package/lib/packages/vue/src/components/forms/form/Form.vue.js +232 -137
- package/lib/packages/vue/src/components/forms/formItem/FormItem.vue.js +19 -2
- package/lib/packages/vue/src/components/forms/subForm/SubForm.vue.js +4 -4
- package/lib/packages/vue/src/components/forms/subTable/SubTable.vue.js +11 -5
- package/lib/packages/vue/src/components/table/CustomButtons.vue.js +11 -3
- package/lib/packages/vue/src/components/table/DynamicQuery.vue.js +16 -8
- package/lib/packages/vue/src/components/table/Table.vue.js +7 -5
- package/lib/packages/vue/src/utils/eventFlow/actionHandlers.js +92 -11
- package/lib/packages/vue/src/utils/parseFilterConfig.js +44 -0
- package/package.json +1 -1
|
@@ -27,6 +27,14 @@ const _sfc_main = {
|
|
|
27
27
|
localConfig: {
|
|
28
28
|
type: Object,
|
|
29
29
|
default: {}
|
|
30
|
+
},
|
|
31
|
+
readOnly: {
|
|
32
|
+
type: Boolean,
|
|
33
|
+
default: false
|
|
34
|
+
},
|
|
35
|
+
isSubTable: {
|
|
36
|
+
type: Boolean,
|
|
37
|
+
default: false
|
|
30
38
|
}
|
|
31
39
|
},
|
|
32
40
|
emits: ["click"],
|
|
@@ -88,10 +96,10 @@ const _sfc_main = {
|
|
|
88
96
|
})
|
|
89
97
|
])) : createCommentVNode("", true),
|
|
90
98
|
__props.localConfig.showTitle ? (openBlock(), createElementBlock("div", _hoisted_2, toDisplayString(__props.localConfig.templateName), 1)) : createCommentVNode("", true),
|
|
91
|
-
hasButtons.value ? (openBlock(), createBlock(unref(VxeToolbar), {
|
|
99
|
+
!__props.readOnly && !__props.isSubTable && hasButtons.value ? (openBlock(), createBlock(unref(VxeToolbar), {
|
|
92
100
|
key: 2,
|
|
93
101
|
ref: "toolbarRef",
|
|
94
|
-
style: { "flex": "1" }
|
|
102
|
+
style: { "flex": "1", "margin-bottom": "8px" }
|
|
95
103
|
}, {
|
|
96
104
|
buttons: withCtx(() => [
|
|
97
105
|
leftButtons.value.length ? (openBlock(true), createElementBlock(Fragment, { key: 0 }, renderList(leftButtons.value, (btn) => {
|
|
@@ -129,7 +137,7 @@ const _sfc_main = {
|
|
|
129
137
|
};
|
|
130
138
|
}
|
|
131
139
|
};
|
|
132
|
-
const CustomButtons = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-
|
|
140
|
+
const CustomButtons = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-4a702348"]]);
|
|
133
141
|
export {
|
|
134
142
|
CustomButtons as default
|
|
135
143
|
};
|
|
@@ -50,7 +50,10 @@ const _hoisted_5 = {
|
|
|
50
50
|
class: "tab-display-section"
|
|
51
51
|
};
|
|
52
52
|
const _hoisted_6 = { class: "search-display-section" };
|
|
53
|
-
const _hoisted_7 = {
|
|
53
|
+
const _hoisted_7 = {
|
|
54
|
+
key: 0,
|
|
55
|
+
class: "search-input-group"
|
|
56
|
+
};
|
|
54
57
|
const _hoisted_8 = { class: "expand-filter-section" };
|
|
55
58
|
const _hoisted_9 = { class: "filter-form-section" };
|
|
56
59
|
const _hoisted_10 = { class: "form-items-draggable" };
|
|
@@ -72,6 +75,10 @@ const _sfc_main = {
|
|
|
72
75
|
isSubTable: {
|
|
73
76
|
type: Boolean,
|
|
74
77
|
default: false
|
|
78
|
+
},
|
|
79
|
+
readOnly: {
|
|
80
|
+
type: Boolean,
|
|
81
|
+
default: false
|
|
75
82
|
}
|
|
76
83
|
},
|
|
77
84
|
emits: ["click", "search"],
|
|
@@ -249,7 +256,7 @@ const _sfc_main = {
|
|
|
249
256
|
})
|
|
250
257
|
])) : createCommentVNode("", true),
|
|
251
258
|
__props.localConfig.showTitle ? (openBlock(), createElementBlock("div", _hoisted_4, toDisplayString(__props.localConfig.templateName), 1)) : createCommentVNode("", true),
|
|
252
|
-
tabConfigs.value.length > 0 ? (openBlock(), createElementBlock("div", _hoisted_5, [
|
|
259
|
+
queryConfig.value.enabled && tabConfigs.value.length > 0 ? (openBlock(), createElementBlock("div", _hoisted_5, [
|
|
253
260
|
createVNode(_component_el_tabs, {
|
|
254
261
|
modelValue: activeTab.value,
|
|
255
262
|
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => activeTab.value = $event),
|
|
@@ -268,7 +275,7 @@ const _sfc_main = {
|
|
|
268
275
|
}, 8, ["modelValue"])
|
|
269
276
|
])) : createCommentVNode("", true),
|
|
270
277
|
createElementVNode("div", _hoisted_6, [
|
|
271
|
-
|
|
278
|
+
queryConfig.value.enabled ? (openBlock(), createElementBlock("div", _hoisted_7, [
|
|
272
279
|
createVNode(_component_el_input, {
|
|
273
280
|
modelValue: searchInputValue.value,
|
|
274
281
|
"onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => searchInputValue.value = $event),
|
|
@@ -293,10 +300,11 @@ const _sfc_main = {
|
|
|
293
300
|
key: "0"
|
|
294
301
|
} : void 0
|
|
295
302
|
]), 1032, ["modelValue", "prefix-icon"])
|
|
296
|
-
]),
|
|
297
|
-
rightButtons.value.length > 0 ? (openBlock(), createBlock(unref(VxeToolbar), {
|
|
298
|
-
key:
|
|
299
|
-
ref: "toolbarRef"
|
|
303
|
+
])) : createCommentVNode("", true),
|
|
304
|
+
!__props.readOnly && !__props.isSubTable && rightButtons.value.length > 0 ? (openBlock(), createBlock(unref(VxeToolbar), {
|
|
305
|
+
key: 1,
|
|
306
|
+
ref: "toolbarRef",
|
|
307
|
+
style: { "margin-bottom": "8px" }
|
|
300
308
|
}, {
|
|
301
309
|
tools: withCtx(() => [
|
|
302
310
|
!__props.isSubTable && rightButtons.value.length ? (openBlock(true), createElementBlock(Fragment, { key: 0 }, renderList(rightButtons.value, (btn) => {
|
|
@@ -423,7 +431,7 @@ const _sfc_main = {
|
|
|
423
431
|
};
|
|
424
432
|
}
|
|
425
433
|
};
|
|
426
|
-
const DynamicQuery = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-
|
|
434
|
+
const DynamicQuery = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-cc8f1fb6"]]);
|
|
427
435
|
export {
|
|
428
436
|
DynamicQuery as default
|
|
429
437
|
};
|
|
@@ -564,21 +564,23 @@ const _sfc_main = /* @__PURE__ */ Object.assign({
|
|
|
564
564
|
onSearch: handleFilterSearch,
|
|
565
565
|
onReset: handleFilterReset
|
|
566
566
|
}, null, 8, ["query-config", "fields-data"]),
|
|
567
|
-
|
|
568
|
-
key: 0,
|
|
567
|
+
createVNode(CustomButtons, {
|
|
569
568
|
"custom-btns": localConfig.value.customBtns,
|
|
570
569
|
localConfig: localConfig.value,
|
|
570
|
+
readonly: __props.readonly,
|
|
571
|
+
isSubTable: __props.isSubTable,
|
|
571
572
|
onClick: handleCustomBtnClick
|
|
572
|
-
}, null, 8, ["custom-btns", "localConfig"
|
|
573
|
+
}, null, 8, ["custom-btns", "localConfig", "readonly", "isSubTable"])
|
|
573
574
|
], 64)) : createCommentVNode("", true),
|
|
574
575
|
localConfig.value.queryConfig.mode == "dynamic" ? (openBlock(), createBlock(DynamicQuery, {
|
|
575
576
|
key: 1,
|
|
577
|
+
readonly: __props.readonly,
|
|
576
578
|
isSubTable: __props.isSubTable,
|
|
577
579
|
localConfig: localConfig.value,
|
|
578
580
|
"fields-data": fieldsData.value,
|
|
579
581
|
onSearch: handleFilterSearch,
|
|
580
582
|
onClick: handleCustomBtnClick
|
|
581
|
-
}, null, 8, ["isSubTable", "localConfig", "fields-data"])) : createCommentVNode("", true),
|
|
583
|
+
}, null, 8, ["readonly", "isSubTable", "localConfig", "fields-data"])) : createCommentVNode("", true),
|
|
582
584
|
createElementVNode("div", _hoisted_1, [
|
|
583
585
|
createVNode(unref(VxeTable), {
|
|
584
586
|
ref_key: "tableRef",
|
|
@@ -643,7 +645,7 @@ const _sfc_main = /* @__PURE__ */ Object.assign({
|
|
|
643
645
|
};
|
|
644
646
|
}
|
|
645
647
|
});
|
|
646
|
-
const _Table = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-
|
|
648
|
+
const _Table = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-8f3c46b5"]]);
|
|
647
649
|
export {
|
|
648
650
|
_Table as default
|
|
649
651
|
};
|
|
@@ -8,8 +8,8 @@ import api from "../../api/index.mjs";
|
|
|
8
8
|
/* empty css */
|
|
9
9
|
/* empty css */
|
|
10
10
|
/* empty css */
|
|
11
|
-
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";
|
|
12
11
|
import { ElMessageBox } from "../../../../../node_modules/.pnpm/element-plus@2.13.2_vue@3.5.13_typescript@5.7.3_/node_modules/element-plus/es/components/message-box/index.mjs";
|
|
12
|
+
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";
|
|
13
13
|
async function handlePageJump(node, data, fields, context) {
|
|
14
14
|
const dialogDoms = document.querySelectorAll(".el-modal-dialog");
|
|
15
15
|
if ((dialogDoms == null ? void 0 : dialogDoms.length) > 0) {
|
|
@@ -262,7 +262,7 @@ async function handleTableRefresh(node, data, fields, context) {
|
|
|
262
262
|
var _a, _b, _c;
|
|
263
263
|
console.log("[EventFlow] 执行表格刷新:", node.basic);
|
|
264
264
|
const basic = node.basic || {};
|
|
265
|
-
const
|
|
265
|
+
const refreshOptions2 = {
|
|
266
266
|
resetSort: basic.resetSort !== false,
|
|
267
267
|
// 默认 true
|
|
268
268
|
resetFilter: basic.resetFilter !== false,
|
|
@@ -270,11 +270,11 @@ async function handleTableRefresh(node, data, fields, context) {
|
|
|
270
270
|
resetPagination: basic.resetPagination !== false
|
|
271
271
|
// 默认 true
|
|
272
272
|
};
|
|
273
|
-
console.log("[EventFlow] 刷新选项:",
|
|
273
|
+
console.log("[EventFlow] 刷新选项:", refreshOptions2);
|
|
274
274
|
const tableComponent = (_a = context.components) == null ? void 0 : _a.table;
|
|
275
275
|
const refreshMethod = (_c = (_b = tableComponent == null ? void 0 : tableComponent.$) == null ? void 0 : _b.exposed) == null ? void 0 : _c.refresh;
|
|
276
276
|
if (typeof refreshMethod === "function") {
|
|
277
|
-
await refreshMethod(
|
|
277
|
+
await refreshMethod(refreshOptions2);
|
|
278
278
|
return {
|
|
279
279
|
success: true,
|
|
280
280
|
message: "表格已刷新"
|
|
@@ -288,6 +288,83 @@ async function handleTableRefresh(node, data, fields, context) {
|
|
|
288
288
|
};
|
|
289
289
|
}
|
|
290
290
|
}
|
|
291
|
+
async function handleTableChildRefresh(node, data, fields, context) {
|
|
292
|
+
var _a, _b, _c, _d;
|
|
293
|
+
console.log("[EventFlow] 执行子表格刷新:", node.basic);
|
|
294
|
+
const basic = node.basic || {};
|
|
295
|
+
const formComponent = (_a = context.components) == null ? void 0 : _a.form;
|
|
296
|
+
const getFormItemRefMethod = (_c = (_b = formComponent == null ? void 0 : formComponent.$) == null ? void 0 : _b.exposed) == null ? void 0 : _c.getFormItemRef;
|
|
297
|
+
if (typeof getFormItemRefMethod === "function") {
|
|
298
|
+
const subTableRef = getFormItemRefMethod(String(basic.selectSubTableFieldId));
|
|
299
|
+
context.components.table = {
|
|
300
|
+
$: {
|
|
301
|
+
exposed: {
|
|
302
|
+
refresh: (_d = subTableRef == null ? void 0 : subTableRef.subTableRef) == null ? void 0 : _d.refresh
|
|
303
|
+
}
|
|
304
|
+
}
|
|
305
|
+
};
|
|
306
|
+
return await handleTableRefresh(node, data, fields, context);
|
|
307
|
+
} else {
|
|
308
|
+
console.error("[EventFlow] 未找到表单组件的 getFormItemRef 方法");
|
|
309
|
+
return {
|
|
310
|
+
success: false,
|
|
311
|
+
message: "表单组件未正确配置或 getFormItemRef 方法未暴露",
|
|
312
|
+
shouldShowError: true
|
|
313
|
+
};
|
|
314
|
+
}
|
|
315
|
+
}
|
|
316
|
+
async function handleTableRowDelete(node, data, fields, context) {
|
|
317
|
+
var _a, _b, _c;
|
|
318
|
+
console.log("[EventFlow] 执行表格行删除:", node.basic);
|
|
319
|
+
const basic = node.basic || {};
|
|
320
|
+
if (basic.showConfirmDeleteMessage) {
|
|
321
|
+
try {
|
|
322
|
+
await ElMessageBox.confirm(
|
|
323
|
+
"此操作将永久删除该记录, 是否继续",
|
|
324
|
+
"确认操作",
|
|
325
|
+
{
|
|
326
|
+
type: "warning",
|
|
327
|
+
draggable: true,
|
|
328
|
+
showClose: false
|
|
329
|
+
}
|
|
330
|
+
);
|
|
331
|
+
} catch (error) {
|
|
332
|
+
return {
|
|
333
|
+
success: false,
|
|
334
|
+
message: "用户已取消",
|
|
335
|
+
confirmed: false,
|
|
336
|
+
shouldShowError: false
|
|
337
|
+
// 用户取消不提示错误
|
|
338
|
+
};
|
|
339
|
+
}
|
|
340
|
+
}
|
|
341
|
+
const result = await handleApiCall(node, data, fields, context);
|
|
342
|
+
if (!result.success) {
|
|
343
|
+
return result;
|
|
344
|
+
}
|
|
345
|
+
if (basic.resetTableAfterDelete) {
|
|
346
|
+
const tableComponent = (_a = context.components) == null ? void 0 : _a.table;
|
|
347
|
+
const refreshMethod = (_c = (_b = tableComponent == null ? void 0 : tableComponent.$) == null ? void 0 : _b.exposed) == null ? void 0 : _c.refresh;
|
|
348
|
+
if (typeof refreshMethod === "function") {
|
|
349
|
+
await refreshMethod(refreshOptions);
|
|
350
|
+
return {
|
|
351
|
+
success: true,
|
|
352
|
+
message: "表格已刷新"
|
|
353
|
+
};
|
|
354
|
+
} else {
|
|
355
|
+
console.error("[EventFlow] 未找到表格组件的 refresh 方法");
|
|
356
|
+
return {
|
|
357
|
+
success: false,
|
|
358
|
+
message: "表格组件未正确配置或 refresh 方法未暴露",
|
|
359
|
+
shouldShowError: true
|
|
360
|
+
};
|
|
361
|
+
}
|
|
362
|
+
}
|
|
363
|
+
return {
|
|
364
|
+
success: true,
|
|
365
|
+
message: "列表数据已删除"
|
|
366
|
+
};
|
|
367
|
+
}
|
|
291
368
|
async function handleCustomAction(node, data, fields, context) {
|
|
292
369
|
console.log("[EventFlow] 执行自定义动作:", node.basic);
|
|
293
370
|
return {
|
|
@@ -490,6 +567,8 @@ const defaultActionHandlers = {
|
|
|
490
567
|
"ui-confirm": handleConfirm,
|
|
491
568
|
"ui-message": handleMessage,
|
|
492
569
|
"table-refresh": handleTableRefresh,
|
|
570
|
+
"table-row-delete": handleTableRowDelete,
|
|
571
|
+
"table-child-refresh": handleTableChildRefresh,
|
|
493
572
|
"form-setValue": handleFormSetValue,
|
|
494
573
|
"form-submit": handleFormSubmit,
|
|
495
574
|
"custom": handleCustomAction,
|
|
@@ -505,5 +584,7 @@ export {
|
|
|
505
584
|
handleMessage,
|
|
506
585
|
handlePageGoBack,
|
|
507
586
|
handlePageJump,
|
|
508
|
-
|
|
587
|
+
handleTableChildRefresh,
|
|
588
|
+
handleTableRefresh,
|
|
589
|
+
handleTableRowDelete
|
|
509
590
|
};
|
|
@@ -71,6 +71,50 @@ function checkConditionMatch(condition, data, fields) {
|
|
|
71
71
|
return dataValue == parsedValue;
|
|
72
72
|
}
|
|
73
73
|
}
|
|
74
|
+
function checkFieldInFilterConfig(filterConfig, fieldId) {
|
|
75
|
+
if (!fieldId) {
|
|
76
|
+
return true;
|
|
77
|
+
}
|
|
78
|
+
return checkFieldInGroup(filterConfig, fieldId);
|
|
79
|
+
}
|
|
80
|
+
function checkFieldInGroup(group, targetFieldId) {
|
|
81
|
+
const { conditions, groups } = group;
|
|
82
|
+
if (conditions && conditions.length > 0) {
|
|
83
|
+
const foundInConditions = conditions.some((cond) => cond.field === targetFieldId);
|
|
84
|
+
if (foundInConditions) {
|
|
85
|
+
return true;
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
if (groups && groups.length > 0) {
|
|
89
|
+
return groups.some((g) => checkFieldInGroup(g, targetFieldId));
|
|
90
|
+
}
|
|
91
|
+
return false;
|
|
92
|
+
}
|
|
93
|
+
function checkFieldInResultConfig(resultConfig, fieldId, fields = []) {
|
|
94
|
+
var _a, _b;
|
|
95
|
+
if (!fieldId || !Array.isArray(resultConfig)) {
|
|
96
|
+
return true;
|
|
97
|
+
}
|
|
98
|
+
let fieldName = fieldId;
|
|
99
|
+
if (fields && fields.length > 0) {
|
|
100
|
+
const field = fields.find((f) => f.id == fieldId);
|
|
101
|
+
if (field) {
|
|
102
|
+
fieldName = field.fieldName;
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
for (const item of resultConfig) {
|
|
106
|
+
if ((_b = (_a = item.formula) == null ? void 0 : _a.value) == null ? void 0 : _b.text) {
|
|
107
|
+
const formulaText = item.formula.value.text;
|
|
108
|
+
const fieldPattern = new RegExp(`\\{${fieldName}\\}`, "i");
|
|
109
|
+
if (fieldPattern.test(formulaText)) {
|
|
110
|
+
return true;
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
return false;
|
|
115
|
+
}
|
|
74
116
|
export {
|
|
117
|
+
checkFieldInFilterConfig,
|
|
118
|
+
checkFieldInResultConfig,
|
|
75
119
|
checkFilterMatch
|
|
76
120
|
};
|