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