@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
@@ -7,11 +7,12 @@ import "../../../node_modules/element-plus/es/index.mjs";
7
7
  /* empty css */
8
8
  /* empty css */
9
9
  /* empty css */
10
- import { getCurrentInstance, ref, onMounted, createBlock, createCommentVNode, unref, openBlock, withCtx } from "vue";
10
+ import { getCurrentInstance, ref, provide, onMounted, createBlock, createCommentVNode, unref, openBlock, withCtx } from "vue";
11
11
  import MobilePage from "./page.vue.mjs";
12
12
  import api from "./api/index.mjs";
13
13
  import emitter from "./utils/eventBus.mjs";
14
14
  import { pageHistory } from "./utils/pageHistory.mjs";
15
+ import { findPageById } from "./utils/common.mjs";
15
16
  /* empty css */
16
17
  /* empty css */
17
18
  /* empty css */
@@ -48,7 +49,6 @@ const _sfc_main = {
48
49
  let option = await api.getAppById(ctx.$http, props.appId);
49
50
  pageList.value = ((_a = JSON.parse(option.pageConfig)) == null ? void 0 : _a.pageConfig) || [];
50
51
  pageHistory.clear();
51
- console.log("🚀 ~ pageList ~ pageList.value:", pageList.value);
52
52
  let homePage;
53
53
  if (props.pageKey) {
54
54
  homePage = pageList.value.find((page) => page.isHome);
@@ -74,6 +74,7 @@ const _sfc_main = {
74
74
  }
75
75
  };
76
76
  const currentPage = ref(null);
77
+ const routePage = ref(null);
77
78
  function loadPage(pageId) {
78
79
  var _a;
79
80
  if (((_a = currentPage.value) == null ? void 0 : _a.id) == pageId) {
@@ -96,24 +97,12 @@ const _sfc_main = {
96
97
  routePage.value = null;
97
98
  }
98
99
  }
99
- function findPageById(pageList2, pageId) {
100
- for (const item of pageList2) {
101
- if (item.id == pageId) {
102
- return item;
103
- }
104
- if (item.children && item.children.length > 0) {
105
- const found = findPageById(item.children, pageId);
106
- if (found) {
107
- return { ...found, parentPage: item };
108
- }
109
- }
110
- }
111
- return null;
112
- }
113
- const routePage = ref(null);
114
- emitter.on("loadPage", (pageId) => {
100
+ const pageParams = ref({});
101
+ emitter.on("loadPage", (pageId, params) => {
115
102
  loadPage(pageId);
103
+ pageParams.value = params || { applyId: "7a16522c29e047d1be80e884773a87ac" };
116
104
  });
105
+ provide("pageList", pageList);
117
106
  onMounted(() => {
118
107
  loadConfig();
119
108
  });
@@ -130,8 +119,9 @@ const _sfc_main = {
130
119
  !unref(noTargetPage) ? (openBlock(), createBlock(unref(MobilePage), {
131
120
  key: 0,
132
121
  parentPage: unref(currentPage),
133
- routePage: unref(routePage)
134
- }, null, 8, ["parentPage", "routePage"])) : (openBlock(), createBlock(_component_van_empty, {
122
+ routePage: unref(routePage),
123
+ params: unref(pageParams)
124
+ }, null, 8, ["parentPage", "routePage", "params"])) : (openBlock(), createBlock(_component_van_empty, {
135
125
  key: 1,
136
126
  image: "search",
137
127
  description: "页面找不到了"
@@ -142,7 +132,7 @@ const _sfc_main = {
142
132
  };
143
133
  }
144
134
  };
145
- const MobileApp = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-67de5a65"]]);
135
+ const MobileApp = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-4e4cf5f1"]]);
146
136
  export {
147
137
  MobileApp as default
148
138
  };
@@ -1,7 +1,9 @@
1
- import { ref, computed, watch, resolveComponent, createElementBlock, openBlock, Fragment, createBlock, createCommentVNode, createElementVNode, normalizeProps, mergeProps, unref, createVNode, guardReactiveProps, isRef, withCtx, resolveDynamicComponent } from "vue";
1
+ import { ref, getCurrentInstance, computed, watch, onMounted, resolveComponent, createElementBlock, openBlock, Fragment, createBlock, createCommentVNode, createElementVNode, normalizeProps, mergeProps, unref, createVNode, guardReactiveProps, isRef, withCtx, resolveDynamicComponent, nextTick } from "vue";
2
2
  import "../../../node_modules/grid-layout-plus/es/index.mjs";
3
3
  import * as all from "./components/all.mjs";
4
4
  import { pageHistory } from "./utils/pageHistory.mjs";
5
+ import { usePageEvents } from "./composables/usePageEvents.mjs";
6
+ import hooks from "../node_modules/moment/dist/moment.mjs";
5
7
  /* empty css */
6
8
  import _export_sfc from "../../../_virtual/_plugin-vue_export-helper.mjs";
7
9
  import De from "../../../node_modules/grid-layout-plus/es/components/grid-layout.vue.mjs";
@@ -18,19 +20,32 @@ const _sfc_main = {
18
20
  },
19
21
  routePage: {
20
22
  type: Object
23
+ },
24
+ params: {
25
+ type: Object,
26
+ default: {}
21
27
  }
22
28
  },
23
- setup(__props) {
29
+ setup(__props, { expose: __expose }) {
30
+ var _a;
24
31
  const props = __props;
25
- const formData = ref({});
32
+ const configLoading = ref(true);
33
+ const instance = getCurrentInstance();
34
+ const ctx = instance.proxy;
35
+ const formData = ref(props.params);
26
36
  function getComp(type) {
27
37
  return all[type];
28
38
  }
39
+ const gridLayout = ref();
29
40
  const layoutData = computed(() => {
30
- var _a;
41
+ var _a2;
31
42
  if (Array.isArray(props.parentPage.layoutData)) {
32
- return ((_a = props.parentPage.layoutData) == null ? void 0 : _a.map((item) => {
43
+ return ((_a2 = props.parentPage.layoutData) == null ? void 0 : _a2.map((item) => {
44
+ var _a3, _b;
33
45
  item.isResizable = false;
46
+ if ((_b = (_a3 = item.component) == null ? void 0 : _a3.props) == null ? void 0 : _b.autoHeight) {
47
+ item.class = "isAutoHeight";
48
+ }
34
49
  return item;
35
50
  })) || [];
36
51
  }
@@ -56,22 +71,142 @@ const _sfc_main = {
56
71
  watch(
57
72
  [() => props.parentPage, () => props.routePage],
58
73
  () => {
59
- var _a;
74
+ var _a2;
60
75
  childPage.value = props.routePage;
61
76
  if (props.parentPage.footerType == "tabbar") {
62
- tabbarActive.value = ((_a = props.routePage) == null ? void 0 : _a.id) || props.parentPage.tabbarConfig.tabbarOptions[0].pageId;
77
+ tabbarActive.value = ((_a2 = props.routePage) == null ? void 0 : _a2.id) || props.parentPage.tabbarConfig.tabbarOptions[0].pageId;
63
78
  }
64
79
  },
65
80
  {
66
81
  immediate: true
67
82
  }
68
83
  );
84
+ const fieldsData = ref([]);
85
+ const hiddenFields = ref(props.parentPage.hiddenFields || []);
86
+ if (Array.isArray(props.parentPage.layoutData)) {
87
+ fieldsData.value = ((_a = props.parentPage.layoutData) == null ? void 0 : _a.map((item) => {
88
+ var _a2;
89
+ return { id: item.component.id, ...(_a2 = item.component) == null ? void 0 : _a2.props };
90
+ })) || [];
91
+ }
92
+ const loadFormData = (state) => {
93
+ formData.value = props.params;
94
+ console.log("初始化赋值", formData.value);
95
+ };
96
+ onMounted(async () => {
97
+ loadFormData();
98
+ const pageEvents = usePageEvents(() => ({
99
+ pageEventConfig: props.parentPage.pageEventConfig,
100
+ fields: [...fieldsData.value, ...hiddenFields.value],
101
+ instance,
102
+ formData: formData.value,
103
+ localConfig: props.parentPage,
104
+ components: {
105
+ form: ctx
106
+ }
107
+ }));
108
+ if (pageEvents) {
109
+ pageEvents.handleBeforeUnmount();
110
+ pageEvents.handleUnmounted();
111
+ if (props.parentPage.pageEventConfig) {
112
+ const onCreatedEvent = props.parentPage.pageEventConfig.find(
113
+ (e) => e.name === "onCreated"
114
+ );
115
+ if (onCreatedEvent) {
116
+ console.log("🚀 页面 onCreated 事件触发");
117
+ try {
118
+ await pageEvents.executeEvent("onCreated");
119
+ } catch (error) {
120
+ }
121
+ }
122
+ }
123
+ }
124
+ configLoading.value = false;
125
+ });
126
+ const valueFormatMap = {
127
+ date: "YYYYMMDD",
128
+ week: "YYYYMMDD",
129
+ month: "YYYYMM",
130
+ year: "YYYY",
131
+ datetime: "YYYYMMDDHHmmss"
132
+ };
133
+ const formValueFormatMap = {
134
+ date: "YYYY/MM/DD",
135
+ week: "YYYY/MM/DD",
136
+ month: "YYYY/MM",
137
+ year: "YYYY",
138
+ datetime: "YYYY/MM/DD HH:mm:ss"
139
+ };
140
+ const setFormData = (data) => {
141
+ const processedData = { ...data };
142
+ const processField = (field) => {
143
+ const fieldName = field.fieldName;
144
+ const fieldType = field.fieldType;
145
+ if (!processedData.hasOwnProperty(fieldName)) {
146
+ return;
147
+ }
148
+ const value = processedData[fieldName];
149
+ if (fieldName && (fieldType === "checkbox" || fieldType === "multipleSelection" || fieldType === "cascader" || fieldType === "area" || fieldType === "industry")) {
150
+ let splitStr = "|";
151
+ if (fieldType === "cascader" || fieldType === "area" || fieldType === "industry") {
152
+ splitStr = ",";
153
+ }
154
+ if (typeof value === "string" && value.includes(splitStr)) {
155
+ processedData[fieldName] = value.split(splitStr);
156
+ } else if (typeof value === "string" && value !== "") {
157
+ processedData[fieldName] = [value];
158
+ } else if (value === "" || value === null || value === void 0) {
159
+ processedData[fieldName] = [];
160
+ }
161
+ processedData[fieldName] = processedData[fieldName].map((item) => {
162
+ if (item.indexOf(",") > -1) {
163
+ return item.split(",");
164
+ }
165
+ return item;
166
+ });
167
+ } else if (fieldName && fieldType === "date" && value) {
168
+ const valueFormat = valueFormatMap[field.dateType] || "YYYYMMDD";
169
+ const formValueFormat = formValueFormatMap[field.dateType] || "YYYY/MM/DD";
170
+ processedData[fieldName] = hooks(value, valueFormat).format(
171
+ formValueFormat
172
+ );
173
+ }
174
+ };
175
+ if (fieldsData.value) {
176
+ fieldsData.value.forEach((component) => {
177
+ processField(component);
178
+ });
179
+ }
180
+ if (hiddenFields.value && hiddenFields.value.length > 0) {
181
+ hiddenFields.value.forEach((field) => {
182
+ processField(field);
183
+ });
184
+ }
185
+ formData.value = { ...formData.value, ...processedData };
186
+ nextTick(() => {
187
+ var _a2;
188
+ layoutData.value.forEach((item) => {
189
+ const id = item.component.id;
190
+ const dom = document.getElementById(id);
191
+ const labelDom = dom == null ? void 0 : dom.querySelector(".van-field__label");
192
+ if (labelDom) {
193
+ let height = labelDom.offsetHeight + 20;
194
+ item.h = height / 10;
195
+ }
196
+ });
197
+ (_a2 = gridLayout.value) == null ? void 0 : _a2.resizeEvent();
198
+ });
199
+ };
200
+ __expose({
201
+ setFormData
202
+ });
69
203
  return (_ctx, _cache) => {
70
204
  const _component_FecMobileNavBar = resolveComponent("FecMobileNavBar");
71
205
  const _component_page = resolveComponent("page", true);
72
206
  const _component_FecMobileMenuGrid = resolveComponent("FecMobileMenuGrid");
73
207
  const _component_FecMobileNoticeBar = resolveComponent("FecMobileNoticeBar");
74
208
  const _component_FecMobileDataStat = resolveComponent("FecMobileDataStat");
209
+ const _component_FecMobileAppDetail = resolveComponent("FecMobileAppDetail");
75
210
  const _component_FecMobileTabbar = resolveComponent("FecMobileTabbar");
76
211
  const _component_FecMobileActionBar = resolveComponent("FecMobileActionBar");
77
212
  return openBlock(), createElementBlock(Fragment, null, [
@@ -87,9 +222,13 @@ const _sfc_main = {
87
222
  createVNode(_component_FecMobileMenuGrid, normalizeProps(guardReactiveProps(__props.parentPage.layoutData.menuGridProps)), null, 16),
88
223
  createVNode(_component_FecMobileNoticeBar),
89
224
  createVNode(_component_FecMobileDataStat)
90
- ], 64)) : __props.parentPage.type == "approval" ? (openBlock(), createElementBlock(Fragment, { key: 1 }, [], 64)) : (openBlock(), createBlock(unref(De), {
225
+ ], 64)) : __props.parentPage.type == "approval" ? (openBlock(), createBlock(_component_FecMobileAppDetail, mergeProps({ key: 1 }, __props.parentPage.layoutData.appDetailProps, {
226
+ actionBar: __props.parentPage.layoutData.actionBar,
227
+ params: __props.params
228
+ }), null, 16, ["actionBar", "params"])) : (openBlock(), createBlock(unref(De), {
91
229
  key: 2,
92
- ref: "gridLayout",
230
+ ref_key: "gridLayout",
231
+ ref: gridLayout,
93
232
  layout: unref(layoutData),
94
233
  "onUpdate:layout": _cache[0] || (_cache[0] = ($event) => isRef(layoutData) ? layoutData.value = $event : null),
95
234
  "row-height": rowHeight,
@@ -106,9 +245,10 @@ const _sfc_main = {
106
245
  modelValue: unref(formData)[component.props.fieldName],
107
246
  "onUpdate:modelValue": ($event) => unref(formData)[component.props.fieldName] = $event,
108
247
  dataSources: unref(currentPage).dataSources,
248
+ formData: unref(formData),
109
249
  compId: component.id,
110
- currentPage: unref(currentPage)
111
- }), null, 16, ["modelValue", "onUpdate:modelValue", "dataSources", "compId", "currentPage"]))
250
+ fields: [...unref(fieldsData), ...unref(hiddenFields)]
251
+ }), null, 16, ["modelValue", "onUpdate:modelValue", "dataSources", "formData", "compId", "fields"]))
112
252
  ])
113
253
  ]),
114
254
  _: 1
@@ -125,7 +265,7 @@ const _sfc_main = {
125
265
  };
126
266
  }
127
267
  };
128
- const MobilePage = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-71059c96"]]);
268
+ const MobilePage = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-726a6dad"]]);
129
269
  export {
130
270
  MobilePage as default
131
271
  };
@@ -22,7 +22,22 @@ function removeEmptyValues(data) {
22
22
  }
23
23
  return result;
24
24
  }
25
+ const findPageById = (pageList, pageId) => {
26
+ for (const item of pageList) {
27
+ if (item.id == pageId) {
28
+ return item;
29
+ }
30
+ if (item.children && item.children.length > 0) {
31
+ const found = findPageById(item.children, pageId);
32
+ if (found) {
33
+ return { ...found, parentPage: item };
34
+ }
35
+ }
36
+ }
37
+ return null;
38
+ };
25
39
  export {
26
40
  cloneDeep,
41
+ findPageById,
27
42
  removeEmptyValues
28
43
  };
@@ -2,8 +2,10 @@ import { reactive } from "vue";
2
2
  import { parseRouteParams } from "./parseRouteParams.mjs";
3
3
  import "../../../../node_modules/element-plus/es/index.mjs";
4
4
  /* empty css */
5
+ /* empty css */
5
6
  /* empty css */
6
7
  /* empty css */
8
+ import { ElLoading } from "../../../../node_modules/element-plus/es/components/loading/index.mjs";
7
9
  import { ElMessage } from "../../../../node_modules/element-plus/es/components/message/index.mjs";
8
10
  class DataSourceManager {
9
11
  constructor(options = {}) {
@@ -131,7 +133,16 @@ class DataSourceManager {
131
133
  this.loading = true;
132
134
  this.error = null;
133
135
  this.LoadingInstance.count++;
134
- if (this.LoadingInstance.count === 1) ;
136
+ if (this.LoadingInstance.count === 1) {
137
+ this.LoadingInstance.target = ElLoading.service({
138
+ fullscreen: true,
139
+ lock: true,
140
+ text: "拼命加载中",
141
+ // spinner: loadingSvg,
142
+ background: "rgba(0, 0, 0, 0)",
143
+ customClass: "h-loading"
144
+ });
145
+ }
135
146
  try {
136
147
  const params = this.buildRequestParams(extraParams);
137
148
  const requestConfig = this.getRequestConfig();