@fecp/designer 5.3.14 → 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.
Files changed (47) hide show
  1. package/es/designer.css +107 -101
  2. package/es/packages/designer/package.json.mjs +1 -1
  3. package/es/packages/designer/src/layout/header/index.vue.mjs +1 -0
  4. package/es/packages/designer/src/packages/dialog/index.vue.mjs +44 -32
  5. package/es/packages/designer/src/packages/dialogGlobal/index.vue.mjs +1 -0
  6. package/es/packages/designer/src/packages/eventFlow/dialog/action/TableChildSelection.vue2.mjs +100 -0
  7. package/es/packages/designer/src/packages/eventFlow/dialog/action/config.mjs +4 -0
  8. package/es/packages/designer/src/packages/form/property/pageFooterBtn.vue.mjs +13 -1
  9. package/es/packages/designer/src/packages/table/headerBtn.vue.mjs +1 -0
  10. package/es/packages/designer/src/packages/table/property/widgets.vue.mjs +8 -1
  11. package/es/packages/designer/src/packages/table/tableSetting.vue.mjs +72 -16
  12. package/es/packages/vue/src/components/details/header/Header.vue.mjs +14 -6
  13. package/es/packages/vue/src/components/dialog/DialogRenderer.vue2.mjs +6 -2
  14. package/es/packages/vue/src/components/forms/checkbox/Checkbox.vue.mjs +2 -3
  15. package/es/packages/vue/src/components/forms/form/Form.vue.mjs +28 -4
  16. package/es/packages/vue/src/components/forms/radio/Radio.vue.mjs +2 -3
  17. package/es/packages/vue/src/components/forms/subTable/SubTable.vue.mjs +5 -5
  18. package/es/packages/vue/src/components/forms/text/Text.vue.mjs +1 -1
  19. package/es/packages/vue/src/components/table/Table.vue.mjs +6 -3
  20. package/es/packages/vue/src/components/table/TableColumn.vue.mjs +1 -1
  21. package/es/packages/vue/src/composables/usePageEvents.mjs +1 -1
  22. package/es/packages/vue/src/utils/datasource.mjs +1 -1
  23. package/es/packages/vue/src/utils/eventFlow/actionHandlers.mjs +62 -0
  24. package/lib/designer.css +107 -101
  25. package/lib/packages/designer/package.json.js +1 -1
  26. package/lib/packages/designer/src/layout/header/index.vue.js +1 -0
  27. package/lib/packages/designer/src/packages/dialog/index.vue.js +44 -32
  28. package/lib/packages/designer/src/packages/dialogGlobal/index.vue.js +1 -0
  29. package/lib/packages/designer/src/packages/eventFlow/dialog/action/TableChildSelection.vue2.js +100 -0
  30. package/lib/packages/designer/src/packages/eventFlow/dialog/action/config.js +4 -0
  31. package/lib/packages/designer/src/packages/form/property/pageFooterBtn.vue.js +13 -1
  32. package/lib/packages/designer/src/packages/table/headerBtn.vue.js +1 -0
  33. package/lib/packages/designer/src/packages/table/property/widgets.vue.js +8 -1
  34. package/lib/packages/designer/src/packages/table/tableSetting.vue.js +71 -15
  35. package/lib/packages/vue/src/components/details/header/Header.vue.js +13 -5
  36. package/lib/packages/vue/src/components/dialog/DialogRenderer.vue2.js +6 -2
  37. package/lib/packages/vue/src/components/forms/checkbox/Checkbox.vue.js +2 -3
  38. package/lib/packages/vue/src/components/forms/form/Form.vue.js +28 -4
  39. package/lib/packages/vue/src/components/forms/radio/Radio.vue.js +2 -3
  40. package/lib/packages/vue/src/components/forms/subTable/SubTable.vue.js +5 -5
  41. package/lib/packages/vue/src/components/forms/text/Text.vue.js +1 -1
  42. package/lib/packages/vue/src/components/table/Table.vue.js +6 -3
  43. package/lib/packages/vue/src/components/table/TableColumn.vue.js +1 -1
  44. package/lib/packages/vue/src/composables/usePageEvents.js +1 -1
  45. package/lib/packages/vue/src/utils/datasource.js +1 -1
  46. package/lib/packages/vue/src/utils/eventFlow/actionHandlers.js +62 -0
  47. package/package.json +1 -1
@@ -2,7 +2,7 @@
2
2
  /* empty css */
3
3
  /* empty css */
4
4
  /* empty css */
5
- import { createBlock, createCommentVNode, openBlock, normalizeClass, unref, createSlots, withCtx, createElementVNode, toDisplayString, createElementBlock, Fragment, renderList, createTextVNode } from "vue";
5
+ import { computed, createBlock, createCommentVNode, openBlock, normalizeClass, unref, createSlots, withCtx, createElementVNode, toDisplayString, createElementBlock, Fragment, renderList, createTextVNode } from "vue";
6
6
  import { ArrowLeft as arrow_left_default } from "../../../../../../node_modules/.pnpm/@element-plus_icons-vue@2.3.2_vue@3.5.13_typescript@5.7.3_/node_modules/@element-plus/icons-vue/dist/index.mjs";
7
7
  import { getCurrentVueInstance } from "../../../utils/getInstance.mjs";
8
8
  /* empty css */
@@ -18,6 +18,10 @@ const _sfc_main = {
18
18
  pageHeaderConfig: {
19
19
  type: Object,
20
20
  required: true
21
+ },
22
+ isApproval: {
23
+ type: Boolean,
24
+ default: false
21
25
  }
22
26
  },
23
27
  emits: ["action-click"],
@@ -25,6 +29,10 @@ const _sfc_main = {
25
29
  const props = __props;
26
30
  const ctx = getCurrentVueInstance();
27
31
  const emit = __emit;
32
+ const canBack = computed(() => {
33
+ var _a;
34
+ return !props.isApproval && ((_a = props.pageHeaderConfig) == null ? void 0 : _a.canBack);
35
+ });
28
36
  const getButtonType = (btnStyle) => {
29
37
  return "primary";
30
38
  };
@@ -53,14 +61,14 @@ const _sfc_main = {
53
61
  emit("action-click", action);
54
62
  };
55
63
  return (_ctx, _cache) => {
56
- var _a, _b, _c, _d, _e;
64
+ var _a, _b, _c;
57
65
  const _component_el_button = ElButton;
58
66
  const _component_el_page_header = ElPageHeader;
59
67
  return ((_a = __props.pageHeaderConfig) == null ? void 0 : _a.enabled) ? (openBlock(), createBlock(_component_el_page_header, {
60
68
  key: 0,
61
- icon: ((_b = __props.pageHeaderConfig) == null ? void 0 : _b.canBack) ? unref(arrow_left_default) : null,
69
+ icon: unref(canBack) ? unref(arrow_left_default) : null,
62
70
  onBack: handleBack,
63
- class: normalizeClass(["fec-header", { "can-not-back": !((_c = __props.pageHeaderConfig) == null ? void 0 : _c.canBack) }])
71
+ class: normalizeClass(["fec-header", { "can-not-back": !unref(canBack) }])
64
72
  }, createSlots({
65
73
  content: withCtx(() => {
66
74
  var _a2, _b2;
@@ -71,7 +79,7 @@ const _sfc_main = {
71
79
  }),
72
80
  _: 2
73
81
  }, [
74
- ((_e = (_d = __props.pageHeaderConfig) == null ? void 0 : _d.actions) == null ? void 0 : _e.length) ? {
82
+ ((_c = (_b = __props.pageHeaderConfig) == null ? void 0 : _b.actions) == null ? void 0 : _c.length) ? {
75
83
  name: "extra",
76
84
  fn: withCtx(() => {
77
85
  var _a2;
@@ -96,7 +104,7 @@ const _sfc_main = {
96
104
  };
97
105
  }
98
106
  };
99
- const component = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-93e082c1"]]);
107
+ const component = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-d2665303"]]);
100
108
  export {
101
109
  component as default
102
110
  };
@@ -8,9 +8,9 @@ import { Form } from "../forms/form/index.mjs";
8
8
  import { parseRouteParams } from "../../utils/parseRouteParams.mjs";
9
9
  import { calculate } from "../../utils/formulajs/calculate.mjs";
10
10
  import { useEventFlow, executeEventFlow } from "../../utils/eventFlow/eventFlowHandler.mjs";
11
- /* empty css */
12
11
  /* empty css */
13
12
  /* empty css */
13
+ /* empty css */
14
14
  /* empty css */
15
15
  import _export_sfc from "../../../../../_virtual/_plugin-vue_export-helper.mjs";
16
16
  /* empty css */
@@ -167,6 +167,10 @@ const _sfc_main = {
167
167
  } else {
168
168
  console.log("未配置参数字段: displayField");
169
169
  }
170
+ const isRowDataAssignToForm = currentDialogConfig.value.isRowDataAssignToForm;
171
+ if (isRowDataAssignToForm) {
172
+ Object.assign(formData, tableSelectionRows.value[0]);
173
+ }
170
174
  const fieldMapping = currentDialogConfig.value.fieldMapping;
171
175
  if ((fieldMapping == null ? void 0 : fieldMapping.length) > 0) {
172
176
  fieldMapping.forEach((item) => {
@@ -411,7 +415,7 @@ const _sfc_main = {
411
415
  };
412
416
  }
413
417
  };
414
- const DialogRenderer = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-7e9fd985"]]);
418
+ const DialogRenderer = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-409d49b3"]]);
415
419
  export {
416
420
  DialogRenderer as default
417
421
  };
@@ -69,9 +69,8 @@ const _sfc_main = /* @__PURE__ */ Object.assign({
69
69
  (openBlock(true), createElementBlock(Fragment, null, renderList(options.value, (option) => {
70
70
  return openBlock(), createBlock(_component_el_checkbox, {
71
71
  value: option.value,
72
- label: option.label,
73
- disabled: option.disabled
74
- }, null, 8, ["value", "label", "disabled"]);
72
+ label: option.label
73
+ }, null, 8, ["value", "label"]);
75
74
  }), 256))
76
75
  ]),
77
76
  _: 1
@@ -78,6 +78,10 @@ const _sfc_main = /* @__PURE__ */ Object.assign({
78
78
  initFormMode: {
79
79
  type: String,
80
80
  default: ""
81
+ },
82
+ isApproval: {
83
+ type: Boolean,
84
+ default: false
81
85
  }
82
86
  },
83
87
  emits: [
@@ -553,6 +557,24 @@ const _sfc_main = /* @__PURE__ */ Object.assign({
553
557
  (_a = button.eventConfig) == null ? void 0 : _a.find((item) => item.name == "Click")
554
558
  );
555
559
  };
560
+ const handleApprovalEvent = () => {
561
+ return new Promise((resolve, reject) => {
562
+ var _a, _b;
563
+ const actions = ((_a = localConfig.value.pageFooterConfig) == null ? void 0 : _a.actions) || [];
564
+ const approvalAction = actions.find((item) => item.isApproval);
565
+ if (approvalAction) {
566
+ handleEvent.value(
567
+ formData.value,
568
+ approvalAction,
569
+ (_b = approvalAction.eventConfig) == null ? void 0 : _b.find((item) => item.name == "Click")
570
+ ).then(() => {
571
+ resolve();
572
+ }).catch((error) => {
573
+ reject(error);
574
+ });
575
+ }
576
+ });
577
+ };
556
578
  const validate = () => {
557
579
  var _a;
558
580
  return (_a = formRef.value) == null ? void 0 : _a.validate();
@@ -897,7 +919,8 @@ const _sfc_main = /* @__PURE__ */ Object.assign({
897
919
  setFormData,
898
920
  getFormItemRef,
899
921
  formRef,
900
- localConfig
922
+ localConfig,
923
+ handleApprovalEvent
901
924
  });
902
925
  return (_ctx, _cache) => {
903
926
  const _component_el_form = ElForm;
@@ -913,8 +936,9 @@ const _sfc_main = /* @__PURE__ */ Object.assign({
913
936
  default: withCtx(() => [
914
937
  !configLoading.value && !__props.isSubForm && !__props.isDialog ? (openBlock(), createBlock(unref(header), {
915
938
  key: 0,
939
+ isApproval: __props.isApproval,
916
940
  pageHeaderConfig: localConfig.value.pageHeaderConfig
917
- }, null, 8, ["pageHeaderConfig"])) : createCommentVNode("", true),
941
+ }, null, 8, ["isApproval", "pageHeaderConfig"])) : createCommentVNode("", true),
918
942
  createVNode(unref(main), null, {
919
943
  default: withCtx(() => [
920
944
  createVNode(_component_el_form, {
@@ -969,7 +993,7 @@ const _sfc_main = /* @__PURE__ */ Object.assign({
969
993
  ]),
970
994
  _: 1
971
995
  }),
972
- !__props.isSubForm && !__props.isDialog ? (openBlock(), createBlock(unref(footer), {
996
+ !__props.isSubForm && !__props.isDialog && !__props.isApproval ? (openBlock(), createBlock(unref(footer), {
973
997
  key: 1,
974
998
  formMode: formMode.value,
975
999
  pageFooterConfig: localConfig.value.pageFooterConfig,
@@ -981,7 +1005,7 @@ const _sfc_main = /* @__PURE__ */ Object.assign({
981
1005
  };
982
1006
  }
983
1007
  });
984
- const _Form = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-01bfaf4f"]]);
1008
+ const _Form = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-bf001c7c"]]);
985
1009
  export {
986
1010
  _Form as default
987
1011
  };
@@ -64,9 +64,8 @@ const _sfc_main = /* @__PURE__ */ Object.assign({
64
64
  (openBlock(true), createElementBlock(Fragment, null, renderList(options.value, (option) => {
65
65
  return openBlock(), createBlock(_component_el_radio, {
66
66
  value: option.value,
67
- label: option.label,
68
- disabled: option.disabled
69
- }, null, 8, ["value", "label", "disabled"]);
67
+ label: option.label
68
+ }, null, 8, ["value", "label"]);
70
69
  }), 256))
71
70
  ]),
72
71
  _: 1
@@ -63,7 +63,7 @@ const _sfc_main = /* @__PURE__ */ Object.assign({
63
63
  ...props.localConfig.hiddenFields
64
64
  ];
65
65
  });
66
- const initHiddenData = computed(() => {
66
+ const initSearchData = computed(() => {
67
67
  if (props.config.dataSourceFrom == "self") {
68
68
  const params = parseRouteParams(
69
69
  props.config.subTableParams,
@@ -88,7 +88,7 @@ const _sfc_main = /* @__PURE__ */ Object.assign({
88
88
  if (!item.showCondition) return true;
89
89
  return checkFilterMatch(
90
90
  item.showCondition,
91
- initHiddenData.value,
91
+ initSearchData.value,
92
92
  subTableFieldsData.value
93
93
  );
94
94
  });
@@ -99,7 +99,7 @@ const _sfc_main = /* @__PURE__ */ Object.assign({
99
99
  if (!item.showCondition) return true;
100
100
  return checkFilterMatch(
101
101
  item.showCondition,
102
- initHiddenData.value,
102
+ initSearchData.value,
103
103
  subTableFieldsData.value
104
104
  );
105
105
  });
@@ -196,11 +196,11 @@ const _sfc_main = /* @__PURE__ */ Object.assign({
196
196
  hasPagination: __props.config.isSubTablePagination,
197
197
  height: __props.config.subTableHeight,
198
198
  tableData: unref(subTableData),
199
- initHiddenData: unref(initHiddenData),
199
+ initSearchData: unref(initSearchData),
200
200
  canLoadBySearchData: __props.config.reloadOnParamsChange,
201
201
  readonly: __props.config.isSubTableReadOnly || __props.formMode == "query",
202
202
  btnRollbackEvent: unref(btnRollbackEvent)
203
- }, null, 8, ["templateKey", "mode", "titleMode", "hasPagination", "height", "tableData", "initHiddenData", "canLoadBySearchData", "readonly", "btnRollbackEvent"])
203
+ }, null, 8, ["templateKey", "mode", "titleMode", "hasPagination", "height", "tableData", "initSearchData", "canLoadBySearchData", "readonly", "btnRollbackEvent"])
204
204
  ], 64);
205
205
  };
206
206
  }
@@ -2,9 +2,9 @@
2
2
  /* empty css */
3
3
  /* empty css */
4
4
  import { computed, getCurrentInstance, inject, createElementBlock, openBlock, createVNode, createCommentVNode, mergeProps, toHandlers, createSlots, withCtx, createElementVNode, toDisplayString, createBlock, createTextVNode, unref } from "vue";
5
- /* empty css */
6
5
  /* empty css */
7
6
  /* empty css */
7
+ /* empty css */
8
8
  import { openDialog } from "../../dialog/index.mjs";
9
9
  import api from "../../../api/index.mjs";
10
10
  /* empty css */
@@ -125,7 +125,10 @@ const _sfc_main = /* @__PURE__ */ Object.assign({
125
125
  const configLoading = ref(true);
126
126
  const localConfig = ref({});
127
127
  const fieldsData = ref({});
128
- const hiddenFormData = computed(() => props.initHiddenData);
128
+ const hiddenFormData = computed(() => ({
129
+ ...props.initHiddenData,
130
+ ...props.initSearchData
131
+ }));
129
132
  const dataSourceOptions = ref({});
130
133
  const dictionaryOptions = ref({});
131
134
  const displayData = computed(() => {
@@ -518,7 +521,7 @@ const _sfc_main = /* @__PURE__ */ Object.assign({
518
521
  initDataSourceManager();
519
522
  });
520
523
  });
521
- const searchData = ref(props.initSearchData);
524
+ const searchData = ref({});
522
525
  watch(
523
526
  () => props.initSearchData,
524
527
  (newVal, oldVal) => {
@@ -660,7 +663,7 @@ const _sfc_main = /* @__PURE__ */ Object.assign({
660
663
  };
661
664
  }
662
665
  });
663
- const _Table = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-3c129bed"]]);
666
+ const _Table = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-23e9627d"]]);
664
667
  export {
665
668
  _Table as default
666
669
  };
@@ -6,9 +6,9 @@ import "../../../../../node_modules/.pnpm/vxe-table@4.17.47_vue@3.5.13_typescrip
6
6
  import { CopyDocument as copy_document_default } from "../../../../../node_modules/.pnpm/@element-plus_icons-vue@2.3.2_vue@3.5.13_typescript@5.7.3_/node_modules/@element-plus/icons-vue/dist/index.mjs";
7
7
  import { checkFilterMatch } from "../../utils/parseFilterConfig.mjs";
8
8
  import { removeEmptyValues } from "../../utils/common.mjs";
9
- /* empty css */
10
9
  /* empty css */
11
10
  /* empty css */
11
+ /* empty css */
12
12
  /* empty css */
13
13
  /* empty css */
14
14
  import "./index.mjs";
@@ -1,8 +1,8 @@
1
1
  import { onUnmounted, onBeforeUnmount, onMounted } from "vue";
2
2
  /* empty css */
3
- /* empty css */
4
3
  /* empty css */
5
4
  /* empty css */
5
+ /* empty css */
6
6
  /* empty css */
7
7
  /* empty css */
8
8
  /* empty css */
@@ -1,9 +1,9 @@
1
1
  import { reactive } from "vue";
2
2
  import { parseRouteParams } from "./parseRouteParams.mjs";
3
3
  /* empty css */
4
- /* empty css */
5
4
  /* empty css */
6
5
  /* empty css */
6
+ /* empty css */
7
7
  import { ElLoading } from "../../../../node_modules/.pnpm/element-plus@2.13.2_vue@3.5.13_typescript@5.7.3_/node_modules/element-plus/es/components/loading/index.mjs";
8
8
  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";
9
9
  class DataSourceManager {
@@ -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