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