@fecp/designer 5.5.5 → 5.5.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (99) hide show
  1. package/es/_virtual/app.mjs +5 -0
  2. package/es/_virtual/app2.mjs +4 -0
  3. package/es/designer/package.json.mjs +1 -1
  4. package/es/designer/src/api/index.mjs +30 -31
  5. package/es/designer/src/components/DocumentParam.vue.mjs +5 -3
  6. package/es/designer/src/components/RiskSchemeDialog.vue2.mjs +5 -3
  7. package/es/designer/src/components/TemplateDialog.vue.mjs +5 -3
  8. package/es/designer/src/layout/header/index.vue.mjs +4 -2
  9. package/es/designer/src/layout/index.vue.mjs +6 -4
  10. package/es/designer/src/packages/advancedFilter/ValueInput.vue2.mjs +5 -3
  11. package/es/designer/src/packages/dataLinkage/index.vue.mjs +0 -3
  12. package/es/designer/src/packages/dialog/index.vue2.mjs +6 -4
  13. package/es/designer/src/packages/dialog/useDialogDialog.mjs +1 -1
  14. package/es/designer/src/packages/dialogGlobal/index.vue2.mjs +9 -7
  15. package/es/designer/src/packages/dialogGlobal/useDialogGlobalDialog.mjs +1 -1
  16. package/es/designer/src/packages/eventFlow/dialog/action/Dialog.vue.mjs +5 -3
  17. package/es/designer/src/packages/eventFlow/dialog/action/TableChildSelection.vue2.mjs +5 -3
  18. package/es/designer/src/packages/form/components/ComponentPreviewWrapper.vue.mjs +5 -3
  19. package/es/designer/src/packages/form/components/DefaultValueEditor.vue.mjs +2 -2
  20. package/es/designer/src/packages/form/property/contract.vue.mjs +5 -3
  21. package/es/designer/src/packages/form/property/subTable.vue.mjs +5 -3
  22. package/es/designer/src/packages/form/property/widgets.vue.mjs +8 -6
  23. package/es/designer/src/packages/prod/index.vue.mjs +5 -3
  24. package/es/designer/src/packages/table/headerBtn.vue.mjs +1 -4
  25. package/es/designer/src/utils/optionLoader.mjs +8 -7
  26. package/es/designer.css +214 -185
  27. package/es/node_modules/element-china-category-data/dist/app.mjs +77 -0
  28. package/es/packages/mobile/index.mjs +4 -0
  29. package/es/packages/mobile/src/components/all.mjs +4 -0
  30. package/es/packages/mobile/src/components/form/checkboxGroup/CheckboxGroup.vue.mjs +2 -2
  31. package/es/packages/mobile/src/components/form/fieldCheckbox/FieldCheckbox.vue.mjs +29 -25
  32. package/es/packages/mobile/src/components/form/fieldIndustry/FieldIndustry.vue.mjs +195 -0
  33. package/es/packages/mobile/src/components/form/fieldIndustry/index.mjs +10 -0
  34. package/es/packages/mobile/src/components/form/fieldPicker/FieldPicker.vue.mjs +3 -25
  35. package/es/packages/mobile/src/components/form/fieldRadio/FieldRadio.vue.mjs +34 -7
  36. package/es/packages/mobile/src/components/form/fieldSubTitle/FieldSubTitle.vue.mjs +27 -0
  37. package/es/packages/mobile/src/components/form/fieldSubTitle/index.mjs +10 -0
  38. package/es/packages/mobile/src/components/form/radioGroup/RadioGroup.vue.mjs +1 -1
  39. package/es/packages/mobile/src/components/navigation/actionBar/ActionBar.vue.mjs +35 -16
  40. package/es/packages/mobile/src/components/navigation/tabbar/Tabbar.vue.mjs +2 -1
  41. package/es/packages/mobile/src/utils/common.mjs +28 -0
  42. package/es/packages/mobile/src/utils/datasource.mjs +354 -0
  43. package/es/packages/mobile/src/utils/optionUtil.mjs +63 -40
  44. package/es/packages/mobile/src/utils/parseRouteParams.mjs +41 -0
  45. package/es/packages/vue/src/components/dialog/DialogRenderer.vue2.mjs +1 -1
  46. package/es/packages/vue/src/components/forms/text/Text.vue.mjs +1 -1
  47. package/es/packages/vue/src/components/table/TableColumn.vue.mjs +1 -1
  48. package/es/packages/vue/src/composables/usePageEvents.mjs +1 -1
  49. package/es/packages/vue/src/utils/datasource.mjs +1 -1
  50. package/lib/_virtual/app.js +5 -0
  51. package/lib/_virtual/app2.js +4 -0
  52. package/lib/designer/package.json.js +1 -1
  53. package/lib/designer/src/api/index.js +30 -31
  54. package/lib/designer/src/components/DocumentParam.vue.js +4 -2
  55. package/lib/designer/src/components/RiskSchemeDialog.vue2.js +4 -2
  56. package/lib/designer/src/components/TemplateDialog.vue.js +4 -2
  57. package/lib/designer/src/layout/header/index.vue.js +3 -1
  58. package/lib/designer/src/layout/index.vue.js +5 -3
  59. package/lib/designer/src/packages/advancedFilter/ValueInput.vue2.js +4 -2
  60. package/lib/designer/src/packages/dataLinkage/index.vue.js +0 -3
  61. package/lib/designer/src/packages/dialog/index.vue2.js +5 -3
  62. package/lib/designer/src/packages/dialog/useDialogDialog.js +1 -1
  63. package/lib/designer/src/packages/dialogGlobal/index.vue2.js +8 -6
  64. package/lib/designer/src/packages/dialogGlobal/useDialogGlobalDialog.js +1 -1
  65. package/lib/designer/src/packages/eventFlow/dialog/action/Dialog.vue.js +4 -2
  66. package/lib/designer/src/packages/eventFlow/dialog/action/TableChildSelection.vue2.js +4 -2
  67. package/lib/designer/src/packages/form/components/ComponentPreviewWrapper.vue.js +4 -2
  68. package/lib/designer/src/packages/form/components/DefaultValueEditor.vue.js +2 -2
  69. package/lib/designer/src/packages/form/property/contract.vue.js +4 -2
  70. package/lib/designer/src/packages/form/property/subTable.vue.js +4 -2
  71. package/lib/designer/src/packages/form/property/widgets.vue.js +7 -5
  72. package/lib/designer/src/packages/prod/index.vue.js +4 -2
  73. package/lib/designer/src/packages/table/headerBtn.vue.js +1 -4
  74. package/lib/designer/src/utils/optionLoader.js +8 -7
  75. package/lib/designer.css +214 -185
  76. package/lib/node_modules/element-china-category-data/dist/app.js +77 -0
  77. package/lib/packages/mobile/index.js +48 -44
  78. package/lib/packages/mobile/src/components/all.js +48 -44
  79. package/lib/packages/mobile/src/components/form/checkboxGroup/CheckboxGroup.vue.js +2 -2
  80. package/lib/packages/mobile/src/components/form/fieldCheckbox/FieldCheckbox.vue.js +28 -24
  81. package/lib/packages/mobile/src/components/form/fieldIndustry/FieldIndustry.vue.js +195 -0
  82. package/lib/packages/mobile/src/components/form/fieldIndustry/index.js +10 -0
  83. package/lib/packages/mobile/src/components/form/fieldPicker/FieldPicker.vue.js +2 -24
  84. package/lib/packages/mobile/src/components/form/fieldRadio/FieldRadio.vue.js +33 -6
  85. package/lib/packages/mobile/src/components/form/fieldSubTitle/FieldSubTitle.vue.js +27 -0
  86. package/lib/packages/mobile/src/components/form/fieldSubTitle/index.js +10 -0
  87. package/lib/packages/mobile/src/components/form/radioGroup/RadioGroup.vue.js +1 -1
  88. package/lib/packages/mobile/src/components/navigation/actionBar/ActionBar.vue.js +34 -15
  89. package/lib/packages/mobile/src/components/navigation/tabbar/Tabbar.vue.js +2 -1
  90. package/lib/packages/mobile/src/utils/common.js +28 -0
  91. package/lib/packages/mobile/src/utils/datasource.js +354 -0
  92. package/lib/packages/mobile/src/utils/optionUtil.js +64 -41
  93. package/lib/packages/mobile/src/utils/parseRouteParams.js +41 -0
  94. package/lib/packages/vue/src/components/dialog/DialogRenderer.vue2.js +1 -1
  95. package/lib/packages/vue/src/components/forms/text/Text.vue.js +1 -1
  96. package/lib/packages/vue/src/components/table/TableColumn.vue.js +1 -1
  97. package/lib/packages/vue/src/composables/usePageEvents.js +1 -1
  98. package/lib/packages/vue/src/utils/datasource.js +1 -1
  99. package/package.json +1 -1
@@ -0,0 +1,354 @@
1
+ "use strict";
2
+ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
3
+ const vue = require("vue");
4
+ const parseRouteParams = require("./parseRouteParams.js");
5
+ require("../../../../node_modules/element-plus/es/index.js");
6
+ ;/* empty css */
7
+ ;/* empty css */
8
+ ;/* empty css */
9
+ ;/* empty css */
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");
12
+ class DataSourceManager {
13
+ constructor(options = {}) {
14
+ this.templateId = options.templateId;
15
+ this.http = options.http;
16
+ this.params = options.params || {};
17
+ this.initSearchData = options.initSearchData || {};
18
+ this.dataSources = options.dataSources || [];
19
+ this.currentDataSourceId = options.currentDataSourceId;
20
+ this.pagination = options.pagination || false;
21
+ this.sortRules = vue.reactive(options.sortRules || []);
22
+ this.originalSortRules = JSON.parse(
23
+ JSON.stringify(options.sortRules || [])
24
+ );
25
+ this.showSuccessMessage = options.showSuccessMessage || false;
26
+ this.loading = false;
27
+ this.error = null;
28
+ this.data = vue.reactive({});
29
+ this.contextData = options.data || null;
30
+ this.fields = options.fields || [];
31
+ this.events = {
32
+ loaded: [],
33
+ error: []
34
+ };
35
+ this.LoadingInstance = {
36
+ target: null,
37
+ // 保存Loading实例
38
+ count: 0
39
+ };
40
+ }
41
+ /**
42
+ * 获取当前数据源配置
43
+ */
44
+ getCurrentDataSource() {
45
+ if (!this.currentDataSourceId || !this.dataSources.length) return null;
46
+ return this.dataSources.find((ds) => ds.id == this.currentDataSourceId);
47
+ }
48
+ /**
49
+ * 构建请求参数
50
+ */
51
+ buildRequestParams(extraParams = {}) {
52
+ const currentDs = this.getCurrentDataSource();
53
+ if (!currentDs) return {};
54
+ const params = { ...this.params };
55
+ if (this.templateId) {
56
+ params.tableId = this.templateId;
57
+ }
58
+ if (currentDs.params && Array.isArray(currentDs.params)) {
59
+ const parsedParams = parseRouteParams.parseRouteParams(
60
+ currentDs.params,
61
+ this.contextData,
62
+ this.fields
63
+ );
64
+ Object.assign(params, parsedParams);
65
+ }
66
+ if (this.pagination) {
67
+ params.pageNo = this.pagination.pageNo;
68
+ params.pageSize = this.pagination.pageSize;
69
+ }
70
+ if (this.sortRules && this.sortRules.length > 0) {
71
+ params.sortRules = JSON.stringify(this.sortRules);
72
+ }
73
+ return { ...this.initSearchData, ...params, ...extraParams };
74
+ }
75
+ /**
76
+ * 根据内容类型处理请求数据
77
+ */
78
+ prepareRequestData(params, contentType) {
79
+ switch (contentType) {
80
+ case "formData":
81
+ const formData = new FormData();
82
+ Object.keys(params).forEach((key) => {
83
+ formData.append(key, params[key]);
84
+ });
85
+ return formData;
86
+ case "formUrlencoded":
87
+ const urlencoded = new URLSearchParams();
88
+ Object.keys(params).forEach((key) => {
89
+ urlencoded.append(key, params[key]);
90
+ });
91
+ return urlencoded;
92
+ case "json":
93
+ default:
94
+ return JSON.stringify(params);
95
+ }
96
+ }
97
+ /**
98
+ * 获取请求配置
99
+ */
100
+ getRequestConfig() {
101
+ const currentDs = this.getCurrentDataSource();
102
+ if (!currentDs) return {};
103
+ const config = {
104
+ url: `/${currentDs.serverName}${currentDs.url}`,
105
+ method: currentDs.method
106
+ };
107
+ if (currentDs.contentType === "formData") {
108
+ config.headers = {
109
+ "Content-Type": "multipart/form-data"
110
+ };
111
+ } else if (currentDs.contentType === "formUrlencoded") {
112
+ config.headers = {
113
+ "Content-Type": "application/x-www-form-urlencoded"
114
+ };
115
+ } else {
116
+ config.headers = {
117
+ "Content-Type": "application/json"
118
+ };
119
+ }
120
+ return config;
121
+ }
122
+ /**
123
+ * 发起请求
124
+ */
125
+ async fetch(extraParams = {}) {
126
+ const currentDs = this.getCurrentDataSource();
127
+ if (!currentDs) {
128
+ console.warn("未找到当前数据源配置");
129
+ return;
130
+ }
131
+ if (!this.http) {
132
+ console.warn("未配置 HTTP 实例");
133
+ return;
134
+ }
135
+ this.loading = true;
136
+ this.error = null;
137
+ this.LoadingInstance.count++;
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
+ }
148
+ try {
149
+ const params = this.buildRequestParams(extraParams);
150
+ const requestConfig = this.getRequestConfig();
151
+ let response;
152
+ const { url, method } = requestConfig;
153
+ switch (method.toLowerCase()) {
154
+ case "get":
155
+ response = await this.http.get(url, { params });
156
+ break;
157
+ case "post":
158
+ if (currentDs.contentType === "formData") {
159
+ response = await this.http.postForm(url, params, requestConfig);
160
+ } else if (currentDs.contentType === "download") {
161
+ await this.http.download(url, params, requestConfig);
162
+ } else if (currentDs.contentType === "upload") {
163
+ response = await this.http.upload(url, params, requestConfig);
164
+ } else {
165
+ response = await this.http.post(url, params, requestConfig);
166
+ }
167
+ break;
168
+ case "put":
169
+ if (currentDs.contentType === "formData") {
170
+ response = await this.http.putForm(url, params, requestConfig);
171
+ } else {
172
+ response = await this.http.put(url, params, requestConfig);
173
+ }
174
+ break;
175
+ case "delete":
176
+ response = await this.http.delete(url, { params });
177
+ break;
178
+ default:
179
+ response = await this.http.get(url, { params });
180
+ }
181
+ if (response && typeof response === "object" && "code" in response) {
182
+ if (response.code == 0) {
183
+ const responseData = response.data;
184
+ const responseMessage = response.message;
185
+ if (this.pagination) {
186
+ this.data.list = (responseData == null ? void 0 : responseData.records) || responseData;
187
+ this.data.total = (responseData == null ? void 0 : responseData.total) || (responseData == null ? void 0 : responseData.length);
188
+ } else {
189
+ this.data = responseData;
190
+ }
191
+ this.emit("loaded", this.data);
192
+ if (this.showSuccessMessage && responseMessage) {
193
+ index$1.ElMessage.success(responseMessage);
194
+ }
195
+ return this.data;
196
+ } else {
197
+ this.error = response.message || "请求失败";
198
+ this.emit("error", this.error);
199
+ throw new Error(this.error);
200
+ }
201
+ } else {
202
+ const responseData = response;
203
+ if (this.pagination) {
204
+ this.data.list = (responseData == null ? void 0 : responseData.records) || responseData;
205
+ this.data.total = (responseData == null ? void 0 : responseData.total) || (responseData == null ? void 0 : responseData.length);
206
+ } else {
207
+ this.data = responseData;
208
+ }
209
+ this.emit("loaded", this.data);
210
+ return this.data;
211
+ }
212
+ } catch (err) {
213
+ this.error = err.message || "请求失败";
214
+ this.emit("error", err);
215
+ throw err;
216
+ } finally {
217
+ this.closeLoading();
218
+ }
219
+ }
220
+ /**
221
+ * 事件监听
222
+ */
223
+ on(event, callback) {
224
+ if (this.events[event]) {
225
+ this.events[event].push(callback);
226
+ }
227
+ }
228
+ /**
229
+ * 移除事件监听
230
+ */
231
+ off(event, callback) {
232
+ if (this.events[event]) {
233
+ const index2 = this.events[event].indexOf(callback);
234
+ if (index2 > -1) {
235
+ this.events[event].splice(index2, 1);
236
+ }
237
+ }
238
+ }
239
+ /**
240
+ * 触发事件
241
+ */
242
+ emit(event, data) {
243
+ if (this.events[event]) {
244
+ this.events[event].forEach((callback) => {
245
+ callback(data);
246
+ });
247
+ }
248
+ }
249
+ /**
250
+ * 更新分页
251
+ */
252
+ updatePagination(pageNo, pageSize) {
253
+ this.pagination.pageNo = pageNo;
254
+ this.pagination.pageSize = pageSize;
255
+ }
256
+ /**
257
+ * 更新排序
258
+ */
259
+ updateSort(field, order) {
260
+ const existingIndex = this.sortRules.findIndex((rule) => rule.field === field);
261
+ if (!order) {
262
+ if (existingIndex > -1) {
263
+ this.sortRules.splice(existingIndex, 1);
264
+ }
265
+ } else {
266
+ if (existingIndex > -1) {
267
+ this.sortRules.splice(existingIndex, 1);
268
+ }
269
+ this.sortRules.unshift({ field, order });
270
+ }
271
+ }
272
+ /**
273
+ * 清空排序规则 - 重置为原始配置
274
+ */
275
+ clearSort() {
276
+ this.sortRules.splice(0, this.sortRules.length);
277
+ this.originalSortRules.forEach((rule) => {
278
+ this.sortRules.push({ ...rule });
279
+ });
280
+ }
281
+ /**
282
+ * 切换数据源
283
+ */
284
+ switchDataSource(dataSourceId) {
285
+ this.currentDataSourceId = dataSourceId;
286
+ }
287
+ /**
288
+ * 获取当前数据
289
+ */
290
+ getData() {
291
+ return this.data;
292
+ }
293
+ /**
294
+ * 获取加载状态
295
+ */
296
+ getLoading() {
297
+ return this.loading;
298
+ }
299
+ closeLoading() {
300
+ if (this.LoadingInstance.count > 0) {
301
+ this.LoadingInstance.count--;
302
+ }
303
+ if (this.LoadingInstance.count === 0 && this.LoadingInstance.target) {
304
+ this.LoadingInstance.target.close();
305
+ this.LoadingInstance.target = null;
306
+ }
307
+ }
308
+ /**
309
+ * 获取错误信息
310
+ */
311
+ getError() {
312
+ return this.error;
313
+ }
314
+ /**
315
+ * 获取分页信息
316
+ */
317
+ getPagination() {
318
+ return this.pagination;
319
+ }
320
+ /**
321
+ * 获取当前请求参数
322
+ */
323
+ getParams() {
324
+ return this.params;
325
+ }
326
+ /**
327
+ * 更新请求参数
328
+ */
329
+ updateParams(newParams) {
330
+ this.params = { ...this.params, ...newParams };
331
+ }
332
+ updateInitSearchData(newParams) {
333
+ this.initSearchData = newParams;
334
+ }
335
+ /**
336
+ * 清空请求参数
337
+ */
338
+ clearParams() {
339
+ this.params = {};
340
+ }
341
+ /**
342
+ * 销毁
343
+ */
344
+ destroy() {
345
+ this.events.loaded = [];
346
+ this.events.error = [];
347
+ }
348
+ }
349
+ function createDataSource(options = {}) {
350
+ return new DataSourceManager(options);
351
+ }
352
+ exports.DataSourceManager = DataSourceManager;
353
+ exports.createDataSource = createDataSource;
354
+ exports.default = DataSourceManager;
@@ -1,56 +1,79 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
3
  const index = require("../axios/index.js");
4
- const dataSourceUtil = require("./dataSourceUtil.js");
4
+ const datasource = require("./datasource.js");
5
5
  const env = require("./env.js");
6
6
  const baseUrl = env.default.api_base_url;
7
7
  const getOptions = ({
8
- optionType,
9
- dicKey,
10
- dicList,
11
- dataSource,
12
- dataSourceParams,
13
- staticOptions,
14
- optionsFieldNames
8
+ ctx,
9
+ dataSources,
10
+ formData = [],
11
+ fields = [],
12
+ optionSource,
13
+ options: staticOptions,
14
+ dataSourceValue,
15
+ displayField,
16
+ valueField,
17
+ dictionaryValue
15
18
  }) => {
16
- return new Promise((resolve, reject) => {
17
- switch (optionType) {
18
- case "static":
19
+ return new Promise(async (resolve, reject) => {
20
+ var _a, _b;
21
+ switch (optionSource) {
22
+ case "custom":
19
23
  resolve(staticOptions);
20
24
  break;
21
- case "dic":
22
- let dicListToOption = function(dicList2) {
23
- return dicList2.map((item) => {
24
- return {
25
- text: item.optName,
26
- value: item.optCode
27
- };
28
- });
29
- };
30
- if (dicList) {
31
- resolve(dicListToOption(dicList));
25
+ case "dictionary":
26
+ if (!dictionaryValue) {
27
+ resolve([]);
28
+ break;
29
+ }
30
+ const response = await ctx.$http.postForm(
31
+ "/base-server/parm/sysParmDic/getDicListByKey",
32
+ {
33
+ keyName: dictionaryValue
34
+ },
35
+ false
36
+ );
37
+ const dictionaryData = response;
38
+ const dictItems = dictionaryData[dictionaryValue];
39
+ if (dictItems) {
40
+ const labelField2 = "optName";
41
+ const keyField2 = "optCode";
42
+ const options2 = dictItems.map((item) => ({
43
+ label: item[labelField2],
44
+ value: item[keyField2],
45
+ disabled: item.disabled || false
46
+ }));
47
+ resolve(options2);
32
48
  } else {
33
- getParmDicMapByKeys(dicKey).then((data) => {
34
- const option = dicListToOption(data[dicKey]);
35
- resolve(option);
36
- });
49
+ resolve([]);
37
50
  }
38
51
  break;
39
- case "library":
40
- const dataSourceRef = dataSourceUtil.useDataSource(dataSource);
41
- dataSourceRef == null ? void 0 : dataSourceRef.load(dataSourceParams || {}).then((res) => {
42
- var _a;
43
- const data = ((_a = res == null ? void 0 : res.data) == null ? void 0 : _a.records) || (res == null ? void 0 : res.data) || res || [];
44
- const option = data.map((item) => {
45
- return {
46
- text: item[optionsFieldNames.text],
47
- value: item[optionsFieldNames.value] + ""
48
- };
49
- });
50
- resolve(option);
51
- }).catch((err) => {
52
- console.error(err);
52
+ case "dataSource":
53
+ const dsManager = datasource.createDataSource({
54
+ http: ctx.$http,
55
+ dataSources,
56
+ currentDataSourceId: dataSourceValue,
57
+ data: formData,
58
+ // fields: [...fieldsData.value, ...hiddenFields.value],
59
+ fields
53
60
  });
61
+ const data = await dsManager.fetch();
62
+ let options = [];
63
+ if (Array.isArray(data)) {
64
+ options = data;
65
+ } else if (typeof data === "object") {
66
+ options = Array.isArray(data.data) ? data.data : ((_a = data.data) == null ? void 0 : _a.records) || ((_b = data.data) == null ? void 0 : _b.list) || [];
67
+ }
68
+ const labelField = displayField || "label";
69
+ const keyField = valueField || "value";
70
+ options = options.map((item) => ({
71
+ label: item[labelField],
72
+ value: item[keyField],
73
+ disabled: item.disabled || false,
74
+ ...item
75
+ }));
76
+ resolve(options);
54
77
  break;
55
78
  }
56
79
  });
@@ -67,7 +90,7 @@ const getTreeOptions = ({
67
90
  case "static":
68
91
  resolve(staticOptions);
69
92
  case "library":
70
- const dataSourceRef = dataSourceUtil.useDataSource(dataSource);
93
+ const dataSourceRef = useDataSource(dataSource);
71
94
  dataSourceRef == null ? void 0 : dataSourceRef.load(dataSourceParams || {}).then((res) => {
72
95
  var _a;
73
96
  const data = ((_a = res == null ? void 0 : res.data) == null ? void 0 : _a.records) || (res == null ? void 0 : res.data) || res || [];
@@ -0,0 +1,41 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ const common = require("./common.js");
4
+ function parseSingleParamValue(value, data, fields) {
5
+ if (typeof value !== "object" || value === null) {
6
+ return value;
7
+ }
8
+ if (Array.isArray(value)) {
9
+ return value.map((item) => parseSingleParamValue(item, data, fields));
10
+ }
11
+ const type = value.type;
12
+ if (type === "field") {
13
+ const field = fields.find((f) => f.id == value.value);
14
+ if (field) {
15
+ return data[field.fieldName];
16
+ }
17
+ return null;
18
+ } else if (type === "userInfo") {
19
+ console.warn("[parseRouteParams] userInfo 类型暂未实现");
20
+ return {};
21
+ } else if (type === "urlParam") {
22
+ const urlParams = new URLSearchParams(window.location.search);
23
+ return urlParams.get(value.value) || null;
24
+ } else {
25
+ return value.value !== void 0 ? value.value : value;
26
+ }
27
+ }
28
+ function parseRouteParams(routeParams, data, fields) {
29
+ if (!routeParams || !Array.isArray(routeParams)) {
30
+ return {};
31
+ }
32
+ const params = {};
33
+ routeParams.forEach((param) => {
34
+ const key = param.key;
35
+ if (!key) return;
36
+ params[key] = parseSingleParamValue(param.value, data, fields);
37
+ });
38
+ return common.removeEmptyValues(params);
39
+ }
40
+ exports.parseRouteParams = parseRouteParams;
41
+ exports.parseSingleParamValue = parseSingleParamValue;
@@ -9,9 +9,9 @@ const vue = require("vue");
9
9
  const parseRouteParams = require("../../utils/parseRouteParams.js");
10
10
  const calculate = require("../../utils/formulajs/calculate.js");
11
11
  const eventFlowHandler = require("../../utils/eventFlow/eventFlowHandler.js");
12
- ;/* empty css */
13
12
  ;/* empty css */
14
13
  ;/* empty css */
14
+ ;/* empty css */
15
15
  const common = require("../../utils/common.js");
16
16
  ;/* empty css */
17
17
  const _pluginVue_exportHelper = require("../../../../../_virtual/_plugin-vue_export-helper.js");
@@ -5,9 +5,9 @@ require("../../../../../../node_modules/element-plus/es/index.js");
5
5
  ;/* empty css */
6
6
  ;/* empty css */
7
7
  const vue = require("vue");
8
- ;/* empty css */
9
8
  ;/* empty css */
10
9
  ;/* empty css */
10
+ ;/* empty css */
11
11
  const index$3 = require("../../dialog/index.js");
12
12
  ;/* empty css */
13
13
  ;/* empty css */
@@ -9,10 +9,10 @@ require("../../../../../node_modules/vxe-table/es/components.js");
9
9
  const index$3 = require("../../../../../node_modules/@element-plus/icons-vue/dist/index.js");
10
10
  const parseFilterConfig = require("../../utils/parseFilterConfig.js");
11
11
  const common = require("../../utils/common.js");
12
- ;/* empty css */
13
12
  ;/* empty css */
14
13
  ;/* empty css */
15
14
  ;/* empty css */
15
+ ;/* empty css */
16
16
  ;/* empty css */
17
17
  require("../../utils/formulajs/functionCore.js");
18
18
  const eventFlowHandler = require("../../utils/eventFlow/eventFlowHandler.js");
@@ -2,10 +2,10 @@
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
3
  const vue = require("vue");
4
4
  ;/* empty css */
5
- ;/* empty css */
6
5
  ;/* empty css */
7
6
  ;/* empty css */
8
7
  ;/* empty css */
8
+ ;/* empty css */
9
9
  ;/* empty css */
10
10
  ;/* empty css */
11
11
  require("../utils/formulajs/functionCore.js");
@@ -4,9 +4,9 @@ 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 */
8
7
  ;/* empty css */
9
8
  ;/* empty css */
9
+ ;/* empty css */
10
10
  const index = require("../../../../node_modules/element-plus/es/components/loading/index.js");
11
11
  const index$1 = require("../../../../node_modules/element-plus/es/components/message/index.js");
12
12
  class DataSourceManager {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fecp/designer",
3
- "version": "5.5.5",
3
+ "version": "5.5.6",
4
4
  "main": "lib/designer/index.js",
5
5
  "module": "es/designer/index.mjs",
6
6
  "files": [