@duxweb/dvha-pro 1.0.33 → 1.0.35
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/dist/cjs/component.cjs +1 -1
- package/dist/cjs/components/chart/echart.cjs +1 -1
- package/dist/cjs/components/crop/imageCrop.cjs +1 -1
- package/dist/cjs/components/data/dynamicSelect.cjs +1 -1
- package/dist/cjs/components/data/selectModal.cjs +1 -1
- package/dist/cjs/components/designEditor/components/grid.cjs +1 -1
- package/dist/cjs/components/designEditor/editor/hook.cjs +1 -1
- package/dist/cjs/components/designEditor/editor.cjs +1 -1
- package/dist/cjs/components/form/pageForm.cjs +1 -1
- package/dist/cjs/components/form/pageTabForm.cjs +1 -1
- package/dist/cjs/components/form/settingForm.cjs +1 -1
- package/dist/cjs/components/formEditor/base/base.cjs +1 -1
- package/dist/cjs/components/formEditor/components/cascader.cjs +1 -1
- package/dist/cjs/components/formEditor/components/cascaderAsync.cjs +1 -1
- package/dist/cjs/components/formEditor/components/checkbox.cjs +1 -1
- package/dist/cjs/components/formEditor/components/color.cjs +1 -1
- package/dist/cjs/components/formEditor/components/date.cjs +1 -1
- package/dist/cjs/components/formEditor/components/dynamicInput.cjs +1 -1
- package/dist/cjs/components/formEditor/components/dynamicTags.cjs +1 -1
- package/dist/cjs/components/formEditor/components/editor.cjs +1 -1
- package/dist/cjs/components/formEditor/components/fileUpload.cjs +1 -0
- package/dist/cjs/components/formEditor/components/imageUpload.cjs +1 -0
- package/dist/cjs/components/formEditor/components/input.cjs +1 -1
- package/dist/cjs/components/formEditor/components/inputNumber.cjs +1 -1
- package/dist/cjs/components/formEditor/components/mentionAsync.cjs +1 -1
- package/dist/cjs/components/formEditor/components/radio.cjs +1 -1
- package/dist/cjs/components/formEditor/components/region.cjs +1 -1
- package/dist/cjs/components/formEditor/components/select.cjs +1 -1
- package/dist/cjs/components/formEditor/components/selectAsync.cjs +1 -1
- package/dist/cjs/components/formEditor/components/sider.cjs +1 -1
- package/dist/cjs/components/formEditor/components/switch.cjs +1 -1
- package/dist/cjs/components/formEditor/components/time.cjs +1 -1
- package/dist/cjs/components/formEditor/components/transferAsync.cjs +1 -1
- package/dist/cjs/components/formEditor/components/treeSelect.cjs +1 -1
- package/dist/cjs/components/formEditor/components/treeSelectAsync.cjs +1 -1
- package/dist/cjs/components/formEditor/editor.cjs +1 -1
- package/dist/cjs/components/formEditor/renderer.cjs +1 -1
- package/dist/cjs/components/icon/icon.cjs +1 -1
- package/dist/cjs/components/layout/list.cjs +1 -1
- package/dist/cjs/components/layout/table.cjs +1 -1
- package/dist/cjs/components/level/level.cjs +1 -1
- package/dist/cjs/components/table/table.cjs +1 -1
- package/dist/cjs/components/upload/config.cjs +1 -1
- package/dist/cjs/components/upload/file.cjs +1 -1
- package/dist/cjs/components/upload/image.cjs +1 -1
- package/dist/cjs/components/upload/manage/item.cjs +1 -1
- package/dist/cjs/components/upload/manager.cjs +1 -1
- package/dist/cjs/langs/en-US.json.cjs +1 -1
- package/dist/cjs/langs/zh-CN.json.cjs +1 -1
- package/dist/cjs/pages/authLayout.cjs +1 -1
- package/dist/cjs/pages/layout/page.cjs +1 -1
- package/dist/cjs/pages/menu/button.cjs +1 -1
- package/dist/cjs/pages/menu/cmd.cjs +1 -1
- package/dist/cjs/pages/menu/main.cjs +1 -1
- package/dist/cjs/pages/menu/mobile.cjs +1 -1
- package/dist/cjs/theme/uno.css.cjs +2 -1
- package/dist/esm/component.js +11 -11
- package/dist/esm/components/chart/echart.js +1 -1
- package/dist/esm/components/crop/imageCrop.js +1 -1
- package/dist/esm/components/data/dynamicSelect.js +1 -1
- package/dist/esm/components/data/selectModal.js +1 -1
- package/dist/esm/components/designEditor/components/grid.js +1 -1
- package/dist/esm/components/designEditor/editor/hook.js +17 -17
- package/dist/esm/components/designEditor/editor.js +6 -6
- package/dist/esm/components/form/pageForm.js +1 -1
- package/dist/esm/components/form/pageTabForm.js +1 -1
- package/dist/esm/components/form/settingForm.js +1 -1
- package/dist/esm/components/formEditor/base/base.js +1 -1
- package/dist/esm/components/formEditor/components/cascader.js +1 -1
- package/dist/esm/components/formEditor/components/cascaderAsync.js +1 -1
- package/dist/esm/components/formEditor/components/checkbox.js +1 -1
- package/dist/esm/components/formEditor/components/color.js +1 -1
- package/dist/esm/components/formEditor/components/date.js +1 -1
- package/dist/esm/components/formEditor/components/dynamicInput.js +1 -1
- package/dist/esm/components/formEditor/components/dynamicTags.js +1 -1
- package/dist/esm/components/formEditor/components/editor.js +1 -1
- package/dist/esm/components/formEditor/components/fileUpload.js +191 -0
- package/dist/esm/components/formEditor/components/imageUpload.js +182 -0
- package/dist/esm/components/formEditor/components/input.js +1 -1
- package/dist/esm/components/formEditor/components/inputNumber.js +1 -1
- package/dist/esm/components/formEditor/components/mentionAsync.js +1 -1
- package/dist/esm/components/formEditor/components/radio.js +1 -1
- package/dist/esm/components/formEditor/components/region.js +1 -1
- package/dist/esm/components/formEditor/components/select.js +1 -1
- package/dist/esm/components/formEditor/components/selectAsync.js +1 -1
- package/dist/esm/components/formEditor/components/sider.js +1 -1
- package/dist/esm/components/formEditor/components/switch.js +1 -1
- package/dist/esm/components/formEditor/components/time.js +1 -1
- package/dist/esm/components/formEditor/components/transferAsync.js +1 -1
- package/dist/esm/components/formEditor/components/treeSelect.js +1 -1
- package/dist/esm/components/formEditor/components/treeSelectAsync.js +1 -1
- package/dist/esm/components/formEditor/editor.js +26 -24
- package/dist/esm/components/formEditor/renderer.js +32 -30
- package/dist/esm/components/icon/icon.js +1 -1
- package/dist/esm/components/layout/list.js +1 -1
- package/dist/esm/components/layout/table.js +1 -1
- package/dist/esm/components/level/level.js +1 -1
- package/dist/esm/components/table/table.js +1 -1
- package/dist/esm/components/upload/config.js +13 -12
- package/dist/esm/components/upload/file.js +62 -57
- package/dist/esm/components/upload/image.js +51 -47
- package/dist/esm/components/upload/manage/item.js +3 -3
- package/dist/esm/components/upload/manager.js +92 -89
- package/dist/esm/langs/en-US.json.js +5 -5
- package/dist/esm/langs/zh-CN.json.js +6 -6
- package/dist/esm/pages/authLayout.js +1 -1
- package/dist/esm/pages/layout/page.js +1 -1
- package/dist/esm/pages/menu/button.js +1 -1
- package/dist/esm/pages/menu/cmd.js +1 -1
- package/dist/esm/pages/menu/main.js +1 -1
- package/dist/esm/pages/menu/mobile.js +1 -1
- package/dist/esm/theme/uno.css.js +2 -1
- package/dist/types/components/formEditor/components/fileUpload.d.ts +2 -0
- package/dist/types/components/formEditor/components/imageUpload.d.ts +2 -0
- package/dist/types/components/formEditor/components/index.d.ts +4 -2
- package/dist/types/components/upload/config.d.ts +4 -2
- package/dist/types/components/upload/file.d.ts +1 -0
- package/dist/types/components/upload/image.d.ts +2 -3
- package/dist/types/components/upload/manager.d.ts +1 -0
- package/dist/types/main.d.ts +1 -0
- package/package.json +3 -3
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { useI18n as h, useJsonSchema as
|
|
3
|
-
import { useVModel as
|
|
1
|
+
import { defineComponent as E, computed as c, createVNode as y } from "vue";
|
|
2
|
+
import { useI18n as h, useJsonSchema as g } from "@duxweb/dvha-core";
|
|
3
|
+
import { useVModel as b } from "@vueuse/core";
|
|
4
4
|
import { duxFormEditorGrid as A } from "../designEditor/components/grid.js";
|
|
5
5
|
import "clsx";
|
|
6
6
|
import "lodash-es";
|
|
@@ -59,27 +59,29 @@ import { duxFormEditorCascader as S } from "./components/cascader.js";
|
|
|
59
59
|
import { duxFormEditorCascaderAsync as v } from "./components/cascaderAsync.js";
|
|
60
60
|
import { duxFormEditorCheckbox as j } from "./components/checkbox.js";
|
|
61
61
|
import { duxFormEditorColor as D } from "./components/color.js";
|
|
62
|
-
import { duxFormEditorDate as
|
|
63
|
-
import { duxFormEditorDynamicInput as
|
|
64
|
-
import { duxFormEditorDynamicTags as
|
|
62
|
+
import { duxFormEditorDate as I } from "./components/date.js";
|
|
63
|
+
import { duxFormEditorDynamicInput as T } from "./components/dynamicInput.js";
|
|
64
|
+
import { duxFormEditorDynamicTags as C } from "./components/dynamicTags.js";
|
|
65
65
|
import { duxFormEditorAIEditor as M } from "./components/editor.js";
|
|
66
|
-
import {
|
|
67
|
-
import {
|
|
68
|
-
import {
|
|
69
|
-
import {
|
|
70
|
-
import {
|
|
71
|
-
import {
|
|
72
|
-
import {
|
|
73
|
-
import {
|
|
74
|
-
import {
|
|
75
|
-
import {
|
|
76
|
-
import {
|
|
77
|
-
import {
|
|
78
|
-
import {
|
|
66
|
+
import { duxFormEditorFileUpload as R } from "./components/fileUpload.js";
|
|
67
|
+
import { duxFormEditorImageUpload as J } from "./components/imageUpload.js";
|
|
68
|
+
import { duxFormEditorInput as N } from "./components/input.js";
|
|
69
|
+
import { duxFormEditorInputNumber as O } from "./components/inputNumber.js";
|
|
70
|
+
import { duxFormEditorMentionAsync as V } from "./components/mentionAsync.js";
|
|
71
|
+
import { duxFormEditorRadio as w } from "./components/radio.js";
|
|
72
|
+
import { duxFormEditorRegion as B } from "./components/region.js";
|
|
73
|
+
import { duxFormEditorSelect as P } from "./components/select.js";
|
|
74
|
+
import { duxFormEditorSelectAsync as U } from "./components/selectAsync.js";
|
|
75
|
+
import { duxFormEditorSider as k } from "./components/sider.js";
|
|
76
|
+
import { duxFormEditorSwitch as G } from "./components/switch.js";
|
|
77
|
+
import { duxFormEditorTime as q } from "./components/time.js";
|
|
78
|
+
import { duxFormEditorTransferAsync as z } from "./components/transferAsync.js";
|
|
79
|
+
import { duxFormEditorTreeSelect as H } from "./components/treeSelect.js";
|
|
80
|
+
import { duxFormEditorTreeSelectAsync as K } from "./components/treeSelectAsync.js";
|
|
79
81
|
import "@iconify-json/tabler/icons.json";
|
|
80
82
|
import "../posterEditor/elements/index.js";
|
|
81
83
|
import "fabric";
|
|
82
|
-
const
|
|
84
|
+
const Ao = /* @__PURE__ */ E({
|
|
83
85
|
name: "DuxFormRenderer",
|
|
84
86
|
props: {
|
|
85
87
|
data: {
|
|
@@ -108,12 +110,12 @@ const yo = /* @__PURE__ */ F({
|
|
|
108
110
|
}) {
|
|
109
111
|
const {
|
|
110
112
|
t: r
|
|
111
|
-
} = h(), s =
|
|
112
|
-
const t = [A(r),
|
|
113
|
+
} = h(), s = c(() => {
|
|
114
|
+
const t = [A(r), N(r), O(r), M(r), k(r), I(r), q(r), D(r), j(r), w(r), G(r), T(r), C(r), J(r), R(r), P(r), S(r), H(r), B(r), U(r), v(r), K(r), z(r), V(r)], m = /* @__PURE__ */ new Map();
|
|
113
115
|
return t.forEach((o) => {
|
|
114
116
|
m.set(o.name, o);
|
|
115
117
|
}), m;
|
|
116
|
-
}), d =
|
|
118
|
+
}), d = b(i, "value", f, {
|
|
117
119
|
defaultValue: {},
|
|
118
120
|
deep: !0
|
|
119
121
|
}), e = (t, m = d.value) => t.length > 0 && Array.isArray(t[0]) ? t.flatMap((o) => Array.isArray(o) ? e(o, m) : []) : t.map((o) => {
|
|
@@ -135,12 +137,12 @@ const yo = /* @__PURE__ */ F({
|
|
|
135
137
|
model: m,
|
|
136
138
|
convertToJsonSchema: e
|
|
137
139
|
});
|
|
138
|
-
const
|
|
140
|
+
const l = {
|
|
139
141
|
tag: n,
|
|
140
142
|
attrs: u.attr || {}
|
|
141
143
|
};
|
|
142
|
-
return o.children?.length && (
|
|
143
|
-
}), x =
|
|
144
|
+
return o.children?.length && (l.children = e(o.children, m)), l;
|
|
145
|
+
}), x = c(() => {
|
|
144
146
|
const t = e(i.data, d.value);
|
|
145
147
|
return [{
|
|
146
148
|
tag: "dux-form-layout",
|
|
@@ -150,16 +152,16 @@ const yo = /* @__PURE__ */ F({
|
|
|
150
152
|
children: t
|
|
151
153
|
}];
|
|
152
154
|
}), {
|
|
153
|
-
render:
|
|
154
|
-
} =
|
|
155
|
+
render: F
|
|
156
|
+
} = g({
|
|
155
157
|
data: x,
|
|
156
158
|
context: {
|
|
157
159
|
form: d.value
|
|
158
160
|
}
|
|
159
161
|
});
|
|
160
|
-
return () => y(
|
|
162
|
+
return () => y(F, null, null);
|
|
161
163
|
}
|
|
162
164
|
});
|
|
163
165
|
export {
|
|
164
|
-
|
|
166
|
+
Ao as DuxFormRenderer
|
|
165
167
|
};
|
|
@@ -51,10 +51,10 @@ import "../../pages/page404.js";
|
|
|
51
51
|
import "short-unique-id";
|
|
52
52
|
import "aieditor";
|
|
53
53
|
import { useModal as c } from "../../hooks/modal.js";
|
|
54
|
+
import "mime";
|
|
54
55
|
import "@iconify-json/tabler/icons.json";
|
|
55
56
|
import "../posterEditor/elements/index.js";
|
|
56
57
|
import "fabric";
|
|
57
|
-
import "mime";
|
|
58
58
|
import "dayjs";
|
|
59
59
|
import "@tanstack/vue-query";
|
|
60
60
|
import "pinia";
|
|
@@ -58,10 +58,10 @@ import { DuxDrawerPage as N } from "../drawer/drawerPage.js";
|
|
|
58
58
|
import { DuxTableTools as ve } from "./tools.js";
|
|
59
59
|
import "short-unique-id";
|
|
60
60
|
import "aieditor";
|
|
61
|
+
import "mime";
|
|
61
62
|
import "@iconify-json/tabler/icons.json";
|
|
62
63
|
import "../posterEditor/elements/index.js";
|
|
63
64
|
import "fabric";
|
|
64
|
-
import "mime";
|
|
65
65
|
import "dayjs";
|
|
66
66
|
import "@tanstack/vue-query";
|
|
67
67
|
import "pinia";
|
|
@@ -57,10 +57,10 @@ import { DuxDrawerPage as S } from "../drawer/drawerPage.js";
|
|
|
57
57
|
import { DuxTableTools as ce } from "./tools.js";
|
|
58
58
|
import "short-unique-id";
|
|
59
59
|
import "aieditor";
|
|
60
|
+
import "mime";
|
|
60
61
|
import "@iconify-json/tabler/icons.json";
|
|
61
62
|
import "../posterEditor/elements/index.js";
|
|
62
63
|
import "fabric";
|
|
63
|
-
import "mime";
|
|
64
64
|
import "dayjs";
|
|
65
65
|
import "@tanstack/vue-query";
|
|
66
66
|
import { useTable as me } from "../../hooks/table.js";
|
|
@@ -50,10 +50,10 @@ import "@duxweb/dvha-naiveui";
|
|
|
50
50
|
import "../../pages/page404.js";
|
|
51
51
|
import "short-unique-id";
|
|
52
52
|
import "aieditor";
|
|
53
|
+
import "mime";
|
|
53
54
|
import "@iconify-json/tabler/icons.json";
|
|
54
55
|
import "../posterEditor/elements/index.js";
|
|
55
56
|
import "fabric";
|
|
56
|
-
import "mime";
|
|
57
57
|
import "dayjs";
|
|
58
58
|
import { useLevel as c } from "../../hooks/level.js";
|
|
59
59
|
import "pinia";
|
|
@@ -51,10 +51,10 @@ import "@duxweb/dvha-naiveui";
|
|
|
51
51
|
import "../../pages/page404.js";
|
|
52
52
|
import "short-unique-id";
|
|
53
53
|
import "aieditor";
|
|
54
|
+
import "mime";
|
|
54
55
|
import "@iconify-json/tabler/icons.json";
|
|
55
56
|
import "../posterEditor/elements/index.js";
|
|
56
57
|
import "fabric";
|
|
57
|
-
import "mime";
|
|
58
58
|
import "dayjs";
|
|
59
59
|
import "@tanstack/vue-query";
|
|
60
60
|
import { useTable as y } from "../../hooks/table.js";
|
|
@@ -1,20 +1,21 @@
|
|
|
1
|
-
import { useManage as u, createS3UploadDriver as
|
|
2
|
-
import { computed as
|
|
3
|
-
|
|
4
|
-
const
|
|
5
|
-
signPath: a?.signPath ||
|
|
6
|
-
signCallback: a?.signCallback ||
|
|
1
|
+
import { useManage as u, createS3UploadDriver as c, createLocalUploadDriver as g } from "@duxweb/dvha-core";
|
|
2
|
+
import { computed as t } from "vue";
|
|
3
|
+
function h(a) {
|
|
4
|
+
const o = u(), n = t(() => a?.uploadPath || o.config?.apiPath?.upload || "upload"), r = t(() => a?.managePath || o.config?.apiPath?.uploadManager || "uploadManager"), d = t(() => a?.driver || o.config?.upload?.driver || "local"), e = t(() => a?.method || o.config?.upload?.method || "POST"), i = t(() => d.value === "s3" ? c({
|
|
5
|
+
signPath: a?.signPath || o.config?.apiPath?.upload || n.value || "",
|
|
6
|
+
signCallback: a?.signCallback || o.config?.upload?.signCallback || ((l) => ({
|
|
7
7
|
uploadUrl: l.data?.uploadUrl,
|
|
8
8
|
url: l.data?.url,
|
|
9
9
|
params: l.data?.params
|
|
10
10
|
}))
|
|
11
|
-
}) :
|
|
11
|
+
}) : g());
|
|
12
12
|
return {
|
|
13
|
-
uploadPath:
|
|
14
|
-
managePath:
|
|
15
|
-
driver: i
|
|
13
|
+
uploadPath: n,
|
|
14
|
+
managePath: r,
|
|
15
|
+
driver: i,
|
|
16
|
+
method: e
|
|
16
17
|
};
|
|
17
|
-
}
|
|
18
|
+
}
|
|
18
19
|
export {
|
|
19
|
-
|
|
20
|
+
h as useUploadConfig
|
|
20
21
|
};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { useI18n as
|
|
3
|
-
import { useVModel as
|
|
4
|
-
import
|
|
5
|
-
import { useMessage as
|
|
1
|
+
import { defineComponent as A, ref as x, computed as s, watch as b, createVNode as o, Fragment as U, createTextVNode as w, isVNode as Z } from "vue";
|
|
2
|
+
import { useI18n as j, useUpload as O } from "@duxweb/dvha-core";
|
|
3
|
+
import { useVModel as B, useDropZone as X } from "@vueuse/core";
|
|
4
|
+
import E from "mime";
|
|
5
|
+
import { useMessage as L, NDataTable as T, NProgress as I, NButton as y } from "naive-ui";
|
|
6
6
|
import "vue-router";
|
|
7
7
|
import "@overlastic/vue";
|
|
8
|
-
import { DuxMedia as
|
|
8
|
+
import { DuxMedia as W } from "../media/media.js";
|
|
9
9
|
import "vue-echarts";
|
|
10
10
|
import "vue3-ace-editor";
|
|
11
11
|
import "ace-builds/src-noconflict/mode-vue";
|
|
@@ -52,18 +52,18 @@ import "@duxweb/dvha-naiveui";
|
|
|
52
52
|
import "../../pages/page404.js";
|
|
53
53
|
import "short-unique-id";
|
|
54
54
|
import "aieditor";
|
|
55
|
-
import { useModal as
|
|
55
|
+
import { useModal as G } from "../../hooks/modal.js";
|
|
56
|
+
import { useUploadConfig as _ } from "./config.js";
|
|
56
57
|
import "@iconify-json/tabler/icons.json";
|
|
57
58
|
import "../posterEditor/elements/index.js";
|
|
58
59
|
import "fabric";
|
|
59
|
-
import { useUploadConfig as G } from "./config.js";
|
|
60
60
|
import "dayjs";
|
|
61
61
|
import "@tanstack/vue-query";
|
|
62
62
|
import "pinia";
|
|
63
|
-
function
|
|
64
|
-
return typeof t == "function" || Object.prototype.toString.call(t) === "[object Object]" && !
|
|
63
|
+
function F(t) {
|
|
64
|
+
return typeof t == "function" || Object.prototype.toString.call(t) === "[object Object]" && !Z(t);
|
|
65
65
|
}
|
|
66
|
-
const
|
|
66
|
+
const p = {
|
|
67
67
|
"image/*": "JPG, PNG, GIF, BMP, WEBP",
|
|
68
68
|
"video/*": "MP4, AVI, MOV, WMV, FLV",
|
|
69
69
|
"audio/*": "MP3, WAV, AAC, FLAC",
|
|
@@ -94,7 +94,7 @@ const m = {
|
|
|
94
94
|
empty: "flex items-center justify-center h-full text-muted",
|
|
95
95
|
actions: "flex gap-2"
|
|
96
96
|
}
|
|
97
|
-
},
|
|
97
|
+
}, et = /* @__PURE__ */ A({
|
|
98
98
|
name: "DuxFileUpload",
|
|
99
99
|
props: {
|
|
100
100
|
path: {
|
|
@@ -121,59 +121,63 @@ const m = {
|
|
|
121
121
|
accept: String,
|
|
122
122
|
value: [String, Array],
|
|
123
123
|
defaultValue: [String, Array],
|
|
124
|
-
onUpdateValue: Function
|
|
124
|
+
onUpdateValue: Function,
|
|
125
|
+
method: String
|
|
125
126
|
},
|
|
126
127
|
setup(t, {
|
|
127
|
-
emit:
|
|
128
|
+
emit: P
|
|
128
129
|
}) {
|
|
129
|
-
const c =
|
|
130
|
+
const c = B(t, "value", P, {
|
|
130
131
|
passive: !0,
|
|
131
132
|
deep: !0,
|
|
132
133
|
defaultValue: t.defaultValue
|
|
133
|
-
}),
|
|
134
|
+
}), S = L(), {
|
|
134
135
|
t: a
|
|
135
|
-
} =
|
|
136
|
+
} = j(), d = x(), m = s(() => t.maxSize || 5), C = G(), {
|
|
136
137
|
uploadPath: u,
|
|
137
|
-
managePath:
|
|
138
|
-
driver:
|
|
139
|
-
|
|
138
|
+
managePath: N,
|
|
139
|
+
driver: V,
|
|
140
|
+
method: f
|
|
141
|
+
} = _({
|
|
140
142
|
driver: t?.driver,
|
|
141
143
|
signPath: t?.signPath,
|
|
142
144
|
signCallback: t?.signCallback,
|
|
143
145
|
uploadPath: t?.path,
|
|
144
|
-
managePath: t?.managePath
|
|
145
|
-
|
|
146
|
+
managePath: t?.managePath,
|
|
147
|
+
method: t?.method
|
|
148
|
+
}), n = O({
|
|
146
149
|
path: u.value,
|
|
147
150
|
multiple: t.multiple,
|
|
148
151
|
maxFileCount: t.maxNum,
|
|
149
|
-
maxFileSize:
|
|
152
|
+
maxFileSize: m.value * 1024 * 1024,
|
|
150
153
|
autoUpload: !0,
|
|
151
154
|
accept: t.accept,
|
|
152
|
-
onError: (e) =>
|
|
153
|
-
driver:
|
|
155
|
+
onError: (e) => S.error(e.message || a("components.upload.error")),
|
|
156
|
+
driver: V.value,
|
|
157
|
+
method: f.value
|
|
154
158
|
}), {
|
|
155
|
-
isOverDropZone:
|
|
156
|
-
} =
|
|
159
|
+
isOverDropZone: g
|
|
160
|
+
} = X(d, {
|
|
157
161
|
onDrop: (e) => {
|
|
158
162
|
e && e.length > 0 && n.addFiles(Array.from(e), "file");
|
|
159
163
|
}
|
|
160
164
|
});
|
|
161
|
-
|
|
165
|
+
b(n.dataFiles, (e) => {
|
|
162
166
|
const i = t.multiple ? e : e[0];
|
|
163
167
|
c.value = i, t.onUpdateValue?.(i);
|
|
164
168
|
});
|
|
165
|
-
const
|
|
169
|
+
const h = s(() => t.accept ? t.accept.split(",").map((e) => {
|
|
166
170
|
const i = e.trim();
|
|
167
|
-
if (
|
|
171
|
+
if (p[i]) return p[i];
|
|
168
172
|
if (i.includes("*")) {
|
|
169
|
-
const
|
|
170
|
-
return
|
|
171
|
-
ext:
|
|
173
|
+
const M = i.split("/")[0];
|
|
174
|
+
return p[i] || a("common.fileExtension", {
|
|
175
|
+
ext: M.toUpperCase()
|
|
172
176
|
});
|
|
173
177
|
}
|
|
174
|
-
const l =
|
|
178
|
+
const l = E.getExtension(i);
|
|
175
179
|
return l ? l.toUpperCase() : i;
|
|
176
|
-
}).filter(Boolean).join(", ") : ""),
|
|
180
|
+
}).filter(Boolean).join(", ") : ""), z = s(() => ({
|
|
177
181
|
pending: o("div", {
|
|
178
182
|
class: "text-info"
|
|
179
183
|
}, [a("components.upload.status.pending")]),
|
|
@@ -186,11 +190,11 @@ const m = {
|
|
|
186
190
|
error: o("div", {
|
|
187
191
|
class: "text-error"
|
|
188
192
|
}, [a("components.upload.status.error")])
|
|
189
|
-
})),
|
|
190
|
-
return
|
|
191
|
-
if (!e || !e?.length ||
|
|
193
|
+
})), k = s(() => [r.dropZone.base, g.value ? r.dropZone.active : r.dropZone.hover]), D = s(() => [n.uploadFiles.value.length === 0 && "border-b border-muted"]), v = x(!1);
|
|
194
|
+
return b(c, (e) => {
|
|
195
|
+
if (!e || !e?.length || v.value)
|
|
192
196
|
return;
|
|
193
|
-
|
|
197
|
+
v.value = !0;
|
|
194
198
|
const i = Array.isArray(e) ? e : [e];
|
|
195
199
|
n.addDataFiles(i);
|
|
196
200
|
}, {
|
|
@@ -199,7 +203,7 @@ const m = {
|
|
|
199
203
|
class: r.container
|
|
200
204
|
}, [o("div", {
|
|
201
205
|
ref: d,
|
|
202
|
-
class:
|
|
206
|
+
class: k.value,
|
|
203
207
|
onClick: () => n.open()
|
|
204
208
|
}, [o("div", {
|
|
205
209
|
class: r.content
|
|
@@ -211,13 +215,14 @@ const m = {
|
|
|
211
215
|
width: 800,
|
|
212
216
|
component: () => import("./manager.js"),
|
|
213
217
|
componentProps: {
|
|
214
|
-
path:
|
|
218
|
+
path: N.value,
|
|
215
219
|
multiple: t.multiple,
|
|
216
220
|
uploadParams: {
|
|
217
221
|
path: u.value,
|
|
218
222
|
accept: t.accept,
|
|
219
223
|
maxNum: t.maxNum,
|
|
220
|
-
maxSize:
|
|
224
|
+
maxSize: m.value,
|
|
225
|
+
method: f.value
|
|
221
226
|
}
|
|
222
227
|
}
|
|
223
228
|
}).then((i) => {
|
|
@@ -230,20 +235,20 @@ const m = {
|
|
|
230
235
|
class: r.text.title
|
|
231
236
|
}, [a("components.upload.desc")]), o("div", {
|
|
232
237
|
class: r.text.desc
|
|
233
|
-
}, [
|
|
238
|
+
}, [g.value ? o("span", {
|
|
234
239
|
class: r.text.highlight
|
|
235
|
-
}, [a("components.upload.dropHere")]) : o(
|
|
236
|
-
formats:
|
|
237
|
-
}) : a("components.upload.allFormats"),
|
|
238
|
-
size:
|
|
239
|
-
})])])])]), o(
|
|
240
|
+
}, [a("components.upload.dropHere")]) : o(U, null, [h.value ? a("components.upload.supportFormats", {
|
|
241
|
+
formats: h.value
|
|
242
|
+
}) : a("components.upload.allFormats"), w(","), " ", a("components.upload.maxSize", {
|
|
243
|
+
size: m.value
|
|
244
|
+
})])])])]), o(T, {
|
|
240
245
|
bordered: !1,
|
|
241
|
-
class:
|
|
246
|
+
class: D.value,
|
|
242
247
|
columns: [{
|
|
243
248
|
key: "filename",
|
|
244
249
|
title: a("components.upload.file.name"),
|
|
245
250
|
minWidth: 200,
|
|
246
|
-
render: (e) => o(
|
|
251
|
+
render: (e) => o(W, {
|
|
247
252
|
title: e.filename,
|
|
248
253
|
desc: e.filetype
|
|
249
254
|
}, null)
|
|
@@ -257,7 +262,7 @@ const m = {
|
|
|
257
262
|
width: 120,
|
|
258
263
|
render: (e) => e.status === "uploading" ? o("div", {
|
|
259
264
|
class: "flex items-center"
|
|
260
|
-
}, [o(
|
|
265
|
+
}, [o(I, {
|
|
261
266
|
type: "line",
|
|
262
267
|
style: {
|
|
263
268
|
width: "24px",
|
|
@@ -268,7 +273,7 @@ const m = {
|
|
|
268
273
|
percentage: e.progress?.percent,
|
|
269
274
|
showIndicator: !1,
|
|
270
275
|
height: 14
|
|
271
|
-
}, null)]) :
|
|
276
|
+
}, null)]) : z.value[e.status]
|
|
272
277
|
}, {
|
|
273
278
|
key: "actions",
|
|
274
279
|
title: a("components.upload.actions"),
|
|
@@ -277,20 +282,20 @@ const m = {
|
|
|
277
282
|
let i, l;
|
|
278
283
|
return o("div", {
|
|
279
284
|
class: r.table.actions
|
|
280
|
-
}, [o(
|
|
285
|
+
}, [o(y, {
|
|
281
286
|
type: "warning",
|
|
282
287
|
size: "small",
|
|
283
288
|
text: !0,
|
|
284
289
|
disabled: ["success", "error", "cancelled"].includes(e.status),
|
|
285
290
|
onClick: () => n.cancelFiles([e.id])
|
|
286
|
-
},
|
|
291
|
+
}, F(i = a("components.upload.cancel")) ? i : {
|
|
287
292
|
default: () => [i]
|
|
288
|
-
}), o(
|
|
293
|
+
}), o(y, {
|
|
289
294
|
type: "error",
|
|
290
295
|
size: "small",
|
|
291
296
|
text: !0,
|
|
292
297
|
onClick: () => n.removeFiles([e.id])
|
|
293
|
-
},
|
|
298
|
+
}, F(l = a("components.upload.delete")) ? l : {
|
|
294
299
|
default: () => [l]
|
|
295
300
|
})]);
|
|
296
301
|
}
|
|
@@ -304,5 +309,5 @@ const m = {
|
|
|
304
309
|
}
|
|
305
310
|
});
|
|
306
311
|
export {
|
|
307
|
-
|
|
312
|
+
et as DuxFileUpload
|
|
308
313
|
};
|