@fecp/designer 5.5.40 → 5.5.43

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.
@@ -1,4 +1,4 @@
1
- const version = "5.5.40";
1
+ const version = "5.5.43";
2
2
  const packageJson = {
3
3
  version
4
4
  };
@@ -1,4 +1,4 @@
1
- import DialogDialog from "./index.vue2.mjs";
1
+ import DialogDialog from "./index.vue.mjs";
2
2
  import { ref } from "vue";
3
3
  function useDialogDialog() {
4
4
  const dialogDialogVisible = ref(false);
@@ -84,7 +84,7 @@ import widgets from "../table/property/widgets.vue.mjs";
84
84
  import "../../../../node_modules/element-plus/theme-chalk/el-tab-pane.css.mjs";
85
85
  /* empty css */
86
86
  /* empty css */
87
- /* empty css */
87
+ /* empty css */
88
88
  /* empty css */
89
89
  /* empty css */
90
90
  /* empty css */
@@ -1,4 +1,4 @@
1
- import DialogGlobalDialog from "./index.vue2.mjs";
1
+ import DialogGlobalDialog from "./index.vue.mjs";
2
2
  import { ref } from "vue";
3
3
  function useDialogGlobalDialog() {
4
4
  const dialogGlobalDialogVisible = ref(false);
@@ -52,8 +52,8 @@ import _export_sfc from "../../../../../_virtual/_plugin-vue_export-helper.mjs";
52
52
  import "../../../components/TemplateSelector.vue.mjs";
53
53
  import "../../table/default.mjs";
54
54
  /* empty css */
55
- /* empty css */
56
- /* empty css */
55
+ /* empty css */
56
+ /* empty css */
57
57
  import "../../../store/index.mjs";
58
58
  /* empty css */
59
59
  import { ElCollapse, ElCollapseItem } from "../../../../../node_modules/element-plus/es/components/collapse/index.mjs";
package/es/designer.css CHANGED
@@ -5852,23 +5852,20 @@ body,
5852
5852
  outline: none;
5853
5853
  box-shadow: 0 1px 0 0 #c0c4cc inset, 0 -1px 0 0 #c0c4cc inset, -1px 0 0 0 #c0c4cc inset;
5854
5854
  }
5855
- .info-icon[data-v-2860c795] {
5855
+ .info-icon[data-v-44a32b0c] {
5856
5856
  margin-left: 4px;
5857
5857
  color: #f5b041;
5858
5858
  cursor: help;
5859
5859
  font-size: 14px;
5860
5860
  pointer-events: all;
5861
5861
  }
5862
- .credit-icon[data-v-2860c795] {
5862
+ .credit-icon[data-v-44a32b0c] {
5863
5863
  color: #2e8bff;
5864
5864
  margin-right: 2px;
5865
5865
  }
5866
- .regulation-icon[data-v-2860c795] {
5866
+ .regulation-icon[data-v-44a32b0c] {
5867
5867
  color: #f56c6c;
5868
5868
  margin-right: 2px;
5869
- }
5870
- [data-v-2860c795] .el-form-item__label {
5871
- padding: 0 8px 0 0;
5872
5869
  }
5873
5870
  .el-page-header.is-contentful .el-page-header__main{border-top:1px solid var(--el-border-color-light);margin-top:16px}.el-page-header__header{justify-content:space-between;align-items:center;line-height:24px;display:flex}.el-page-header__left{align-items:center;margin-right:40px;display:flex;position:relative}.el-page-header__back{cursor:pointer;align-items:center;display:flex}.el-page-header__left .el-divider--vertical{margin:0 16px}.el-page-header__icon{align-items:center;margin-right:10px;font-size:16px;display:flex}.el-page-header__icon .el-icon{font-size:inherit}.el-page-header__title{font-size:14px;font-weight:500}.el-page-header__content{color:var(--el-text-color-primary);font-size:18px}.el-page-header__breadcrumb{margin-bottom:16px}.fec-header[data-v-a55fc4ab] {
5874
5871
  padding: 0 20px;
@@ -5934,25 +5931,26 @@ body,
5934
5931
  width: 80px;
5935
5932
  font-size: var(--el-font-size-extra-small);
5936
5933
  }
5937
- .fec-form[data-v-71dda23e] {
5934
+
5935
+ .fec-form[data-v-95d9b970] {
5938
5936
  height: 100%;
5939
5937
  }
5940
- [data-v-71dda23e] .vgl-layout {
5938
+ [data-v-95d9b970] .vgl-layout {
5941
5939
  position: relative;
5942
5940
  }
5943
- [data-v-71dda23e] .vgl-item {
5941
+ [data-v-95d9b970] .vgl-item {
5944
5942
  transition: none;
5945
5943
  }
5946
- [data-v-71dda23e] .vgl-item > .el-form-item {
5944
+ [data-v-95d9b970] .vgl-item > .el-form-item {
5947
5945
  width: 100%;
5948
5946
  padding: 6px 8px 0 8px;
5949
5947
  height: calc(100% - 15px);
5950
5948
  display: flex;
5951
5949
  }
5952
- [data-v-71dda23e] .vgl-item > .el-form-item.el-form-item--label-top {
5950
+ [data-v-95d9b970] .vgl-item > .el-form-item.el-form-item--label-top {
5953
5951
  flex-direction: column;
5954
5952
  }
5955
- [data-v-71dda23e] .vgl-item > .el-form-item .el-form-item__label {
5953
+ [data-v-95d9b970] .vgl-item > .el-form-item .el-form-item__label {
5956
5954
  line-height: 20px;
5957
5955
  display: flex;
5958
5956
  align-items: center;
@@ -5960,14 +5958,48 @@ body,
5960
5958
  pointer-events: none;
5961
5959
  flex-wrap: wrap;
5962
5960
  white-space: normal;
5961
+ padding: 0 8px 0 0;
5962
+ width: 100% !important;
5963
+ max-width: 160px;
5964
+ min-width: 80px;
5965
+ flex-shrink: 0;
5963
5966
  }
5964
- [data-v-71dda23e] .vgl-item > .el-form-item {
5967
+ [data-v-95d9b970] .vgl-item > .el-form-item {
5965
5968
  /* .el-form-item__error {
5966
5969
  padding-top: 10px;
5967
5970
  } */
5968
5971
  }
5969
- [data-v-71dda23e] .vgl-item > .el-container {
5972
+ [data-v-95d9b970] .vgl-item > .el-container {
5970
5973
  height: auto !important;
5974
+ }
5975
+ @media (min-width: 1440px) {
5976
+ [data-v-95d9b970] .vgl-item .el-form-item__label {
5977
+ max-width: 160px !important;
5978
+ }
5979
+ }
5980
+ /* 标准 PC(1200px ~ 1439px)*/
5981
+ @media (min-width: 1200px) and (max-width: 1439px) {
5982
+ [data-v-95d9b970] .vgl-item .el-form-item__label {
5983
+ max-width: 135px !important;
5984
+ }
5985
+ }
5986
+ /* 2. 标准 PC 992px ~ 1199px */
5987
+ @media (min-width: 992px) and (max-width: 1199px) {
5988
+ [data-v-95d9b970] .vgl-item .el-form-item__label {
5989
+ max-width: 120px !important;
5990
+ }
5991
+ }
5992
+ /* 3. 小屏 PC / 窄窗口 <992px(最小到768px)*/
5993
+ @media (max-width: 991px) and (min-width: 768px) {
5994
+ [data-v-95d9b970] .vgl-item .el-form-item__label {
5995
+ max-width: 100px !important;
5996
+ }
5997
+ }
5998
+ /* 超小屏 <768px */
5999
+ @media (max-width: 767px) {
6000
+ [data-v-95d9b970] .vgl-item .el-form-item__label {
6001
+ max-width: 80px !important;
6002
+ }
5971
6003
  }.table-pagination[data-v-142fdd35] {
5972
6004
  display: flex;
5973
6005
  justify-content: flex-end;
@@ -117,6 +117,8 @@ const _sfc_main = /* @__PURE__ */ Object.assign({
117
117
  const productData = ref({});
118
118
  const fieldsData = ref([]);
119
119
  const hiddenFields = ref([]);
120
+ const prevFormData = ref({});
121
+ let linkaged = false;
120
122
  const rowHeight = ref(1);
121
123
  const pageEvents = props.canPageEvent ? usePageEvents(() => ({
122
124
  pageEventConfig: localConfig.value.pageEventConfig,
@@ -138,7 +140,7 @@ const _sfc_main = /* @__PURE__ */ Object.assign({
138
140
  () => props.templateKey,
139
141
  (key) => {
140
142
  if (key) {
141
- loadConfig();
143
+ loadConfig("dynamic");
142
144
  }
143
145
  }
144
146
  );
@@ -146,14 +148,16 @@ const _sfc_main = /* @__PURE__ */ Object.assign({
146
148
  () => props.modelValue,
147
149
  (newVal, oldVal) => {
148
150
  if (JSON.stringify(newVal) !== JSON.stringify(oldVal)) {
149
- loadFormData(true);
151
+ loadFormData("change");
150
152
  }
151
153
  }
152
154
  );
153
- const loadConfig = async () => {
155
+ const loadConfig = async (state) => {
154
156
  if (!props.templateKey && (!props.initOption || Object.keys(props.initOption).length == 0)) {
155
157
  return;
156
158
  }
159
+ prevFormData.value = {};
160
+ linkaged = false;
157
161
  configLoading.value = true;
158
162
  try {
159
163
  let option = await getJsonAsyncUtil(
@@ -176,7 +180,7 @@ const _sfc_main = /* @__PURE__ */ Object.assign({
176
180
  return item.component;
177
181
  });
178
182
  hiddenFields.value = option.hiddenFields || [];
179
- loadFormData();
183
+ loadFormData(state);
180
184
  loadEventFlow();
181
185
  if (pageEvents && localConfig.value.pageEventConfig) {
182
186
  const onCreatedEvent = localConfig.value.pageEventConfig.find(
@@ -207,7 +211,7 @@ const _sfc_main = /* @__PURE__ */ Object.assign({
207
211
  function layoutUpdated(layoutData) {
208
212
  emit("layoutUpdated", layoutData);
209
213
  }
210
- const loadFormData = (flag) => {
214
+ const loadFormData = (state) => {
211
215
  var _a;
212
216
  const defaultData = {};
213
217
  const rules = {};
@@ -220,7 +224,7 @@ const _sfc_main = /* @__PURE__ */ Object.assign({
220
224
  }
221
225
  defaultData[component.fieldName] = defaultValue;
222
226
  }
223
- if (!flag) {
227
+ if (state != "change") {
224
228
  if (component.fieldName) {
225
229
  const fieldRules = generateFieldRules(component, formData, [
226
230
  ...fieldsData.value,
@@ -241,15 +245,22 @@ const _sfc_main = /* @__PURE__ */ Object.assign({
241
245
  ...fieldsData.value,
242
246
  ...hiddenFields.value
243
247
  ]);
244
- defaultData[field.fieldName] = value !== void 0 ? value : null;
245
- } else {
246
- defaultData[field.fieldName] = field.value !== void 0 ? field.value : null;
248
+ if (value) {
249
+ defaultData[field.fieldName] = value;
250
+ }
251
+ } else if (field.value) {
252
+ defaultData[field.fieldName] = field.value;
247
253
  }
248
254
  }
249
255
  });
250
256
  }
251
- formData.value = { ...defaultData, ...setFormData(props.modelValue, true) };
252
- if (!flag) {
257
+ if (state == "dynamic") {
258
+ debugger;
259
+ formData.value = { ...setFormData(props.modelValue, true), ...defaultData };
260
+ } else {
261
+ formData.value = { ...defaultData, ...setFormData(props.modelValue, true) };
262
+ }
263
+ if (state != "change") {
253
264
  formRules.value = rules;
254
265
  }
255
266
  };
@@ -763,7 +774,6 @@ const _sfc_main = /* @__PURE__ */ Object.assign({
763
774
  onBeforeUnmount(() => {
764
775
  formItemRefs.value.clear();
765
776
  });
766
- const prevFormData = ref({});
767
777
  const findChangedFields = (newData, oldData) => {
768
778
  const changedFields = [];
769
779
  const allKeys = /* @__PURE__ */ new Set([
@@ -949,7 +959,6 @@ const _sfc_main = /* @__PURE__ */ Object.assign({
949
959
  gridLayoutFieldsData.value = updatedLayoutData.filter((item) => !item.hidden);
950
960
  (_a = gridLayout == null ? void 0 : gridLayout.value) == null ? void 0 : _a.resizeEvent();
951
961
  };
952
- let linkaged = false;
953
962
  function initLinkage() {
954
963
  const changedFields = findChangedFields(formData.value, prevFormData.value);
955
964
  console.log("🚀 ~ initLinkage ~ changedFields:", changedFields);
@@ -1003,6 +1012,7 @@ const _sfc_main = /* @__PURE__ */ Object.assign({
1003
1012
  provide("setFormItemHeight", setFormItemHeight);
1004
1013
  provide("formCtx", ctx);
1005
1014
  provide("handleEvent", handleEvent);
1015
+ provide("getFormData", getFormData);
1006
1016
  __expose({
1007
1017
  validate,
1008
1018
  resetFields,
@@ -1103,7 +1113,7 @@ const _sfc_main = /* @__PURE__ */ Object.assign({
1103
1113
  };
1104
1114
  }
1105
1115
  });
1106
- const _Form = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-71dda23e"]]);
1116
+ const _Form = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-95d9b970"]]);
1107
1117
  export {
1108
1118
  _Form as default
1109
1119
  };
@@ -205,7 +205,7 @@ const _sfc_main = /* @__PURE__ */ Object.assign({
205
205
  };
206
206
  }
207
207
  });
208
- const _FormItem = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-2860c795"]]);
208
+ const _FormItem = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-44a32b0c"]]);
209
209
  export {
210
210
  _FormItem as default
211
211
  };
@@ -48,6 +48,7 @@ const _sfc_main = /* @__PURE__ */ Object.assign({
48
48
  setup(__props, { expose: __expose }) {
49
49
  const props = __props;
50
50
  const formData = inject("formData");
51
+ inject("getFormData");
51
52
  inject("rowHeight");
52
53
  inject("gridLayout");
53
54
  const setFormItemHeight = inject("setFormItemHeight");
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
3
- const version = "5.5.40";
3
+ const version = "5.5.43";
4
4
  const packageJson = {
5
5
  version
6
6
  };
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const index = require("./index.vue2.js");
3
+ const index = require("./index.vue.js");
4
4
  const Vue = require("vue");
5
5
  function useDialogDialog() {
6
6
  const dialogDialogVisible = Vue.ref(false);
@@ -86,7 +86,7 @@ const widgets = require("../table/property/widgets.vue.js");
86
86
  require("../../../../node_modules/element-plus/theme-chalk/el-tab-pane.css.js");
87
87
  ;/* empty css */
88
88
  ;/* empty css */
89
- ;/* empty css */
89
+ ;/* empty css */
90
90
  ;/* empty css */
91
91
  ;/* empty css */
92
92
  ;/* empty css */
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const index = require("./index.vue2.js");
3
+ const index = require("./index.vue.js");
4
4
  const Vue = require("vue");
5
5
  function useDialogGlobalDialog() {
6
6
  const dialogGlobalDialogVisible = Vue.ref(false);
@@ -54,8 +54,8 @@ const _pluginVue_exportHelper = require("../../../../../_virtual/_plugin-vue_exp
54
54
  require("../../../components/TemplateSelector.vue.js");
55
55
  require("../../table/default.js");
56
56
  ;/* empty css */
57
- ;/* empty css */
58
- ;/* empty css */
57
+ ;/* empty css */
58
+ ;/* empty css */
59
59
  require("../../../store/index.js");
60
60
  ;/* empty css */
61
61
  const index$2 = require("../../../../../node_modules/element-plus/es/components/collapse/index.js");
package/lib/designer.css CHANGED
@@ -5852,23 +5852,20 @@ body,
5852
5852
  outline: none;
5853
5853
  box-shadow: 0 1px 0 0 #c0c4cc inset, 0 -1px 0 0 #c0c4cc inset, -1px 0 0 0 #c0c4cc inset;
5854
5854
  }
5855
- .info-icon[data-v-2860c795] {
5855
+ .info-icon[data-v-44a32b0c] {
5856
5856
  margin-left: 4px;
5857
5857
  color: #f5b041;
5858
5858
  cursor: help;
5859
5859
  font-size: 14px;
5860
5860
  pointer-events: all;
5861
5861
  }
5862
- .credit-icon[data-v-2860c795] {
5862
+ .credit-icon[data-v-44a32b0c] {
5863
5863
  color: #2e8bff;
5864
5864
  margin-right: 2px;
5865
5865
  }
5866
- .regulation-icon[data-v-2860c795] {
5866
+ .regulation-icon[data-v-44a32b0c] {
5867
5867
  color: #f56c6c;
5868
5868
  margin-right: 2px;
5869
- }
5870
- [data-v-2860c795] .el-form-item__label {
5871
- padding: 0 8px 0 0;
5872
5869
  }
5873
5870
  .el-page-header.is-contentful .el-page-header__main{border-top:1px solid var(--el-border-color-light);margin-top:16px}.el-page-header__header{justify-content:space-between;align-items:center;line-height:24px;display:flex}.el-page-header__left{align-items:center;margin-right:40px;display:flex;position:relative}.el-page-header__back{cursor:pointer;align-items:center;display:flex}.el-page-header__left .el-divider--vertical{margin:0 16px}.el-page-header__icon{align-items:center;margin-right:10px;font-size:16px;display:flex}.el-page-header__icon .el-icon{font-size:inherit}.el-page-header__title{font-size:14px;font-weight:500}.el-page-header__content{color:var(--el-text-color-primary);font-size:18px}.el-page-header__breadcrumb{margin-bottom:16px}.fec-header[data-v-a55fc4ab] {
5874
5871
  padding: 0 20px;
@@ -5934,25 +5931,26 @@ body,
5934
5931
  width: 80px;
5935
5932
  font-size: var(--el-font-size-extra-small);
5936
5933
  }
5937
- .fec-form[data-v-71dda23e] {
5934
+
5935
+ .fec-form[data-v-95d9b970] {
5938
5936
  height: 100%;
5939
5937
  }
5940
- [data-v-71dda23e] .vgl-layout {
5938
+ [data-v-95d9b970] .vgl-layout {
5941
5939
  position: relative;
5942
5940
  }
5943
- [data-v-71dda23e] .vgl-item {
5941
+ [data-v-95d9b970] .vgl-item {
5944
5942
  transition: none;
5945
5943
  }
5946
- [data-v-71dda23e] .vgl-item > .el-form-item {
5944
+ [data-v-95d9b970] .vgl-item > .el-form-item {
5947
5945
  width: 100%;
5948
5946
  padding: 6px 8px 0 8px;
5949
5947
  height: calc(100% - 15px);
5950
5948
  display: flex;
5951
5949
  }
5952
- [data-v-71dda23e] .vgl-item > .el-form-item.el-form-item--label-top {
5950
+ [data-v-95d9b970] .vgl-item > .el-form-item.el-form-item--label-top {
5953
5951
  flex-direction: column;
5954
5952
  }
5955
- [data-v-71dda23e] .vgl-item > .el-form-item .el-form-item__label {
5953
+ [data-v-95d9b970] .vgl-item > .el-form-item .el-form-item__label {
5956
5954
  line-height: 20px;
5957
5955
  display: flex;
5958
5956
  align-items: center;
@@ -5960,14 +5958,48 @@ body,
5960
5958
  pointer-events: none;
5961
5959
  flex-wrap: wrap;
5962
5960
  white-space: normal;
5961
+ padding: 0 8px 0 0;
5962
+ width: 100% !important;
5963
+ max-width: 160px;
5964
+ min-width: 80px;
5965
+ flex-shrink: 0;
5963
5966
  }
5964
- [data-v-71dda23e] .vgl-item > .el-form-item {
5967
+ [data-v-95d9b970] .vgl-item > .el-form-item {
5965
5968
  /* .el-form-item__error {
5966
5969
  padding-top: 10px;
5967
5970
  } */
5968
5971
  }
5969
- [data-v-71dda23e] .vgl-item > .el-container {
5972
+ [data-v-95d9b970] .vgl-item > .el-container {
5970
5973
  height: auto !important;
5974
+ }
5975
+ @media (min-width: 1440px) {
5976
+ [data-v-95d9b970] .vgl-item .el-form-item__label {
5977
+ max-width: 160px !important;
5978
+ }
5979
+ }
5980
+ /* 标准 PC(1200px ~ 1439px)*/
5981
+ @media (min-width: 1200px) and (max-width: 1439px) {
5982
+ [data-v-95d9b970] .vgl-item .el-form-item__label {
5983
+ max-width: 135px !important;
5984
+ }
5985
+ }
5986
+ /* 2. 标准 PC 992px ~ 1199px */
5987
+ @media (min-width: 992px) and (max-width: 1199px) {
5988
+ [data-v-95d9b970] .vgl-item .el-form-item__label {
5989
+ max-width: 120px !important;
5990
+ }
5991
+ }
5992
+ /* 3. 小屏 PC / 窄窗口 <992px(最小到768px)*/
5993
+ @media (max-width: 991px) and (min-width: 768px) {
5994
+ [data-v-95d9b970] .vgl-item .el-form-item__label {
5995
+ max-width: 100px !important;
5996
+ }
5997
+ }
5998
+ /* 超小屏 <768px */
5999
+ @media (max-width: 767px) {
6000
+ [data-v-95d9b970] .vgl-item .el-form-item__label {
6001
+ max-width: 80px !important;
6002
+ }
5971
6003
  }.table-pagination[data-v-142fdd35] {
5972
6004
  display: flex;
5973
6005
  justify-content: flex-end;
@@ -119,6 +119,8 @@ const _sfc_main = /* @__PURE__ */ Object.assign({
119
119
  const productData = Vue.ref({});
120
120
  const fieldsData = Vue.ref([]);
121
121
  const hiddenFields = Vue.ref([]);
122
+ const prevFormData = Vue.ref({});
123
+ let linkaged = false;
122
124
  const rowHeight = Vue.ref(1);
123
125
  const pageEvents = props.canPageEvent ? usePageEvents.usePageEvents(() => ({
124
126
  pageEventConfig: localConfig.value.pageEventConfig,
@@ -140,7 +142,7 @@ const _sfc_main = /* @__PURE__ */ Object.assign({
140
142
  () => props.templateKey,
141
143
  (key) => {
142
144
  if (key) {
143
- loadConfig();
145
+ loadConfig("dynamic");
144
146
  }
145
147
  }
146
148
  );
@@ -148,14 +150,16 @@ const _sfc_main = /* @__PURE__ */ Object.assign({
148
150
  () => props.modelValue,
149
151
  (newVal, oldVal) => {
150
152
  if (JSON.stringify(newVal) !== JSON.stringify(oldVal)) {
151
- loadFormData(true);
153
+ loadFormData("change");
152
154
  }
153
155
  }
154
156
  );
155
- const loadConfig = async () => {
157
+ const loadConfig = async (state) => {
156
158
  if (!props.templateKey && (!props.initOption || Object.keys(props.initOption).length == 0)) {
157
159
  return;
158
160
  }
161
+ prevFormData.value = {};
162
+ linkaged = false;
159
163
  configLoading.value = true;
160
164
  try {
161
165
  let option = await getJsonAsyncUtil.default(
@@ -178,7 +182,7 @@ const _sfc_main = /* @__PURE__ */ Object.assign({
178
182
  return item.component;
179
183
  });
180
184
  hiddenFields.value = option.hiddenFields || [];
181
- loadFormData();
185
+ loadFormData(state);
182
186
  loadEventFlow();
183
187
  if (pageEvents && localConfig.value.pageEventConfig) {
184
188
  const onCreatedEvent = localConfig.value.pageEventConfig.find(
@@ -209,7 +213,7 @@ const _sfc_main = /* @__PURE__ */ Object.assign({
209
213
  function layoutUpdated(layoutData) {
210
214
  emit("layoutUpdated", layoutData);
211
215
  }
212
- const loadFormData = (flag) => {
216
+ const loadFormData = (state) => {
213
217
  var _a;
214
218
  const defaultData = {};
215
219
  const rules = {};
@@ -222,7 +226,7 @@ const _sfc_main = /* @__PURE__ */ Object.assign({
222
226
  }
223
227
  defaultData[component.fieldName] = defaultValue;
224
228
  }
225
- if (!flag) {
229
+ if (state != "change") {
226
230
  if (component.fieldName) {
227
231
  const fieldRules = validation.generateFieldRules(component, formData, [
228
232
  ...fieldsData.value,
@@ -243,15 +247,22 @@ const _sfc_main = /* @__PURE__ */ Object.assign({
243
247
  ...fieldsData.value,
244
248
  ...hiddenFields.value
245
249
  ]);
246
- defaultData[field.fieldName] = value !== void 0 ? value : null;
247
- } else {
248
- defaultData[field.fieldName] = field.value !== void 0 ? field.value : null;
250
+ if (value) {
251
+ defaultData[field.fieldName] = value;
252
+ }
253
+ } else if (field.value) {
254
+ defaultData[field.fieldName] = field.value;
249
255
  }
250
256
  }
251
257
  });
252
258
  }
253
- formData.value = { ...defaultData, ...setFormData(props.modelValue, true) };
254
- if (!flag) {
259
+ if (state == "dynamic") {
260
+ debugger;
261
+ formData.value = { ...setFormData(props.modelValue, true), ...defaultData };
262
+ } else {
263
+ formData.value = { ...defaultData, ...setFormData(props.modelValue, true) };
264
+ }
265
+ if (state != "change") {
255
266
  formRules.value = rules;
256
267
  }
257
268
  };
@@ -765,7 +776,6 @@ const _sfc_main = /* @__PURE__ */ Object.assign({
765
776
  Vue.onBeforeUnmount(() => {
766
777
  formItemRefs.value.clear();
767
778
  });
768
- const prevFormData = Vue.ref({});
769
779
  const findChangedFields = (newData, oldData) => {
770
780
  const changedFields = [];
771
781
  const allKeys = /* @__PURE__ */ new Set([
@@ -951,7 +961,6 @@ const _sfc_main = /* @__PURE__ */ Object.assign({
951
961
  gridLayoutFieldsData.value = updatedLayoutData.filter((item) => !item.hidden);
952
962
  (_a = gridLayout == null ? void 0 : gridLayout.value) == null ? void 0 : _a.resizeEvent();
953
963
  };
954
- let linkaged = false;
955
964
  function initLinkage() {
956
965
  const changedFields = findChangedFields(formData.value, prevFormData.value);
957
966
  console.log("🚀 ~ initLinkage ~ changedFields:", changedFields);
@@ -1005,6 +1014,7 @@ const _sfc_main = /* @__PURE__ */ Object.assign({
1005
1014
  Vue.provide("setFormItemHeight", setFormItemHeight);
1006
1015
  Vue.provide("formCtx", ctx);
1007
1016
  Vue.provide("handleEvent", handleEvent);
1017
+ Vue.provide("getFormData", getFormData);
1008
1018
  __expose({
1009
1019
  validate,
1010
1020
  resetFields,
@@ -1105,5 +1115,5 @@ const _sfc_main = /* @__PURE__ */ Object.assign({
1105
1115
  };
1106
1116
  }
1107
1117
  });
1108
- const _Form = /* @__PURE__ */ _pluginVue_exportHelper.default(_sfc_main, [["__scopeId", "data-v-71dda23e"]]);
1118
+ const _Form = /* @__PURE__ */ _pluginVue_exportHelper.default(_sfc_main, [["__scopeId", "data-v-95d9b970"]]);
1109
1119
  exports.default = _Form;
@@ -207,5 +207,5 @@ const _sfc_main = /* @__PURE__ */ Object.assign({
207
207
  };
208
208
  }
209
209
  });
210
- const _FormItem = /* @__PURE__ */ _pluginVue_exportHelper.default(_sfc_main, [["__scopeId", "data-v-2860c795"]]);
210
+ const _FormItem = /* @__PURE__ */ _pluginVue_exportHelper.default(_sfc_main, [["__scopeId", "data-v-44a32b0c"]]);
211
211
  exports.default = _FormItem;
@@ -50,6 +50,7 @@ const _sfc_main = /* @__PURE__ */ Object.assign({
50
50
  setup(__props, { expose: __expose }) {
51
51
  const props = __props;
52
52
  const formData = Vue.inject("formData");
53
+ Vue.inject("getFormData");
53
54
  Vue.inject("rowHeight");
54
55
  Vue.inject("gridLayout");
55
56
  const setFormItemHeight = Vue.inject("setFormItemHeight");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fecp/designer",
3
- "version": "5.5.40",
3
+ "version": "5.5.43",
4
4
  "main": "lib/designer/index.js",
5
5
  "module": "es/designer/index.mjs",
6
6
  "files": [