@fecp/designer 5.3.4 → 5.3.6

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 +208 -179
  2. package/es/packages/designer/package.json.mjs +1 -1
  3. package/es/packages/designer/src/components/FilterConfigDisplay.vue.mjs +5 -3
  4. package/es/packages/designer/src/packages/advancedFilter/ValueInput.vue2.mjs +2 -2
  5. package/es/packages/designer/src/packages/dataLinkage/index.vue.mjs +85 -75
  6. package/es/packages/designer/src/packages/dialogGlobal/index.vue.mjs +2 -0
  7. package/es/packages/designer/src/packages/eventFlow/dialog/action/TableChildRefresh.vue2.mjs +94 -0
  8. package/es/packages/designer/src/packages/eventFlow/dialog/action/TableRowDelete.vue2.mjs +54 -0
  9. package/es/packages/designer/src/packages/eventFlow/dialog/action/config.mjs +12 -1
  10. package/es/packages/designer/src/packages/formulaEditor/index.vue2.mjs +10 -1
  11. package/es/packages/designer/src/packages/table/headerBtn.vue.mjs +2 -0
  12. package/es/packages/designer/src/packages/table/queryModule/DynamicModeConfig.vue.mjs +12 -5
  13. package/es/packages/designer/src/packages/table/queryModule/index.vue.mjs +11 -16
  14. package/es/packages/vue/src/components/bus/approvalHistory/ApprovalHistory.vue.mjs +5 -4
  15. package/es/packages/vue/src/components/forms/form/Form.vue.mjs +246 -139
  16. package/es/packages/vue/src/components/forms/formItem/FormItem.vue.mjs +20 -3
  17. package/es/packages/vue/src/components/forms/subForm/SubForm.vue.mjs +5 -6
  18. package/es/packages/vue/src/components/forms/subTable/SubTable.vue.mjs +12 -6
  19. package/es/packages/vue/src/components/table/CustomButtons.vue.mjs +11 -3
  20. package/es/packages/vue/src/components/table/DynamicQuery.vue.mjs +16 -8
  21. package/es/packages/vue/src/components/table/Table.vue.mjs +7 -5
  22. package/es/packages/vue/src/utils/eventFlow/actionHandlers.mjs +88 -2
  23. package/es/packages/vue/src/utils/parseFilterConfig.mjs +44 -0
  24. package/lib/designer.css +208 -179
  25. package/lib/packages/designer/package.json.js +1 -1
  26. package/lib/packages/designer/src/components/FilterConfigDisplay.vue.js +5 -3
  27. package/lib/packages/designer/src/packages/advancedFilter/ValueInput.vue2.js +2 -2
  28. package/lib/packages/designer/src/packages/dataLinkage/index.vue.js +93 -83
  29. package/lib/packages/designer/src/packages/dialogGlobal/index.vue.js +2 -0
  30. package/lib/packages/designer/src/packages/eventFlow/dialog/action/TableChildRefresh.vue2.js +94 -0
  31. package/lib/packages/designer/src/packages/eventFlow/dialog/action/TableRowDelete.vue2.js +54 -0
  32. package/lib/packages/designer/src/packages/eventFlow/dialog/action/config.js +12 -1
  33. package/lib/packages/designer/src/packages/formulaEditor/index.vue2.js +10 -1
  34. package/lib/packages/designer/src/packages/table/headerBtn.vue.js +2 -0
  35. package/lib/packages/designer/src/packages/table/queryModule/DynamicModeConfig.vue.js +12 -5
  36. package/lib/packages/designer/src/packages/table/queryModule/index.vue.js +11 -16
  37. package/lib/packages/vue/src/components/bus/approvalHistory/ApprovalHistory.vue.js +5 -4
  38. package/lib/packages/vue/src/components/forms/form/Form.vue.js +244 -137
  39. package/lib/packages/vue/src/components/forms/formItem/FormItem.vue.js +19 -2
  40. package/lib/packages/vue/src/components/forms/subForm/SubForm.vue.js +5 -6
  41. package/lib/packages/vue/src/components/forms/subTable/SubTable.vue.js +12 -6
  42. package/lib/packages/vue/src/components/table/CustomButtons.vue.js +11 -3
  43. package/lib/packages/vue/src/components/table/DynamicQuery.vue.js +16 -8
  44. package/lib/packages/vue/src/components/table/Table.vue.js +7 -5
  45. package/lib/packages/vue/src/utils/eventFlow/actionHandlers.js +94 -8
  46. package/lib/packages/vue/src/utils/parseFilterConfig.js +44 -0
  47. package/package.json +1 -1
@@ -36,8 +36,9 @@ const _sfc_main = /* @__PURE__ */ Object.assign({
36
36
  const traceNo = ref("");
37
37
  const formData = inject("formData");
38
38
  inject("rowHeight");
39
- const gridLayout = inject("gridLayout");
39
+ inject("gridLayout");
40
40
  inject("gridLayoutFieldsData");
41
+ const setFormItemHeight = inject("setFormItemHeight");
41
42
  const fieldsData = props.localConfig.fieldsData.map((item) => {
42
43
  return item.component;
43
44
  });
@@ -63,11 +64,11 @@ const _sfc_main = /* @__PURE__ */ Object.assign({
63
64
  const foundItem = props.localConfig.fieldsData.find(
64
65
  (item) => item.id == props.config.id
65
66
  );
66
- const titleHeight = config.titleMode != "none" ? 60 : 0;
67
+ const titleHeight = props.config.titleMode != "none" ? 60 : 0;
67
68
  if (foundItem) {
68
69
  foundItem.fixedH = true;
69
70
  foundItem.h = dom.offsetHeight + titleHeight;
70
- gridLayout.value.resizeEvent();
71
+ setFormItemHeight(props.config.id, true, dom.offsetHeight + titleHeight);
71
72
  }
72
73
  }
73
74
  return (_ctx, _cache) => {
@@ -124,7 +125,7 @@ const _sfc_main = /* @__PURE__ */ Object.assign({
124
125
  };
125
126
  }
126
127
  });
127
- const _ApprovalHistory = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-7be2a6d2"]]);
128
+ const _ApprovalHistory = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-f7d02612"]]);
128
129
  export {
129
130
  _ApprovalHistory as default
130
131
  };
@@ -5,7 +5,7 @@
5
5
  /* empty css */
6
6
  /* empty css */
7
7
  /* empty css */
8
- import { getCurrentInstance, ref, computed, onMounted, watch, provide, createBlock, openBlock, withCtx, createCommentVNode, createVNode, unref, normalizeStyle, createElementBlock, isRef, Fragment, renderList } from "vue";
8
+ import { getCurrentInstance, ref, onMounted, onBeforeUnmount, watch, provide, createBlock, openBlock, withCtx, createCommentVNode, createVNode, unref, normalizeStyle, createElementBlock, Fragment, renderList } from "vue";
9
9
  import "../../../../../../node_modules/.pnpm/grid-layout-plus@1.1.1_vue@3.5.13_typescript@5.7.3_/node_modules/grid-layout-plus/es/index.mjs";
10
10
  import { getCurrentVueInstance } from "../../../utils/getInstance.mjs";
11
11
  import getJsonAsyncUtil from "../../../utils/getJsonAsyncUtil.mjs";
@@ -31,7 +31,7 @@ import { usePageEvents } from "../../../composables/usePageEvents.mjs";
31
31
  import { header } from "../../details/header/index.mjs";
32
32
  import { main } from "../../details/main/index.mjs";
33
33
  import { footer } from "../../details/footer/index.mjs";
34
- import { checkFilterMatch } from "../../../utils/parseFilterConfig.mjs";
34
+ import { checkFilterMatch, checkFieldInFilterConfig, checkFieldInResultConfig } from "../../../utils/parseFilterConfig.mjs";
35
35
  import hooks from "../../../../../../node_modules/.pnpm/moment@2.30.1/node_modules/moment/dist/moment.mjs";
36
36
  /* empty css */
37
37
  import { ElContainer } from "../../../../../../node_modules/.pnpm/element-plus@2.13.2_vue@3.5.13_typescript@5.7.3_/node_modules/element-plus/es/components/container/index.mjs";
@@ -147,8 +147,12 @@ const _sfc_main = /* @__PURE__ */ Object.assign({
147
147
  });
148
148
  hiddenFields.value = option.hiddenFields || [];
149
149
  await loadFieldDataSources();
150
+ await loadProductData();
151
+ applyProductConfigToForm();
152
+ mergeOptionsToFields();
150
153
  loadFormData();
151
154
  loadEventFlow();
155
+ initGridLayoutDataConfig();
152
156
  if (pageEvents && localConfig.value.pageEventConfig) {
153
157
  const onCreatedEvent = localConfig.value.pageEventConfig.find(
154
158
  (e) => e.name === "onCreated"
@@ -158,9 +162,6 @@ const _sfc_main = /* @__PURE__ */ Object.assign({
158
162
  await pageEvents.executeEvent("onCreated");
159
163
  }
160
164
  }
161
- await loadProductData();
162
- applyProductConfigToForm();
163
- mergeOptionsToFields();
164
165
  } catch (error) {
165
166
  console.error("加载配置失败:", error);
166
167
  ElMessage.error("加载配置失败");
@@ -174,7 +175,11 @@ const _sfc_main = /* @__PURE__ */ Object.assign({
174
175
  if (fieldsData.value) {
175
176
  fieldsData.value.forEach((component) => {
176
177
  if (component.fieldName) {
177
- defaultData[component.fieldName] = component.defaultValue ? component.defaultValue : null;
178
+ let defaultValue = component.defaultValue || null;
179
+ if (component.fieldType == "number") {
180
+ defaultValue = Number(defaultValue || 0);
181
+ }
182
+ defaultData[component.fieldName] = defaultValue;
178
183
  }
179
184
  if (component.fieldName) {
180
185
  const fieldRules = generateFieldRules(component);
@@ -357,16 +362,6 @@ const _sfc_main = /* @__PURE__ */ Object.assign({
357
362
  prodRules.value[formField.fieldName] = [];
358
363
  }
359
364
  const customValidator = (rule, value, callback) => {
360
- console.log(
361
- "🚀 ~ customValidator 被调用 ~ 字段:",
362
- formField == null ? void 0 : formField.fieldName,
363
- "值:",
364
- value,
365
- "minValue:",
366
- minValue,
367
- "maxValue:",
368
- maxValue
369
- );
370
365
  if (value === null || value === void 0 || value === "") {
371
366
  callback();
372
367
  return;
@@ -472,7 +467,36 @@ const _sfc_main = /* @__PURE__ */ Object.assign({
472
467
  }
473
468
  });
474
469
  }
475
- const gridLayoutDataConfig = ref([]);
470
+ const gridLayoutFieldsData = ref([]);
471
+ const oriGridLayoutData = ref([]);
472
+ const formItemRefs = ref(/* @__PURE__ */ new Map());
473
+ const setFormItemRef = (el, component) => {
474
+ if (!el) {
475
+ if (component && component.id) {
476
+ formItemRefs.value.delete(component.id);
477
+ }
478
+ return;
479
+ }
480
+ if (component && component.id) {
481
+ formItemRefs.value.set(String(component.id), el);
482
+ }
483
+ };
484
+ const getFormItemRef = (fieldId) => {
485
+ const formItem = formItemRefs.value.get(fieldId);
486
+ if (!formItem) {
487
+ console.log(`未找到 fieldId: ${fieldId} 的 FormItem 组件`);
488
+ return null;
489
+ }
490
+ console.log(`找到 FormItem 组件:`, formItem);
491
+ if (typeof formItem.getInnerComponentRef === "function") {
492
+ const innerRef = formItem.getInnerComponentRef();
493
+ console.log(`内部组件 ref:`, innerRef);
494
+ return innerRef;
495
+ } else {
496
+ console.log(`FormItem 组件没有 getInnerComponentRef 方法`);
497
+ return null;
498
+ }
499
+ };
476
500
  function initGridLayoutDataConfig() {
477
501
  let gridLayoutData = cloneDeep(localConfig.value.fieldsData || []);
478
502
  gridLayoutData = gridLayoutData.map((item) => {
@@ -490,125 +514,8 @@ const _sfc_main = /* @__PURE__ */ Object.assign({
490
514
  }
491
515
  return item;
492
516
  });
493
- gridLayoutDataConfig.value = gridLayoutData;
517
+ oriGridLayoutData.value = gridLayoutData;
494
518
  }
495
- const gridLayoutFieldsData = computed(() => {
496
- initGridLayoutDataConfig();
497
- let gridLayoutData = cloneDeep(gridLayoutDataConfig.value || []);
498
- const linkedConfig = localConfig.value.linkedConfig || {};
499
- const dataLink = (linkedConfig == null ? void 0 : linkedConfig.dataLink) || [];
500
- const fields = [...fieldsData.value, ...hiddenFields.value];
501
- dataLink.forEach((item) => {
502
- if (checkFilterMatch(item.filterConfig, formData.value, fields)) {
503
- const fieldAssignments = item.fieldAssignments || [];
504
- fieldAssignments.forEach((assignment) => {
505
- var _a, _b;
506
- const fieldId = assignment.fieldId;
507
- const formulaText = (_b = (_a = assignment.formula) == null ? void 0 : _a.value) == null ? void 0 : _b.text;
508
- const field = fields.find((f) => f.id == fieldId);
509
- if (field && formulaText) {
510
- const calcResult = calculate({
511
- text: formulaText,
512
- marks: [],
513
- value: formData.value
514
- });
515
- formData.value[field.fieldName] = calcResult;
516
- }
517
- });
518
- }
519
- });
520
- const visibility = (linkedConfig == null ? void 0 : linkedConfig.visibility) || [];
521
- visibility.forEach((item) => {
522
- const dataLinkFieldList = item.dataLinkFieldList || [];
523
- if (checkFilterMatch(item.filterConfig, formData.value, fields)) {
524
- dataLinkFieldList.forEach((fieldId) => {
525
- const layoutFieldItem = gridLayoutData.find((g) => g.id == fieldId);
526
- if (layoutFieldItem) {
527
- layoutFieldItem.hidden = false;
528
- }
529
- });
530
- } else {
531
- dataLinkFieldList.forEach((fieldId) => {
532
- const layoutFieldItem = gridLayoutData.find((g) => g.id == fieldId);
533
- if (layoutFieldItem) {
534
- layoutFieldItem.hidden = true;
535
- }
536
- });
537
- }
538
- });
539
- gridLayoutData = gridLayoutData.filter((item) => !item.hidden);
540
- const requiredArr = (linkedConfig == null ? void 0 : linkedConfig.required) || [];
541
- requiredArr.forEach((item) => {
542
- const dataLinkFieldList = item.dataLinkFieldList || [];
543
- if (checkFilterMatch(item.filterConfig, formData.value, fields)) {
544
- dataLinkFieldList.forEach((fieldId) => {
545
- const layoutFieldItem = gridLayoutData.find((g) => g.id == fieldId);
546
- if (layoutFieldItem) {
547
- layoutFieldItem.component.required = true;
548
- }
549
- });
550
- } else {
551
- dataLinkFieldList.forEach((fieldId) => {
552
- const layoutFieldItem = gridLayoutData.find((g) => g.id == fieldId);
553
- if (layoutFieldItem) {
554
- layoutFieldItem.component.required = false;
555
- }
556
- });
557
- }
558
- });
559
- const rules = {};
560
- gridLayoutData.forEach(({ component }) => {
561
- if (component.fieldName) {
562
- const fieldRules = generateFieldRules(component);
563
- if (fieldRules.length > 0) {
564
- rules[component.fieldName] = fieldRules;
565
- }
566
- }
567
- });
568
- for (let fieldName in prodRules.value) {
569
- rules[fieldName] = prodRules.value[fieldName];
570
- }
571
- formRules.value = rules;
572
- const readonlyArr = (linkedConfig == null ? void 0 : linkedConfig.readonly) || [];
573
- readonlyArr.forEach((item) => {
574
- const dataLinkFieldList = item.dataLinkFieldList || [];
575
- if (checkFilterMatch(item.filterConfig, formData.value, fields)) {
576
- dataLinkFieldList.forEach((fieldId) => {
577
- const layoutFieldItem = gridLayoutData.find((g) => g.id == fieldId);
578
- if (layoutFieldItem) {
579
- layoutFieldItem.component.readOnly = true;
580
- }
581
- });
582
- } else {
583
- dataLinkFieldList.forEach((fieldId) => {
584
- const layoutFieldItem = gridLayoutData.find((g) => g.id == fieldId);
585
- if (layoutFieldItem) {
586
- layoutFieldItem.component.readOnly = false;
587
- }
588
- });
589
- }
590
- });
591
- const disabledArr = (linkedConfig == null ? void 0 : linkedConfig.disabled) || [];
592
- disabledArr.forEach((item) => {
593
- const dataLinkFieldList = item.dataLinkFieldList || [];
594
- if (checkFilterMatch(item.filterConfig, formData.value, fields)) {
595
- dataLinkFieldList.forEach((fieldId) => {
596
- const layoutFieldItem = gridLayoutData.find((g) => g.id == fieldId);
597
- if (layoutFieldItem) {
598
- layoutFieldItem.component.disabled = true;
599
- }
600
- });
601
- } else {
602
- dataLinkFieldList.forEach((fieldId) => {
603
- const layoutFieldItem = gridLayoutData.find((g) => g.id == fieldId);
604
- if (layoutFieldItem) {
605
- layoutFieldItem.component.disabled = false;
606
- }
607
- });
608
- }
609
- });
610
- return gridLayoutData;
611
- });
612
519
  const getFieldError = (fieldName) => {
613
520
  var _a;
614
521
  if (!formRef.value) return "";
@@ -746,13 +653,210 @@ const _sfc_main = /* @__PURE__ */ Object.assign({
746
653
  onMounted(() => {
747
654
  loadConfig();
748
655
  });
656
+ onBeforeUnmount(() => {
657
+ formItemRefs.value.clear();
658
+ });
659
+ const prevFormData = ref({});
660
+ const findChangedFields = (newData, oldData) => {
661
+ const changedFields = [];
662
+ const allKeys = /* @__PURE__ */ new Set([
663
+ ...Object.keys(newData || {}),
664
+ ...Object.keys(oldData || {})
665
+ ]);
666
+ for (const key of allKeys) {
667
+ const newVal = newData[key];
668
+ const oldVal = oldData[key];
669
+ if (newVal !== oldVal) {
670
+ changedFields.push(key);
671
+ }
672
+ }
673
+ return changedFields;
674
+ };
675
+ const filterRelevantLinkageConfigs = (changedFieldNames, linkedConfig, fields) => {
676
+ const result = {
677
+ dataLink: [],
678
+ visibility: [],
679
+ required: [],
680
+ readonly: [],
681
+ disabled: []
682
+ };
683
+ if (!linkedConfig || changedFieldNames.length === 0) {
684
+ return result;
685
+ }
686
+ const changedFieldIds = changedFieldNames.map((fieldName) => {
687
+ const field = fields.find((f) => f.fieldName == fieldName);
688
+ return field ? field.id : null;
689
+ }).filter((id) => id !== null);
690
+ if (linkedConfig.dataLink) {
691
+ result.dataLink = linkedConfig.dataLink.filter((item) => {
692
+ return changedFieldIds.some(
693
+ (fieldId) => checkFieldInFilterConfig(item.filterConfig, fieldId) || checkFieldInResultConfig(item.fieldAssignments, fieldId, fields)
694
+ );
695
+ });
696
+ }
697
+ if (linkedConfig.visibility) {
698
+ result.visibility = linkedConfig.visibility;
699
+ }
700
+ if (linkedConfig.required) {
701
+ result.required = linkedConfig.required;
702
+ }
703
+ if (linkedConfig.readonly) {
704
+ result.readonly = linkedConfig.readonly;
705
+ }
706
+ if (linkedConfig.disabled) {
707
+ result.disabled = linkedConfig.disabled;
708
+ }
709
+ return result;
710
+ };
711
+ const applyLinkageEffectsForChangedFields = (changedFieldNames) => {
712
+ var _a;
713
+ console.log(
714
+ "🚀 ~ applyLinkageEffectsForChangedFields ~ 变化的字段:",
715
+ changedFieldNames
716
+ );
717
+ const linkedConfig = localConfig.value.linkedConfig || {};
718
+ const fields = [...fieldsData.value, ...hiddenFields.value];
719
+ const relevantConfigs = filterRelevantLinkageConfigs(
720
+ changedFieldNames,
721
+ linkedConfig,
722
+ fields
723
+ );
724
+ relevantConfigs.dataLink.forEach((item) => {
725
+ if (checkFilterMatch(item.filterConfig, formData.value, fields)) {
726
+ const fieldAssignments = item.fieldAssignments || [];
727
+ fieldAssignments.forEach((assignment) => {
728
+ var _a2, _b;
729
+ const fieldId = assignment.fieldId;
730
+ const formulaText = (_b = (_a2 = assignment.formula) == null ? void 0 : _a2.value) == null ? void 0 : _b.text;
731
+ const field = fields.find((f) => f.id == fieldId);
732
+ if (field && formulaText) {
733
+ const calcResult = calculate({
734
+ text: formulaText,
735
+ marks: [],
736
+ value: formData.value
737
+ });
738
+ formData.value[field.fieldName] = calcResult;
739
+ }
740
+ });
741
+ }
742
+ });
743
+ const updatedLayoutData = cloneDeep(oriGridLayoutData.value || []);
744
+ relevantConfigs.visibility.forEach((item) => {
745
+ const dataLinkFieldList = item.dataLinkFieldList || [];
746
+ if (checkFilterMatch(item.filterConfig, formData.value, fields)) {
747
+ dataLinkFieldList.forEach((fieldId) => {
748
+ const layoutFieldItem = updatedLayoutData.find((g) => g.id == fieldId);
749
+ if (layoutFieldItem) {
750
+ layoutFieldItem.hidden = false;
751
+ }
752
+ });
753
+ } else {
754
+ dataLinkFieldList.forEach((fieldId) => {
755
+ const layoutFieldItem = updatedLayoutData.find((g) => g.id == fieldId);
756
+ if (layoutFieldItem) {
757
+ layoutFieldItem.hidden = true;
758
+ }
759
+ });
760
+ }
761
+ });
762
+ relevantConfigs.required.forEach((item) => {
763
+ const dataLinkFieldList = item.dataLinkFieldList || [];
764
+ if (checkFilterMatch(item.filterConfig, formData.value, fields)) {
765
+ dataLinkFieldList.forEach((fieldId) => {
766
+ const layoutFieldItem = updatedLayoutData.find((g) => g.id == fieldId);
767
+ if (layoutFieldItem) {
768
+ layoutFieldItem.component.required = true;
769
+ }
770
+ });
771
+ } else {
772
+ dataLinkFieldList.forEach((fieldId) => {
773
+ const layoutFieldItem = updatedLayoutData.find((g) => g.id == fieldId);
774
+ if (layoutFieldItem) {
775
+ layoutFieldItem.component.required = false;
776
+ }
777
+ });
778
+ }
779
+ });
780
+ const rules = {};
781
+ updatedLayoutData.forEach(({ component }) => {
782
+ if (component.fieldName) {
783
+ const fieldRules = generateFieldRules(component);
784
+ if (fieldRules.length > 0) {
785
+ rules[component.fieldName] = fieldRules;
786
+ }
787
+ }
788
+ });
789
+ for (let fieldName in prodRules.value) {
790
+ rules[fieldName] = prodRules.value[fieldName];
791
+ }
792
+ formRules.value = rules;
793
+ relevantConfigs.readonly.forEach((item) => {
794
+ const dataLinkFieldList = item.dataLinkFieldList || [];
795
+ if (checkFilterMatch(item.filterConfig, formData.value, fields)) {
796
+ dataLinkFieldList.forEach((fieldId) => {
797
+ const layoutFieldItem = updatedLayoutData.find((g) => g.id == fieldId);
798
+ if (layoutFieldItem) {
799
+ layoutFieldItem.component.readOnly = true;
800
+ }
801
+ });
802
+ } else {
803
+ dataLinkFieldList.forEach((fieldId) => {
804
+ const layoutFieldItem = updatedLayoutData.find((g) => g.id == fieldId);
805
+ if (layoutFieldItem) {
806
+ layoutFieldItem.component.readOnly = false;
807
+ }
808
+ });
809
+ }
810
+ });
811
+ relevantConfigs.disabled.forEach((item) => {
812
+ const dataLinkFieldList = item.dataLinkFieldList || [];
813
+ if (checkFilterMatch(item.filterConfig, formData.value, fields)) {
814
+ dataLinkFieldList.forEach((fieldId) => {
815
+ const layoutFieldItem = updatedLayoutData.find((g) => g.id == fieldId);
816
+ if (layoutFieldItem) {
817
+ layoutFieldItem.component.disabled = true;
818
+ }
819
+ });
820
+ } else {
821
+ dataLinkFieldList.forEach((fieldId) => {
822
+ const layoutFieldItem = updatedLayoutData.find((g) => g.id == fieldId);
823
+ if (layoutFieldItem) {
824
+ layoutFieldItem.component.disabled = false;
825
+ }
826
+ });
827
+ }
828
+ });
829
+ gridLayoutFieldsData.value = updatedLayoutData.filter((item) => !item.hidden);
830
+ (_a = gridLayout == null ? void 0 : gridLayout.value) == null ? void 0 : _a.resizeEvent();
831
+ };
749
832
  watch(
750
833
  formData,
751
- (newVal) => {
834
+ (newVal, oldVal) => {
835
+ const changedFields = findChangedFields(newVal, prevFormData.value);
836
+ if (changedFields.length > 0) {
837
+ applyLinkageEffectsForChangedFields(changedFields);
838
+ }
839
+ prevFormData.value = { ...newVal };
752
840
  emit("update:modelValue", newVal);
753
841
  },
754
842
  { deep: true }
755
843
  );
844
+ function setFormItemHeight(id, fixedH, h) {
845
+ var _a;
846
+ const item = gridLayoutFieldsData.value.find((item2) => item2.id == id);
847
+ if (!fixedH) {
848
+ item.h = h * 60;
849
+ } else if (fixedH) {
850
+ item.h = h / (localConfig.value.labelPosition == "top" ? 1.5 : 1);
851
+ }
852
+ const oriItem = oriGridLayoutData.value.find((item2) => item2.id == id);
853
+ if (!fixedH) {
854
+ oriItem.h = h * 60;
855
+ } else if (fixedH) {
856
+ oriItem.h = h / (localConfig.value.labelPosition == "top" ? 1.5 : 1);
857
+ }
858
+ (_a = gridLayout == null ? void 0 : gridLayout.value) == null ? void 0 : _a.resizeEvent();
859
+ }
756
860
  provide("formData", formData);
757
861
  provide("localConfig", localConfig);
758
862
  provide("fieldsData", fieldsData);
@@ -760,12 +864,14 @@ const _sfc_main = /* @__PURE__ */ Object.assign({
760
864
  provide("rowHeight", rowHeight);
761
865
  provide("gridLayout", gridLayout);
762
866
  provide("gridLayoutFieldsData", gridLayoutFieldsData);
867
+ provide("setFormItemHeight", setFormItemHeight);
763
868
  provide("formCtx", ctx);
764
869
  __expose({
765
870
  validate,
766
871
  resetFields,
767
872
  getFormData,
768
873
  setFormData,
874
+ getFormItemRef,
769
875
  formRef,
770
876
  localConfig
771
877
  });
@@ -801,8 +907,8 @@ const _sfc_main = /* @__PURE__ */ Object.assign({
801
907
  key: 0,
802
908
  ref_key: "gridLayout",
803
909
  ref: gridLayout,
804
- layout: unref(gridLayoutFieldsData),
805
- "onUpdate:layout": _cache[0] || (_cache[0] = ($event) => isRef(gridLayoutFieldsData) ? gridLayoutFieldsData.value = $event : null),
910
+ layout: gridLayoutFieldsData.value,
911
+ "onUpdate:layout": _cache[0] || (_cache[0] = ($event) => gridLayoutFieldsData.value = $event),
806
912
  "row-height": rowHeight.value,
807
913
  margin: [0, 0],
808
914
  "use-css-transforms": false,
@@ -812,6 +918,7 @@ const _sfc_main = /* @__PURE__ */ Object.assign({
812
918
  }, {
813
919
  item: withCtx(({ item: { component } }) => [
814
920
  createVNode(_FormItem, {
921
+ ref: (el) => setFormItemRef(el, component),
815
922
  modelValue: formData.value[component.fieldName],
816
923
  "onUpdate:modelValue": ($event) => formData.value[component.fieldName] = $event,
817
924
  config: component,
@@ -850,7 +957,7 @@ const _sfc_main = /* @__PURE__ */ Object.assign({
850
957
  };
851
958
  }
852
959
  });
853
- const _Form = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-f1c90d7c"]]);
960
+ const _Form = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-a3082b55"]]);
854
961
  export {
855
962
  _Form as default
856
963
  };
@@ -2,7 +2,7 @@
2
2
  /* empty css */
3
3
  import "../../../../../../node_modules/.pnpm/element-plus@2.13.2_vue@3.5.13_typescript@5.7.3_/node_modules/element-plus/theme-chalk/el-tooltip.css.mjs";
4
4
  /* empty css */
5
- import { computed, createBlock, createElementBlock, openBlock, unref, normalizeClass, createSlots, withCtx, createCommentVNode, resolveDynamicComponent, mergeProps, createElementVNode, toDisplayString } from "vue";
5
+ import { computed, ref, createBlock, createElementBlock, openBlock, unref, normalizeClass, createSlots, withCtx, createCommentVNode, resolveDynamicComponent, mergeProps, createElementVNode, toDisplayString } from "vue";
6
6
  import { debounce } from "../form/debounce.mjs";
7
7
  import { SubTitle } from "../subTitle/index.mjs";
8
8
  import { H2 } from "../h2/index.mjs";
@@ -54,7 +54,7 @@ const _sfc_main = /* @__PURE__ */ Object.assign({
54
54
  }
55
55
  },
56
56
  emits: ["update:modelValue", "change"],
57
- setup(__props, { emit: __emit }) {
57
+ setup(__props, { expose: __expose, emit: __emit }) {
58
58
  const props = __props;
59
59
  const emit = __emit;
60
60
  function handleChange(config, val) {
@@ -88,6 +88,7 @@ const _sfc_main = /* @__PURE__ */ Object.assign({
88
88
  }
89
89
  });
90
90
  }, 300);
91
+ const innerComponentRef = ref(null);
91
92
  const compValue = computed({
92
93
  get: () => props.modelValue,
93
94
  set: (val) => {
@@ -97,6 +98,14 @@ const _sfc_main = /* @__PURE__ */ Object.assign({
97
98
  }
98
99
  }
99
100
  });
101
+ const getInnerComponentRef = () => {
102
+ debugger;
103
+ return innerComponentRef.value;
104
+ };
105
+ __expose({
106
+ config: props.config,
107
+ getInnerComponentRef
108
+ });
100
109
  return (_ctx, _cache) => {
101
110
  const _component_el_tooltip = ElTooltip;
102
111
  const _component_el_form_item = ElFormItem;
@@ -108,15 +117,21 @@ const _sfc_main = /* @__PURE__ */ Object.assign({
108
117
  config: __props.config
109
118
  }, null, 8, ["config"])) : __props.config.fieldType == "subForm" ? (openBlock(), createBlock(unref(SubForm), {
110
119
  key: 2,
120
+ ref_key: "innerComponentRef",
121
+ ref: innerComponentRef,
111
122
  config: __props.config,
112
123
  localConfig: __props.localConfig,
113
124
  formMode: __props.formMode
114
125
  }, null, 8, ["config", "localConfig", "formMode"])) : __props.config.fieldType == "subTable" ? (openBlock(), createBlock(unref(SubTable), {
115
126
  key: 3,
127
+ ref_key: "innerComponentRef",
128
+ ref: innerComponentRef,
116
129
  config: __props.config,
117
130
  localConfig: __props.localConfig
118
131
  }, null, 8, ["config", "localConfig"])) : __props.config.fieldType == "approvalHistory" ? (openBlock(), createBlock(unref(ApprovalHistory), {
119
132
  key: 4,
133
+ ref_key: "innerComponentRef",
134
+ ref: innerComponentRef,
120
135
  config: __props.config,
121
136
  localConfig: __props.localConfig
122
137
  }, null, 8, ["config", "localConfig"])) : __props.config.fieldType == "blank" || __props.config.fieldType == "divider" ? (openBlock(), createElementBlock("div", {
@@ -132,6 +147,8 @@ const _sfc_main = /* @__PURE__ */ Object.assign({
132
147
  default: withCtx(() => [
133
148
  __props.config.labelMode != "label" ? (openBlock(), createBlock(resolveDynamicComponent(componentType.value), mergeProps({
134
149
  key: 0,
150
+ ref_key: "innerComponentRef",
151
+ ref: innerComponentRef,
135
152
  modelValue: compValue.value,
136
153
  "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => compValue.value = $event)
137
154
  }, componentProps.value, {
@@ -170,7 +187,7 @@ const _sfc_main = /* @__PURE__ */ Object.assign({
170
187
  };
171
188
  }
172
189
  });
173
- const _FormItem = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-c5553ecf"]]);
190
+ const _FormItem = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-1fbcd248"]]);
174
191
  export {
175
192
  _FormItem as default
176
193
  };
@@ -48,8 +48,8 @@ const _sfc_main = /* @__PURE__ */ Object.assign({
48
48
  const props = __props;
49
49
  const formData = inject("formData");
50
50
  inject("rowHeight");
51
- const gridLayout = inject("gridLayout");
52
- inject("gridLayoutFieldsData");
51
+ inject("gridLayout");
52
+ const setFormItemHeight = inject("setFormItemHeight");
53
53
  function subFormLoaded(subOption) {
54
54
  const fieldsData = subOption.fieldsData;
55
55
  console.log("🚀 ~ loaded ~ subOption:", subOption);
@@ -59,11 +59,10 @@ const _sfc_main = /* @__PURE__ */ Object.assign({
59
59
  const foundItem = props.localConfig.fieldsData.find(
60
60
  (item) => item.id == props.config.id
61
61
  );
62
- const y = 1;
63
- const titleHeight = config.titleMode != "none" ? 1 : 0;
62
+ const titleHeight = props.config.titleMode != "none" ? 1 : 0;
64
63
  if (foundItem) {
65
- foundItem.h = maxY + y + titleHeight;
66
- gridLayout.value.resizeEvent();
64
+ foundItem.h = maxY + titleHeight;
65
+ setFormItemHeight(props.config.id, false, maxY + titleHeight);
67
66
  }
68
67
  }
69
68
  return (_ctx, _cache) => {
@@ -44,12 +44,12 @@ const _sfc_main = /* @__PURE__ */ Object.assign({
44
44
  // default: false,
45
45
  // },
46
46
  },
47
- setup(__props) {
47
+ setup(__props, { expose: __expose }) {
48
48
  const props = __props;
49
49
  const formData = inject("formData");
50
50
  inject("rowHeight");
51
- const gridLayout = inject("gridLayout");
52
- inject("gridLayoutFieldsData");
51
+ inject("gridLayout");
52
+ const setFormItemHeight = inject("setFormItemHeight");
53
53
  const subTableData = computed(() => {
54
54
  if (props.config.dataSourceFrom == "main") {
55
55
  return formData.value[props.config.fieldName];
@@ -79,15 +79,18 @@ const _sfc_main = /* @__PURE__ */ Object.assign({
79
79
  });
80
80
  function subTableLoaded(subOption) {
81
81
  subTableOption.value = subOption;
82
- console.log("🚀 ~ subTableLoaded ~ subOption:", subOption);
83
82
  const foundItem = props.localConfig.fieldsData.find(
84
83
  (item) => item.id == props.config.id
85
84
  );
86
- const titleHeight = config.titleMode != "none" ? 60 : 0;
85
+ const titleHeight = props.config.titleMode != "none" ? 60 : 0;
87
86
  if (foundItem) {
88
87
  foundItem.fixedH = true;
89
88
  foundItem.h = props.config.subTableHeight + titleHeight;
90
- gridLayout.value.resizeEvent();
89
+ setFormItemHeight(
90
+ props.config.id,
91
+ true,
92
+ props.config.subTableHeight + titleHeight
93
+ );
91
94
  }
92
95
  }
93
96
  const tableRef = ref();
@@ -99,6 +102,9 @@ const _sfc_main = /* @__PURE__ */ Object.assign({
99
102
  type: "custom"
100
103
  });
101
104
  };
105
+ __expose({
106
+ subTableRef: tableRef
107
+ });
102
108
  return (_ctx, _cache) => {
103
109
  const _component_el_button = ElButton;
104
110
  return openBlock(), createElementBlock(Fragment, null, [