@aplus-frontend/ui 7.14.0 → 7.14.2
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/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-image/ApImage.vue2.mjs +32 -32
- package/es/src/business/ap-image/style/index.mjs +9 -8
- 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/version.d.ts +1 -1
- package/es/src/version.mjs +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-image/ApImage.vue2.js +1 -1
- package/lib/src/business/ap-image/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/version.d.ts +1 -1
- package/lib/src/version.js +1 -1
- package/package.json +6 -6
|
@@ -1,151 +1,164 @@
|
|
|
1
|
-
import { useToken as
|
|
2
|
-
import { isBoolean as
|
|
3
|
-
import { ref as
|
|
1
|
+
import { useToken as j } from "@aplus-frontend/antdv/es/theme/internal";
|
|
2
|
+
import { isBoolean as G, isNumber as h, isObject as b, mergeWith as z, omit as P, isString as R } from "lodash-unified";
|
|
3
|
+
import { ref as y, unref as p, watch as v } from "vue";
|
|
4
4
|
import "../../config-provider/index.mjs";
|
|
5
|
-
import { randomStr as
|
|
6
|
-
import { getColumnStateString as
|
|
7
|
-
import { useInjectApTable as
|
|
8
|
-
import { getTableTitle as
|
|
9
|
-
import { useLocale as
|
|
10
|
-
import { useNamespace as
|
|
11
|
-
function
|
|
12
|
-
return
|
|
5
|
+
import { randomStr as E } from "../../utils/index.mjs";
|
|
6
|
+
import { getColumnStateString as U } from "../components/setting/utils.mjs";
|
|
7
|
+
import { useInjectApTable as W } from "../context.mjs";
|
|
8
|
+
import { getTableTitle as X } from "../utils.mjs";
|
|
9
|
+
import { useLocale as q } from "../../config-provider/hooks/use-locale.mjs";
|
|
10
|
+
import { useNamespace as D } from "../../config-provider/hooks/use-namespace.mjs";
|
|
11
|
+
function H(t, e, o, a) {
|
|
12
|
+
return a ? a.fixed : e ? e.fixed : o && "fixed" in o ? o.fixed : G(t.fixed) ? t.fixed ? "left" : void 0 : t.fixed;
|
|
13
13
|
}
|
|
14
|
-
const
|
|
15
|
-
function
|
|
16
|
-
const
|
|
17
|
-
let
|
|
18
|
-
return t.fixed === "right" && e.fixed !== "right" && (
|
|
14
|
+
const k = Number.MAX_SAFE_INTEGER, A = E();
|
|
15
|
+
function Q(t, e) {
|
|
16
|
+
const o = h(t.order) ? t.order : k;
|
|
17
|
+
let a = h(e.order) ? e.order : k;
|
|
18
|
+
return t.fixed === "right" && e.fixed !== "right" && (a = o - 1), e.fixed === "left" && t.fixed !== "left" && (a = o - 1), o - a;
|
|
19
19
|
}
|
|
20
|
-
function
|
|
20
|
+
function V(t, e) {
|
|
21
21
|
e && t.removeItem(e);
|
|
22
22
|
}
|
|
23
|
-
function
|
|
23
|
+
function I(t, e) {
|
|
24
24
|
if (!e)
|
|
25
25
|
return [];
|
|
26
|
-
const
|
|
27
|
-
if (!
|
|
26
|
+
const o = t.getItem(e);
|
|
27
|
+
if (!o)
|
|
28
28
|
return [];
|
|
29
|
-
const
|
|
30
|
-
return Array.isArray(
|
|
29
|
+
const a = JSON.parse(o);
|
|
30
|
+
return Array.isArray(a) ? a : (V(t, e), []);
|
|
31
31
|
}
|
|
32
|
-
function
|
|
33
|
-
if (
|
|
34
|
-
return
|
|
32
|
+
function N(t, e) {
|
|
33
|
+
if (b(t) && b(e))
|
|
34
|
+
return z({}, t, e, N);
|
|
35
35
|
}
|
|
36
|
-
const
|
|
37
|
-
const { columnsBackup:
|
|
38
|
-
|
|
39
|
-
|
|
36
|
+
const le = (t, e, o) => {
|
|
37
|
+
const { columnsBackup: a, size: d } = W(), { t: _ } = q(), { be: L } = D("ap-table"), [Y, O] = j(), s = y(), l = y(
|
|
38
|
+
T(
|
|
39
|
+
I(localStorage, p(e))
|
|
40
40
|
)
|
|
41
41
|
);
|
|
42
|
-
|
|
43
|
-
[
|
|
44
|
-
([r,
|
|
45
|
-
r && (
|
|
42
|
+
v(
|
|
43
|
+
[a, d],
|
|
44
|
+
([r, i]) => {
|
|
45
|
+
r && (s.value = {
|
|
46
46
|
label: "basic_template",
|
|
47
47
|
columnState: f(r),
|
|
48
|
-
key:
|
|
49
|
-
size:
|
|
48
|
+
key: A,
|
|
49
|
+
size: i
|
|
50
50
|
});
|
|
51
51
|
},
|
|
52
52
|
{ immediate: !0, deep: !0 }
|
|
53
|
+
), v(
|
|
54
|
+
() => e.value,
|
|
55
|
+
(r) => {
|
|
56
|
+
const i = T(
|
|
57
|
+
I(localStorage, r)
|
|
58
|
+
);
|
|
59
|
+
l.value = i, s.value = {
|
|
60
|
+
label: "basic_template",
|
|
61
|
+
columnState: f(a?.value || []),
|
|
62
|
+
key: A,
|
|
63
|
+
size: d?.value
|
|
64
|
+
}, o(i ?? []);
|
|
65
|
+
}
|
|
53
66
|
);
|
|
54
|
-
function
|
|
55
|
-
return r.length ? r.map((
|
|
56
|
-
...
|
|
67
|
+
function T(r) {
|
|
68
|
+
return r.length ? r.map((i) => ({
|
|
69
|
+
...i,
|
|
57
70
|
columnState: f(
|
|
58
|
-
|
|
59
|
-
|
|
71
|
+
a.value,
|
|
72
|
+
i.columnState,
|
|
60
73
|
!1
|
|
61
74
|
)
|
|
62
75
|
})) : [
|
|
63
76
|
{
|
|
64
|
-
label:
|
|
65
|
-
key: t.getActiveKey?.("DEFAULT_TEMPLATE") ??
|
|
66
|
-
size:
|
|
67
|
-
columnState: f(
|
|
77
|
+
label: _("ap.apTable.setting.defaultTemplate"),
|
|
78
|
+
key: t.getActiveKey?.("DEFAULT_TEMPLATE") ?? E(),
|
|
79
|
+
size: d?.value,
|
|
80
|
+
columnState: f(a?.value || [])
|
|
68
81
|
}
|
|
69
82
|
];
|
|
70
83
|
}
|
|
71
|
-
function f(r,
|
|
72
|
-
const
|
|
84
|
+
function f(r, i = {}, n = !0) {
|
|
85
|
+
const c = z(
|
|
73
86
|
{},
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
87
|
+
n ? t.defaultValue || {} : {},
|
|
88
|
+
i,
|
|
89
|
+
N
|
|
77
90
|
);
|
|
78
|
-
function
|
|
79
|
-
return
|
|
80
|
-
const
|
|
91
|
+
function x(C, J, M) {
|
|
92
|
+
return C.map((u) => {
|
|
93
|
+
const S = J?.[u.key] || {}, m = {
|
|
81
94
|
key: u.key,
|
|
82
|
-
label:
|
|
95
|
+
label: R(u.title) ? X(
|
|
83
96
|
u,
|
|
84
|
-
|
|
97
|
+
L("table-header", "title"),
|
|
85
98
|
void 0,
|
|
86
|
-
|
|
99
|
+
O.value.colorTextTertiary
|
|
87
100
|
) : u.title,
|
|
88
101
|
show: !0,
|
|
89
|
-
fixed:
|
|
102
|
+
fixed: H(
|
|
90
103
|
u,
|
|
91
104
|
void 0,
|
|
92
|
-
|
|
93
|
-
|
|
105
|
+
n ? t.defaultValue?.[u.key] : void 0,
|
|
106
|
+
M
|
|
94
107
|
),
|
|
95
108
|
disabled: !1,
|
|
96
|
-
...
|
|
109
|
+
...P(S, ["children", "fixed"])
|
|
97
110
|
};
|
|
98
|
-
return
|
|
111
|
+
return m.children = u.children?.length ? x(
|
|
99
112
|
u.children,
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
) : void 0,
|
|
103
|
-
}).sort(
|
|
113
|
+
S.children,
|
|
114
|
+
m
|
|
115
|
+
) : void 0, m;
|
|
116
|
+
}).sort(Q);
|
|
104
117
|
}
|
|
105
|
-
return
|
|
118
|
+
return x(r || [], c);
|
|
106
119
|
}
|
|
107
|
-
function
|
|
108
|
-
if (
|
|
109
|
-
const
|
|
110
|
-
...
|
|
111
|
-
columnState:
|
|
120
|
+
function g(r) {
|
|
121
|
+
if (p(e)) {
|
|
122
|
+
const i = r.map((n) => ({
|
|
123
|
+
...n,
|
|
124
|
+
columnState: U(n.columnState)
|
|
112
125
|
}));
|
|
113
|
-
localStorage.setItem(
|
|
126
|
+
localStorage.setItem(p(e), JSON.stringify(i));
|
|
114
127
|
}
|
|
115
128
|
}
|
|
116
|
-
function
|
|
129
|
+
function B(r) {
|
|
117
130
|
l.value.push(r);
|
|
118
131
|
}
|
|
119
|
-
function
|
|
120
|
-
const
|
|
121
|
-
(
|
|
132
|
+
function F(r) {
|
|
133
|
+
const i = l.value.findIndex(
|
|
134
|
+
(n) => n.key === r
|
|
122
135
|
);
|
|
123
|
-
l.value.splice(
|
|
136
|
+
l.value.splice(i, 1);
|
|
124
137
|
}
|
|
125
|
-
function
|
|
126
|
-
const
|
|
127
|
-
(
|
|
138
|
+
function w(r, i) {
|
|
139
|
+
const n = l.value.findIndex(
|
|
140
|
+
(c) => c.key === r
|
|
128
141
|
);
|
|
129
|
-
return l.value[
|
|
130
|
-
...l.value[
|
|
131
|
-
...
|
|
132
|
-
}, l.value[
|
|
142
|
+
return l.value[n] = {
|
|
143
|
+
...l.value[n],
|
|
144
|
+
...i
|
|
145
|
+
}, l.value[n];
|
|
133
146
|
}
|
|
134
|
-
return
|
|
147
|
+
return v(
|
|
135
148
|
() => l.value,
|
|
136
149
|
(r) => {
|
|
137
|
-
|
|
150
|
+
g(r);
|
|
138
151
|
},
|
|
139
152
|
{ deep: !0, immediate: !0 }
|
|
140
153
|
), {
|
|
141
|
-
basicTemplate:
|
|
154
|
+
basicTemplate: s,
|
|
142
155
|
customizeTemplateList: l,
|
|
143
|
-
syncTemplateListToStorage:
|
|
144
|
-
addTemplate:
|
|
145
|
-
deleteTemplate:
|
|
146
|
-
updateTemplate:
|
|
156
|
+
syncTemplateListToStorage: g,
|
|
157
|
+
addTemplate: B,
|
|
158
|
+
deleteTemplate: F,
|
|
159
|
+
updateTemplate: w
|
|
147
160
|
};
|
|
148
161
|
};
|
|
149
162
|
export {
|
|
150
|
-
|
|
163
|
+
le as useTableTemplateStorage
|
|
151
164
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent as S, computed as
|
|
1
|
+
import { defineComponent as S, computed as n, ref as _, watchEffect as W, createBlock as h, openBlock as i, unref as r, mergeProps as j, withCtx as B, renderSlot as E, normalizeProps as F, guardReactiveProps as L, createElementVNode as b, normalizeClass as U, createElementBlock as x, Fragment as D, renderList as P, resolveDynamicComponent as R, createVNode as T } from "vue";
|
|
2
2
|
import { DownloadOutlined as z } from "@ant-design/icons-vue";
|
|
3
3
|
import { Image as V } from "@aplus-frontend/antdv";
|
|
4
4
|
import { omit as $ } from "lodash-unified";
|
|
@@ -23,20 +23,20 @@ const ue = /* @__PURE__ */ S({
|
|
|
23
23
|
uiMode: {},
|
|
24
24
|
preview: { type: [Boolean, Object], default: !0 }
|
|
25
25
|
},
|
|
26
|
-
setup(
|
|
27
|
-
const { b: u } = X("ap-image"), p = Q("ap-image"), e =
|
|
26
|
+
setup(v) {
|
|
27
|
+
const { b: u } = X("ap-image"), p = Q("ap-image"), e = v, d = {
|
|
28
28
|
aplus: K,
|
|
29
29
|
admin: J
|
|
30
|
-
},
|
|
30
|
+
}, k = m("apImage", { uiMode: "aplus" }), w = m("apUpload"), f = m(
|
|
31
31
|
"downloadCenterTriggerConfig"
|
|
32
|
-
),
|
|
33
|
-
() => e.uiMode ||
|
|
34
|
-
), { t:
|
|
35
|
-
() => e.getOssAccess ||
|
|
36
|
-
),
|
|
37
|
-
() => d[
|
|
38
|
-
),
|
|
39
|
-
G(
|
|
32
|
+
), C = n(
|
|
33
|
+
() => e.uiMode || k.value?.uiMode
|
|
34
|
+
), { t: O, lang: y } = Y(), g = n(
|
|
35
|
+
() => e.getOssAccess || w.value?.getOssAccess
|
|
36
|
+
), A = n(
|
|
37
|
+
() => d[C.value] || d.aplus
|
|
38
|
+
), N = n(() => e?.fallback || A.value), s = _("");
|
|
39
|
+
G(O, y), W(async () => {
|
|
40
40
|
if (!e?.src) {
|
|
41
41
|
s.value = "";
|
|
42
42
|
return;
|
|
@@ -46,11 +46,11 @@ const ue = /* @__PURE__ */ S({
|
|
|
46
46
|
return;
|
|
47
47
|
}
|
|
48
48
|
try {
|
|
49
|
-
const a = e.src?.match(/^([^:]+):(.*)$/),
|
|
50
|
-
() =>
|
|
51
|
-
|
|
49
|
+
const a = e.src?.match(/^([^:]+):(.*)$/), o = a?.[1], t = a?.[2] ?? e.src, l = await q(
|
|
50
|
+
() => o ? g.value?.(o) : g.value?.(),
|
|
51
|
+
o
|
|
52
52
|
), c = await H({
|
|
53
|
-
oss:
|
|
53
|
+
oss: l,
|
|
54
54
|
fileName: t
|
|
55
55
|
});
|
|
56
56
|
c && (s.value = c);
|
|
@@ -58,46 +58,46 @@ const ue = /* @__PURE__ */ S({
|
|
|
58
58
|
s.value = "";
|
|
59
59
|
}
|
|
60
60
|
});
|
|
61
|
-
async function
|
|
61
|
+
async function I() {
|
|
62
62
|
if (!e?.src)
|
|
63
63
|
return;
|
|
64
|
-
const a = e.src,
|
|
64
|
+
const a = e.src, o = e.fileName ?? e.src;
|
|
65
65
|
if (e.src?.startsWith("http") || e.src?.startsWith("data:")) {
|
|
66
|
-
M(a,
|
|
66
|
+
M(a, o);
|
|
67
67
|
return;
|
|
68
68
|
}
|
|
69
69
|
if (f.value?.trigger) {
|
|
70
70
|
let t = [
|
|
71
71
|
{
|
|
72
72
|
objectName: a,
|
|
73
|
-
fileName:
|
|
73
|
+
fileName: o
|
|
74
74
|
}
|
|
75
75
|
];
|
|
76
76
|
await f.value?.trigger(t);
|
|
77
77
|
}
|
|
78
78
|
}
|
|
79
|
-
const M = (a,
|
|
79
|
+
const M = (a, o) => {
|
|
80
80
|
const t = document.createElement("a");
|
|
81
|
-
t.href = a, t.rel = "noopener noreferrer", t.setAttribute("download",
|
|
81
|
+
t.href = a, t.rel = "noopener noreferrer", t.setAttribute("download", o), document.body.appendChild(t), t.click(), document.body.removeChild(t);
|
|
82
82
|
};
|
|
83
|
-
return (a,
|
|
84
|
-
class: [
|
|
83
|
+
return (a, o) => (i(), h(r(V), j({
|
|
84
|
+
class: [r(u)(), r(p)]
|
|
85
85
|
}, {
|
|
86
|
-
...
|
|
87
|
-
fallback:
|
|
86
|
+
...r($)(e, ["src", "getOssAccess"]),
|
|
87
|
+
fallback: N.value,
|
|
88
88
|
src: s.value
|
|
89
89
|
}), {
|
|
90
90
|
toolbarRender: B((t) => [
|
|
91
91
|
E(a.$slots, "toolbarRender", F(L({ ...t })), () => [
|
|
92
|
-
|
|
93
|
-
class: U([
|
|
92
|
+
b("div", {
|
|
93
|
+
class: U([r(u)("toolbar"), r(p)])
|
|
94
94
|
}, [
|
|
95
|
-
(i(!0), x(D, null, P(t.originalNodes, (
|
|
96
|
-
|
|
95
|
+
(i(!0), x(D, null, P(t.originalNodes, (l, c) => (i(), h(R(l), { key: c }))), 128)),
|
|
96
|
+
b("div", {
|
|
97
97
|
class: "ant-image-preview-operations-operation",
|
|
98
|
-
onClick:
|
|
98
|
+
onClick: I
|
|
99
99
|
}, [
|
|
100
|
-
T(
|
|
100
|
+
T(r(z))
|
|
101
101
|
])
|
|
102
102
|
], 2)
|
|
103
103
|
])
|
|
@@ -1,20 +1,21 @@
|
|
|
1
|
-
import { genComponentStyleHook as
|
|
2
|
-
const
|
|
1
|
+
import { genComponentStyleHook as a } from "../../../utils/cssinjs/index.mjs";
|
|
2
|
+
const n = (e) => {
|
|
3
3
|
const { componentCls: o } = e;
|
|
4
4
|
return {
|
|
5
5
|
[`${o}-toolbar`]: {
|
|
6
6
|
display: "flex",
|
|
7
7
|
alignItems: "center",
|
|
8
|
-
paddingInline: e.
|
|
8
|
+
paddingInline: e.spaceXL,
|
|
9
9
|
paddingBlock: 0,
|
|
10
10
|
backgroundColor: "rgba(0, 0, 0, 0.1)",
|
|
11
|
-
borderRadius: "100px"
|
|
11
|
+
borderRadius: "100px",
|
|
12
|
+
gap: e.space
|
|
12
13
|
}
|
|
13
14
|
};
|
|
14
|
-
},
|
|
15
|
-
|
|
15
|
+
}, t = a("ApImage", (e) => [
|
|
16
|
+
n(e)
|
|
16
17
|
]);
|
|
17
18
|
export {
|
|
18
|
-
|
|
19
|
-
|
|
19
|
+
t as default,
|
|
20
|
+
n as genApImageStyle
|
|
20
21
|
};
|
|
@@ -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
|
};
|