@fecp/designer 5.3.8 → 5.3.10

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.
@@ -4,13 +4,6 @@ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toString
4
4
  ;/* empty css */
5
5
  ;/* empty css */
6
6
  ;/* empty css */
7
- ;/* empty css */
8
- ;/* empty css */
9
- ;/* empty css */
10
- ;/* empty css */
11
- require("../../../../../node_modules/.pnpm/element-plus@2.13.2_vue@3.5.13_typescript@5.7.3_/node_modules/element-plus/theme-chalk/el-dropdown-menu.css.js");
12
- ;/* empty css */
13
- ;/* empty css */
14
7
  const vue = require("vue");
15
8
  const eventBus = require("../utils/eventBus.js");
16
9
  require("../../../../../node_modules/.pnpm/grid-layout-plus@1.1.1_vue@3.5.13_typescript@5.7.3_/node_modules/grid-layout-plus/es/index.js");
@@ -35,11 +28,8 @@ const index$1 = require("../../../../../node_modules/.pnpm/element-plus@2.13.2_v
35
28
  const index$2 = require("../../../../../node_modules/.pnpm/element-plus@2.13.2_vue@3.5.13_typescript@5.7.3_/node_modules/element-plus/es/components/form/index.js");
36
29
  const gridLayout_vue = require("../../../../../node_modules/.pnpm/grid-layout-plus@1.1.1_vue@3.5.13_typescript@5.7.3_/node_modules/grid-layout-plus/es/components/grid-layout.vue.js");
37
30
  const index$3 = require("../../../../../node_modules/.pnpm/element-plus@2.13.2_vue@3.5.13_typescript@5.7.3_/node_modules/element-plus/es/components/icon/index.js");
38
- const index$5 = require("../../../../../node_modules/.pnpm/element-plus@2.13.2_vue@3.5.13_typescript@5.7.3_/node_modules/element-plus/es/components/dropdown/index.js");
39
- const index$6 = require("../../../../../node_modules/.pnpm/element-plus@2.13.2_vue@3.5.13_typescript@5.7.3_/node_modules/element-plus/es/components/input/index.js");
40
- const index$7 = require("../../../../../node_modules/.pnpm/element-plus@2.13.2_vue@3.5.13_typescript@5.7.3_/node_modules/element-plus/es/components/checkbox/index.js");
41
- const index$8 = require("../../../../../node_modules/.pnpm/element-plus@2.13.2_vue@3.5.13_typescript@5.7.3_/node_modules/element-plus/es/components/divider/index.js");
42
- const index$9 = require("../../../../../node_modules/.pnpm/element-plus@2.13.2_vue@3.5.13_typescript@5.7.3_/node_modules/element-plus/es/components/message/index.js");
31
+ const index$5 = require("../../../../../node_modules/.pnpm/element-plus@2.13.2_vue@3.5.13_typescript@5.7.3_/node_modules/element-plus/es/components/divider/index.js");
32
+ const index$6 = require("../../../../../node_modules/.pnpm/element-plus@2.13.2_vue@3.5.13_typescript@5.7.3_/node_modules/element-plus/es/components/message/index.js");
43
33
  const _hoisted_1 = { class: "form-work-area" };
44
34
  const _hoisted_2 = { class: "form-grid-container" };
45
35
  const _hoisted_3 = ["onMouseenter", "onClick"];
@@ -48,22 +38,19 @@ const _hoisted_4 = {
48
38
  class: "component-toolbar"
49
39
  };
50
40
  const _hoisted_5 = ["onClick"];
51
- const _hoisted_6 = { class: "quick-setting-panel" };
52
- const _hoisted_7 = { class: "setting-row" };
53
- const _hoisted_8 = { class: "setting-row" };
54
- const _hoisted_9 = { class: "setting-row" };
55
- const _hoisted_10 = ["onClick"];
56
- const _hoisted_11 = ["onClick"];
57
- const _hoisted_12 = { class: "status-tags" };
58
- const _hoisted_13 = {
41
+ const _hoisted_6 = ["onClick"];
42
+ const _hoisted_7 = ["onClick"];
43
+ const _hoisted_8 = ["onClick"];
44
+ const _hoisted_9 = { class: "status-tags" };
45
+ const _hoisted_10 = {
59
46
  key: 0,
60
47
  class: "field-name-tag"
61
48
  };
62
- const _hoisted_14 = {
49
+ const _hoisted_11 = {
63
50
  key: 1,
64
51
  class: "status-tag disabled-tag"
65
52
  };
66
- const _hoisted_15 = {
53
+ const _hoisted_12 = {
67
54
  key: 2,
68
55
  class: "status-tag readonly-tag"
69
56
  };
@@ -182,7 +169,7 @@ const _sfc_main = {
182
169
  };
183
170
  editConfigData.value.deletedFields.push(deletedField);
184
171
  layoutData.value.splice(index2, 1);
185
- index$9.ElMessage.success("字段已移至回收站");
172
+ index$6.ElMessage.success("字段已移至回收站");
186
173
  }
187
174
  }
188
175
  function handleHide(item) {
@@ -319,13 +306,7 @@ const _sfc_main = {
319
306
  eventBus.default.on("resizeEvent", () => {
320
307
  gridLayout.value.resizeEvent();
321
308
  });
322
- const dropdownVisibleMap = vue.ref(/* @__PURE__ */ new Map());
323
- function getDropdownVisible(itemId) {
324
- return dropdownVisibleMap.value.get(itemId) || false;
325
- }
326
- function setDropdownVisible(itemId, visible) {
327
- dropdownVisibleMap.value.set(itemId, visible);
328
- }
309
+ vue.ref(/* @__PURE__ */ new Map());
329
310
  const isDragging = vue.computed(() => {
330
311
  var _a;
331
312
  return ((_a = gridLayout.value) == null ? void 0 : _a.state.isDragging) || false;
@@ -345,12 +326,8 @@ const _sfc_main = {
345
326
  });
346
327
  return (_ctx, _cache) => {
347
328
  const _component_el_icon = index$3.ElIcon;
348
- const _component_el_input = index$6.ElInput;
349
- const _component_el_checkbox = index$7.ElCheckbox;
350
- const _component_el_dropdown_menu = index$5.ElDropdownMenu;
351
- const _component_el_dropdown = index$5.ElDropdown;
352
329
  const _component_Hide = vue.resolveComponent("Hide");
353
- const _component_el_divider = index$8.ElDivider;
330
+ const _component_el_divider = index$5.ElDivider;
354
331
  const _component_el_form = index$2.ElForm;
355
332
  const _component_el_scrollbar = index$1.ElScrollbar;
356
333
  return vue.openBlock(), vue.createElementBlock("div", _hoisted_1, [
@@ -413,76 +390,18 @@ const _sfc_main = {
413
390
  _: 2
414
391
  }, 1024)
415
392
  ], 10, _hoisted_5),
416
- vue.createVNode(_component_el_dropdown, {
417
- "popper-class": `form-quick-setting-${item.i}`,
418
- trigger: "click",
419
- placement: "bottom",
420
- "hide-on-click": false,
421
- onVisibleChange: (visible) => setDropdownVisible(item.id, visible)
422
- }, {
423
- dropdown: vue.withCtx(() => [
424
- getDropdownVisible(item.id) ? (vue.openBlock(), vue.createBlock(_component_el_dropdown_menu, { key: 0 }, {
425
- default: vue.withCtx(() => [
426
- vue.createElementVNode("div", _hoisted_6, [
427
- vue.createElementVNode("div", _hoisted_7, [
428
- _cache[3] || (_cache[3] = vue.createElementVNode("span", { class: "setting-label" }, "标题:", -1)),
429
- vue.createVNode(_component_el_input, {
430
- modelValue: item.component.label,
431
- "onUpdate:modelValue": ($event) => item.component.label = $event,
432
- size: "small",
433
- class: "setting-input"
434
- }, null, 8, ["modelValue", "onUpdate:modelValue"])
435
- ]),
436
- vue.createElementVNode("div", _hoisted_8, [
437
- _cache[4] || (_cache[4] = vue.createElementVNode("span", { class: "setting-label" }, "字段:", -1)),
438
- vue.createVNode(_component_el_input, {
439
- modelValue: item.component.fieldName,
440
- "onUpdate:modelValue": ($event) => item.component.fieldName = $event,
441
- size: "small",
442
- class: "setting-input"
443
- }, null, 8, ["modelValue", "onUpdate:modelValue"])
444
- ]),
445
- vue.createElementVNode("div", _hoisted_9, [
446
- vue.createVNode(_component_el_checkbox, {
447
- modelValue: item.component.required,
448
- "onUpdate:modelValue": ($event) => item.component.required = $event,
449
- label: "必填",
450
- size: "small"
451
- }, null, 8, ["modelValue", "onUpdate:modelValue"]),
452
- vue.createVNode(_component_el_checkbox, {
453
- modelValue: item.component.readOnly,
454
- "onUpdate:modelValue": ($event) => item.component.readOnly = $event,
455
- label: "只读",
456
- size: "small"
457
- }, null, 8, ["modelValue", "onUpdate:modelValue"]),
458
- vue.createVNode(_component_el_checkbox, {
459
- modelValue: item.component.disabled,
460
- "onUpdate:modelValue": ($event) => item.component.disabled = $event,
461
- label: "禁用",
462
- size: "small"
463
- }, null, 8, ["modelValue", "onUpdate:modelValue"])
464
- ])
465
- ])
466
- ]),
467
- _: 2
468
- }, 1024)) : vue.createCommentVNode("", true)
469
- ]),
470
- default: vue.withCtx(() => [
471
- item.component.fieldType != "blank" ? (vue.openBlock(), vue.createElementBlock("span", {
472
- key: 0,
473
- class: vue.normalizeClass(["toolbar-btn settings-btn", { "is-active": getDropdownVisible(item.id) }]),
474
- title: "快捷设置"
475
- }, [
476
- vue.createVNode(_component_el_icon, null, {
477
- default: vue.withCtx(() => [
478
- vue.createVNode(vue.unref(index$4.Setting))
479
- ]),
480
- _: 1
481
- })
482
- ], 2)) : vue.createCommentVNode("", true)
483
- ]),
484
- _: 2
485
- }, 1032, ["popper-class", "onVisibleChange"]),
393
+ vue.createElementVNode("span", {
394
+ class: vue.normalizeClass(["toolbar-btn disabled-btn", { "is-disabled": item.component.disabled }]),
395
+ title: "设置只读",
396
+ onClick: vue.withModifiers(($event) => item.component.disabled = !item.component.disabled, ["stop"])
397
+ }, [
398
+ vue.createVNode(_component_el_icon, null, {
399
+ default: vue.withCtx(() => [
400
+ item.component.disabled ? (vue.openBlock(), vue.createBlock(vue.unref(index$4.Lock), { key: 0 })) : (vue.openBlock(), vue.createBlock(vue.unref(index$4.Unlock), { key: 1 }))
401
+ ]),
402
+ _: 2
403
+ }, 1024)
404
+ ], 10, _hoisted_6),
486
405
  vue.createElementVNode("span", {
487
406
  class: "toolbar-btn settings-btn",
488
407
  title: "放进隐藏域",
@@ -494,7 +413,7 @@ const _sfc_main = {
494
413
  ]),
495
414
  _: 1
496
415
  })
497
- ], 8, _hoisted_10),
416
+ ], 8, _hoisted_7),
498
417
  vue.createElementVNode("span", {
499
418
  class: "toolbar-btn delete-btn",
500
419
  title: "删除组件",
@@ -506,18 +425,18 @@ const _sfc_main = {
506
425
  ]),
507
426
  _: 1
508
427
  })
509
- ], 8, _hoisted_11)
428
+ ], 8, _hoisted_8)
510
429
  ])) : vue.createCommentVNode("", true),
511
- vue.createElementVNode("div", _hoisted_12, [
512
- editConfigData.value.showFieldName && item.component.fieldName ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_13, vue.toDisplayString(item.component.fieldType == "blank" ? "空白占位" : item.component.fieldName), 1)) : vue.createCommentVNode("", true),
513
- item.component.disabled ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_14, [
430
+ vue.createElementVNode("div", _hoisted_9, [
431
+ editConfigData.value.showFieldName && item.component.fieldName ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_10, vue.toDisplayString(item.component.fieldType == "blank" ? "空白占位" : item.component.fieldName), 1)) : vue.createCommentVNode("", true),
432
+ item.component.disabled ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_11, [
514
433
  vue.createVNode(_component_el_icon, null, {
515
434
  default: vue.withCtx(() => [
516
435
  vue.createVNode(vue.unref(index$4.Lock))
517
436
  ]),
518
437
  _: 1
519
438
  })
520
- ])) : item.component.readOnly ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_15, [
439
+ ])) : item.component.readOnly ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_12, [
521
440
  vue.createVNode(_component_el_icon, null, {
522
441
  default: vue.withCtx(() => [
523
442
  vue.createVNode(vue.unref(index$4.View))
@@ -554,7 +473,7 @@ const _sfc_main = {
554
473
  key: 5,
555
474
  "border-style": "dashed"
556
475
  }, {
557
- default: vue.withCtx(() => _cache[5] || (_cache[5] = [
476
+ default: vue.withCtx(() => _cache[3] || (_cache[3] = [
558
477
  vue.createTextVNode(" 此处为分割线,阻止下方组件自动向上补齐,解析时不显示 ")
559
478
  ])),
560
479
  _: 1
@@ -582,5 +501,5 @@ const _sfc_main = {
582
501
  };
583
502
  }
584
503
  };
585
- const formWorkArea = /* @__PURE__ */ _pluginVue_exportHelper.default(_sfc_main, [["__scopeId", "data-v-f689abe4"]]);
504
+ const formWorkArea = /* @__PURE__ */ _pluginVue_exportHelper.default(_sfc_main, [["__scopeId", "data-v-1d0d8388"]]);
586
505
  exports.default = formWorkArea;
@@ -209,7 +209,7 @@ const _sfc_main = /* @__PURE__ */ Object.assign({
209
209
  }
210
210
  });
211
211
  }
212
- formData.value = { ...defaultData, ...props.modelValue };
212
+ formData.value = { ...defaultData, ...setFormData(props.modelValue, true) };
213
213
  formRules.value = rules;
214
214
  };
215
215
  const loadFieldDataSources = async () => {
@@ -616,7 +616,7 @@ const _sfc_main = /* @__PURE__ */ Object.assign({
616
616
  }
617
617
  return result;
618
618
  };
619
- const setFormData = (data) => {
619
+ const setFormData = (data, flag = false) => {
620
620
  const processedData = { ...data };
621
621
  const processField = (field) => {
622
622
  const fieldName = field.fieldName;
@@ -661,6 +661,9 @@ const _sfc_main = /* @__PURE__ */ Object.assign({
661
661
  processField(field);
662
662
  });
663
663
  }
664
+ if (flag) {
665
+ return processedData;
666
+ }
664
667
  Object.assign(formData.value, processedData);
665
668
  };
666
669
  vue.onMounted(() => {
@@ -850,7 +853,7 @@ const _sfc_main = /* @__PURE__ */ Object.assign({
850
853
  applyLinkageEffectsForChangedFields(changedFields);
851
854
  }
852
855
  prevFormData.value = { ...newVal };
853
- emit("update:modelValue", newVal);
856
+ emit("update:modelValue", getFormData());
854
857
  },
855
858
  { deep: true }
856
859
  );
@@ -970,5 +973,5 @@ const _sfc_main = /* @__PURE__ */ Object.assign({
970
973
  };
971
974
  }
972
975
  });
973
- const _Form = /* @__PURE__ */ _pluginVue_exportHelper.default(_sfc_main, [["__scopeId", "data-v-63966ae6"]]);
976
+ const _Form = /* @__PURE__ */ _pluginVue_exportHelper.default(_sfc_main, [["__scopeId", "data-v-bf77b845"]]);
974
977
  exports.default = _Form;
@@ -4,6 +4,7 @@ const vue = require("vue");
4
4
  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
+ const common = require("../../../utils/common.js");
7
8
  const _hoisted_1 = {
8
9
  key: 0,
9
10
  style: { "height": "60px", "position": "relative" }
@@ -52,6 +53,14 @@ const _sfc_main = /* @__PURE__ */ Object.assign({
52
53
  vue.inject("rowHeight");
53
54
  vue.inject("gridLayout");
54
55
  const setFormItemHeight = vue.inject("setFormItemHeight");
56
+ const subFormData = vue.computed({
57
+ get: () => {
58
+ return common.cloneDeep(formData.value);
59
+ },
60
+ set: (val) => {
61
+ formData.value = { ...formData.value, ...val };
62
+ }
63
+ });
55
64
  const templateKey = vue.computed(() => {
56
65
  if (props.config.formSource == "dynamic") {
57
66
  const dynamicSubFormKey = props.config.dynamicSubFormKey;
@@ -113,8 +122,8 @@ const _sfc_main = /* @__PURE__ */ Object.assign({
113
122
  onLoaded: subFormLoaded,
114
123
  canPageEvent: __props.config.triggerSubFormPageEvent,
115
124
  initFormMode: __props.formMode,
116
- modelValue: vue.unref(formData),
117
- "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => vue.isRef(formData) ? formData.value = $event : null)
125
+ modelValue: vue.unref(subFormData),
126
+ "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => vue.isRef(subFormData) ? subFormData.value = $event : null)
118
127
  }, null, 8, ["templateKey", "canPageEvent", "initFormMode", "modelValue"])
119
128
  ], 64);
120
129
  };
@@ -119,7 +119,7 @@ const _sfc_main = /* @__PURE__ */ Object.assign({
119
119
  const configLoading = vue.ref(true);
120
120
  const localConfig = vue.ref({});
121
121
  const fieldsData = vue.ref({});
122
- const hiddenFormData = vue.ref(props.initHiddenData);
122
+ const hiddenFormData = vue.computed(() => props.initHiddenData);
123
123
  const dataSourceOptions = vue.ref({});
124
124
  const dictionaryOptions = vue.ref({});
125
125
  const displayData = vue.computed(() => {
@@ -647,5 +647,5 @@ const _sfc_main = /* @__PURE__ */ Object.assign({
647
647
  };
648
648
  }
649
649
  });
650
- const _Table = /* @__PURE__ */ _pluginVue_exportHelper.default(_sfc_main, [["__scopeId", "data-v-8f3c46b5"]]);
650
+ const _Table = /* @__PURE__ */ _pluginVue_exportHelper.default(_sfc_main, [["__scopeId", "data-v-be17662c"]]);
651
651
  exports.default = _Table;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fecp/designer",
3
- "version": "5.3.8",
3
+ "version": "5.3.10",
4
4
  "main": "lib/packages/designer/index.js",
5
5
  "module": "es/packages/designer/index.mjs",
6
6
  "files": [