@fecp/vue 1.1.9 → 1.2.1
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.
- 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
- 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
- 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
- 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
- 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
- package/es/packages/mobile/src/components/base/card/Card.vue.mjs +2 -2
- package/es/packages/vue/index.mjs +1 -1
- package/es/packages/vue/src/components/details/footer/Footer.vue.mjs +19 -11
- package/es/packages/vue/src/components/dialog/DialogRenderer.vue2.mjs +403 -0
- package/es/packages/vue/src/components/dialog/index.mjs +68 -0
- package/es/packages/vue/src/components/forms/form/Form.vue.mjs +50 -19
- package/es/packages/vue/src/components/forms/formItem/FormItem.vue.mjs +10 -4
- package/es/packages/vue/src/components/forms/subForm/SubForm.vue.mjs +6 -1
- package/es/packages/vue/src/components/forms/subTable/SubTable.vue.mjs +2 -3
- package/es/packages/vue/src/components/forms/text/Text.vue.mjs +81 -8
- package/es/packages/vue/src/components/table/Pagination.vue.mjs +3 -2
- package/es/packages/vue/src/components/table/Table.vue.mjs +59 -18
- package/es/packages/vue/src/components/table/TableColumn.vue.mjs +32 -17
- package/es/packages/vue/src/components/table/TableFilter.vue.mjs +8 -5
- package/es/packages/vue/src/components/table/index.mjs +2 -2
- package/es/packages/vue/src/composables/usePageEvents.mjs +14 -6
- package/es/packages/vue/src/utils/common.mjs +5 -0
- package/es/packages/vue/src/utils/eventFlow/actionHandlers.mjs +48 -3
- package/es/packages/vue/src/utils/eventFlow/eventFlowHandler.mjs +58 -26
- package/es/packages/vue/src/utils/eventFlowParser.mjs +9 -6
- package/es/packages/vue/src/utils/formulajs/calculate.mjs +1 -1
- package/es/vue.css +293 -208
- 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
- package/lib/packages/mobile/src/components/base/card/Card.vue.js +2 -2
- package/lib/packages/vue/index.js +1 -1
- package/lib/packages/vue/src/components/details/footer/Footer.vue.js +19 -11
- package/lib/packages/vue/src/components/dialog/DialogRenderer.vue2.js +403 -0
- package/lib/packages/vue/src/components/dialog/index.js +68 -0
- package/lib/packages/vue/src/components/forms/form/Form.vue.js +50 -19
- package/lib/packages/vue/src/components/forms/formItem/FormItem.vue.js +10 -4
- package/lib/packages/vue/src/components/forms/subForm/SubForm.vue.js +6 -1
- package/lib/packages/vue/src/components/forms/subTable/SubTable.vue.js +0 -1
- package/lib/packages/vue/src/components/forms/text/Text.vue.js +80 -7
- package/lib/packages/vue/src/components/table/Pagination.vue.js +3 -2
- package/lib/packages/vue/src/components/table/Table.vue.js +59 -18
- package/lib/packages/vue/src/components/table/TableColumn.vue.js +31 -16
- package/lib/packages/vue/src/components/table/TableFilter.vue.js +8 -5
- package/lib/packages/vue/src/composables/usePageEvents.js +14 -6
- package/lib/packages/vue/src/utils/common.js +5 -0
- package/lib/packages/vue/src/utils/eventFlow/actionHandlers.js +56 -11
- package/lib/packages/vue/src/utils/eventFlow/eventFlowHandler.js +58 -26
- package/lib/packages/vue/src/utils/eventFlowParser.js +9 -6
- package/lib/packages/vue/src/utils/formulajs/calculate.js +1 -1
- package/lib/vue.css +293 -208
- package/package.json +1 -1
|
@@ -3,14 +3,26 @@ 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$
|
|
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
|
+
if ((dialogDoms == null ? void 0 : dialogDoms.length) > 0) {
|
|
17
|
+
for (let i in dialogDoms) {
|
|
18
|
+
if (!dialogDoms[i].style.display) {
|
|
19
|
+
return {
|
|
20
|
+
success: true,
|
|
21
|
+
message: "页面存在弹层,跳过页面跳转"
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
}
|
|
14
26
|
const basic = node.basic || {};
|
|
15
27
|
const transitionType = basic.transitionType || "page";
|
|
16
28
|
const params = parseRouteParams.parseRouteParams(basic.routeParams, data, fields);
|
|
@@ -80,7 +92,7 @@ async function handlePageGoBack(node, data, fields, context) {
|
|
|
80
92
|
};
|
|
81
93
|
if (config.showConfirm) {
|
|
82
94
|
try {
|
|
83
|
-
await index$
|
|
95
|
+
await index$2.ElMessageBox.confirm(
|
|
84
96
|
config.confirmMessage,
|
|
85
97
|
config.confirmTitle,
|
|
86
98
|
{
|
|
@@ -135,7 +147,7 @@ async function handleApiCall(node, data, fields, context, params) {
|
|
|
135
147
|
message: "数据源配置不完整,缺少 dataSourceId"
|
|
136
148
|
};
|
|
137
149
|
}
|
|
138
|
-
const dataSources = context.dataSources || [];
|
|
150
|
+
const dataSources = context.localConfig.dataSources || [];
|
|
139
151
|
const dataSourceConfig = dataSources.find((ds) => ds.id === basic.dataSourceId);
|
|
140
152
|
if (!dataSourceConfig) {
|
|
141
153
|
return {
|
|
@@ -186,7 +198,7 @@ async function handleConfirm(node, data, fields, context) {
|
|
|
186
198
|
cancelAction: basic.cancelAction || "stop"
|
|
187
199
|
};
|
|
188
200
|
try {
|
|
189
|
-
await index$
|
|
201
|
+
await index$2.ElMessageBox.confirm(
|
|
190
202
|
config.message,
|
|
191
203
|
config.title,
|
|
192
204
|
{
|
|
@@ -228,17 +240,17 @@ async function handleMessage(node, data, fields, context) {
|
|
|
228
240
|
const message = node.basic.message || "操作成功";
|
|
229
241
|
switch (messageType) {
|
|
230
242
|
case "success":
|
|
231
|
-
index.ElMessage.success(message);
|
|
243
|
+
index$1.ElMessage.success(message);
|
|
232
244
|
break;
|
|
233
245
|
case "warning":
|
|
234
|
-
index.ElMessage.warning(message);
|
|
246
|
+
index$1.ElMessage.warning(message);
|
|
235
247
|
break;
|
|
236
248
|
case "error":
|
|
237
|
-
index.ElMessage.error(message);
|
|
249
|
+
index$1.ElMessage.error(message);
|
|
238
250
|
break;
|
|
239
251
|
case "info":
|
|
240
252
|
default:
|
|
241
|
-
index.ElMessage.info(message);
|
|
253
|
+
index$1.ElMessage.info(message);
|
|
242
254
|
break;
|
|
243
255
|
}
|
|
244
256
|
}
|
|
@@ -291,7 +303,9 @@ async function handleFormSetValue(node, data, fields, context) {
|
|
|
291
303
|
console.error("form-setValue: 缺少 dataSourceId 配置");
|
|
292
304
|
return;
|
|
293
305
|
}
|
|
294
|
-
const
|
|
306
|
+
const metadata = context.metadata || {};
|
|
307
|
+
const initSearchData = (metadata == null ? void 0 : metadata.initSearchData) || {};
|
|
308
|
+
const result = await handleApiCall(node, data, fields, context, initSearchData);
|
|
295
309
|
if (!result.success) {
|
|
296
310
|
return result;
|
|
297
311
|
}
|
|
@@ -418,6 +432,35 @@ async function handleFormSubmit(node, data, fields, context) {
|
|
|
418
432
|
};
|
|
419
433
|
}
|
|
420
434
|
}
|
|
435
|
+
async function handleDialog(node, data, fields, context) {
|
|
436
|
+
const basic = node.basic || {};
|
|
437
|
+
if (!(basic == null ? void 0 : basic.dialogId)) {
|
|
438
|
+
console.error("ui-dialog: 缺少 dialogId 配置");
|
|
439
|
+
return;
|
|
440
|
+
}
|
|
441
|
+
const dialogList = context.localConfig.dialogs || [];
|
|
442
|
+
const dialog = dialogList.find((item) => item.id == (basic == null ? void 0 : basic.dialogId));
|
|
443
|
+
if (!dialog) {
|
|
444
|
+
console.error("ui-dialog: 未找到匹配的弹层配置," + (basic == null ? void 0 : basic.dialogId));
|
|
445
|
+
return;
|
|
446
|
+
}
|
|
447
|
+
index.openDialog(
|
|
448
|
+
null,
|
|
449
|
+
dialog,
|
|
450
|
+
context.instance,
|
|
451
|
+
context.ctx,
|
|
452
|
+
fields,
|
|
453
|
+
data
|
|
454
|
+
).then((result) => {
|
|
455
|
+
console.log("确定", result);
|
|
456
|
+
}).catch(() => {
|
|
457
|
+
console.log("取消");
|
|
458
|
+
});
|
|
459
|
+
return {
|
|
460
|
+
success: true,
|
|
461
|
+
message: `弹层 ${dialog.name} 已打开`
|
|
462
|
+
};
|
|
463
|
+
}
|
|
421
464
|
const defaultActionHandlers = {
|
|
422
465
|
"page-jump": handlePageJump,
|
|
423
466
|
"page-go-back": handlePageGoBack,
|
|
@@ -427,13 +470,15 @@ const defaultActionHandlers = {
|
|
|
427
470
|
"table-refresh": handleTableRefresh,
|
|
428
471
|
"form-setValue": handleFormSetValue,
|
|
429
472
|
"form-submit": handleFormSubmit,
|
|
430
|
-
"custom": handleCustomAction
|
|
473
|
+
"custom": handleCustomAction,
|
|
474
|
+
"ui-dialog": handleDialog
|
|
431
475
|
};
|
|
432
476
|
exports.default = defaultActionHandlers;
|
|
433
477
|
exports.defaultActionHandlers = defaultActionHandlers;
|
|
434
478
|
exports.handleApiCall = handleApiCall;
|
|
435
479
|
exports.handleConfirm = handleConfirm;
|
|
436
480
|
exports.handleCustomAction = handleCustomAction;
|
|
481
|
+
exports.handleDialog = handleDialog;
|
|
437
482
|
exports.handleMessage = handleMessage;
|
|
438
483
|
exports.handlePageGoBack = handlePageGoBack;
|
|
439
484
|
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
|
-
|
|
48
|
+
instance = null,
|
|
8
49
|
onSuccess,
|
|
9
50
|
onError,
|
|
10
|
-
|
|
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
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
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
|
-
|
|
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
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
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;
|