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