@fecp/designer 5.5.120 → 5.5.121

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 (115) hide show
  1. package/es/designer/package.json.mjs +1 -1
  2. package/es/designer/src/packages/dataSource/index.vue.mjs +3 -3
  3. package/es/designer/src/packages/dialog/index.vue2.mjs +15 -15
  4. package/es/designer/src/packages/dialog/useDialogDialog.mjs +1 -1
  5. package/es/designer/src/packages/dialogGlobal/index.vue2.mjs +15 -16
  6. package/es/designer/src/packages/dialogGlobal/useDialogGlobalDialog.mjs +1 -1
  7. package/es/designer/src/packages/event/pageEvent.vue.mjs +1 -1
  8. package/es/designer/src/packages/form/index.vue.mjs +2 -2
  9. package/es/designer/src/packages/form/property/widgets.vue.mjs +2 -2
  10. package/es/designer.css +505 -415
  11. package/es/packages/mobile/index.mjs +2 -0
  12. package/es/packages/mobile/src/api/index.mjs +1 -1
  13. package/es/packages/mobile/src/assets/images/baseRate.png.mjs +1 -1
  14. package/es/packages/mobile/src/assets/images/home-bg.png.mjs +1 -1
  15. package/es/packages/mobile/src/assets/images/rentCalc.png.mjs +1 -1
  16. package/es/packages/mobile/src/assets/images/user.png.mjs +4 -0
  17. package/es/packages/mobile/src/components/all.mjs +2 -0
  18. package/es/packages/mobile/src/components/base/card/Card.vue.mjs +2 -2
  19. package/es/packages/mobile/src/components/custom/appDetail/AppDetail.vue.mjs +62 -44
  20. package/es/packages/mobile/src/components/custom/appTimeLine/AppTimeLine.vue.mjs +2 -2
  21. package/es/packages/mobile/src/components/custom/approvalBar/ApprovalBar.vue.mjs +128 -67
  22. package/es/packages/mobile/src/components/custom/approvalList/ApprovalList.vue.mjs +5 -5
  23. package/es/packages/mobile/src/components/custom/customCode/CustomCode.vue.mjs +60 -0
  24. package/es/packages/mobile/src/components/custom/customCode/index.mjs +10 -0
  25. package/es/packages/mobile/src/components/custom/document/Document.vue.mjs +2 -2
  26. package/es/packages/mobile/src/components/custom/userSelect/UserSelect.vue.mjs +2 -2
  27. package/es/packages/mobile/src/components/dataDisplay/cardList/CardList.vue.mjs +187 -7
  28. package/es/packages/mobile/src/components/dataDisplay/dataStat/DataStat.vue.mjs +2 -2
  29. package/es/packages/mobile/src/components/dataDisplay/mine/Mine.vue.mjs +33 -9
  30. package/es/packages/mobile/src/components/dataDisplay/rentCalcResult/RentCalcResult.vue.mjs +39 -79
  31. package/es/packages/mobile/src/components/feedback/quickFilter/QuickFilter.vue.mjs +10 -2
  32. package/es/packages/mobile/src/components/form/field/Field.vue.mjs +167 -32
  33. package/es/packages/mobile/src/components/form/fieldArea/FieldArea.vue.mjs +3 -2
  34. package/es/packages/mobile/src/components/form/fieldCalendarPicker/FieldCalendarPicker.vue.mjs +13 -15
  35. package/es/packages/mobile/src/components/form/fieldCascaderPicker/fieldCascaderPicker.vue.mjs +10 -10
  36. package/es/packages/mobile/src/components/form/fieldCheckbox/FieldCheckbox.vue.mjs +7 -23
  37. package/es/packages/mobile/src/components/form/fieldDatePicker/FieldDatePicker.vue.mjs +14 -26
  38. package/es/packages/mobile/src/components/form/fieldDateTimePicker/FieldDateTimePicker.vue.mjs +14 -15
  39. package/es/packages/mobile/src/components/form/fieldIndustry/FieldIndustry.vue.mjs +6 -19
  40. package/es/packages/mobile/src/components/form/fieldPicker/FieldPicker.vue.mjs +9 -25
  41. package/es/packages/mobile/src/components/form/fieldRadio/FieldRadio.vue.mjs +8 -24
  42. package/es/packages/mobile/src/components/form/search/Search.vue.mjs +15 -6
  43. package/es/packages/mobile/src/components/form/uploader/Uploader.vue.mjs +2 -2
  44. package/es/packages/mobile/src/components/navigation/tabbar/Tabbar.vue.mjs +9 -5
  45. package/es/packages/mobile/src/components/navigation/tabs/Tabs.vue.mjs +58 -25
  46. package/es/packages/mobile/src/index.vue.mjs +21 -4
  47. package/es/packages/mobile/src/page.vue.mjs +342 -138
  48. package/es/packages/mobile/src/utils/common.mjs +21 -0
  49. package/es/packages/mobile/src/utils/datasource.mjs +3 -3
  50. package/es/packages/mobile/src/utils/eventFlow/actionHandlers.mjs +35 -22
  51. package/es/packages/mobile/src/utils/formatterUtil.mjs +4 -24
  52. package/es/packages/mobile/src/utils/formulajs/calculate.mjs +11 -5
  53. package/es/packages/mobile/src/utils/optionUtil.mjs +3 -28
  54. package/es/packages/mobile/src/utils/pageHistory.mjs +16 -0
  55. package/es/packages/mobile/src/utils/validation.mjs +129 -0
  56. package/es/packages/vue/src/components/forms/number/Number.vue.mjs +3 -2
  57. package/es/packages/vue/src/components/table/TableColumn.vue.mjs +12 -8
  58. package/lib/designer/package.json.js +1 -1
  59. package/lib/designer/src/packages/dataSource/index.vue.js +3 -3
  60. package/lib/designer/src/packages/dialog/index.vue2.js +15 -15
  61. package/lib/designer/src/packages/dialog/useDialogDialog.js +1 -1
  62. package/lib/designer/src/packages/dialogGlobal/index.vue2.js +15 -16
  63. package/lib/designer/src/packages/dialogGlobal/useDialogGlobalDialog.js +1 -1
  64. package/lib/designer/src/packages/event/pageEvent.vue.js +1 -1
  65. package/lib/designer/src/packages/form/index.vue.js +2 -2
  66. package/lib/designer/src/packages/form/property/widgets.vue.js +2 -2
  67. package/lib/designer.css +505 -415
  68. package/lib/packages/mobile/index.js +4 -2
  69. package/lib/packages/mobile/src/api/index.js +1 -1
  70. package/lib/packages/mobile/src/assets/images/baseRate.png.js +1 -1
  71. package/lib/packages/mobile/src/assets/images/home-bg.png.js +1 -1
  72. package/lib/packages/mobile/src/assets/images/rentCalc.png.js +1 -1
  73. package/lib/packages/mobile/src/assets/images/user.png.js +4 -0
  74. package/lib/packages/mobile/src/components/all.js +2 -0
  75. package/lib/packages/mobile/src/components/base/card/Card.vue.js +2 -2
  76. package/lib/packages/mobile/src/components/custom/appDetail/AppDetail.vue.js +61 -43
  77. package/lib/packages/mobile/src/components/custom/appTimeLine/AppTimeLine.vue.js +2 -2
  78. package/lib/packages/mobile/src/components/custom/approvalBar/ApprovalBar.vue.js +131 -70
  79. package/lib/packages/mobile/src/components/custom/approvalList/ApprovalList.vue.js +5 -5
  80. package/lib/packages/mobile/src/components/custom/customCode/CustomCode.vue.js +60 -0
  81. package/lib/packages/mobile/src/components/custom/customCode/index.js +10 -0
  82. package/lib/packages/mobile/src/components/custom/document/Document.vue.js +2 -2
  83. package/lib/packages/mobile/src/components/custom/userSelect/UserSelect.vue.js +2 -2
  84. package/lib/packages/mobile/src/components/dataDisplay/cardList/CardList.vue.js +187 -7
  85. package/lib/packages/mobile/src/components/dataDisplay/dataStat/DataStat.vue.js +2 -2
  86. package/lib/packages/mobile/src/components/dataDisplay/mine/Mine.vue.js +38 -14
  87. package/lib/packages/mobile/src/components/dataDisplay/rentCalcResult/RentCalcResult.vue.js +39 -79
  88. package/lib/packages/mobile/src/components/feedback/quickFilter/QuickFilter.vue.js +10 -2
  89. package/lib/packages/mobile/src/components/form/field/Field.vue.js +165 -30
  90. package/lib/packages/mobile/src/components/form/fieldArea/FieldArea.vue.js +3 -2
  91. package/lib/packages/mobile/src/components/form/fieldCalendarPicker/FieldCalendarPicker.vue.js +13 -15
  92. package/lib/packages/mobile/src/components/form/fieldCascaderPicker/fieldCascaderPicker.vue.js +9 -9
  93. package/lib/packages/mobile/src/components/form/fieldCheckbox/FieldCheckbox.vue.js +6 -22
  94. package/lib/packages/mobile/src/components/form/fieldDatePicker/FieldDatePicker.vue.js +13 -25
  95. package/lib/packages/mobile/src/components/form/fieldDateTimePicker/FieldDateTimePicker.vue.js +13 -14
  96. package/lib/packages/mobile/src/components/form/fieldIndustry/FieldIndustry.vue.js +6 -19
  97. package/lib/packages/mobile/src/components/form/fieldPicker/FieldPicker.vue.js +8 -24
  98. package/lib/packages/mobile/src/components/form/fieldRadio/FieldRadio.vue.js +7 -23
  99. package/lib/packages/mobile/src/components/form/search/Search.vue.js +15 -6
  100. package/lib/packages/mobile/src/components/form/uploader/Uploader.vue.js +2 -2
  101. package/lib/packages/mobile/src/components/navigation/tabbar/Tabbar.vue.js +9 -5
  102. package/lib/packages/mobile/src/components/navigation/tabs/Tabs.vue.js +61 -28
  103. package/lib/packages/mobile/src/index.vue.js +20 -3
  104. package/lib/packages/mobile/src/page.vue.js +341 -137
  105. package/lib/packages/mobile/src/utils/common.js +21 -0
  106. package/lib/packages/mobile/src/utils/datasource.js +3 -3
  107. package/lib/packages/mobile/src/utils/eventFlow/actionHandlers.js +35 -22
  108. package/lib/packages/mobile/src/utils/formatterUtil.js +3 -23
  109. package/lib/packages/mobile/src/utils/formulajs/calculate.js +11 -5
  110. package/lib/packages/mobile/src/utils/optionUtil.js +2 -27
  111. package/lib/packages/mobile/src/utils/pageHistory.js +16 -0
  112. package/lib/packages/mobile/src/utils/validation.js +129 -0
  113. package/lib/packages/vue/src/components/forms/number/Number.vue.js +3 -2
  114. package/lib/packages/vue/src/components/table/TableColumn.vue.js +12 -8
  115. package/package.json +1 -1
@@ -1,19 +1,18 @@
1
1
  "use strict";
2
2
  Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
3
+ ;/* empty css */
3
4
  const Vue = require("vue");
4
5
  const homeBg = require("./assets/images/home-bg.png.js");
5
6
  require("../../../node_modules/grid-layout-plus/es/index.js");
6
7
  const all = require("./components/all.js");
7
8
  const pageHistory = require("./utils/pageHistory.js");
8
9
  const usePageEvents = require("./composables/usePageEvents.js");
9
- const moment = require("../../../node_modules/moment/dist/moment.js");
10
+ require("../../../node_modules/moment/dist/moment.js");
11
+ const datasource = require("./utils/datasource.js");
10
12
  const parseRouteParams = require("./utils/parseRouteParams.js");
11
- ;/* empty css */
12
- ;/* empty css */
13
- ;/* empty css */
14
- ;/* empty css */
15
13
  const common = require("./utils/common.js");
16
14
  require("./utils/eventBus.js");
15
+ ;/* empty css */
17
16
  ;/* empty css */
18
17
  ;/* empty css */
19
18
  ;/* empty css */
@@ -21,11 +20,13 @@ require("./utils/eventBus.js");
21
20
  const eventFlowHandler = require("./utils/eventFlow/eventFlowHandler.js");
22
21
  const parseFilterConfig = require("./utils/parseFilterConfig.js");
23
22
  const calculate = require("./utils/formulajs/calculate.js");
23
+ const validation = require("./utils/validation.js");
24
24
  ;/* empty css */
25
25
  const _pluginVue_exportHelper = require("../../../_virtual/_plugin-vue_export-helper.js");
26
26
  const gridLayout_vue = require("../../../node_modules/grid-layout-plus/es/components/grid-layout.vue.js");
27
- const _hoisted_1 = { class: "grid-wrapper no-scrollbar" };
28
- const _hoisted_2 = { class: "component-content" };
27
+ const index = require("../../../node_modules/vant/es/form/index.js");
28
+ const functionCall = require("../../../node_modules/vant/es/toast/function-call.js");
29
+ const _hoisted_1 = { class: "component-content" };
29
30
  const colNum = 24;
30
31
  const rowHeight = 10;
31
32
  const _sfc_main = {
@@ -41,18 +42,26 @@ const _sfc_main = {
41
42
  params: {
42
43
  type: Object,
43
44
  default: {}
45
+ },
46
+ initSearchData: {
47
+ type: Object,
48
+ default: {}
44
49
  }
45
50
  },
46
- setup(__props, { expose: __expose }) {
51
+ emits: ["layoutDataHeight"],
52
+ setup(__props, { expose: __expose, emit: __emit }) {
47
53
  var _a;
48
54
  const props = __props;
55
+ const emit = __emit;
49
56
  const configLoading = Vue.ref(true);
50
57
  const instance = Vue.getCurrentInstance();
51
58
  const ctx = instance.proxy;
52
59
  const formData = Vue.ref(props.params);
60
+ const formRules = Vue.ref({});
53
61
  function getComp(type) {
54
62
  return all[type];
55
63
  }
64
+ const formRef = Vue.ref();
56
65
  const gridLayout = Vue.ref();
57
66
  const tabbarActive = Vue.ref(0);
58
67
  const childPage = Vue.ref(null);
@@ -96,7 +105,18 @@ const _sfc_main = {
96
105
  })) || [];
97
106
  }
98
107
  const loadFormData = (state) => {
108
+ var _a2;
99
109
  const defaultData = { ...props.params };
110
+ if (fieldsData.value) {
111
+ (_a2 = fieldsData.value) == null ? void 0 : _a2.forEach((component) => {
112
+ if (component.fieldName) {
113
+ let defaultValue = component.defaultValue || null;
114
+ if (defaultValue) {
115
+ defaultData[component.fieldName] = defaultValue;
116
+ }
117
+ }
118
+ });
119
+ }
100
120
  if (hiddenFields.value && hiddenFields.value.length > 0) {
101
121
  hiddenFields.value.forEach((field) => {
102
122
  if (field.fieldName) {
@@ -118,44 +138,197 @@ const _sfc_main = {
118
138
  formData.value = { ...defaultData };
119
139
  console.log("初始化赋值", formData.value);
120
140
  };
141
+ const initFormRule = () => {
142
+ var _a2;
143
+ const rules = {};
144
+ if (fieldsData.value) {
145
+ (_a2 = fieldsData.value) == null ? void 0 : _a2.forEach((component) => {
146
+ if (component.fieldName) {
147
+ const fieldRules = validation.generateFieldRules(component, formData, [
148
+ ...fieldsData.value,
149
+ ...hiddenFields.value
150
+ ]);
151
+ if (fieldRules.length > 0) {
152
+ rules[component.fieldName] = fieldRules;
153
+ }
154
+ }
155
+ });
156
+ }
157
+ formRules.value = rules;
158
+ };
121
159
  const prevFormData = Vue.ref({});
122
160
  let linkaged = false;
161
+ let isDesigner = false;
162
+ const dataSourceOptions = Vue.ref({});
163
+ const dictionaryOptions = Vue.ref({});
123
164
  Vue.onMounted(async () => {
165
+ var _a2, _b;
124
166
  prevFormData.value = {};
125
167
  linkaged = false;
126
168
  loadFormData();
127
- const pageEvents = usePageEvents.usePageEvents(() => ({
128
- pageEventConfig: props.parentPage.pageEventConfig,
129
- fields: [...fieldsData.value, ...hiddenFields.value],
130
- instance,
131
- formData: formData.value,
132
- localConfig: props.parentPage,
133
- components: {
134
- form: ctx
169
+ try {
170
+ const uid = (_b = (_a2 = formRef.value) == null ? void 0 : _a2.$el) == null ? void 0 : _b.closest(".device-content");
171
+ if (uid) {
172
+ isDesigner = true;
135
173
  }
136
- }));
137
- if (pageEvents) {
138
- pageEvents.handleBeforeUnmount();
139
- pageEvents.handleUnmounted();
140
- if (props.parentPage.pageEventConfig) {
141
- const onCreatedEvent = props.parentPage.pageEventConfig.find(
142
- (e) => e.name === "onCreated"
143
- );
144
- if (onCreatedEvent) {
145
- console.log("🚀 页面 onCreated 事件触发");
146
- try {
147
- await pageEvents.executeEvent("onCreated");
148
- } catch (error) {
174
+ } catch (error) {
175
+ }
176
+ if (!isDesigner) {
177
+ const pageEvents = usePageEvents.usePageEvents(() => ({
178
+ pageEventConfig: props.parentPage.pageEventConfig,
179
+ fields: [...fieldsData.value, ...hiddenFields.value],
180
+ instance,
181
+ formData: formData.value,
182
+ localConfig: props.parentPage,
183
+ components: {
184
+ form: ctx
185
+ }
186
+ }));
187
+ if (pageEvents) {
188
+ pageEvents.handleBeforeUnmount();
189
+ pageEvents.handleUnmounted();
190
+ if (props.parentPage.pageEventConfig) {
191
+ const onCreatedEvent = props.parentPage.pageEventConfig.find(
192
+ (e) => e.name === "onCreated"
193
+ );
194
+ if (onCreatedEvent) {
195
+ console.log("🚀 页面 onCreated 事件触发");
196
+ try {
197
+ await pageEvents.executeEvent("onCreated");
198
+ } catch (error) {
199
+ }
149
200
  }
150
201
  }
151
202
  }
152
203
  }
153
204
  loadEventFlow();
205
+ await initParmDic();
206
+ mergeOptionsToFields();
154
207
  initGridLayoutDataConfig();
208
+ initFormRule();
155
209
  initLinkage();
156
210
  configLoading.value = false;
157
211
  });
212
+ const initParmDic = async () => {
213
+ var _a2, _b;
214
+ const fields = fieldsData.value || [];
215
+ const fieldDataSources = /* @__PURE__ */ new Set();
216
+ const dictionaryKeys = /* @__PURE__ */ new Set();
217
+ for (const component of fields) {
218
+ const fieldType = component.fieldType;
219
+ if ((fieldType === "picker" || fieldType === "radio" || fieldType === "checkbox" || fieldType === "cascader") && component.optionConfig) {
220
+ const { optionSource, dataSourceValue, dictionaryValue } = component.optionConfig;
221
+ if (optionSource === "dataSource" && dataSourceValue) {
222
+ fieldDataSources.add(dataSourceValue);
223
+ } else if (optionSource === "dictionary" && dictionaryValue) {
224
+ dictionaryKeys.add(dictionaryValue);
225
+ }
226
+ }
227
+ }
228
+ for (const dataSourceId of fieldDataSources) {
229
+ if (dataSourceOptions.value[dataSourceId]) continue;
230
+ try {
231
+ const dsManager = datasource.createDataSource({
232
+ http: ctx.$http,
233
+ dataSources: currentPage.value.dataSources,
234
+ currentDataSourceId: dataSourceId,
235
+ pagination: false,
236
+ data: formData.value,
237
+ fields: [...fieldsData.value, ...hiddenFields.value]
238
+ });
239
+ const data = await dsManager.fetch();
240
+ let options = [];
241
+ if (Array.isArray(data)) {
242
+ options = data;
243
+ } else if (typeof data === "object") {
244
+ options = Array.isArray(data.data) ? data.data : ((_a2 = data.data) == null ? void 0 : _a2.records) || ((_b = data.data) == null ? void 0 : _b.list) || [];
245
+ }
246
+ dataSourceOptions.value[dataSourceId] = options;
247
+ dsManager.destroy();
248
+ } catch (error) {
249
+ console.error(`Failed to load data source ${dataSourceId}:`, error);
250
+ }
251
+ }
252
+ if (dictionaryKeys.size > 0) {
253
+ try {
254
+ const keyName = Array.from(dictionaryKeys).join(",");
255
+ const response = await ctx.$http.postFormMobile(
256
+ "/base-server/parm/sysParmDic/getDicListByKey",
257
+ {
258
+ keyName
259
+ },
260
+ true
261
+ );
262
+ const dictionaryData = response;
263
+ if (typeof dictionaryData === "object") {
264
+ Object.keys(dictionaryData).forEach((dictKey) => {
265
+ if (dictionaryKeys.has(dictKey)) {
266
+ const dictItems = dictionaryData[dictKey];
267
+ if (Array.isArray(dictItems)) {
268
+ dictionaryOptions.value[dictKey] = dictItems;
269
+ }
270
+ }
271
+ });
272
+ }
273
+ } catch (error) {
274
+ console.error("Failed to load dictionary data:", error);
275
+ }
276
+ }
277
+ };
278
+ const mergeOptionsToFields = () => {
279
+ if (fieldsData.value) {
280
+ fieldsData.value.forEach((component) => {
281
+ if (!component.optionConfig) return;
282
+ const {
283
+ optionSource,
284
+ dataSourceValue,
285
+ dictionaryValue,
286
+ displayField,
287
+ valueField,
288
+ idField,
289
+ pidField
290
+ } = component.optionConfig;
291
+ if (optionSource === "dataSource" && dataSourceOptions.value[dataSourceValue]) {
292
+ const rawOptions = dataSourceOptions.value[dataSourceValue];
293
+ const labelField = displayField || "label";
294
+ const keyField = valueField || "value";
295
+ component.optionConfig.options = rawOptions.map((item) => ({
296
+ label: item[labelField],
297
+ value: item[keyField],
298
+ disabled: item.disabled || false,
299
+ ...item
300
+ }));
301
+ } else if (optionSource === "dictionary" && dictionaryOptions.value[dictionaryValue]) {
302
+ const rawOptions = dictionaryOptions.value[dictionaryValue];
303
+ const labelField = "optName";
304
+ const keyField = "optCode";
305
+ component.optionConfig.options = rawOptions.map((item) => ({
306
+ label: item[labelField],
307
+ value: item[keyField],
308
+ disabled: item.disabled || false
309
+ }));
310
+ } else if (optionSource === "custom") {
311
+ component.optionConfig.options = component.optionConfig.options || [];
312
+ }
313
+ });
314
+ }
315
+ };
158
316
  const gridLayoutFieldsData = Vue.ref([]);
317
+ const gridWrapperHeight = Vue.ref(null);
318
+ Vue.watch(
319
+ () => gridLayoutFieldsData,
320
+ (val) => {
321
+ if (Array.isArray(val.value)) {
322
+ const maxY = val.value.reduce(
323
+ (max, item) => Math.max(max, item.y + item.h),
324
+ 0
325
+ );
326
+ gridWrapperHeight.value = maxY * rowHeight;
327
+ emit("layoutDataHeight", gridWrapperHeight.value);
328
+ }
329
+ },
330
+ { immediate: true, deep: true }
331
+ );
159
332
  const oriGridLayoutData = Vue.ref([]);
160
333
  function initGridLayoutDataConfig() {
161
334
  if (!Array.isArray(props.parentPage.layoutData)) {
@@ -171,7 +344,7 @@ const _sfc_main = {
171
344
  }
172
345
  return item;
173
346
  }) || [];
174
- oriGridLayoutData.value = gridLayoutData;
347
+ oriGridLayoutData.value = sortLayoutItems(gridLayoutData);
175
348
  }
176
349
  function initLinkage() {
177
350
  if (!Array.isArray(props.parentPage.layoutData)) {
@@ -261,6 +434,16 @@ const _sfc_main = {
261
434
  });
262
435
  }
263
436
  });
437
+ const rules = {};
438
+ updatedLayoutData.forEach(({ component }) => {
439
+ if (component.props.fieldName) {
440
+ const fieldRules = validation.generateFieldRules(component.props, formData, fields);
441
+ if (fieldRules.length > 0) {
442
+ rules[component.props.fieldName] = fieldRules;
443
+ }
444
+ }
445
+ });
446
+ formRules.value = rules;
264
447
  relevantConfigs.disabled.forEach((item) => {
265
448
  const dataLinkFieldList = item.dataLinkFieldList || [];
266
449
  dataLinkFieldList.forEach((fieldId) => {
@@ -396,20 +579,6 @@ const _sfc_main = {
396
579
  });
397
580
  handleEvent.value = createHandleEvent;
398
581
  }
399
- const valueFormatMap = {
400
- date: "YYYYMMDD",
401
- week: "YYYYMMDD",
402
- month: "YYYYMM",
403
- year: "YYYY",
404
- datetime: "YYYYMMDDHHmmss"
405
- };
406
- const formValueFormatMap = {
407
- date: "YYYY/MM/DD",
408
- week: "YYYY/MM/DD",
409
- month: "YYYY/MM",
410
- year: "YYYY",
411
- datetime: "YYYY/MM/DD HH:mm:ss"
412
- };
413
582
  const getFormData = () => {
414
583
  const result = { ...formData.value };
415
584
  const processField = (field) => {
@@ -424,27 +593,6 @@ const _sfc_main = {
424
593
  if (Array.isArray(value)) {
425
594
  result[fieldName] = value.join(splitStr);
426
595
  }
427
- } else if (fieldName && fieldType === "date" && value) {
428
- const dateValueType = field.dateValueType;
429
- const valueFormat = valueFormatMap[field.dateType] || "YYYYMMDD";
430
- const formValueFormat = formValueFormatMap[field.dateType] || "YYYY/MM/DD";
431
- switch (dateValueType) {
432
- case "date":
433
- result[fieldName] = moment.default(value, formValueFormat).toDate();
434
- break;
435
- case "timestamp":
436
- result[fieldName] = moment.default(value, formValueFormat).valueOf();
437
- break;
438
- case "string":
439
- default:
440
- result[fieldName] = moment.default(value, formValueFormat).format(
441
- valueFormat
442
- );
443
- break;
444
- }
445
- }
446
- if (fieldType != "number" && !result[fieldName]) {
447
- result[fieldName] = "";
448
596
  }
449
597
  };
450
598
  if (fieldsData.value) {
@@ -459,6 +607,26 @@ const _sfc_main = {
459
607
  }
460
608
  return result;
461
609
  };
610
+ const validate = () => {
611
+ var _a2;
612
+ return (_a2 = formRef.value) == null ? void 0 : _a2.validate().then(() => getFormData()).catch((errors) => {
613
+ Vue.nextTick(() => {
614
+ const firstError = document.querySelector(".van-field__error-message");
615
+ if (firstError) {
616
+ functionCall.showToast({
617
+ message: firstError.innerHTML,
618
+ icon: "warning-o",
619
+ duration: 2e3
620
+ });
621
+ firstError.scrollIntoView({
622
+ behavior: "smooth",
623
+ block: "center"
624
+ });
625
+ }
626
+ });
627
+ throw errors;
628
+ });
629
+ };
462
630
  const setFormData = (data) => {
463
631
  const processedData = { ...data };
464
632
  const processField = (field) => {
@@ -468,11 +636,8 @@ const _sfc_main = {
468
636
  return;
469
637
  }
470
638
  const value = processedData[fieldName];
471
- if (fieldName && (fieldType === "checkbox" || fieldType === "multipleSelection" || fieldType === "cascader" || fieldType === "area" || fieldType === "industry")) {
639
+ if (fieldName && (fieldType === "checkbox" || fieldType === "multipleSelection" || fieldType === "cascader")) {
472
640
  let splitStr = "|";
473
- if (fieldType === "cascader" || fieldType === "area" || fieldType === "industry") {
474
- splitStr = ",";
475
- }
476
641
  if (typeof value === "string" && value.includes(splitStr)) {
477
642
  processedData[fieldName] = value.split(splitStr);
478
643
  } else if (typeof value === "string" && value !== "") {
@@ -486,12 +651,6 @@ const _sfc_main = {
486
651
  }
487
652
  return item;
488
653
  });
489
- } else if (fieldName && fieldType === "date" && value) {
490
- const valueFormat = valueFormatMap[field.dateType] || "YYYYMMDD";
491
- const formValueFormat = formValueFormatMap[field.dateType] || "YYYY/MM/DD";
492
- processedData[fieldName] = moment.default(value, valueFormat).format(
493
- formValueFormat
494
- );
495
654
  }
496
655
  };
497
656
  if (fieldsData.value) {
@@ -506,11 +665,40 @@ const _sfc_main = {
506
665
  }
507
666
  formData.value = { ...formData.value, ...processedData };
508
667
  };
668
+ const compRefs = {};
669
+ const setCompRef = (id, el) => {
670
+ if (el) compRefs[id] = el;
671
+ };
672
+ function onSearch(filter) {
673
+ Object.values(compRefs).forEach((comp) => {
674
+ if (comp == null ? void 0 : comp.onSearch) {
675
+ comp.onSearch(filter);
676
+ }
677
+ });
678
+ }
679
+ Vue.watch(
680
+ () => props.initSearchData,
681
+ () => {
682
+ onSearch(props.initSearchData);
683
+ }
684
+ );
685
+ function refreshGridLayoutItemHeight(compId, height) {
686
+ var _a2;
687
+ gridLayoutFieldsData.value.forEach((item) => {
688
+ const id = item.component.id;
689
+ if (compId == id) {
690
+ item.h = height / 10;
691
+ }
692
+ });
693
+ (_a2 = gridLayout == null ? void 0 : gridLayout.value) == null ? void 0 : _a2.resizeEvent();
694
+ }
509
695
  Vue.provide("handleEvent", handleEvent);
510
696
  Vue.provide("formData", formData);
697
+ Vue.provide("refreshGridLayoutItemHeight", refreshGridLayoutItemHeight);
511
698
  __expose({
512
699
  setFormData,
513
- getFormData
700
+ getFormData,
701
+ validate
514
702
  });
515
703
  return (_ctx, _cache) => {
516
704
  const _component_FecMobileNavBar = Vue.resolveComponent("FecMobileNavBar");
@@ -523,70 +711,86 @@ const _sfc_main = {
523
711
  const _component_FecMobileApprovalList = Vue.resolveComponent("FecMobileApprovalList");
524
712
  const _component_FecMobileRentCalcResult = Vue.resolveComponent("FecMobileRentCalcResult");
525
713
  const _component_FecMobileMine = Vue.resolveComponent("FecMobileMine");
714
+ const _component_van_form = index.Form;
526
715
  const _component_FecMobileTabbar = Vue.resolveComponent("FecMobileTabbar");
527
716
  const _component_FecMobileActionBar = Vue.resolveComponent("FecMobileActionBar");
528
717
  return Vue.openBlock(), Vue.createElementBlock(Vue.Fragment, null, [
529
718
  __props.parentPage.isNavBar ? (Vue.openBlock(), Vue.createBlock(_component_FecMobileNavBar, Vue.normalizeProps(Vue.mergeProps({ key: 0 }, __props.parentPage.navBarConfig)), null, 16)) : Vue.createCommentVNode("", true),
530
- Vue.createElementVNode("div", _hoisted_1, [
531
- __props.parentPage.footerType == "tabbar" ? (Vue.openBlock(), Vue.createElementBlock(Vue.Fragment, { key: 0 }, [
532
- Vue.unref(childPage) ? (Vue.openBlock(), Vue.createBlock(_component_page, {
533
- key: 0,
534
- parentPage: Vue.unref(childPage)
535
- }, null, 8, ["parentPage"])) : Vue.createCommentVNode("", true)
536
- ], 64)) : (Vue.openBlock(), Vue.createElementBlock(Vue.Fragment, { key: 1 }, [
537
- __props.parentPage.type == "home" ? (Vue.openBlock(), Vue.createElementBlock("div", {
538
- key: 0,
539
- class: "home-page",
540
- style: Vue.normalizeStyle({
541
- backgroundImage: `url(${Vue.unref(homeBg.default)})`,
542
- backgroundRepeat: "no-repeat",
543
- backgroundSize: "100%",
544
- backgroundPosition: "center -20px",
545
- backgroundColor: "#f7f8fa",
546
- height: "100%"
547
- })
548
- }, [
549
- Vue.createVNode(_component_FecMobileHomeHeader, Vue.normalizeProps(Vue.guardReactiveProps(__props.parentPage.layoutData.homeHeader)), null, 16),
550
- Vue.createVNode(_component_FecMobileMenuGrid, Vue.normalizeProps(Vue.guardReactiveProps(__props.parentPage.layoutData.menuGridProps)), null, 16),
551
- Vue.createVNode(_component_FecMobileHomeTools, Vue.normalizeProps(Vue.guardReactiveProps(__props.parentPage.layoutData.homeTools)), null, 16),
552
- Vue.createVNode(_component_FecMobileDataStat)
553
- ], 4)) : __props.parentPage.type == "approval" ? (Vue.openBlock(), Vue.createBlock(_component_FecMobileAppDetail, Vue.mergeProps({ key: 1 }, __props.parentPage.layoutData.appDetailProps, {
554
- actionBar: __props.parentPage.layoutData.actionBar,
555
- params: __props.params
556
- }), null, 16, ["actionBar", "params"])) : __props.parentPage.type == "flowList" ? (Vue.openBlock(), Vue.createBlock(_component_FecMobileApprovalList, Vue.normalizeProps(Vue.mergeProps({ key: 2 }, __props.parentPage.layoutData.approvalListProps)), null, 16)) : __props.parentPage.type == "rentCalcResult" ? (Vue.openBlock(), Vue.createBlock(_component_FecMobileRentCalcResult, {
557
- key: 3,
558
- params: __props.params
559
- }, null, 8, ["params"])) : __props.parentPage.type == "mine" ? (Vue.openBlock(), Vue.createBlock(_component_FecMobileMine, { key: 4 })) : (Vue.openBlock(), Vue.createBlock(Vue.unref(gridLayout_vue.default), {
560
- key: 5,
561
- ref_key: "gridLayout",
562
- ref: gridLayout,
563
- layout: Vue.unref(gridLayoutFieldsData),
564
- "onUpdate:layout": _cache[0] || (_cache[0] = ($event) => Vue.isRef(gridLayoutFieldsData) ? gridLayoutFieldsData.value = $event : null),
565
- "row-height": rowHeight,
566
- margin: [0, 0],
567
- "col-num": colNum,
568
- "use-css-transforms": false,
569
- "is-draggable": false,
570
- "is-resizable": false,
571
- style: { "height": "100%", "width": "100%" }
572
- }, {
573
- item: Vue.withCtx(({ item: { component } }) => [
574
- Vue.createElementVNode("div", _hoisted_2, [
575
- (Vue.openBlock(), Vue.createBlock(Vue.resolveDynamicComponent(getComp(component.fieldType)), Vue.mergeProps(component.props, {
576
- modelValue: Vue.unref(formData)[component.props.fieldName],
577
- "onUpdate:modelValue": ($event) => Vue.unref(formData)[component.props.fieldName] = $event,
578
- dataSources: Vue.unref(currentPage).dataSources,
579
- formData: Vue.unref(formData),
580
- compId: component.id,
581
- fields: [...Vue.unref(fieldsData), ...Vue.unref(hiddenFields)],
582
- params: __props.params
583
- }), null, 16, ["modelValue", "onUpdate:modelValue", "dataSources", "formData", "compId", "fields", "params"]))
584
- ])
585
- ]),
586
- _: 1
587
- }, 8, ["layout"]))
588
- ], 64))
589
- ]),
719
+ Vue.createVNode(_component_van_form, {
720
+ class: "grid-wrapper no-scrollbar",
721
+ ref_key: "formRef",
722
+ ref: formRef,
723
+ "scroll-to-error": "",
724
+ "submit-on-enter": false,
725
+ "show-error": "",
726
+ "scroll-to-error-position": "center"
727
+ }, {
728
+ default: Vue.withCtx(() => [
729
+ __props.parentPage.footerType == "tabbar" ? (Vue.openBlock(), Vue.createElementBlock(Vue.Fragment, { key: 0 }, [
730
+ Vue.unref(childPage) ? (Vue.openBlock(), Vue.createBlock(_component_page, {
731
+ key: 0,
732
+ parentPage: Vue.unref(childPage)
733
+ }, null, 8, ["parentPage"])) : Vue.createCommentVNode("", true)
734
+ ], 64)) : (Vue.openBlock(), Vue.createElementBlock(Vue.Fragment, { key: 1 }, [
735
+ __props.parentPage.type == "home" ? (Vue.openBlock(), Vue.createElementBlock("div", {
736
+ key: 0,
737
+ class: "home-page",
738
+ style: Vue.normalizeStyle({
739
+ backgroundImage: `url(${Vue.unref(homeBg.default)})`,
740
+ backgroundRepeat: "no-repeat",
741
+ backgroundSize: "100%",
742
+ backgroundPosition: "center -20px",
743
+ backgroundColor: "#f7f8fa",
744
+ height: "100%"
745
+ })
746
+ }, [
747
+ Vue.createVNode(_component_FecMobileHomeHeader, Vue.normalizeProps(Vue.guardReactiveProps(__props.parentPage.layoutData.homeHeader)), null, 16),
748
+ Vue.createVNode(_component_FecMobileMenuGrid, Vue.normalizeProps(Vue.guardReactiveProps(__props.parentPage.layoutData.menuGridProps)), null, 16),
749
+ Vue.createVNode(_component_FecMobileHomeTools, Vue.normalizeProps(Vue.guardReactiveProps(__props.parentPage.layoutData.homeTools)), null, 16),
750
+ Vue.createVNode(_component_FecMobileDataStat)
751
+ ], 4)) : __props.parentPage.type == "approval" ? (Vue.openBlock(), Vue.createBlock(_component_FecMobileAppDetail, Vue.mergeProps({ key: 1 }, __props.parentPage.layoutData.appDetailProps, {
752
+ actionBar: __props.parentPage.layoutData.actionBar,
753
+ params: __props.params
754
+ }), null, 16, ["actionBar", "params"])) : __props.parentPage.type == "flowList" ? (Vue.openBlock(), Vue.createBlock(_component_FecMobileApprovalList, Vue.normalizeProps(Vue.mergeProps({ key: 2 }, __props.parentPage.layoutData.approvalListProps)), null, 16)) : __props.parentPage.type == "rentCalcResult" ? (Vue.openBlock(), Vue.createBlock(_component_FecMobileRentCalcResult, {
755
+ key: 3,
756
+ params: __props.params
757
+ }, null, 8, ["params"])) : __props.parentPage.type == "mine" ? (Vue.openBlock(), Vue.createBlock(_component_FecMobileMine, { key: 4 })) : (Vue.openBlock(), Vue.createBlock(Vue.unref(gridLayout_vue.default), {
758
+ key: 5,
759
+ ref_key: "gridLayout",
760
+ ref: gridLayout,
761
+ layout: Vue.unref(gridLayoutFieldsData),
762
+ "onUpdate:layout": _cache[0] || (_cache[0] = ($event) => Vue.isRef(gridLayoutFieldsData) ? gridLayoutFieldsData.value = $event : null),
763
+ "row-height": rowHeight,
764
+ margin: [0, 0],
765
+ "col-num": colNum,
766
+ "use-css-transforms": false,
767
+ "is-draggable": false,
768
+ "is-resizable": false,
769
+ style: { "height": "100%", "width": "100%", "position": "relative" }
770
+ }, {
771
+ item: Vue.withCtx(({ item: { component } }) => [
772
+ Vue.createElementVNode("div", _hoisted_1, [
773
+ (Vue.openBlock(), Vue.createBlock(Vue.resolveDynamicComponent(getComp(component.fieldType)), Vue.mergeProps({
774
+ ref: (el) => setCompRef(component.id, el)
775
+ }, component.props, {
776
+ name: component.props.fieldName,
777
+ modelValue: Vue.unref(formData)[component.props.fieldName],
778
+ "onUpdate:modelValue": ($event) => Vue.unref(formData)[component.props.fieldName] = $event,
779
+ dataSources: Vue.unref(currentPage).dataSources,
780
+ formData: Vue.unref(formData),
781
+ compId: component.id,
782
+ fields: [...Vue.unref(fieldsData), ...Vue.unref(hiddenFields)],
783
+ params: __props.params,
784
+ rules: Vue.unref(formRules)[component.props.fieldName]
785
+ }), null, 16, ["name", "modelValue", "onUpdate:modelValue", "dataSources", "formData", "compId", "fields", "params", "rules"]))
786
+ ])
787
+ ]),
788
+ _: 1
789
+ }, 8, ["layout"]))
790
+ ], 64))
791
+ ]),
792
+ _: 1
793
+ }, 512),
590
794
  __props.parentPage.footerType == "tabbar" ? (Vue.openBlock(), Vue.createBlock(_component_FecMobileTabbar, Vue.mergeProps({
591
795
  key: 1,
592
796
  modelValue: Vue.unref(tabbarActive),
@@ -597,5 +801,5 @@ const _sfc_main = {
597
801
  };
598
802
  }
599
803
  };
600
- const MobilePage = /* @__PURE__ */ _pluginVue_exportHelper.default(_sfc_main, [["__scopeId", "data-v-ce6e3f7e"]]);
804
+ const MobilePage = /* @__PURE__ */ _pluginVue_exportHelper.default(_sfc_main, [["__scopeId", "data-v-aa11f142"]]);
601
805
  exports.default = MobilePage;
@@ -36,6 +36,26 @@ const findPageById = (pageList, pageId) => {
36
36
  if (item.children && item.children.length > 0) {
37
37
  const found = findPageById(item.children, pageId);
38
38
  if (found) {
39
+ if (item.type === "folder") {
40
+ return found;
41
+ }
42
+ return { ...found, parentPage: item };
43
+ }
44
+ }
45
+ }
46
+ return null;
47
+ };
48
+ const findPageByKey = (pageList, pageKey) => {
49
+ for (const item of pageList) {
50
+ if (item.path == pageKey) {
51
+ return item;
52
+ }
53
+ if (item.children && item.children.length > 0) {
54
+ const found = findPageByKey(item.children, pageKey);
55
+ if (found) {
56
+ if (item.type == "folder") {
57
+ return found;
58
+ }
39
59
  return { ...found, parentPage: item };
40
60
  }
41
61
  }
@@ -44,5 +64,6 @@ const findPageById = (pageList, pageId) => {
44
64
  };
45
65
  exports.cloneDeep = cloneDeep;
46
66
  exports.findPageById = findPageById;
67
+ exports.findPageByKey = findPageByKey;
47
68
  exports.isEqual = isEqual;
48
69
  exports.removeEmptyValues = removeEmptyValues;