@fecp/designer 5.3.9 → 5.3.11
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/designer.css +270 -235
- package/es/node_modules/.pnpm/@element-plus_icons-vue@2.3.2_vue@3.5.13_typescript@5.7.3_/node_modules/@element-plus/icons-vue/dist/index.mjs +20 -0
- package/es/packages/designer/package.json.mjs +1 -1
- package/es/packages/designer/src/components/FieldSetMapping.vue2.mjs +3 -1
- package/es/packages/designer/src/layout/header/index.vue.mjs +4 -0
- package/es/packages/designer/src/packages/dataSource/dataSource.vue.mjs +65 -45
- package/es/packages/designer/src/packages/dialogGlobal/index.vue.mjs +2 -0
- package/es/packages/designer/src/packages/event/index.vue2.mjs +3 -1
- package/es/packages/designer/src/packages/eventFlow/dialog/action/Upload.vue2.mjs +179 -0
- package/es/packages/designer/src/packages/eventFlow/dialog/action/config.mjs +18 -3
- package/es/packages/designer/src/packages/form/index.vue.mjs +29 -110
- package/es/packages/designer/src/packages/table/headerBtn.vue.mjs +2 -0
- package/es/packages/designer/src/packages/table/index.vue.mjs +2 -1
- package/es/packages/designer/src/packages/table/property/optBtn.vue.mjs +0 -9
- package/es/packages/designer/src/packages/table/queryModule/index.vue.mjs +3 -1
- package/es/packages/designer/src/packages/table/tableSetting.vue.mjs +2 -1
- package/es/packages/mobile/src/components/base/card/Card.vue.mjs +2 -2
- package/es/packages/vue/src/utils/datasource.mjs +4 -0
- package/es/packages/vue/src/utils/eventFlow/actionHandlers.mjs +105 -5
- package/lib/designer.css +270 -235
- package/lib/node_modules/.pnpm/@element-plus_icons-vue@2.3.2_vue@3.5.13_typescript@5.7.3_/node_modules/@element-plus/icons-vue/dist/index.js +20 -0
- package/lib/packages/designer/package.json.js +1 -1
- package/lib/packages/designer/src/components/FieldSetMapping.vue2.js +3 -1
- package/lib/packages/designer/src/layout/header/index.vue.js +4 -0
- package/lib/packages/designer/src/packages/dataSource/dataSource.vue.js +64 -44
- package/lib/packages/designer/src/packages/dialogGlobal/index.vue.js +2 -0
- package/lib/packages/designer/src/packages/event/index.vue2.js +3 -1
- package/lib/packages/designer/src/packages/eventFlow/dialog/action/Upload.vue2.js +179 -0
- package/lib/packages/designer/src/packages/eventFlow/dialog/action/config.js +18 -3
- package/lib/packages/designer/src/packages/form/index.vue.js +32 -113
- package/lib/packages/designer/src/packages/table/headerBtn.vue.js +2 -0
- package/lib/packages/designer/src/packages/table/index.vue.js +2 -1
- package/lib/packages/designer/src/packages/table/property/optBtn.vue.js +0 -9
- package/lib/packages/designer/src/packages/table/queryModule/index.vue.js +3 -1
- package/lib/packages/designer/src/packages/table/tableSetting.vue.js +2 -1
- package/lib/packages/mobile/src/components/base/card/Card.vue.js +2 -2
- package/lib/packages/vue/src/utils/datasource.js +4 -0
- package/lib/packages/vue/src/utils/eventFlow/actionHandlers.js +104 -4
- package/package.json +1 -1
|
@@ -2,13 +2,6 @@
|
|
|
2
2
|
/* empty css */
|
|
3
3
|
/* empty css */
|
|
4
4
|
/* empty css */
|
|
5
|
-
/* empty css */
|
|
6
|
-
/* empty css */
|
|
7
|
-
/* empty css */
|
|
8
|
-
/* empty css */
|
|
9
|
-
import "../../../../../node_modules/.pnpm/element-plus@2.13.2_vue@3.5.13_typescript@5.7.3_/node_modules/element-plus/theme-chalk/el-dropdown-menu.css.mjs";
|
|
10
|
-
/* empty css */
|
|
11
|
-
/* empty css */
|
|
12
5
|
import { computed, ref, watch, resolveComponent, createElementBlock, openBlock, createVNode, createElementVNode, withCtx, unref, normalizeStyle, createCommentVNode, withModifiers, normalizeClass, createBlock, toDisplayString, createTextVNode, nextTick } from "vue";
|
|
13
6
|
import emitter from "../utils/eventBus.mjs";
|
|
14
7
|
import "../../../../../node_modules/.pnpm/grid-layout-plus@1.1.1_vue@3.5.13_typescript@5.7.3_/node_modules/grid-layout-plus/es/index.mjs";
|
|
@@ -22,7 +15,7 @@ import H2Wrapper from "./components/H2Wrapper.vue.mjs";
|
|
|
22
15
|
import SubForm from "./components/SubForm.vue.mjs";
|
|
23
16
|
import ApprovalHistory from "./components/ApprovalHistory.vue.mjs";
|
|
24
17
|
import SubTable from "./components/SubTable.vue.mjs";
|
|
25
|
-
import { StarFilled as star_filled_default, Star as star_default,
|
|
18
|
+
import { StarFilled as star_filled_default, Star as star_default, Lock as lock_default, Unlock as unlock_default, Delete as delete_default, View as view_default } from "../../../../../node_modules/.pnpm/@element-plus_icons-vue@2.3.2_vue@3.5.13_typescript@5.7.3_/node_modules/@element-plus/icons-vue/dist/index.mjs";
|
|
26
19
|
import { getEditConfigData, setSelectedItem, setHoverItem, getCurrentClass, isSelectedItem } from "../utils/common.mjs";
|
|
27
20
|
import { throttle as eo } from "../../../../../node_modules/.pnpm/@vexip-ui_utils@2.16.4/node_modules/@vexip-ui/utils/dist/index.mjs";
|
|
28
21
|
/* empty css */
|
|
@@ -33,9 +26,6 @@ import { ElScrollbar } from "../../../../../node_modules/.pnpm/element-plus@2.13
|
|
|
33
26
|
import { ElForm } from "../../../../../node_modules/.pnpm/element-plus@2.13.2_vue@3.5.13_typescript@5.7.3_/node_modules/element-plus/es/components/form/index.mjs";
|
|
34
27
|
import De from "../../../../../node_modules/.pnpm/grid-layout-plus@1.1.1_vue@3.5.13_typescript@5.7.3_/node_modules/grid-layout-plus/es/components/grid-layout.vue.mjs";
|
|
35
28
|
import { ElIcon } from "../../../../../node_modules/.pnpm/element-plus@2.13.2_vue@3.5.13_typescript@5.7.3_/node_modules/element-plus/es/components/icon/index.mjs";
|
|
36
|
-
import { ElDropdown, ElDropdownMenu } from "../../../../../node_modules/.pnpm/element-plus@2.13.2_vue@3.5.13_typescript@5.7.3_/node_modules/element-plus/es/components/dropdown/index.mjs";
|
|
37
|
-
import { ElInput } from "../../../../../node_modules/.pnpm/element-plus@2.13.2_vue@3.5.13_typescript@5.7.3_/node_modules/element-plus/es/components/input/index.mjs";
|
|
38
|
-
import { ElCheckbox } from "../../../../../node_modules/.pnpm/element-plus@2.13.2_vue@3.5.13_typescript@5.7.3_/node_modules/element-plus/es/components/checkbox/index.mjs";
|
|
39
29
|
import { ElDivider } from "../../../../../node_modules/.pnpm/element-plus@2.13.2_vue@3.5.13_typescript@5.7.3_/node_modules/element-plus/es/components/divider/index.mjs";
|
|
40
30
|
import { ElMessage } from "../../../../../node_modules/.pnpm/element-plus@2.13.2_vue@3.5.13_typescript@5.7.3_/node_modules/element-plus/es/components/message/index.mjs";
|
|
41
31
|
const _hoisted_1 = { class: "form-work-area" };
|
|
@@ -46,22 +36,19 @@ const _hoisted_4 = {
|
|
|
46
36
|
class: "component-toolbar"
|
|
47
37
|
};
|
|
48
38
|
const _hoisted_5 = ["onClick"];
|
|
49
|
-
const _hoisted_6 =
|
|
50
|
-
const _hoisted_7 =
|
|
51
|
-
const _hoisted_8 =
|
|
52
|
-
const _hoisted_9 = { class: "
|
|
53
|
-
const _hoisted_10 =
|
|
54
|
-
const _hoisted_11 = ["onClick"];
|
|
55
|
-
const _hoisted_12 = { class: "status-tags" };
|
|
56
|
-
const _hoisted_13 = {
|
|
39
|
+
const _hoisted_6 = ["onClick"];
|
|
40
|
+
const _hoisted_7 = ["onClick"];
|
|
41
|
+
const _hoisted_8 = ["onClick"];
|
|
42
|
+
const _hoisted_9 = { class: "status-tags" };
|
|
43
|
+
const _hoisted_10 = {
|
|
57
44
|
key: 0,
|
|
58
45
|
class: "field-name-tag"
|
|
59
46
|
};
|
|
60
|
-
const
|
|
47
|
+
const _hoisted_11 = {
|
|
61
48
|
key: 1,
|
|
62
49
|
class: "status-tag disabled-tag"
|
|
63
50
|
};
|
|
64
|
-
const
|
|
51
|
+
const _hoisted_12 = {
|
|
65
52
|
key: 2,
|
|
66
53
|
class: "status-tag readonly-tag"
|
|
67
54
|
};
|
|
@@ -317,13 +304,7 @@ const _sfc_main = {
|
|
|
317
304
|
emitter.on("resizeEvent", () => {
|
|
318
305
|
gridLayout.value.resizeEvent();
|
|
319
306
|
});
|
|
320
|
-
|
|
321
|
-
function getDropdownVisible(itemId) {
|
|
322
|
-
return dropdownVisibleMap.value.get(itemId) || false;
|
|
323
|
-
}
|
|
324
|
-
function setDropdownVisible(itemId, visible) {
|
|
325
|
-
dropdownVisibleMap.value.set(itemId, visible);
|
|
326
|
-
}
|
|
307
|
+
ref(/* @__PURE__ */ new Map());
|
|
327
308
|
const isDragging = computed(() => {
|
|
328
309
|
var _a;
|
|
329
310
|
return ((_a = gridLayout.value) == null ? void 0 : _a.state.isDragging) || false;
|
|
@@ -343,10 +324,6 @@ const _sfc_main = {
|
|
|
343
324
|
});
|
|
344
325
|
return (_ctx, _cache) => {
|
|
345
326
|
const _component_el_icon = ElIcon;
|
|
346
|
-
const _component_el_input = ElInput;
|
|
347
|
-
const _component_el_checkbox = ElCheckbox;
|
|
348
|
-
const _component_el_dropdown_menu = ElDropdownMenu;
|
|
349
|
-
const _component_el_dropdown = ElDropdown;
|
|
350
327
|
const _component_Hide = resolveComponent("Hide");
|
|
351
328
|
const _component_el_divider = ElDivider;
|
|
352
329
|
const _component_el_form = ElForm;
|
|
@@ -411,76 +388,18 @@ const _sfc_main = {
|
|
|
411
388
|
_: 2
|
|
412
389
|
}, 1024)
|
|
413
390
|
], 10, _hoisted_5),
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
_cache[3] || (_cache[3] = createElementVNode("span", { class: "setting-label" }, "标题:", -1)),
|
|
427
|
-
createVNode(_component_el_input, {
|
|
428
|
-
modelValue: item.component.label,
|
|
429
|
-
"onUpdate:modelValue": ($event) => item.component.label = $event,
|
|
430
|
-
size: "small",
|
|
431
|
-
class: "setting-input"
|
|
432
|
-
}, null, 8, ["modelValue", "onUpdate:modelValue"])
|
|
433
|
-
]),
|
|
434
|
-
createElementVNode("div", _hoisted_8, [
|
|
435
|
-
_cache[4] || (_cache[4] = createElementVNode("span", { class: "setting-label" }, "字段:", -1)),
|
|
436
|
-
createVNode(_component_el_input, {
|
|
437
|
-
modelValue: item.component.fieldName,
|
|
438
|
-
"onUpdate:modelValue": ($event) => item.component.fieldName = $event,
|
|
439
|
-
size: "small",
|
|
440
|
-
class: "setting-input"
|
|
441
|
-
}, null, 8, ["modelValue", "onUpdate:modelValue"])
|
|
442
|
-
]),
|
|
443
|
-
createElementVNode("div", _hoisted_9, [
|
|
444
|
-
createVNode(_component_el_checkbox, {
|
|
445
|
-
modelValue: item.component.required,
|
|
446
|
-
"onUpdate:modelValue": ($event) => item.component.required = $event,
|
|
447
|
-
label: "必填",
|
|
448
|
-
size: "small"
|
|
449
|
-
}, null, 8, ["modelValue", "onUpdate:modelValue"]),
|
|
450
|
-
createVNode(_component_el_checkbox, {
|
|
451
|
-
modelValue: item.component.readOnly,
|
|
452
|
-
"onUpdate:modelValue": ($event) => item.component.readOnly = $event,
|
|
453
|
-
label: "只读",
|
|
454
|
-
size: "small"
|
|
455
|
-
}, null, 8, ["modelValue", "onUpdate:modelValue"]),
|
|
456
|
-
createVNode(_component_el_checkbox, {
|
|
457
|
-
modelValue: item.component.disabled,
|
|
458
|
-
"onUpdate:modelValue": ($event) => item.component.disabled = $event,
|
|
459
|
-
label: "禁用",
|
|
460
|
-
size: "small"
|
|
461
|
-
}, null, 8, ["modelValue", "onUpdate:modelValue"])
|
|
462
|
-
])
|
|
463
|
-
])
|
|
464
|
-
]),
|
|
465
|
-
_: 2
|
|
466
|
-
}, 1024)) : createCommentVNode("", true)
|
|
467
|
-
]),
|
|
468
|
-
default: withCtx(() => [
|
|
469
|
-
item.component.fieldType != "blank" ? (openBlock(), createElementBlock("span", {
|
|
470
|
-
key: 0,
|
|
471
|
-
class: normalizeClass(["toolbar-btn settings-btn", { "is-active": getDropdownVisible(item.id) }]),
|
|
472
|
-
title: "快捷设置"
|
|
473
|
-
}, [
|
|
474
|
-
createVNode(_component_el_icon, null, {
|
|
475
|
-
default: withCtx(() => [
|
|
476
|
-
createVNode(unref(setting_default))
|
|
477
|
-
]),
|
|
478
|
-
_: 1
|
|
479
|
-
})
|
|
480
|
-
], 2)) : createCommentVNode("", true)
|
|
481
|
-
]),
|
|
482
|
-
_: 2
|
|
483
|
-
}, 1032, ["popper-class", "onVisibleChange"]),
|
|
391
|
+
createElementVNode("span", {
|
|
392
|
+
class: normalizeClass(["toolbar-btn disabled-btn", { "is-disabled": item.component.disabled }]),
|
|
393
|
+
title: "设置只读",
|
|
394
|
+
onClick: withModifiers(($event) => item.component.disabled = !item.component.disabled, ["stop"])
|
|
395
|
+
}, [
|
|
396
|
+
createVNode(_component_el_icon, null, {
|
|
397
|
+
default: withCtx(() => [
|
|
398
|
+
item.component.disabled ? (openBlock(), createBlock(unref(lock_default), { key: 0 })) : (openBlock(), createBlock(unref(unlock_default), { key: 1 }))
|
|
399
|
+
]),
|
|
400
|
+
_: 2
|
|
401
|
+
}, 1024)
|
|
402
|
+
], 10, _hoisted_6),
|
|
484
403
|
createElementVNode("span", {
|
|
485
404
|
class: "toolbar-btn settings-btn",
|
|
486
405
|
title: "放进隐藏域",
|
|
@@ -492,7 +411,7 @@ const _sfc_main = {
|
|
|
492
411
|
]),
|
|
493
412
|
_: 1
|
|
494
413
|
})
|
|
495
|
-
], 8,
|
|
414
|
+
], 8, _hoisted_7),
|
|
496
415
|
createElementVNode("span", {
|
|
497
416
|
class: "toolbar-btn delete-btn",
|
|
498
417
|
title: "删除组件",
|
|
@@ -504,18 +423,18 @@ const _sfc_main = {
|
|
|
504
423
|
]),
|
|
505
424
|
_: 1
|
|
506
425
|
})
|
|
507
|
-
], 8,
|
|
426
|
+
], 8, _hoisted_8)
|
|
508
427
|
])) : createCommentVNode("", true),
|
|
509
|
-
createElementVNode("div",
|
|
510
|
-
editConfigData.value.showFieldName && item.component.fieldName ? (openBlock(), createElementBlock("div",
|
|
511
|
-
item.component.disabled ? (openBlock(), createElementBlock("div",
|
|
428
|
+
createElementVNode("div", _hoisted_9, [
|
|
429
|
+
editConfigData.value.showFieldName && item.component.fieldName ? (openBlock(), createElementBlock("div", _hoisted_10, toDisplayString(item.component.fieldType == "blank" ? "空白占位" : item.component.fieldName), 1)) : createCommentVNode("", true),
|
|
430
|
+
item.component.disabled ? (openBlock(), createElementBlock("div", _hoisted_11, [
|
|
512
431
|
createVNode(_component_el_icon, null, {
|
|
513
432
|
default: withCtx(() => [
|
|
514
433
|
createVNode(unref(lock_default))
|
|
515
434
|
]),
|
|
516
435
|
_: 1
|
|
517
436
|
})
|
|
518
|
-
])) : item.component.readOnly ? (openBlock(), createElementBlock("div",
|
|
437
|
+
])) : item.component.readOnly ? (openBlock(), createElementBlock("div", _hoisted_12, [
|
|
519
438
|
createVNode(_component_el_icon, null, {
|
|
520
439
|
default: withCtx(() => [
|
|
521
440
|
createVNode(unref(view_default))
|
|
@@ -552,7 +471,7 @@ const _sfc_main = {
|
|
|
552
471
|
key: 5,
|
|
553
472
|
"border-style": "dashed"
|
|
554
473
|
}, {
|
|
555
|
-
default: withCtx(() => _cache[
|
|
474
|
+
default: withCtx(() => _cache[3] || (_cache[3] = [
|
|
556
475
|
createTextVNode(" 此处为分割线,阻止下方组件自动向上补齐,解析时不显示 ")
|
|
557
476
|
])),
|
|
558
477
|
_: 1
|
|
@@ -580,7 +499,7 @@ const _sfc_main = {
|
|
|
580
499
|
};
|
|
581
500
|
}
|
|
582
501
|
};
|
|
583
|
-
const formWorkArea = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-
|
|
502
|
+
const formWorkArea = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-1d0d8388"]]);
|
|
584
503
|
export {
|
|
585
504
|
formWorkArea as default
|
|
586
505
|
};
|
|
@@ -74,6 +74,8 @@ import "../../axios/config.mjs";
|
|
|
74
74
|
import "../../../../../_virtual/FileSaver.min.mjs";
|
|
75
75
|
import "../../../../../_virtual/index.mjs";
|
|
76
76
|
/* empty css */
|
|
77
|
+
/* empty css */
|
|
78
|
+
/* empty css */
|
|
77
79
|
import { useAdvancedFilterDialog } from "../advancedFilter/useAdvancedFilterDialog.mjs";
|
|
78
80
|
/* empty css */
|
|
79
81
|
/* empty css */
|
|
@@ -259,6 +259,7 @@ const _sfc_main = {
|
|
|
259
259
|
]),
|
|
260
260
|
createElementVNode("div", _hoisted_10, [
|
|
261
261
|
createVNode(_component_el_dropdown, {
|
|
262
|
+
"max-height": 500,
|
|
262
263
|
"popper-class": `quick-operation-dropdown-${item.id}`,
|
|
263
264
|
trigger: "click",
|
|
264
265
|
placement: "bottom",
|
|
@@ -468,7 +469,7 @@ const _sfc_main = {
|
|
|
468
469
|
};
|
|
469
470
|
}
|
|
470
471
|
};
|
|
471
|
-
const tableWorkArea = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-
|
|
472
|
+
const tableWorkArea = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-f581ce52"]]);
|
|
472
473
|
export {
|
|
473
474
|
tableWorkArea as default
|
|
474
475
|
};
|
|
@@ -83,15 +83,6 @@ const _sfc_main = {
|
|
|
83
83
|
]),
|
|
84
84
|
_: 1
|
|
85
85
|
}),
|
|
86
|
-
createVNode(_component_el_form_item, { label: "显示条件" }, {
|
|
87
|
-
default: withCtx(() => [
|
|
88
|
-
createVNode(ConditionConfigButton, {
|
|
89
|
-
condition: unref(currentItem).showCondition,
|
|
90
|
-
onConfirm: (data) => unref(currentItem).showCondition = data
|
|
91
|
-
}, null, 8, ["condition", "onConfirm"])
|
|
92
|
-
]),
|
|
93
|
-
_: 1
|
|
94
|
-
}),
|
|
95
86
|
createVNode(_component_el_form_item, { label: "风格" }, {
|
|
96
87
|
default: withCtx(() => [
|
|
97
88
|
createVNode(_component_el_select, {
|
|
@@ -263,6 +263,7 @@ const _sfc_main = {
|
|
|
263
263
|
queryConfig.value.mode === "dynamic" ? (openBlock(), createElementBlock(Fragment, { key: 1 }, [
|
|
264
264
|
createVNode(_component_el_divider, { direction: "vertical" }),
|
|
265
265
|
createVNode(_component_el_dropdown, {
|
|
266
|
+
"max-height": 500,
|
|
266
267
|
trigger: "click",
|
|
267
268
|
"popper-class": "tab-config-dropdown",
|
|
268
269
|
onVisibleChange: _cache[7] || (_cache[7] = (visible) => tabConfigDropdownVisible.value = visible)
|
|
@@ -384,6 +385,7 @@ const _sfc_main = {
|
|
|
384
385
|
}),
|
|
385
386
|
createVNode(_component_el_divider, { direction: "vertical" }),
|
|
386
387
|
createVNode(_component_el_dropdown, {
|
|
388
|
+
"max-height": 500,
|
|
387
389
|
trigger: "click",
|
|
388
390
|
placement: "bottom",
|
|
389
391
|
"hide-on-click": false
|
|
@@ -551,7 +553,7 @@ const _sfc_main = {
|
|
|
551
553
|
};
|
|
552
554
|
}
|
|
553
555
|
};
|
|
554
|
-
const QueryModule = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-
|
|
556
|
+
const QueryModule = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-e569e134"]]);
|
|
555
557
|
export {
|
|
556
558
|
QueryModule as default
|
|
557
559
|
};
|
|
@@ -269,6 +269,7 @@ const _sfc_main = {
|
|
|
269
269
|
]),
|
|
270
270
|
createElementVNode("div", _hoisted_3, [
|
|
271
271
|
createVNode(_component_el_dropdown, {
|
|
272
|
+
"max-height": 500,
|
|
272
273
|
trigger: "click",
|
|
273
274
|
"popper-class": "sort-config-dropdown",
|
|
274
275
|
onVisibleChange: _cache[6] || (_cache[6] = (visible) => sortConfigDropdownVisible.value = visible)
|
|
@@ -464,7 +465,7 @@ const _sfc_main = {
|
|
|
464
465
|
};
|
|
465
466
|
}
|
|
466
467
|
};
|
|
467
|
-
const TableSetting = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-
|
|
468
|
+
const TableSetting = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-70f62793"]]);
|
|
468
469
|
export {
|
|
469
470
|
TableSetting as default
|
|
470
471
|
};
|
|
@@ -6,13 +6,13 @@
|
|
|
6
6
|
/* empty css */
|
|
7
7
|
/* empty css */
|
|
8
8
|
import { createBlock, openBlock, withCtx, createVNode, renderSlot } from "vue";
|
|
9
|
-
/* empty css */
|
|
10
|
-
import _export_sfc from "../../../../../../_virtual/_plugin-vue_export-helper.mjs";
|
|
11
9
|
/* empty css */
|
|
12
10
|
/* empty css */
|
|
13
11
|
/* empty css */
|
|
14
12
|
/* empty css */
|
|
15
13
|
/* empty css */
|
|
14
|
+
/* empty css */
|
|
15
|
+
import _export_sfc from "../../../../../../_virtual/_plugin-vue_export-helper.mjs";
|
|
16
16
|
import { SwipeCell } from "../../../../../../node_modules/.pnpm/vant@4.9.17_vue@3.5.13_typescript@5.7.3_/node_modules/vant/es/swipe-cell/index.mjs";
|
|
17
17
|
import { showConfirmDialog } from "../../../../../../node_modules/.pnpm/vant@4.9.17_vue@3.5.13_typescript@5.7.3_/node_modules/vant/es/dialog/function-call.mjs";
|
|
18
18
|
import "../../../../../../node_modules/.pnpm/vant@4.9.17_vue@3.5.13_typescript@5.7.3_/node_modules/vant/es/dialog/index.mjs";
|
|
@@ -152,6 +152,10 @@ class DataSourceManager {
|
|
|
152
152
|
case "post":
|
|
153
153
|
if (currentDs.contentType === "formData") {
|
|
154
154
|
response = await this.http.postForm(url, params, requestConfig);
|
|
155
|
+
} else if (currentDs.contentType === "download") {
|
|
156
|
+
await this.http.download(url, params, requestConfig);
|
|
157
|
+
} else if (currentDs.contentType === "upload") {
|
|
158
|
+
response = await this.http.upload(url, params, requestConfig);
|
|
155
159
|
} else {
|
|
156
160
|
response = await this.http.post(url, params, requestConfig);
|
|
157
161
|
}
|
|
@@ -378,7 +378,7 @@ async function handleCustomAction(node, data, fields, context) {
|
|
|
378
378
|
};
|
|
379
379
|
}
|
|
380
380
|
async function handleFormSetValue(node, data, fields, context) {
|
|
381
|
-
var _a, _b, _c;
|
|
381
|
+
var _a, _b, _c, _d;
|
|
382
382
|
const basic = node.basic || {};
|
|
383
383
|
if (!(basic == null ? void 0 : basic.dataSourceId)) {
|
|
384
384
|
console.error("form-setValue: 缺少 dataSourceId 配置");
|
|
@@ -408,8 +408,8 @@ async function handleFormSetValue(node, data, fields, context) {
|
|
|
408
408
|
formData = removeEmptyValues(formData);
|
|
409
409
|
delete formData.pageNo;
|
|
410
410
|
delete formData.pageSize;
|
|
411
|
-
const formComponent = (_a = context.components) == null ? void 0 : _a.form;
|
|
412
|
-
const setFormDataMethod = (
|
|
411
|
+
const formComponent = ((_a = context.components) == null ? void 0 : _a.form) || ((_b = context.components) == null ? void 0 : _b.table);
|
|
412
|
+
const setFormDataMethod = (_d = (_c = formComponent == null ? void 0 : formComponent.$) == null ? void 0 : _c.exposed) == null ? void 0 : _d.setFormData;
|
|
413
413
|
if (typeof setFormDataMethod === "function") {
|
|
414
414
|
setFormDataMethod(formData);
|
|
415
415
|
return {
|
|
@@ -567,6 +567,104 @@ async function handleDialog(node, data, fields, context) {
|
|
|
567
567
|
};
|
|
568
568
|
}
|
|
569
569
|
}
|
|
570
|
+
async function handleUpload(node, data, fields, context) {
|
|
571
|
+
const basic = node.basic || {};
|
|
572
|
+
console.log("[EventFlow] 执行文件上传动作:", basic);
|
|
573
|
+
const dataSourceId = basic.dataSourceId || "";
|
|
574
|
+
const acceptType = basic.acceptType || [];
|
|
575
|
+
const maxSize = basic.maxSize || 0;
|
|
576
|
+
const multipleUpload = basic.multipleUpload || false;
|
|
577
|
+
if (!dataSourceId) {
|
|
578
|
+
return {
|
|
579
|
+
success: false,
|
|
580
|
+
message: "文件上传动作缺少必要的数据源配置(dataSourceId)",
|
|
581
|
+
shouldShowError: true
|
|
582
|
+
};
|
|
583
|
+
}
|
|
584
|
+
const acceptArr = [];
|
|
585
|
+
if (acceptType.includes("image")) {
|
|
586
|
+
acceptArr.push("image/*");
|
|
587
|
+
}
|
|
588
|
+
if (acceptType.includes("video")) {
|
|
589
|
+
acceptArr.push("video/*");
|
|
590
|
+
}
|
|
591
|
+
if (acceptType.includes("audio")) {
|
|
592
|
+
acceptArr.push("audio/*");
|
|
593
|
+
}
|
|
594
|
+
if (acceptType.includes("text")) {
|
|
595
|
+
acceptArr.push("text/plain");
|
|
596
|
+
}
|
|
597
|
+
if (acceptType.includes("doc")) {
|
|
598
|
+
acceptArr.push(".doc");
|
|
599
|
+
acceptArr.push(".docx");
|
|
600
|
+
}
|
|
601
|
+
if (acceptType.includes("xls")) {
|
|
602
|
+
acceptArr.push(".xls");
|
|
603
|
+
acceptArr.push(".xlsx");
|
|
604
|
+
}
|
|
605
|
+
if (acceptType.includes("ppt")) {
|
|
606
|
+
acceptArr.push(".ppt");
|
|
607
|
+
acceptArr.push(".pptx");
|
|
608
|
+
}
|
|
609
|
+
if (acceptType.includes("pdf")) {
|
|
610
|
+
acceptArr.push("application/pdf");
|
|
611
|
+
}
|
|
612
|
+
if (acceptType.includes("zip")) {
|
|
613
|
+
acceptArr.push("application/zip");
|
|
614
|
+
acceptArr.push("application/x-rar-compressed");
|
|
615
|
+
}
|
|
616
|
+
let accept = "";
|
|
617
|
+
if (acceptArr.length < 13) {
|
|
618
|
+
accept = acceptArr.join(",");
|
|
619
|
+
}
|
|
620
|
+
const files = await new Promise((resolve, reject) => {
|
|
621
|
+
const input = document.createElement("input");
|
|
622
|
+
input.type = "file";
|
|
623
|
+
input.multiple = multipleUpload;
|
|
624
|
+
input.accept = accept;
|
|
625
|
+
input.click();
|
|
626
|
+
input.onchange = () => {
|
|
627
|
+
let files2 = Array.from(input.files || []);
|
|
628
|
+
if (files2.length === 0) return resolve([]);
|
|
629
|
+
if (maxSize > 0) {
|
|
630
|
+
const maxByte = maxSize * 1024 * 1024;
|
|
631
|
+
const invalidFiles = files2.some((f) => f.size > maxByte);
|
|
632
|
+
if (invalidFiles) {
|
|
633
|
+
reject(new Error(`文件不能超过 ${maxSize}MB`));
|
|
634
|
+
return;
|
|
635
|
+
}
|
|
636
|
+
}
|
|
637
|
+
resolve(files2);
|
|
638
|
+
};
|
|
639
|
+
});
|
|
640
|
+
if (!files || files.length === 0) {
|
|
641
|
+
return { success: false, message: "未选择文件" };
|
|
642
|
+
}
|
|
643
|
+
try {
|
|
644
|
+
const params = multipleUpload ? { files } : { file: files[0] };
|
|
645
|
+
const result = await handleApiCall(node, data, fields, context, params);
|
|
646
|
+
if (!result.success) {
|
|
647
|
+
return result;
|
|
648
|
+
}
|
|
649
|
+
return {
|
|
650
|
+
success: true,
|
|
651
|
+
message: `文件上传成功'}`,
|
|
652
|
+
data: {
|
|
653
|
+
dataSourceId,
|
|
654
|
+
acceptType,
|
|
655
|
+
maxSize,
|
|
656
|
+
multipleUpload,
|
|
657
|
+
acceptType
|
|
658
|
+
}
|
|
659
|
+
};
|
|
660
|
+
} catch (error) {
|
|
661
|
+
return {
|
|
662
|
+
success: false,
|
|
663
|
+
message: "上传失败",
|
|
664
|
+
shouldShowError: true
|
|
665
|
+
};
|
|
666
|
+
}
|
|
667
|
+
}
|
|
570
668
|
const defaultActionHandlers = {
|
|
571
669
|
"page-jump": handlePageJump,
|
|
572
670
|
"page-go-back": handlePageGoBack,
|
|
@@ -579,7 +677,8 @@ const defaultActionHandlers = {
|
|
|
579
677
|
"form-setValue": handleFormSetValue,
|
|
580
678
|
"form-submit": handleFormSubmit,
|
|
581
679
|
"custom": handleCustomAction,
|
|
582
|
-
"ui-dialog": handleDialog
|
|
680
|
+
"ui-dialog": handleDialog,
|
|
681
|
+
"ui-upload": handleUpload
|
|
583
682
|
};
|
|
584
683
|
export {
|
|
585
684
|
defaultActionHandlers as default,
|
|
@@ -593,5 +692,6 @@ export {
|
|
|
593
692
|
handlePageJump,
|
|
594
693
|
handleTableChildRefresh,
|
|
595
694
|
handleTableRefresh,
|
|
596
|
-
handleTableRowDelete
|
|
695
|
+
handleTableRowDelete,
|
|
696
|
+
handleUpload
|
|
597
697
|
};
|