@fecp/designer 5.4.19 → 5.4.20

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 (29) hide show
  1. package/es/designer/package.json.mjs +1 -1
  2. package/es/designer/src/components/DialogSelect.vue.mjs +122 -0
  3. package/es/designer/src/packages/dialog/index.vue.mjs +58 -41
  4. package/es/designer/src/packages/dialogGlobal/index.vue.mjs +61 -42
  5. package/es/designer/src/packages/event/pageEvent.vue.mjs +18 -3
  6. package/es/designer/src/packages/eventFlow/dialog/action/Dialog.vue.mjs +9 -29
  7. package/es/designer/src/packages/form/aside/index.mjs +1 -0
  8. package/es/designer/src/packages/form/property/subForm.vue.mjs +12 -14
  9. package/es/designer/src/packages/form/property/widgets.vue.mjs +27 -25
  10. package/es/designer/src/packages/table/headerBtn.vue.mjs +2 -2
  11. package/es/designer.css +964 -961
  12. package/es/packages/mobile/src/components/base/card/Card.vue.mjs +2 -2
  13. package/es/packages/vue/src/components/dialog/DialogRenderer.vue2.mjs +34 -23
  14. package/es/packages/vue/src/components/forms/subForm/SubForm.vue.mjs +25 -2
  15. package/lib/designer/package.json.js +1 -1
  16. package/lib/designer/src/components/DialogSelect.vue.js +122 -0
  17. package/lib/designer/src/packages/dialog/index.vue.js +58 -41
  18. package/lib/designer/src/packages/dialogGlobal/index.vue.js +61 -42
  19. package/lib/designer/src/packages/event/pageEvent.vue.js +26 -11
  20. package/lib/designer/src/packages/eventFlow/dialog/action/Dialog.vue.js +11 -31
  21. package/lib/designer/src/packages/form/aside/index.js +1 -0
  22. package/lib/designer/src/packages/form/property/subForm.vue.js +12 -14
  23. package/lib/designer/src/packages/form/property/widgets.vue.js +22 -20
  24. package/lib/designer/src/packages/table/headerBtn.vue.js +2 -2
  25. package/lib/designer.css +964 -961
  26. package/lib/packages/mobile/src/components/base/card/Card.vue.js +2 -2
  27. package/lib/packages/vue/src/components/dialog/DialogRenderer.vue2.js +33 -22
  28. package/lib/packages/vue/src/components/forms/subForm/SubForm.vue.js +25 -2
  29. package/package.json +1 -1
@@ -8,13 +8,13 @@ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toString
8
8
  ;/* empty css */
9
9
  ;/* empty css */
10
10
  const vue = require("vue");
11
- ;/* empty css */
12
- const _pluginVue_exportHelper = require("../../../../../../_virtual/_plugin-vue_export-helper.js");
13
11
  ;/* empty css */
14
12
  ;/* empty css */
15
13
  ;/* empty css */
16
14
  ;/* empty css */
17
15
  ;/* empty css */
16
+ ;/* empty css */
17
+ const _pluginVue_exportHelper = require("../../../../../../_virtual/_plugin-vue_export-helper.js");
18
18
  const index$1 = require("../../../../../../node_modules/vant/es/swipe-cell/index.js");
19
19
  const functionCall = require("../../../../../../node_modules/vant/es/dialog/function-call.js");
20
20
  require("../../../../../../node_modules/vant/es/dialog/index.js");
@@ -127,6 +127,9 @@ const _sfc_main = {
127
127
  },
128
128
  (val) => {
129
129
  dialogVisible.value = val;
130
+ if (val) {
131
+ loadComponentByPath(currentDialogConfig.value.componentPath);
132
+ }
130
133
  },
131
134
  {
132
135
  immediate: true
@@ -135,19 +138,27 @@ const _sfc_main = {
135
138
  vue.watch(dialogVisible, (val) => {
136
139
  emit("update:modelValue", val);
137
140
  });
138
- const loadComponent = (path) => {
139
- if (!path) return null;
140
- try {
141
- const component = vue.defineAsyncComponent(
142
- () => import(
143
- /* @vite-ignore */
144
- path
145
- )
146
- );
147
- return component;
148
- } catch (error) {
149
- console.error("组件加载失败:", error);
150
- return null;
141
+ const componentParams = vue.computed(() => {
142
+ var _a;
143
+ const params = parseRouteParams.parseRouteParams(
144
+ ((_a = currentDialogConfig.value) == null ? void 0 : _a.componentParams) || [],
145
+ props.formData,
146
+ props.fieldsList
147
+ );
148
+ return params;
149
+ });
150
+ const currentComponent = vue.ref(null);
151
+ const loadComponentByPath = (path) => {
152
+ const route = ctx.$router.getRoutes().find((item) => item.path === path);
153
+ if (!route) return;
154
+ const comp = route.components.default;
155
+ if (!comp) return;
156
+ if (typeof comp === "function") {
157
+ comp().then((module2) => {
158
+ currentComponent.value = module2.default;
159
+ });
160
+ } else {
161
+ currentComponent.value = comp;
151
162
  }
152
163
  };
153
164
  const handleSubmit = (data) => {
@@ -318,7 +329,12 @@ const _sfc_main = {
318
329
  return (_ctx, _cache) => {
319
330
  const _component_el_button = index$3.ElButton;
320
331
  const _component_el_dialog = index.ElDialog;
321
- return vue.openBlock(), vue.createBlock(_component_el_dialog, {
332
+ return __props.dialogConfig.componentIsDialog ? (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(currentComponent.value), vue.mergeProps({ key: 0 }, componentParams.value, {
333
+ formData: __props.formData,
334
+ onClose: handleClose,
335
+ onSubmit: handleSubmit
336
+ }), null, 16, ["formData"])) : (vue.openBlock(), vue.createBlock(_component_el_dialog, {
337
+ key: 1,
322
338
  modelValue: dialogVisible.value,
323
339
  "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => dialogVisible.value = $event),
324
340
  width: dialogWidth.value,
@@ -413,20 +429,15 @@ const _sfc_main = {
413
429
  ref_key: "dialogFormRef",
414
430
  ref: dialogFormRef
415
431
  }, null, 8, ["templateKey", "modelValue", "initFormMode"])) : ((_d = __props.dialogConfig) == null ? void 0 : _d.contentSource) === "component" ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 2 }, [
416
- loadComponent(__props.dialogConfig.componentPath) ? (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(loadComponent(__props.dialogConfig.componentPath)), {
417
- key: 0,
418
- "dialog-params": __props.dialogConfig.dialogParams,
419
- onClose: handleClose,
420
- onSubmit: handleSubmit
421
- }, null, 40, ["dialog-params"])) : (vue.openBlock(), vue.createElementBlock("div", _hoisted_2, " 组件加载失败,请检查组件路径: " + vue.toDisplayString((_e = __props.dialogConfig) == null ? void 0 : _e.componentPath), 1))
432
+ currentComponent.value ? (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(currentComponent.value), vue.normalizeProps(vue.mergeProps({ key: 0 }, componentParams.value)), null, 16)) : (vue.openBlock(), vue.createElementBlock("div", _hoisted_2, " 组件加载失败,请检查组件路径: " + vue.toDisplayString((_e = __props.dialogConfig) == null ? void 0 : _e.componentPath), 1))
422
433
  ], 64)) : (vue.openBlock(), vue.createElementBlock("div", _hoisted_3, "请配置弹层内容"))
423
434
  ], 6)
424
435
  ];
425
436
  }),
426
437
  _: 1
427
- }, 8, ["modelValue", "width"]);
438
+ }, 8, ["modelValue", "width"]));
428
439
  };
429
440
  }
430
441
  };
431
- const DialogRenderer = /* @__PURE__ */ _pluginVue_exportHelper.default(_sfc_main, [["__scopeId", "data-v-8b571a63"]]);
442
+ const DialogRenderer = /* @__PURE__ */ _pluginVue_exportHelper.default(_sfc_main, [["__scopeId", "data-v-6b46adf3"]]);
432
443
  exports.default = DialogRenderer;
@@ -5,6 +5,7 @@ const index$2 = require("../form/index.js");
5
5
  const index$1 = require("../subTitle/index.js");
6
6
  const index = require("../h2/index.js");
7
7
  const common = require("../../../utils/common.js");
8
+ const parseRouteParams = require("../../../utils/parseRouteParams.js");
8
9
  const _hoisted_1 = {
9
10
  key: 0,
10
11
  style: { "height": "60px", "position": "relative" }
@@ -55,11 +56,33 @@ const _sfc_main = /* @__PURE__ */ Object.assign({
55
56
  const setFormItemHeight = vue.inject("setFormItemHeight");
56
57
  const subFormData = vue.computed({
57
58
  get: () => {
59
+ if (props.config.dataSourceFrom == "self") {
60
+ return common.cloneDeep(subFormParams.value);
61
+ }
58
62
  return common.cloneDeep(formData.value);
59
63
  },
60
64
  set: (val) => {
61
- formData.value = { ...formData.value, ...val };
65
+ if (props.config.dataSourceFrom != "self") {
66
+ formData.value = { ...formData.value, ...val };
67
+ }
68
+ }
69
+ });
70
+ const fieldList = vue.computed(() => {
71
+ return [
72
+ ...props.localConfig.fieldsData.map((item) => item.component),
73
+ ...props.localConfig.hiddenFields
74
+ ];
75
+ });
76
+ const subFormParams = vue.computed(() => {
77
+ if (props.config.dataSourceFrom == "self") {
78
+ const params = parseRouteParams.parseRouteParams(
79
+ props.config.subFormParams,
80
+ formData.value,
81
+ fieldList.value
82
+ );
83
+ return params;
62
84
  }
85
+ return {};
63
86
  });
64
87
  const templateKey = vue.computed(() => {
65
88
  if (props.config.formSource == "dynamic") {
@@ -128,7 +151,7 @@ const _sfc_main = /* @__PURE__ */ Object.assign({
128
151
  templateKey: vue.unref(templateKey),
129
152
  isSubForm: "",
130
153
  onLayoutUpdated: subFormLoaded,
131
- canPageEvent: __props.config.triggerSubFormPageEvent,
154
+ canPageEvent: __props.config.dataSourceFrom == "self",
132
155
  initFormMode: __props.formMode,
133
156
  modelValue: vue.unref(subFormData),
134
157
  "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => vue.isRef(subFormData) ? subFormData.value = $event : null)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fecp/designer",
3
- "version": "5.4.19",
3
+ "version": "5.4.20",
4
4
  "main": "lib/designer/index.js",
5
5
  "module": "es/designer/index.mjs",
6
6
  "files": [