@fecp/vue 1.1.9 → 1.2.0

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 (50) hide show
  1. package/es/node_modules/.pnpm/@vueuse_shared@10.11.1_vue@3.5.13_typescript@5.7.3_/node_modules/@vueuse/shared/index.mjs +1 -1
  2. package/es/node_modules/.pnpm/element-plus@2.13.2_vue@3.5.13_typescript@5.7.3_/node_modules/element-plus/es/components/cascader/src/cascader.vue2.mjs +1 -1
  3. package/es/node_modules/.pnpm/element-plus@2.13.2_vue@3.5.13_typescript@5.7.3_/node_modules/element-plus/es/components/container/index.mjs +6 -6
  4. package/es/node_modules/.pnpm/element-plus@2.13.2_vue@3.5.13_typescript@5.7.3_/node_modules/element-plus/es/components/form/src/hooks/use-form-common-props.mjs +1 -1
  5. package/es/node_modules/.pnpm/element-plus@2.13.2_vue@3.5.13_typescript@5.7.3_/node_modules/element-plus/es/components/input/src/input.vue2.mjs +1 -1
  6. package/es/packages/mobile/src/components/base/card/Card.vue.mjs +2 -2
  7. package/es/packages/vue/index.mjs +1 -1
  8. package/es/packages/vue/src/components/details/footer/Footer.vue.mjs +19 -11
  9. package/es/packages/vue/src/components/dialog/DialogRenderer.vue2.mjs +403 -0
  10. package/es/packages/vue/src/components/dialog/index.mjs +68 -0
  11. package/es/packages/vue/src/components/forms/form/Form.vue.mjs +50 -19
  12. package/es/packages/vue/src/components/forms/formItem/FormItem.vue.mjs +10 -4
  13. package/es/packages/vue/src/components/forms/subForm/SubForm.vue.mjs +6 -1
  14. package/es/packages/vue/src/components/forms/subTable/SubTable.vue.mjs +2 -3
  15. package/es/packages/vue/src/components/forms/text/Text.vue.mjs +81 -8
  16. package/es/packages/vue/src/components/table/Pagination.vue.mjs +3 -2
  17. package/es/packages/vue/src/components/table/Table.vue.mjs +59 -18
  18. package/es/packages/vue/src/components/table/TableColumn.vue.mjs +32 -17
  19. package/es/packages/vue/src/components/table/TableFilter.vue.mjs +8 -5
  20. package/es/packages/vue/src/components/table/index.mjs +2 -2
  21. package/es/packages/vue/src/composables/usePageEvents.mjs +14 -6
  22. package/es/packages/vue/src/utils/common.mjs +5 -0
  23. package/es/packages/vue/src/utils/eventFlow/actionHandlers.mjs +46 -3
  24. package/es/packages/vue/src/utils/eventFlow/eventFlowHandler.mjs +58 -26
  25. package/es/packages/vue/src/utils/eventFlowParser.mjs +9 -6
  26. package/es/packages/vue/src/utils/formulajs/calculate.mjs +1 -1
  27. package/es/vue.css +293 -208
  28. package/lib/node_modules/.pnpm/element-plus@2.13.2_vue@3.5.13_typescript@5.7.3_/node_modules/element-plus/es/components/cascader/src/cascader.vue2.js +29 -29
  29. package/lib/packages/mobile/src/components/base/card/Card.vue.js +2 -2
  30. package/lib/packages/vue/index.js +1 -1
  31. package/lib/packages/vue/src/components/details/footer/Footer.vue.js +19 -11
  32. package/lib/packages/vue/src/components/dialog/DialogRenderer.vue2.js +403 -0
  33. package/lib/packages/vue/src/components/dialog/index.js +68 -0
  34. package/lib/packages/vue/src/components/forms/form/Form.vue.js +50 -19
  35. package/lib/packages/vue/src/components/forms/formItem/FormItem.vue.js +10 -4
  36. package/lib/packages/vue/src/components/forms/subForm/SubForm.vue.js +6 -1
  37. package/lib/packages/vue/src/components/forms/subTable/SubTable.vue.js +0 -1
  38. package/lib/packages/vue/src/components/forms/text/Text.vue.js +80 -7
  39. package/lib/packages/vue/src/components/table/Pagination.vue.js +3 -2
  40. package/lib/packages/vue/src/components/table/Table.vue.js +59 -18
  41. package/lib/packages/vue/src/components/table/TableColumn.vue.js +31 -16
  42. package/lib/packages/vue/src/components/table/TableFilter.vue.js +8 -5
  43. package/lib/packages/vue/src/composables/usePageEvents.js +14 -6
  44. package/lib/packages/vue/src/utils/common.js +5 -0
  45. package/lib/packages/vue/src/utils/eventFlow/actionHandlers.js +54 -11
  46. package/lib/packages/vue/src/utils/eventFlow/eventFlowHandler.js +58 -26
  47. package/lib/packages/vue/src/utils/eventFlowParser.js +9 -6
  48. package/lib/packages/vue/src/utils/formulajs/calculate.js +1 -1
  49. package/lib/vue.css +293 -208
  50. package/package.json +1 -1
@@ -3,14 +3,24 @@ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toString
3
3
  const datasource = require("../datasource.js");
4
4
  const parseRouteParams = require("../parseRouteParams.js");
5
5
  const common = require("../common.js");
6
+ const index = require("../../components/dialog/index.js");
6
7
  ;/* empty css */
7
8
  ;/* empty css */
8
9
  ;/* empty css */
9
10
  ;/* empty css */
10
11
  ;/* empty css */
11
- const index = require("../../../../../node_modules/.pnpm/element-plus@2.13.2_vue@3.5.13_typescript@5.7.3_/node_modules/element-plus/es/components/message/index.js");
12
- const index$1 = require("../../../../../node_modules/.pnpm/element-plus@2.13.2_vue@3.5.13_typescript@5.7.3_/node_modules/element-plus/es/components/message-box/index.js");
12
+ const index$1 = require("../../../../../node_modules/.pnpm/element-plus@2.13.2_vue@3.5.13_typescript@5.7.3_/node_modules/element-plus/es/components/message/index.js");
13
+ const index$2 = require("../../../../../node_modules/.pnpm/element-plus@2.13.2_vue@3.5.13_typescript@5.7.3_/node_modules/element-plus/es/components/message-box/index.js");
13
14
  async function handlePageJump(node, data, fields, context) {
15
+ const dialogDoms = document.querySelectorAll(".el-modal-dialog");
16
+ for (let i in dialogDoms) {
17
+ if (!dialogDoms[i].style.display) {
18
+ return {
19
+ success: true,
20
+ message: "页面存在弹层,跳过页面跳转"
21
+ };
22
+ }
23
+ }
14
24
  const basic = node.basic || {};
15
25
  const transitionType = basic.transitionType || "page";
16
26
  const params = parseRouteParams.parseRouteParams(basic.routeParams, data, fields);
@@ -80,7 +90,7 @@ async function handlePageGoBack(node, data, fields, context) {
80
90
  };
81
91
  if (config.showConfirm) {
82
92
  try {
83
- await index$1.ElMessageBox.confirm(
93
+ await index$2.ElMessageBox.confirm(
84
94
  config.confirmMessage,
85
95
  config.confirmTitle,
86
96
  {
@@ -135,7 +145,7 @@ async function handleApiCall(node, data, fields, context, params) {
135
145
  message: "数据源配置不完整,缺少 dataSourceId"
136
146
  };
137
147
  }
138
- const dataSources = context.dataSources || [];
148
+ const dataSources = context.localConfig.dataSources || [];
139
149
  const dataSourceConfig = dataSources.find((ds) => ds.id === basic.dataSourceId);
140
150
  if (!dataSourceConfig) {
141
151
  return {
@@ -186,7 +196,7 @@ async function handleConfirm(node, data, fields, context) {
186
196
  cancelAction: basic.cancelAction || "stop"
187
197
  };
188
198
  try {
189
- await index$1.ElMessageBox.confirm(
199
+ await index$2.ElMessageBox.confirm(
190
200
  config.message,
191
201
  config.title,
192
202
  {
@@ -228,17 +238,17 @@ async function handleMessage(node, data, fields, context) {
228
238
  const message = node.basic.message || "操作成功";
229
239
  switch (messageType) {
230
240
  case "success":
231
- index.ElMessage.success(message);
241
+ index$1.ElMessage.success(message);
232
242
  break;
233
243
  case "warning":
234
- index.ElMessage.warning(message);
244
+ index$1.ElMessage.warning(message);
235
245
  break;
236
246
  case "error":
237
- index.ElMessage.error(message);
247
+ index$1.ElMessage.error(message);
238
248
  break;
239
249
  case "info":
240
250
  default:
241
- index.ElMessage.info(message);
251
+ index$1.ElMessage.info(message);
242
252
  break;
243
253
  }
244
254
  }
@@ -291,7 +301,9 @@ async function handleFormSetValue(node, data, fields, context) {
291
301
  console.error("form-setValue: 缺少 dataSourceId 配置");
292
302
  return;
293
303
  }
294
- const result = await handleApiCall(node, data, fields, context);
304
+ const metadata = context.metadata || {};
305
+ const initSearchData = (metadata == null ? void 0 : metadata.initSearchData) || {};
306
+ const result = await handleApiCall(node, data, fields, context, initSearchData);
295
307
  if (!result.success) {
296
308
  return result;
297
309
  }
@@ -418,6 +430,35 @@ async function handleFormSubmit(node, data, fields, context) {
418
430
  };
419
431
  }
420
432
  }
433
+ async function handleDialog(node, data, fields, context) {
434
+ const basic = node.basic || {};
435
+ if (!(basic == null ? void 0 : basic.dialogId)) {
436
+ console.error("ui-dialog: 缺少 dialogId 配置");
437
+ return;
438
+ }
439
+ const dialogList = context.localConfig.dialogs || [];
440
+ const dialog = dialogList.find((item) => item.id == (basic == null ? void 0 : basic.dialogId));
441
+ if (!dialog) {
442
+ console.error("ui-dialog: 未找到匹配的弹层配置," + (basic == null ? void 0 : basic.dialogId));
443
+ return;
444
+ }
445
+ index.openDialog(
446
+ null,
447
+ dialog,
448
+ context.instance,
449
+ context.ctx,
450
+ fields,
451
+ data
452
+ ).then((result) => {
453
+ console.log("确定", result);
454
+ }).catch(() => {
455
+ console.log("取消");
456
+ });
457
+ return {
458
+ success: true,
459
+ message: `弹层 ${dialog.name} 已打开`
460
+ };
461
+ }
421
462
  const defaultActionHandlers = {
422
463
  "page-jump": handlePageJump,
423
464
  "page-go-back": handlePageGoBack,
@@ -427,13 +468,15 @@ const defaultActionHandlers = {
427
468
  "table-refresh": handleTableRefresh,
428
469
  "form-setValue": handleFormSetValue,
429
470
  "form-submit": handleFormSubmit,
430
- "custom": handleCustomAction
471
+ "custom": handleCustomAction,
472
+ "ui-dialog": handleDialog
431
473
  };
432
474
  exports.default = defaultActionHandlers;
433
475
  exports.defaultActionHandlers = defaultActionHandlers;
434
476
  exports.handleApiCall = handleApiCall;
435
477
  exports.handleConfirm = handleConfirm;
436
478
  exports.handleCustomAction = handleCustomAction;
479
+ exports.handleDialog = handleDialog;
437
480
  exports.handleMessage = handleMessage;
438
481
  exports.handlePageGoBack = handlePageGoBack;
439
482
  exports.handlePageJump = handlePageJump;
@@ -1,40 +1,71 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
3
  const eventFlowParser = require("../eventFlowParser.js");
4
+ async function executeEventFlow(params) {
5
+ const {
6
+ eventFlow,
7
+ fields = [],
8
+ instance = null,
9
+ localConfig = {},
10
+ components = {},
11
+ onSuccess,
12
+ onError,
13
+ row,
14
+ item,
15
+ metadata
16
+ } = params;
17
+ if (!eventFlow) {
18
+ return;
19
+ }
20
+ try {
21
+ const parser = eventFlowParser.createEventFlowParser({
22
+ eventFlow,
23
+ fields,
24
+ data: row,
25
+ instance,
26
+ localConfig,
27
+ components,
28
+ metadata
29
+ });
30
+ const result = await parser.start();
31
+ console.log("事件流执行完成:", result);
32
+ parser.destroy();
33
+ if (onSuccess) {
34
+ onSuccess(result, row, item);
35
+ }
36
+ return result;
37
+ } catch (error) {
38
+ console.error("事件流执行失败:", error);
39
+ if (onError) {
40
+ onError(error, row, item);
41
+ }
42
+ throw error;
43
+ }
44
+ }
4
45
  function createEventFlowHandler(options = {}) {
5
46
  const {
6
47
  fields = [],
7
- ctx = null,
48
+ instance = null,
8
49
  onSuccess,
9
50
  onError,
10
- dataSources = [],
11
- components = {}
51
+ localConfig = {},
52
+ components = {},
53
+ metadata = {}
12
54
  } = options;
13
55
  return async function handleEvent(row, item, eventConfig) {
14
56
  if (eventConfig && eventConfig.eventFlow) {
15
- try {
16
- const parser = eventFlowParser.createEventFlowParser({
17
- eventFlow: eventConfig.eventFlow,
18
- fields,
19
- data: row,
20
- ctx,
21
- dataSources,
22
- components
23
- });
24
- const result = await parser.start();
25
- console.log("事件流执行完成:", result);
26
- parser.destroy();
27
- if (onSuccess) {
28
- onSuccess(result, row, item);
29
- }
30
- return result;
31
- } catch (error) {
32
- console.error("事件流执行失败:", error);
33
- if (onError) {
34
- onError(error, row, item);
35
- }
36
- throw error;
37
- }
57
+ return await executeEventFlow({
58
+ eventFlow: eventConfig.eventFlow,
59
+ fields,
60
+ instance,
61
+ localConfig,
62
+ components,
63
+ onSuccess,
64
+ onError,
65
+ row,
66
+ item,
67
+ metadata
68
+ });
38
69
  }
39
70
  };
40
71
  }
@@ -58,5 +89,6 @@ function useEventFlow(options = {}) {
58
89
  };
59
90
  }
60
91
  exports.createEventFlowHandler = createEventFlowHandler;
92
+ exports.executeEventFlow = executeEventFlow;
61
93
  exports.getEventHandlers = getEventHandlers;
62
94
  exports.useEventFlow = useEventFlow;
@@ -32,6 +32,7 @@ class EventFlowParser {
32
32
  results: []
33
33
  // 每个节点的执行结果
34
34
  };
35
+ this.metadata = options.metadata || {};
35
36
  this.actionHandlers = {
36
37
  ...actionHandlers.defaultActionHandlers,
37
38
  ...options.customActionHandlers
@@ -262,7 +263,7 @@ class EventFlowParser {
262
263
  if (actionResult.shouldShowError !== false) {
263
264
  index.ElMessage.error(errorMessage);
264
265
  }
265
- return null;
266
+ throw new Error(errorMessage);
266
267
  }
267
268
  if ((_b = node.advanced) == null ? void 0 : _b.blockCondition) {
268
269
  const shouldBlock = parseFilterConfig.checkFilterMatch(
@@ -291,17 +292,19 @@ class EventFlowParser {
291
292
  * 执行动作
292
293
  */
293
294
  async executeAction(node) {
294
- var _a, _b, _c;
295
+ var _a, _b, _c, _d, _e, _f;
295
296
  const handler = this.actionHandlers[node.actionType];
296
297
  if (!handler) {
297
298
  throw new Error(`未找到动作处理器: ${node.actionType}`);
298
299
  }
299
300
  const context = {
300
301
  parser: this,
301
- ctx: (_a = this.options) == null ? void 0 : _a.ctx,
302
- customActions: (_b = this.options) == null ? void 0 : _b.customActions,
303
- dataSources: (_c = this.options) == null ? void 0 : _c.dataSources,
304
- components: this.components
302
+ instance: (_a = this.options) == null ? void 0 : _a.instance,
303
+ ctx: (_c = (_b = this.options) == null ? void 0 : _b.instance) == null ? void 0 : _c.proxy,
304
+ customActions: (_d = this.options) == null ? void 0 : _d.customActions,
305
+ localConfig: (_e = this.options) == null ? void 0 : _e.localConfig,
306
+ components: this.components,
307
+ metadata: (_f = this.options) == null ? void 0 : _f.metadata
305
308
  };
306
309
  return await handler(node, this.data, this.fields, context);
307
310
  }
@@ -3,7 +3,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
3
  const functionCore = require("./functionCore.js");
4
4
  require("vue");
5
5
  function calculate(params) {
6
- const { text, value = {} } = params;
6
+ const { text, marks = [], value = {} } = params;
7
7
  if (!text) return new Error("非法公式");
8
8
  try {
9
9
  let str = text;