@fecp/designer 5.5.100 → 5.5.102

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 (75) hide show
  1. package/es/designer/package.json.mjs +1 -1
  2. package/es/designer/src/packages/dialog/useDialogDialog.mjs +1 -1
  3. package/es/designer/src/packages/dialogGlobal/useDialogGlobalDialog.mjs +1 -1
  4. package/es/designer/src/packages/form/property/widgets.vue.mjs +2 -2
  5. package/es/designer.css +436 -125
  6. package/es/packages/mobile/index.mjs +4 -0
  7. package/es/packages/mobile/src/components/all.mjs +4 -0
  8. package/es/packages/mobile/src/components/custom/appDetail/AppDetail.vue.mjs +69 -9
  9. package/es/packages/mobile/src/components/custom/approvalBar/ApprovalBar.vue.mjs +191 -0
  10. package/es/packages/mobile/src/components/custom/approvalBar/index.mjs +10 -0
  11. package/es/packages/mobile/src/components/custom/approvalList/ApprovalList.vue.mjs +391 -0
  12. package/es/packages/mobile/src/components/custom/approvalList/index.mjs +10 -0
  13. package/es/packages/mobile/src/components/dataDisplay/cardList/CardList.vue.mjs +2 -18
  14. package/es/packages/mobile/src/components/dataDisplay/table/Table.vue.mjs +43 -11
  15. package/es/packages/mobile/src/components/form/field/Field.vue.mjs +38 -26
  16. package/es/packages/mobile/src/components/form/fieldArea/FieldArea.vue.mjs +4 -2
  17. package/es/packages/mobile/src/components/form/fieldCalendarPicker/FieldCalendarPicker.vue.mjs +1 -1
  18. package/es/packages/mobile/src/components/form/fieldCascaderPicker/fieldCascaderPicker.vue.mjs +1 -1
  19. package/es/packages/mobile/src/components/form/fieldDatePicker/FieldDatePicker.vue.mjs +1 -1
  20. package/es/packages/mobile/src/components/form/fieldDateTimePicker/FieldDateTimePicker.vue.mjs +1 -1
  21. package/es/packages/mobile/src/components/form/fieldIndustry/FieldIndustry.vue.mjs +38 -27
  22. package/es/packages/mobile/src/components/form/fieldPicker/FieldPicker.vue.mjs +58 -41
  23. package/es/packages/mobile/src/components/form/fieldTimePicker/FieldTimePicker.vue.mjs +1 -1
  24. package/es/packages/mobile/src/components/navigation/tabs/Tabs.vue.mjs +34 -5
  25. package/es/packages/mobile/src/composables/usePageEvents.mjs +80 -0
  26. package/es/packages/mobile/src/index.vue.mjs +11 -21
  27. package/es/packages/mobile/src/page.vue.mjs +152 -12
  28. package/es/packages/mobile/src/utils/common.mjs +15 -0
  29. package/es/packages/mobile/src/utils/datasource.mjs +12 -1
  30. package/es/packages/mobile/src/utils/eventFlow/actionHandlers.mjs +852 -0
  31. package/es/packages/mobile/src/utils/eventFlow/eventFlowHandler.mjs +94 -0
  32. package/es/packages/mobile/src/utils/eventFlowParser.mjs +396 -0
  33. package/es/packages/mobile/src/utils/formatterUtil.mjs +1 -0
  34. package/es/packages/mobile/src/utils/parseFilterConfig.mjs +98 -0
  35. package/es/packages/vue/src/components/forms/form/Form.vue.mjs +1 -1
  36. package/es/packages/vue/src/components/forms/subTable/SubTable.vue.mjs +8 -7
  37. package/es/packages/vue/src/components/table/Table.vue.mjs +11 -1
  38. package/lib/designer/package.json.js +1 -1
  39. package/lib/designer/src/packages/dialog/useDialogDialog.js +1 -1
  40. package/lib/designer/src/packages/dialogGlobal/useDialogGlobalDialog.js +1 -1
  41. package/lib/designer/src/packages/form/property/widgets.vue.js +2 -2
  42. package/lib/designer.css +436 -125
  43. package/lib/packages/mobile/index.js +6 -2
  44. package/lib/packages/mobile/src/components/all.js +4 -0
  45. package/lib/packages/mobile/src/components/custom/appDetail/AppDetail.vue.js +68 -8
  46. package/lib/packages/mobile/src/components/custom/approvalBar/ApprovalBar.vue.js +191 -0
  47. package/lib/packages/mobile/src/components/custom/approvalBar/index.js +10 -0
  48. package/lib/packages/mobile/src/components/custom/approvalList/ApprovalList.vue.js +391 -0
  49. package/lib/packages/mobile/src/components/custom/approvalList/index.js +10 -0
  50. package/lib/packages/mobile/src/components/dataDisplay/cardList/CardList.vue.js +2 -18
  51. package/lib/packages/mobile/src/components/dataDisplay/table/Table.vue.js +43 -11
  52. package/lib/packages/mobile/src/components/form/field/Field.vue.js +37 -25
  53. package/lib/packages/mobile/src/components/form/fieldArea/FieldArea.vue.js +4 -2
  54. package/lib/packages/mobile/src/components/form/fieldCalendarPicker/FieldCalendarPicker.vue.js +1 -1
  55. package/lib/packages/mobile/src/components/form/fieldCascaderPicker/fieldCascaderPicker.vue.js +1 -1
  56. package/lib/packages/mobile/src/components/form/fieldDatePicker/FieldDatePicker.vue.js +1 -1
  57. package/lib/packages/mobile/src/components/form/fieldDateTimePicker/FieldDateTimePicker.vue.js +1 -1
  58. package/lib/packages/mobile/src/components/form/fieldIndustry/FieldIndustry.vue.js +37 -26
  59. package/lib/packages/mobile/src/components/form/fieldPicker/FieldPicker.vue.js +57 -40
  60. package/lib/packages/mobile/src/components/form/fieldTimePicker/FieldTimePicker.vue.js +1 -1
  61. package/lib/packages/mobile/src/components/navigation/tabs/Tabs.vue.js +33 -4
  62. package/lib/packages/mobile/src/composables/usePageEvents.js +80 -0
  63. package/lib/packages/mobile/src/index.vue.js +11 -21
  64. package/lib/packages/mobile/src/page.vue.js +151 -11
  65. package/lib/packages/mobile/src/utils/common.js +15 -0
  66. package/lib/packages/mobile/src/utils/datasource.js +14 -3
  67. package/lib/packages/mobile/src/utils/eventFlow/actionHandlers.js +852 -0
  68. package/lib/packages/mobile/src/utils/eventFlow/eventFlowHandler.js +94 -0
  69. package/lib/packages/mobile/src/utils/eventFlowParser.js +396 -0
  70. package/lib/packages/mobile/src/utils/formatterUtil.js +1 -0
  71. package/lib/packages/mobile/src/utils/parseFilterConfig.js +98 -0
  72. package/lib/packages/vue/src/components/forms/form/Form.vue.js +1 -1
  73. package/lib/packages/vue/src/components/forms/subTable/SubTable.vue.js +7 -6
  74. package/lib/packages/vue/src/components/table/Table.vue.js +11 -1
  75. package/package.json +1 -1
@@ -4,6 +4,8 @@ const Vue = require("vue");
4
4
  require("../../../node_modules/grid-layout-plus/es/index.js");
5
5
  const all = require("./components/all.js");
6
6
  const pageHistory = require("./utils/pageHistory.js");
7
+ const usePageEvents = require("./composables/usePageEvents.js");
8
+ const moment = require("../node_modules/moment/dist/moment.js");
7
9
  ;/* empty css */
8
10
  const _pluginVue_exportHelper = require("../../../_virtual/_plugin-vue_export-helper.js");
9
11
  const gridLayout_vue = require("../../../node_modules/grid-layout-plus/es/components/grid-layout.vue.js");
@@ -20,19 +22,32 @@ const _sfc_main = {
20
22
  },
21
23
  routePage: {
22
24
  type: Object
25
+ },
26
+ params: {
27
+ type: Object,
28
+ default: {}
23
29
  }
24
30
  },
25
- setup(__props) {
31
+ setup(__props, { expose: __expose }) {
32
+ var _a;
26
33
  const props = __props;
27
- const formData = Vue.ref({});
34
+ const configLoading = Vue.ref(true);
35
+ const instance = Vue.getCurrentInstance();
36
+ const ctx = instance.proxy;
37
+ const formData = Vue.ref(props.params);
28
38
  function getComp(type) {
29
39
  return all[type];
30
40
  }
41
+ const gridLayout = Vue.ref();
31
42
  const layoutData = Vue.computed(() => {
32
- var _a;
43
+ var _a2;
33
44
  if (Array.isArray(props.parentPage.layoutData)) {
34
- return ((_a = props.parentPage.layoutData) == null ? void 0 : _a.map((item) => {
45
+ return ((_a2 = props.parentPage.layoutData) == null ? void 0 : _a2.map((item) => {
46
+ var _a3, _b;
35
47
  item.isResizable = false;
48
+ if ((_b = (_a3 = item.component) == null ? void 0 : _a3.props) == null ? void 0 : _b.autoHeight) {
49
+ item.class = "isAutoHeight";
50
+ }
36
51
  return item;
37
52
  })) || [];
38
53
  }
@@ -58,22 +73,142 @@ const _sfc_main = {
58
73
  Vue.watch(
59
74
  [() => props.parentPage, () => props.routePage],
60
75
  () => {
61
- var _a;
76
+ var _a2;
62
77
  childPage.value = props.routePage;
63
78
  if (props.parentPage.footerType == "tabbar") {
64
- tabbarActive.value = ((_a = props.routePage) == null ? void 0 : _a.id) || props.parentPage.tabbarConfig.tabbarOptions[0].pageId;
79
+ tabbarActive.value = ((_a2 = props.routePage) == null ? void 0 : _a2.id) || props.parentPage.tabbarConfig.tabbarOptions[0].pageId;
65
80
  }
66
81
  },
67
82
  {
68
83
  immediate: true
69
84
  }
70
85
  );
86
+ const fieldsData = Vue.ref([]);
87
+ const hiddenFields = Vue.ref(props.parentPage.hiddenFields || []);
88
+ if (Array.isArray(props.parentPage.layoutData)) {
89
+ fieldsData.value = ((_a = props.parentPage.layoutData) == null ? void 0 : _a.map((item) => {
90
+ var _a2;
91
+ return { id: item.component.id, ...(_a2 = item.component) == null ? void 0 : _a2.props };
92
+ })) || [];
93
+ }
94
+ const loadFormData = (state) => {
95
+ formData.value = props.params;
96
+ console.log("初始化赋值", formData.value);
97
+ };
98
+ Vue.onMounted(async () => {
99
+ loadFormData();
100
+ const pageEvents = usePageEvents.usePageEvents(() => ({
101
+ pageEventConfig: props.parentPage.pageEventConfig,
102
+ fields: [...fieldsData.value, ...hiddenFields.value],
103
+ instance,
104
+ formData: formData.value,
105
+ localConfig: props.parentPage,
106
+ components: {
107
+ form: ctx
108
+ }
109
+ }));
110
+ if (pageEvents) {
111
+ pageEvents.handleBeforeUnmount();
112
+ pageEvents.handleUnmounted();
113
+ if (props.parentPage.pageEventConfig) {
114
+ const onCreatedEvent = props.parentPage.pageEventConfig.find(
115
+ (e) => e.name === "onCreated"
116
+ );
117
+ if (onCreatedEvent) {
118
+ console.log("🚀 页面 onCreated 事件触发");
119
+ try {
120
+ await pageEvents.executeEvent("onCreated");
121
+ } catch (error) {
122
+ }
123
+ }
124
+ }
125
+ }
126
+ configLoading.value = false;
127
+ });
128
+ const valueFormatMap = {
129
+ date: "YYYYMMDD",
130
+ week: "YYYYMMDD",
131
+ month: "YYYYMM",
132
+ year: "YYYY",
133
+ datetime: "YYYYMMDDHHmmss"
134
+ };
135
+ const formValueFormatMap = {
136
+ date: "YYYY/MM/DD",
137
+ week: "YYYY/MM/DD",
138
+ month: "YYYY/MM",
139
+ year: "YYYY",
140
+ datetime: "YYYY/MM/DD HH:mm:ss"
141
+ };
142
+ const setFormData = (data) => {
143
+ const processedData = { ...data };
144
+ const processField = (field) => {
145
+ const fieldName = field.fieldName;
146
+ const fieldType = field.fieldType;
147
+ if (!processedData.hasOwnProperty(fieldName)) {
148
+ return;
149
+ }
150
+ const value = processedData[fieldName];
151
+ if (fieldName && (fieldType === "checkbox" || fieldType === "multipleSelection" || fieldType === "cascader" || fieldType === "area" || fieldType === "industry")) {
152
+ let splitStr = "|";
153
+ if (fieldType === "cascader" || fieldType === "area" || fieldType === "industry") {
154
+ splitStr = ",";
155
+ }
156
+ if (typeof value === "string" && value.includes(splitStr)) {
157
+ processedData[fieldName] = value.split(splitStr);
158
+ } else if (typeof value === "string" && value !== "") {
159
+ processedData[fieldName] = [value];
160
+ } else if (value === "" || value === null || value === void 0) {
161
+ processedData[fieldName] = [];
162
+ }
163
+ processedData[fieldName] = processedData[fieldName].map((item) => {
164
+ if (item.indexOf(",") > -1) {
165
+ return item.split(",");
166
+ }
167
+ return item;
168
+ });
169
+ } else if (fieldName && fieldType === "date" && value) {
170
+ const valueFormat = valueFormatMap[field.dateType] || "YYYYMMDD";
171
+ const formValueFormat = formValueFormatMap[field.dateType] || "YYYY/MM/DD";
172
+ processedData[fieldName] = moment.default(value, valueFormat).format(
173
+ formValueFormat
174
+ );
175
+ }
176
+ };
177
+ if (fieldsData.value) {
178
+ fieldsData.value.forEach((component) => {
179
+ processField(component);
180
+ });
181
+ }
182
+ if (hiddenFields.value && hiddenFields.value.length > 0) {
183
+ hiddenFields.value.forEach((field) => {
184
+ processField(field);
185
+ });
186
+ }
187
+ formData.value = { ...formData.value, ...processedData };
188
+ Vue.nextTick(() => {
189
+ var _a2;
190
+ layoutData.value.forEach((item) => {
191
+ const id = item.component.id;
192
+ const dom = document.getElementById(id);
193
+ const labelDom = dom == null ? void 0 : dom.querySelector(".van-field__label");
194
+ if (labelDom) {
195
+ let height = labelDom.offsetHeight + 20;
196
+ item.h = height / 10;
197
+ }
198
+ });
199
+ (_a2 = gridLayout.value) == null ? void 0 : _a2.resizeEvent();
200
+ });
201
+ };
202
+ __expose({
203
+ setFormData
204
+ });
71
205
  return (_ctx, _cache) => {
72
206
  const _component_FecMobileNavBar = Vue.resolveComponent("FecMobileNavBar");
73
207
  const _component_page = Vue.resolveComponent("page", true);
74
208
  const _component_FecMobileMenuGrid = Vue.resolveComponent("FecMobileMenuGrid");
75
209
  const _component_FecMobileNoticeBar = Vue.resolveComponent("FecMobileNoticeBar");
76
210
  const _component_FecMobileDataStat = Vue.resolveComponent("FecMobileDataStat");
211
+ const _component_FecMobileAppDetail = Vue.resolveComponent("FecMobileAppDetail");
77
212
  const _component_FecMobileTabbar = Vue.resolveComponent("FecMobileTabbar");
78
213
  const _component_FecMobileActionBar = Vue.resolveComponent("FecMobileActionBar");
79
214
  return Vue.openBlock(), Vue.createElementBlock(Vue.Fragment, null, [
@@ -89,9 +224,13 @@ const _sfc_main = {
89
224
  Vue.createVNode(_component_FecMobileMenuGrid, Vue.normalizeProps(Vue.guardReactiveProps(__props.parentPage.layoutData.menuGridProps)), null, 16),
90
225
  Vue.createVNode(_component_FecMobileNoticeBar),
91
226
  Vue.createVNode(_component_FecMobileDataStat)
92
- ], 64)) : __props.parentPage.type == "approval" ? (Vue.openBlock(), Vue.createElementBlock(Vue.Fragment, { key: 1 }, [], 64)) : (Vue.openBlock(), Vue.createBlock(Vue.unref(gridLayout_vue.default), {
227
+ ], 64)) : __props.parentPage.type == "approval" ? (Vue.openBlock(), Vue.createBlock(_component_FecMobileAppDetail, Vue.mergeProps({ key: 1 }, __props.parentPage.layoutData.appDetailProps, {
228
+ actionBar: __props.parentPage.layoutData.actionBar,
229
+ params: __props.params
230
+ }), null, 16, ["actionBar", "params"])) : (Vue.openBlock(), Vue.createBlock(Vue.unref(gridLayout_vue.default), {
93
231
  key: 2,
94
- ref: "gridLayout",
232
+ ref_key: "gridLayout",
233
+ ref: gridLayout,
95
234
  layout: Vue.unref(layoutData),
96
235
  "onUpdate:layout": _cache[0] || (_cache[0] = ($event) => Vue.isRef(layoutData) ? layoutData.value = $event : null),
97
236
  "row-height": rowHeight,
@@ -108,9 +247,10 @@ const _sfc_main = {
108
247
  modelValue: Vue.unref(formData)[component.props.fieldName],
109
248
  "onUpdate:modelValue": ($event) => Vue.unref(formData)[component.props.fieldName] = $event,
110
249
  dataSources: Vue.unref(currentPage).dataSources,
250
+ formData: Vue.unref(formData),
111
251
  compId: component.id,
112
- currentPage: Vue.unref(currentPage)
113
- }), null, 16, ["modelValue", "onUpdate:modelValue", "dataSources", "compId", "currentPage"]))
252
+ fields: [...Vue.unref(fieldsData), ...Vue.unref(hiddenFields)]
253
+ }), null, 16, ["modelValue", "onUpdate:modelValue", "dataSources", "formData", "compId", "fields"]))
114
254
  ])
115
255
  ]),
116
256
  _: 1
@@ -127,5 +267,5 @@ const _sfc_main = {
127
267
  };
128
268
  }
129
269
  };
130
- const MobilePage = /* @__PURE__ */ _pluginVue_exportHelper.default(_sfc_main, [["__scopeId", "data-v-71059c96"]]);
270
+ const MobilePage = /* @__PURE__ */ _pluginVue_exportHelper.default(_sfc_main, [["__scopeId", "data-v-726a6dad"]]);
131
271
  exports.default = MobilePage;
@@ -24,5 +24,20 @@ function removeEmptyValues(data) {
24
24
  }
25
25
  return result;
26
26
  }
27
+ const findPageById = (pageList, pageId) => {
28
+ for (const item of pageList) {
29
+ if (item.id == pageId) {
30
+ return item;
31
+ }
32
+ if (item.children && item.children.length > 0) {
33
+ const found = findPageById(item.children, pageId);
34
+ if (found) {
35
+ return { ...found, parentPage: item };
36
+ }
37
+ }
38
+ }
39
+ return null;
40
+ };
27
41
  exports.cloneDeep = cloneDeep;
42
+ exports.findPageById = findPageById;
28
43
  exports.removeEmptyValues = removeEmptyValues;
@@ -4,9 +4,11 @@ const Vue = require("vue");
4
4
  const parseRouteParams = require("./parseRouteParams.js");
5
5
  require("../../../../node_modules/element-plus/es/index.js");
6
6
  ;/* empty css */
7
+ ;/* empty css */
7
8
  ;/* empty css */
8
9
  ;/* empty css */
9
- const index = require("../../../../node_modules/element-plus/es/components/message/index.js");
10
+ const index = require("../../../../node_modules/element-plus/es/components/loading/index.js");
11
+ const index$1 = require("../../../../node_modules/element-plus/es/components/message/index.js");
10
12
  class DataSourceManager {
11
13
  constructor(options = {}) {
12
14
  this.templateId = options.templateId;
@@ -133,7 +135,16 @@ class DataSourceManager {
133
135
  this.loading = true;
134
136
  this.error = null;
135
137
  this.LoadingInstance.count++;
136
- if (this.LoadingInstance.count === 1) ;
138
+ if (this.LoadingInstance.count === 1) {
139
+ this.LoadingInstance.target = index.ElLoading.service({
140
+ fullscreen: true,
141
+ lock: true,
142
+ text: "拼命加载中",
143
+ // spinner: loadingSvg,
144
+ background: "rgba(0, 0, 0, 0)",
145
+ customClass: "h-loading"
146
+ });
147
+ }
137
148
  try {
138
149
  const params = this.buildRequestParams(extraParams);
139
150
  const requestConfig = this.getRequestConfig();
@@ -179,7 +190,7 @@ class DataSourceManager {
179
190
  }
180
191
  this.emit("loaded", this.data);
181
192
  if (this.showSuccessMessage && responseMessage) {
182
- index.ElMessage.success(responseMessage);
193
+ index$1.ElMessage.success(responseMessage);
183
194
  }
184
195
  return this.data;
185
196
  } else {