@aplus-frontend/ui 0.4.14 → 0.4.15
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/src/ap-table/ap-table.vue2.mjs +206 -181
- package/es/src/ap-upload/apUpload.vue.d.ts +9 -0
- package/es/src/ap-upload/apUpload.vue.mjs +22 -18
- package/es/src/ap-upload/components/MultipleFile.vue2.mjs +66 -66
- package/es/src/ap-upload/components/Picture.vue2.mjs +82 -82
- package/es/src/ap-upload/components/SingleFile.vue2.mjs +114 -114
- package/es/src/config-provider/config-provider.d.ts +3 -0
- package/es/src/config-provider/css-var.d.ts +3 -0
- package/es/src/config-provider/css-var.mjs +21 -14
- package/es/src/config-provider/index.d.ts +15 -0
- package/es/src/scroll-bar/index.vue.d.ts +1 -0
- package/es/src/scroll-bar/index.vue.mjs +31 -30
- package/es/src/scroll-bar/interface.d.ts +3 -1
- package/es/src/theme/antd-global-overwrite/admin/index.css +24 -2
- package/es/src/theme/antd-global-overwrite/admin/table.css +24 -2
- package/es/src/theme/antd-global-overwrite/aplus/index.css +24 -2
- package/es/src/theme/antd-global-overwrite/aplus/table.css +24 -2
- package/es/src/utils/index.d.ts +1 -0
- package/es/src/utils/index.mjs +40 -30
- package/lib/src/ap-table/ap-table.vue2.js +1 -1
- package/lib/src/ap-upload/apUpload.vue.d.ts +9 -0
- package/lib/src/ap-upload/apUpload.vue.js +1 -1
- package/lib/src/ap-upload/components/MultipleFile.vue2.js +1 -1
- package/lib/src/ap-upload/components/Picture.vue2.js +1 -1
- package/lib/src/ap-upload/components/SingleFile.vue2.js +1 -1
- package/lib/src/config-provider/config-provider.d.ts +3 -0
- package/lib/src/config-provider/css-var.d.ts +3 -0
- package/lib/src/config-provider/css-var.js +1 -1
- package/lib/src/config-provider/index.d.ts +15 -0
- package/lib/src/scroll-bar/index.vue.d.ts +1 -0
- package/lib/src/scroll-bar/index.vue.js +1 -1
- package/lib/src/scroll-bar/interface.d.ts +3 -1
- package/lib/src/theme/antd-global-overwrite/admin/index.css +24 -2
- package/lib/src/theme/antd-global-overwrite/admin/table.css +24 -2
- package/lib/src/theme/antd-global-overwrite/aplus/index.css +24 -2
- package/lib/src/theme/antd-global-overwrite/aplus/table.css +24 -2
- package/lib/src/utils/index.d.ts +1 -0
- package/lib/src/utils/index.js +1 -1
- package/package.json +1 -1
- package/theme/antd-global-overwrite/admin/index.css +24 -2
- package/theme/antd-global-overwrite/admin/table.css +24 -2
- package/theme/antd-global-overwrite/admin/table.less +8 -2
- package/theme/antd-global-overwrite/aplus/index.css +24 -2
- package/theme/antd-global-overwrite/aplus/table.css +24 -2
- package/theme/antd-global-overwrite/aplus/table.less +7 -2
- package/theme/ap-table/ap-table.css +7 -0
- package/theme/ap-table/ap-table.less +10 -8
- package/theme/ap-table-modal/index.css +7 -0
- package/theme/index.css +7 -0
|
@@ -1,37 +1,37 @@
|
|
|
1
|
-
import { defineComponent as
|
|
1
|
+
import { defineComponent as G, inject as s, ref as H, watch as J, nextTick as K, openBlock as h, createElementBlock as C, normalizeClass as Q, unref as n, createVNode as U, withCtx as b, createElementVNode as S, createTextVNode as X, toDisplayString as L, withModifiers as Y, createBlock as Z, resolveDynamicComponent as ee, createCommentVNode as te } from "vue";
|
|
2
2
|
import "../../config-provider/index.mjs";
|
|
3
|
-
import { getPath as
|
|
4
|
-
import { useOss as ae, getOssInstance as
|
|
5
|
-
import { message as m, Upload as
|
|
6
|
-
import { UploadOutlined as
|
|
7
|
-
import { fileMatchesAccept as
|
|
8
|
-
import { useLocale as
|
|
9
|
-
import { useNamespace as
|
|
10
|
-
const
|
|
3
|
+
import { getPath as oe, getName as se, getReturnData as M } from "../utils/returnData.mjs";
|
|
4
|
+
import { useOss as ae, getOssInstance as ne } from "../hooks/useOss.mjs";
|
|
5
|
+
import { message as m, Upload as re, Button as ie } from "@aplus-frontend/antdv";
|
|
6
|
+
import { UploadOutlined as le } from "@ant-design/icons-vue";
|
|
7
|
+
import { fileMatchesAccept as ue, getAcceptText as ce } from "../utils/accept.mjs";
|
|
8
|
+
import { useLocale as pe } from "../../config-provider/hooks/use-locale.mjs";
|
|
9
|
+
import { useNamespace as me } from "../../config-provider/hooks/use-namespace.mjs";
|
|
10
|
+
const de = { class: "multiple-file-context" }, fe = { key: 0 }, ge = { key: 1 }, Ae = /* @__PURE__ */ G({
|
|
11
11
|
__name: "MultipleFile",
|
|
12
|
-
setup(
|
|
13
|
-
const { t: r } =
|
|
14
|
-
|
|
12
|
+
setup(ve, { expose: z }) {
|
|
13
|
+
const { t: r } = pe(), { b: E } = me("ap-upload-multiple-file"), { put: R } = ae(), B = s("theme"), I = s("dirName"), y = s("accept") || "*", _ = s("maxSize") ?? 500, P = s("title") || r("ap.apUpload.uploadFile"), f = s("subTitle"), i = s("maxCount") ?? 10, d = s("uploadingCount"), A = s("beforeUpload"), F = s("customRequest"), O = s("getOssAccess"), q = s("maxSizeErrorMsg"), D = s("maxCountErrorMsg"), $ = s("acceptErrorMsg"), g = s("onRemove"), a = s("value"), c = [], v = s("needName"), l = H(null);
|
|
14
|
+
J(
|
|
15
15
|
() => a == null ? void 0 : a.value,
|
|
16
16
|
function(e) {
|
|
17
17
|
var t, o;
|
|
18
|
-
!((o = (t = l == null ? void 0 : l.value) == null ? void 0 : t.fileList) != null && o.length) && e &&
|
|
18
|
+
!((o = (t = l == null ? void 0 : l.value) == null ? void 0 : t.fileList) != null && o.length) && e && N(e);
|
|
19
19
|
},
|
|
20
20
|
{ immediate: !0 }
|
|
21
21
|
);
|
|
22
|
-
function
|
|
22
|
+
function N(e) {
|
|
23
23
|
if (!e) {
|
|
24
24
|
p = [], l.value.fileList = [], a.value = void 0, c.splice(0, c.length);
|
|
25
25
|
return;
|
|
26
26
|
}
|
|
27
|
-
|
|
27
|
+
K(() => {
|
|
28
28
|
const t = e.map((o) => {
|
|
29
|
-
const u =
|
|
29
|
+
const u = oe(v, o), w = se(v, o), k = new File(
|
|
30
30
|
[o],
|
|
31
|
-
|
|
31
|
+
w,
|
|
32
32
|
{}
|
|
33
33
|
);
|
|
34
|
-
return
|
|
34
|
+
return k.response = u, k.uid = u, k;
|
|
35
35
|
});
|
|
36
36
|
if (i && t.length > i) {
|
|
37
37
|
m.warning(
|
|
@@ -49,9 +49,9 @@ const me = { class: "multiple-file-context" }, de = { key: 0 }, fe = { key: 1 },
|
|
|
49
49
|
}), l.value.fileList = t, a.value = e;
|
|
50
50
|
});
|
|
51
51
|
}
|
|
52
|
-
|
|
53
|
-
let p = [],
|
|
54
|
-
function
|
|
52
|
+
z({ setValue: N });
|
|
53
|
+
let p = [], T;
|
|
54
|
+
function x(e) {
|
|
55
55
|
setTimeout(() => {
|
|
56
56
|
const t = l.value.fileList.findIndex(
|
|
57
57
|
(o) => o.uid === e.uid
|
|
@@ -59,32 +59,32 @@ const me = { class: "multiple-file-context" }, de = { key: 0 }, fe = { key: 1 },
|
|
|
59
59
|
t >= 0 && l.value.fileList.splice(t, 1);
|
|
60
60
|
});
|
|
61
61
|
}
|
|
62
|
-
async function
|
|
62
|
+
async function j(e) {
|
|
63
63
|
if (i && i > 1 && p.length >= i)
|
|
64
|
-
return clearTimeout(
|
|
64
|
+
return clearTimeout(T), T = setTimeout(() => {
|
|
65
65
|
m.warning(
|
|
66
|
-
|
|
66
|
+
D || r("ap.apUpload.maxUploadFiles", {
|
|
67
67
|
maxCount: i
|
|
68
68
|
})
|
|
69
69
|
);
|
|
70
|
-
}),
|
|
71
|
-
if (e.size >
|
|
70
|
+
}), x(e), !1;
|
|
71
|
+
if (e.size > _ * 1024 * 1024)
|
|
72
72
|
return m.warning(
|
|
73
|
-
|
|
74
|
-
maxSize:
|
|
73
|
+
q || r("ap.apUpload.maxUploadFileSize", {
|
|
74
|
+
maxSize: _
|
|
75
75
|
})
|
|
76
|
-
),
|
|
77
|
-
if (!
|
|
76
|
+
), x(e), !1;
|
|
77
|
+
if (!ue(e, y))
|
|
78
78
|
return m.warning(
|
|
79
|
-
|
|
80
|
-
),
|
|
81
|
-
if (typeof
|
|
82
|
-
return
|
|
79
|
+
$ || r("ap.apUpload.fileFormatNotSupported")
|
|
80
|
+
), x(e), !1;
|
|
81
|
+
if (typeof A == "function" && await A(e) === !1)
|
|
82
|
+
return x(e), !1;
|
|
83
83
|
i && i === 1 && (p = [], a.value = void 0), p.push(e);
|
|
84
84
|
}
|
|
85
|
-
async function
|
|
86
|
-
if (d.value++, typeof
|
|
87
|
-
|
|
85
|
+
async function V(e) {
|
|
86
|
+
if (d.value++, typeof F == "function") {
|
|
87
|
+
F({
|
|
88
88
|
onProgress: (t) => {
|
|
89
89
|
setTimeout(() => {
|
|
90
90
|
e.onProgress({
|
|
@@ -105,7 +105,7 @@ const me = { class: "multiple-file-context" }, de = { key: 0 }, fe = { key: 1 },
|
|
|
105
105
|
e.onSuccess(t);
|
|
106
106
|
}), a.value = [
|
|
107
107
|
...a.value || [],
|
|
108
|
-
|
|
108
|
+
M(v, t, e.file.name)
|
|
109
109
|
], c.push({
|
|
110
110
|
uid: e.file.uid,
|
|
111
111
|
path: t
|
|
@@ -116,15 +116,15 @@ const me = { class: "multiple-file-context" }, de = { key: 0 }, fe = { key: 1 },
|
|
|
116
116
|
return;
|
|
117
117
|
}
|
|
118
118
|
try {
|
|
119
|
-
const t = await
|
|
120
|
-
e.file.oss = t,
|
|
119
|
+
const t = await ne(O);
|
|
120
|
+
e.file.oss = t, R({
|
|
121
121
|
file: e.file,
|
|
122
|
-
dirName:
|
|
122
|
+
dirName: I,
|
|
123
123
|
oss: t,
|
|
124
124
|
successCallBack(o) {
|
|
125
125
|
e.onSuccess(o), a.value = [
|
|
126
126
|
...a.value || [],
|
|
127
|
-
|
|
127
|
+
M(v, o, e.file.name)
|
|
128
128
|
], c.push({
|
|
129
129
|
uid: e.file.uid,
|
|
130
130
|
path: o
|
|
@@ -151,11 +151,11 @@ const me = { class: "multiple-file-context" }, de = { key: 0 }, fe = { key: 1 },
|
|
|
151
151
|
}), d.value--;
|
|
152
152
|
}
|
|
153
153
|
}
|
|
154
|
-
function
|
|
154
|
+
function W(e) {
|
|
155
155
|
var o;
|
|
156
|
-
if (e.response) {
|
|
156
|
+
if (g && (g == null || g(e)), e.response) {
|
|
157
157
|
if (Array.isArray(a.value)) {
|
|
158
|
-
const u = c.findIndex((
|
|
158
|
+
const u = c.findIndex((w) => w.uid === e.uid);
|
|
159
159
|
u >= 0 && (a == null || a.value.splice(u, 1), c.splice(u, 1)), a.value.length === 0 && (a.value = void 0);
|
|
160
160
|
}
|
|
161
161
|
} else
|
|
@@ -165,16 +165,16 @@ const me = { class: "multiple-file-context" }, de = { key: 0 }, fe = { key: 1 },
|
|
|
165
165
|
);
|
|
166
166
|
return p.splice(t, 1), Promise.resolve(!0);
|
|
167
167
|
}
|
|
168
|
-
return (e, t) => (
|
|
169
|
-
class:
|
|
170
|
-
[n(
|
|
171
|
-
[n(
|
|
168
|
+
return (e, t) => (h(), C("div", {
|
|
169
|
+
class: Q({
|
|
170
|
+
[n(E)()]: !0,
|
|
171
|
+
[n(E)("admin")]: n(B) === "admin"
|
|
172
172
|
})
|
|
173
173
|
}, [
|
|
174
|
-
|
|
174
|
+
U(n(re), {
|
|
175
175
|
ref_key: "uploadRef",
|
|
176
176
|
ref: l,
|
|
177
|
-
accept: n(
|
|
177
|
+
accept: n(y),
|
|
178
178
|
multiple: "",
|
|
179
179
|
"max-count": n(i),
|
|
180
180
|
progress: {
|
|
@@ -182,27 +182,27 @@ const me = { class: "multiple-file-context" }, de = { key: 0 }, fe = { key: 1 },
|
|
|
182
182
|
showInfo: !1,
|
|
183
183
|
strokeColor: "#0070FF"
|
|
184
184
|
},
|
|
185
|
-
"before-upload":
|
|
186
|
-
"custom-request":
|
|
187
|
-
onRemove:
|
|
185
|
+
"before-upload": j,
|
|
186
|
+
"custom-request": V,
|
|
187
|
+
onRemove: W
|
|
188
188
|
}, {
|
|
189
|
-
default:
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
default:
|
|
193
|
-
|
|
194
|
-
|
|
189
|
+
default: b(() => [
|
|
190
|
+
S("div", de, [
|
|
191
|
+
U(n(ie), { class: "file-btn" }, {
|
|
192
|
+
default: b(() => [
|
|
193
|
+
U(n(le)),
|
|
194
|
+
X(" " + L(n(P)), 1)
|
|
195
195
|
]),
|
|
196
196
|
_: 1
|
|
197
197
|
}),
|
|
198
|
-
|
|
198
|
+
S("div", {
|
|
199
199
|
class: "sub-title",
|
|
200
|
-
onClick: t[0] || (t[0] =
|
|
200
|
+
onClick: t[0] || (t[0] = Y(() => {
|
|
201
201
|
}, ["stop"]))
|
|
202
202
|
}, [
|
|
203
|
-
typeof n(f) == "string" ? (
|
|
204
|
-
(
|
|
205
|
-
])) :
|
|
203
|
+
typeof n(f) == "string" ? (h(), C("div", fe, L(n(f) || `${n(r)("ap.apUpload.supportExtension")}:${n(ce)(n(y))}`), 1)) : n(f) ? (h(), C("div", ge, [
|
|
204
|
+
(h(), Z(ee(n(f))))
|
|
205
|
+
])) : te("", !0)
|
|
206
206
|
])
|
|
207
207
|
])
|
|
208
208
|
]),
|
|
@@ -212,5 +212,5 @@ const me = { class: "multiple-file-context" }, de = { key: 0 }, fe = { key: 1 },
|
|
|
212
212
|
}
|
|
213
213
|
});
|
|
214
214
|
export {
|
|
215
|
-
|
|
215
|
+
Ae as default
|
|
216
216
|
};
|
|
@@ -1,48 +1,48 @@
|
|
|
1
|
-
import { defineComponent as
|
|
1
|
+
import { defineComponent as Y, inject as c, ref as $, watch as Z, nextTick as F, openBlock as g, createElementBlock as h, normalizeClass as ee, unref as i, createElementVNode as d, renderSlot as te, Fragment as ne, renderList as ae, withDirectives as se, createVNode as k, createCommentVNode as I, vShow as oe, toDisplayString as C } from "vue";
|
|
2
2
|
import "../../config-provider/index.mjs";
|
|
3
|
-
import { getPath as
|
|
4
|
-
import { CloseOutlined as
|
|
5
|
-
import { useOss as
|
|
6
|
-
import { fileMatchesAccept as
|
|
7
|
-
import { message as m, Progress as
|
|
8
|
-
import { omit as
|
|
9
|
-
import { useLocale as
|
|
10
|
-
import { useNamespace as
|
|
11
|
-
const
|
|
3
|
+
import { getPath as ie, getName as re, getReturnData as M } from "../utils/returnData.mjs";
|
|
4
|
+
import { CloseOutlined as ce, PlusOutlined as ue } from "@ant-design/icons-vue";
|
|
5
|
+
import { useOss as le, getOssInstance as T } from "../hooks/useOss.mjs";
|
|
6
|
+
import { fileMatchesAccept as pe, getAcceptText as de } from "../utils/accept.mjs";
|
|
7
|
+
import { message as m, Progress as me } from "@aplus-frontend/antdv";
|
|
8
|
+
import { omit as fe } from "lodash-unified";
|
|
9
|
+
import { useLocale as ge } from "../../config-provider/hooks/use-locale.mjs";
|
|
10
|
+
import { useNamespace as he } from "../../config-provider/hooks/use-namespace.mjs";
|
|
11
|
+
const ve = ["accept"], xe = { class: "picture-context" }, ye = { class: "picture-item-box" }, _e = ["src"], we = { class: "picture-item-shadow" }, Ue = ["onClick"], ke = {
|
|
12
12
|
key: 0,
|
|
13
13
|
class: "picture-item-uploading"
|
|
14
|
-
},
|
|
14
|
+
}, Ce = { class: "picture-title" }, Se = { key: 0 }, Ee = { key: 1 }, Oe = /* @__PURE__ */ Y({
|
|
15
15
|
__name: "Picture",
|
|
16
|
-
setup(
|
|
17
|
-
const { t: l } =
|
|
18
|
-
let o =
|
|
16
|
+
setup(be, { expose: D }) {
|
|
17
|
+
const { t: l } = ge(), { b: S } = he("ap-upload-picture"), { put: O } = le(), B = c("theme"), L = c("dirName"), w = c("accept") || "image/*", U = c("maxSize") ?? 5, E = c("title"), p = c("maxCount") ?? 10, v = c("uploadingCount"), b = c("beforeUpload"), z = c("customRequest"), A = c("getOssAccess"), q = c("maxSizeErrorMsg"), V = c("maxCountErrorMsg"), j = c("acceptErrorMsg"), x = $(null), r = c("value"), y = c("needName"), _ = c("onRemove");
|
|
18
|
+
let o = $([]);
|
|
19
19
|
const f = [];
|
|
20
|
-
|
|
20
|
+
Z(
|
|
21
21
|
() => r == null ? void 0 : r.value,
|
|
22
22
|
async function(e) {
|
|
23
23
|
var a;
|
|
24
|
-
!((a = o == null ? void 0 : o.value) != null && a.length) && e &&
|
|
24
|
+
!((a = o == null ? void 0 : o.value) != null && a.length) && e && N(e);
|
|
25
25
|
},
|
|
26
26
|
{ immediate: !0 }
|
|
27
27
|
);
|
|
28
|
-
function
|
|
28
|
+
function N(e) {
|
|
29
29
|
if (!e) {
|
|
30
30
|
r.value = void 0, f.splice(0, f.length), o.value = [];
|
|
31
31
|
return;
|
|
32
32
|
}
|
|
33
|
-
|
|
33
|
+
F(async () => {
|
|
34
34
|
const a = [];
|
|
35
35
|
for (let t of e) {
|
|
36
|
-
const n =
|
|
36
|
+
const n = ie(y, t), s = re(y, t), u = await T(A), W = await u.getSignatureUrl(n), X = {
|
|
37
37
|
...typeof t == "string" ? {} : t,
|
|
38
38
|
...new File([t], s, {}),
|
|
39
39
|
uid: `${(/* @__PURE__ */ new Date()).getTime()}-${Math.random()}`,
|
|
40
|
-
thumbUrl:
|
|
40
|
+
thumbUrl: W,
|
|
41
41
|
status: "success",
|
|
42
42
|
percent: 100,
|
|
43
43
|
path: n
|
|
44
44
|
};
|
|
45
|
-
a.push(
|
|
45
|
+
a.push(X), u.destroy();
|
|
46
46
|
}
|
|
47
47
|
if (p && a.length > p) {
|
|
48
48
|
m.warning(
|
|
@@ -60,38 +60,38 @@ const he = ["accept"], ve = { class: "picture-context" }, xe = { class: "picture
|
|
|
60
60
|
}), r.value = e;
|
|
61
61
|
});
|
|
62
62
|
}
|
|
63
|
-
|
|
64
|
-
function
|
|
63
|
+
D({ setValue: N });
|
|
64
|
+
function G() {
|
|
65
65
|
var e;
|
|
66
66
|
(e = x.value) == null || e.click();
|
|
67
67
|
}
|
|
68
|
-
function
|
|
68
|
+
function H(e) {
|
|
69
69
|
const a = e.target;
|
|
70
|
-
|
|
70
|
+
J(a == null ? void 0 : a.files);
|
|
71
71
|
}
|
|
72
|
-
function
|
|
72
|
+
function J(e) {
|
|
73
73
|
if (e != null && e.length)
|
|
74
74
|
for (let a = 0; a < e.length; a++)
|
|
75
|
-
|
|
75
|
+
K(e[a]);
|
|
76
76
|
x.value && (x.value.value = "");
|
|
77
77
|
}
|
|
78
|
-
let
|
|
79
|
-
async function
|
|
78
|
+
let P;
|
|
79
|
+
async function K(e) {
|
|
80
80
|
if (p && p > 1 && o.value.length >= p)
|
|
81
|
-
return clearTimeout(
|
|
81
|
+
return clearTimeout(P), P = setTimeout(() => {
|
|
82
82
|
m.warning(
|
|
83
|
-
|
|
83
|
+
V || l("ap.apUpload.maxUploadPicture", { maxCount: p })
|
|
84
84
|
);
|
|
85
85
|
}), !1;
|
|
86
|
-
if (e.size >
|
|
86
|
+
if (e.size > U * 1024 * 1024)
|
|
87
87
|
return m.warning(
|
|
88
|
-
|
|
88
|
+
q || l("ap.apUpload.maxUploadFileSize", { maxSize: U })
|
|
89
89
|
), !1;
|
|
90
|
-
if (!/image\/\w+/.test(e.type) || !
|
|
90
|
+
if (!/image\/\w+/.test(e.type) || !pe(e, w))
|
|
91
91
|
return m.warning(
|
|
92
|
-
|
|
92
|
+
j || l("ap.apUpload.pictureFormatNotSupported")
|
|
93
93
|
), !1;
|
|
94
|
-
if (typeof
|
|
94
|
+
if (typeof b == "function" && await b(e) === !1)
|
|
95
95
|
return !1;
|
|
96
96
|
const a = new FileReader();
|
|
97
97
|
a.readAsDataURL(e), a.onload = function() {
|
|
@@ -102,14 +102,14 @@ const he = ["accept"], ve = { class: "picture-context" }, xe = { class: "picture
|
|
|
102
102
|
status: "uploading",
|
|
103
103
|
percent: 0
|
|
104
104
|
};
|
|
105
|
-
|
|
105
|
+
Q(t, e);
|
|
106
106
|
}, a.onerror = function() {
|
|
107
107
|
m.warning(l("ap.apUpload.imageParsingFailed"));
|
|
108
108
|
};
|
|
109
109
|
}
|
|
110
|
-
async function
|
|
111
|
-
if (v.value++, typeof
|
|
112
|
-
|
|
110
|
+
async function Q(e, a) {
|
|
111
|
+
if (v.value++, typeof z == "function") {
|
|
112
|
+
z({
|
|
113
113
|
onProgress: (t) => {
|
|
114
114
|
const n = o.value.find((s) => s.uid === e.uid);
|
|
115
115
|
n && (n.percent = t);
|
|
@@ -125,7 +125,7 @@ const he = ["accept"], ve = { class: "picture-context" }, xe = { class: "picture
|
|
|
125
125
|
const n = o.value.find((s) => s.uid === e.uid);
|
|
126
126
|
n && (n.status = "success", n.path = t), r.value = [
|
|
127
127
|
...r.value || [],
|
|
128
|
-
|
|
128
|
+
M(y, t, a.name)
|
|
129
129
|
], f.push({
|
|
130
130
|
uid: e.uid,
|
|
131
131
|
path: t
|
|
@@ -136,16 +136,16 @@ const he = ["accept"], ve = { class: "picture-context" }, xe = { class: "picture
|
|
|
136
136
|
return;
|
|
137
137
|
}
|
|
138
138
|
try {
|
|
139
|
-
const t = await
|
|
140
|
-
e.oss = t, o.value.push(e),
|
|
139
|
+
const t = await T(A);
|
|
140
|
+
e.oss = t, o.value.push(e), O({
|
|
141
141
|
file: a,
|
|
142
|
-
dirName:
|
|
142
|
+
dirName: L,
|
|
143
143
|
oss: t,
|
|
144
144
|
successCallBack(n) {
|
|
145
|
-
const s = o.value.find((
|
|
145
|
+
const s = o.value.find((u) => u.uid === e.uid);
|
|
146
146
|
s && (s.status = "success", s.path = n), r.value = [
|
|
147
147
|
...r.value || [],
|
|
148
|
-
|
|
148
|
+
M(y, n, a.name)
|
|
149
149
|
], f.push({
|
|
150
150
|
uid: e.uid,
|
|
151
151
|
path: n
|
|
@@ -154,12 +154,12 @@ const he = ["accept"], ve = { class: "picture-context" }, xe = { class: "picture
|
|
|
154
154
|
errorCallBack(n) {
|
|
155
155
|
m.warning(n || l("ap.apUpload.networkAnomaly"));
|
|
156
156
|
const s = o.value.findIndex(
|
|
157
|
-
(
|
|
157
|
+
(u) => u.uid === e.uid
|
|
158
158
|
);
|
|
159
159
|
s > -1 && o.value.splice(s, 1), v.value--;
|
|
160
160
|
},
|
|
161
161
|
progressCallBack(n) {
|
|
162
|
-
const s = o.value.find((
|
|
162
|
+
const s = o.value.find((u) => u.uid === e.uid);
|
|
163
163
|
s && (s.percent = n);
|
|
164
164
|
}
|
|
165
165
|
});
|
|
@@ -171,16 +171,16 @@ const he = ["accept"], ve = { class: "picture-context" }, xe = { class: "picture
|
|
|
171
171
|
n > -1 && o.value.splice(n, 1), v.value--;
|
|
172
172
|
}
|
|
173
173
|
}
|
|
174
|
-
function
|
|
174
|
+
function R(e) {
|
|
175
175
|
var t, n;
|
|
176
|
-
if (e.path && r) {
|
|
176
|
+
if (_ && (_ == null || _(e)), e.path && r) {
|
|
177
177
|
if (Array.isArray(r.value)) {
|
|
178
178
|
const s = f.findIndex(
|
|
179
|
-
(
|
|
179
|
+
(u) => u.uid === e.uid
|
|
180
180
|
);
|
|
181
181
|
if (s >= 0) {
|
|
182
|
-
const
|
|
183
|
-
|
|
182
|
+
const u = ((t = r == null ? void 0 : r.value) == null ? void 0 : t.slice()) ?? [];
|
|
183
|
+
u == null || u.splice(s, 1), r.value = u, f.splice(s, 1);
|
|
184
184
|
}
|
|
185
185
|
r.value.length === 0 && (r.value = void 0);
|
|
186
186
|
}
|
|
@@ -192,9 +192,9 @@ const he = ["accept"], ve = { class: "picture-context" }, xe = { class: "picture
|
|
|
192
192
|
return o.value.splice(a, 1), Promise.resolve(!0);
|
|
193
193
|
}
|
|
194
194
|
return (e, a) => (g(), h("div", {
|
|
195
|
-
class:
|
|
196
|
-
[i(
|
|
197
|
-
[i(
|
|
195
|
+
class: ee({
|
|
196
|
+
[i(S)()]: !0,
|
|
197
|
+
[i(S)("admin")]: i(B) === "admin"
|
|
198
198
|
})
|
|
199
199
|
}, [
|
|
200
200
|
d("input", {
|
|
@@ -202,49 +202,49 @@ const he = ["accept"], ve = { class: "picture-context" }, xe = { class: "picture
|
|
|
202
202
|
ref: x,
|
|
203
203
|
style: { display: "none" },
|
|
204
204
|
type: "file",
|
|
205
|
-
accept: i(
|
|
206
|
-
onChange:
|
|
207
|
-
}, null, 40,
|
|
208
|
-
d("div",
|
|
209
|
-
|
|
205
|
+
accept: i(w),
|
|
206
|
+
onChange: H
|
|
207
|
+
}, null, 40, ve),
|
|
208
|
+
d("div", xe, [
|
|
209
|
+
te(e.$slots, "pictureContext", {
|
|
210
210
|
fileList: i(o).map((t) => {
|
|
211
211
|
var n;
|
|
212
212
|
return {
|
|
213
|
-
...i(
|
|
213
|
+
...i(fe)(t, "oss"),
|
|
214
214
|
oss: {
|
|
215
215
|
pauseUpload: (n = t == null ? void 0 : t.oss) == null ? void 0 : n.pauseUpload
|
|
216
216
|
}
|
|
217
217
|
};
|
|
218
218
|
}),
|
|
219
|
-
remove:
|
|
219
|
+
remove: R
|
|
220
220
|
}, () => [
|
|
221
|
-
(g(!0), h(
|
|
221
|
+
(g(!0), h(ne, null, ae(i(o), (t) => (g(), h("div", {
|
|
222
222
|
key: t.uid,
|
|
223
223
|
class: "picture-item"
|
|
224
224
|
}, [
|
|
225
|
-
d("div",
|
|
225
|
+
d("div", ye, [
|
|
226
226
|
d("img", {
|
|
227
227
|
src: t.thumbUrl,
|
|
228
228
|
alt: ""
|
|
229
|
-
}, null, 8,
|
|
230
|
-
|
|
229
|
+
}, null, 8, _e),
|
|
230
|
+
se(d("div", we, [
|
|
231
231
|
d("div", {
|
|
232
232
|
class: "picture-item-close",
|
|
233
|
-
onClick: (n) =>
|
|
233
|
+
onClick: (n) => R(t)
|
|
234
234
|
}, [
|
|
235
|
-
|
|
236
|
-
], 8,
|
|
237
|
-
t.status === "uploading" ? (g(), h("div",
|
|
238
|
-
|
|
235
|
+
k(i(ce))
|
|
236
|
+
], 8, Ue),
|
|
237
|
+
t.status === "uploading" ? (g(), h("div", ke, [
|
|
238
|
+
k(i(me), {
|
|
239
239
|
percent: t.percent,
|
|
240
240
|
"stroke-color": "#ffffff",
|
|
241
241
|
"trail-color": "rgba(255, 255, 255, 0.3)",
|
|
242
242
|
size: 4,
|
|
243
243
|
"show-info": !1
|
|
244
244
|
}, null, 8, ["percent"])
|
|
245
|
-
])) :
|
|
245
|
+
])) : I("", !0)
|
|
246
246
|
], 512), [
|
|
247
|
-
[
|
|
247
|
+
[oe, t.status === "uploading"]
|
|
248
248
|
])
|
|
249
249
|
])
|
|
250
250
|
]))), 128))
|
|
@@ -252,21 +252,21 @@ const he = ["accept"], ve = { class: "picture-context" }, xe = { class: "picture
|
|
|
252
252
|
i(p) === void 0 || i(o).length < i(p) ? (g(), h("div", {
|
|
253
253
|
key: 0,
|
|
254
254
|
class: "picture-upload",
|
|
255
|
-
onClick:
|
|
255
|
+
onClick: G
|
|
256
256
|
}, [
|
|
257
|
-
|
|
258
|
-
d("div", null,
|
|
259
|
-
])) :
|
|
257
|
+
k(i(ue)),
|
|
258
|
+
d("div", null, C(i(l)("ap.apUpload.update")), 1)
|
|
259
|
+
])) : I("", !0)
|
|
260
260
|
]),
|
|
261
|
-
d("div",
|
|
262
|
-
i(
|
|
261
|
+
d("div", Ce, [
|
|
262
|
+
i(E) ? (g(), h("div", Se, C(i(E)), 1)) : (g(), h("div", Ee, C(`${i(l)("ap.apUpload.supportExtension")}:${i(de)(i(w))},${i(l)(
|
|
263
263
|
"ap.apUpload.maxUploadPictureSize",
|
|
264
|
-
{ maxSize: i(
|
|
264
|
+
{ maxSize: i(U) }
|
|
265
265
|
)}`), 1))
|
|
266
266
|
])
|
|
267
267
|
], 2));
|
|
268
268
|
}
|
|
269
269
|
});
|
|
270
270
|
export {
|
|
271
|
-
|
|
271
|
+
Oe as default
|
|
272
272
|
};
|