@aplus-frontend/ui 6.26.4 → 6.27.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 +1 -1
- package/es/src/ag-grid/hooks/use-columns.mjs +8 -8
- 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-virtual-config.d.ts +5 -0
- package/es/src/ag-grid/hooks/use-virtual-config.mjs +25 -0
- package/es/src/ag-grid/index.vue.mjs +274 -232
- package/es/src/ag-grid/interface.d.ts +25 -2
- package/es/src/ap-field/select/index.vue.d.ts +51 -21
- package/es/src/ap-field/select/index.vue.mjs +51 -49
- package/es/src/ap-field/select/read.vue2.mjs +4 -1
- package/es/src/ap-field/tree-select/index.vue.d.ts +29 -21
- package/es/src/ap-field/tree-select/index.vue.mjs +11 -9
- package/es/src/ap-field/tree-select/read.vue2.mjs +7 -5
- package/es/src/ap-form/ap-form.vue.d.ts +20 -0
- package/es/src/ap-form/ap-form.vue2.mjs +11 -10
- package/es/src/ap-form/drawer-form/index.vue.d.ts +22 -0
- package/es/src/ap-form/drawer-form/index.vue.mjs +1 -0
- 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-form/items/select/index.vue.d.ts +64 -28
- package/es/src/ap-form/items/tree-select/index.vue.d.ts +40 -28
- package/es/src/ap-form/modal-form/index.vue.d.ts +22 -0
- package/es/src/ap-form/modal-form/index.vue.mjs +31 -30
- package/es/src/ap-form/search-form/index.vue.d.ts +24 -2
- package/es/src/ap-form/search-form/index.vue.mjs +72 -68
- package/es/src/ap-table/constants.d.ts +52 -28
- 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/ap-view/components/main-button-content.vue.d.ts +11 -0
- package/es/src/business/ap-view/components/menu-list-content.vue.d.ts +11 -0
- 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/config-provider/config-provider-props.d.ts +14 -1
- package/es/src/config-provider/config-provider.d.ts +31 -1
- package/es/src/config-provider/hooks/use-global-config.d.ts +14 -1
- package/es/src/config-provider/index.d.ts +52 -1
- package/es/src/utils/config-provider-preset.d.ts +11 -1
- package/es/src/version.d.ts +1 -1
- package/es/src/version.mjs +1 -1
- package/es/src/work-order-modal/work-order-modal.vue.d.ts +11 -0
- 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 +1 -1
- 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-virtual-config.d.ts +5 -0
- package/lib/src/ag-grid/hooks/use-virtual-config.js +1 -0
- package/lib/src/ag-grid/index.vue.js +1 -1
- package/lib/src/ag-grid/interface.d.ts +25 -2
- package/lib/src/ap-field/select/index.vue.d.ts +51 -21
- package/lib/src/ap-field/select/index.vue.js +1 -1
- package/lib/src/ap-field/select/read.vue2.js +1 -1
- package/lib/src/ap-field/tree-select/index.vue.d.ts +29 -21
- package/lib/src/ap-field/tree-select/index.vue.js +1 -1
- package/lib/src/ap-field/tree-select/read.vue2.js +1 -1
- package/lib/src/ap-form/ap-form.vue.d.ts +20 -0
- package/lib/src/ap-form/ap-form.vue2.js +1 -1
- package/lib/src/ap-form/drawer-form/index.vue.d.ts +22 -0
- package/lib/src/ap-form/drawer-form/index.vue.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-form/items/select/index.vue.d.ts +64 -28
- package/lib/src/ap-form/items/tree-select/index.vue.d.ts +40 -28
- package/lib/src/ap-form/modal-form/index.vue.d.ts +22 -0
- package/lib/src/ap-form/modal-form/index.vue.js +1 -1
- package/lib/src/ap-form/search-form/index.vue.d.ts +24 -2
- package/lib/src/ap-form/search-form/index.vue.js +1 -1
- package/lib/src/ap-table/constants.d.ts +52 -28
- 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/ap-view/components/main-button-content.vue.d.ts +11 -0
- package/lib/src/business/ap-view/components/menu-list-content.vue.d.ts +11 -0
- 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/config-provider/config-provider-props.d.ts +14 -1
- package/lib/src/config-provider/config-provider.d.ts +31 -1
- package/lib/src/config-provider/hooks/use-global-config.d.ts +14 -1
- package/lib/src/config-provider/index.d.ts +52 -1
- package/lib/src/utils/config-provider-preset.d.ts +11 -1
- package/lib/src/version.d.ts +1 -1
- package/lib/src/version.js +1 -1
- package/lib/src/work-order-modal/work-order-modal.vue.d.ts +11 -0
- package/package.json +3 -3
- package/theme/ap-pro-card/index.css +5 -5
- package/theme/ap-pro-card/index.less +5 -5
- package/theme/ap-value-select-card/index.css +3 -4
- package/theme/ap-value-select-card/index.less +3 -4
- package/theme/index.css +8 -9
|
@@ -1,33 +1,33 @@
|
|
|
1
|
-
import { defineComponent as
|
|
1
|
+
import { defineComponent as H, inject as a, ref as J, watch as K, nextTick as Q, createElementBlock as U, openBlock as h, normalizeClass as X, unref as s, createVNode as k, withCtx as T, createElementVNode as b, createTextVNode as Y, toDisplayString as M, withModifiers as Z, createCommentVNode as ee, createBlock as te, resolveDynamicComponent as oe } from "vue";
|
|
2
2
|
import "../../config-provider/index.mjs";
|
|
3
|
-
import { getPath as
|
|
4
|
-
import { useOss as
|
|
5
|
-
import { message as c, Upload as
|
|
6
|
-
import { UploadOutlined as
|
|
7
|
-
import { fileMatchesAccept as
|
|
8
|
-
import { useLocale as
|
|
9
|
-
import { useNamespace as
|
|
10
|
-
const
|
|
3
|
+
import { getPath as ae, getName as se, getReturnData as S } from "../utils/returnData.mjs";
|
|
4
|
+
import { useOss as ne, getOssInstance as re } from "../hooks/useOss.mjs";
|
|
5
|
+
import { message as c, Upload as ie, Button as le } from "@aplus-frontend/antdv";
|
|
6
|
+
import { UploadOutlined as ue } from "@ant-design/icons-vue";
|
|
7
|
+
import { fileMatchesAccept as ce, getAcceptText as pe } from "../utils/accept.mjs";
|
|
8
|
+
import { useLocale as me } from "../../config-provider/hooks/use-locale.mjs";
|
|
9
|
+
import { useNamespace as de } from "../../config-provider/hooks/use-namespace.mjs";
|
|
10
|
+
const fe = { class: "multiple-file-context" }, ge = { key: 0 }, ve = { key: 1 }, Fe = /* @__PURE__ */ H({
|
|
11
11
|
__name: "MultipleFile",
|
|
12
|
-
setup(
|
|
13
|
-
const { t: r } =
|
|
14
|
-
|
|
12
|
+
setup(he, { expose: L }) {
|
|
13
|
+
const { t: r } = me(), { b: C } = de("ap-upload-multiple-file"), { put: z } = ne(), B = a("theme"), I = a("dirName"), x = a("accept") || "*", E = a("maxSize") ?? 500, P = a("title") || r("ap.apUpload.uploadFile"), d = a("subTitle"), i = a("maxCount") ?? 10, p = a("uploadingCount"), _ = a("beforeUpload"), A = a("customRequest"), O = a("getOssAccess"), V = a("maxSizeErrorMsg"), q = a("maxCountErrorMsg"), D = a("acceptErrorMsg"), F = a("onRemove"), w = a("showUploadErrorMsg"), n = a("value"), l = [], f = a("needName"), m = J(null);
|
|
14
|
+
K(
|
|
15
15
|
() => n?.value,
|
|
16
16
|
function(e) {
|
|
17
|
-
!m?.value?.fileList?.length && e &&
|
|
17
|
+
!m?.value?.fileList?.length && e && N(e);
|
|
18
18
|
},
|
|
19
19
|
{ immediate: !0 }
|
|
20
20
|
);
|
|
21
|
-
function
|
|
21
|
+
function N(e) {
|
|
22
22
|
if (!e) {
|
|
23
23
|
u = [], m.value.fileList = [], n.value = void 0, l.splice(0, l.length);
|
|
24
24
|
return;
|
|
25
25
|
}
|
|
26
|
-
|
|
26
|
+
Q(() => {
|
|
27
27
|
const t = e.map((o) => {
|
|
28
|
-
const v =
|
|
28
|
+
const v = ae(f, o), G = se(f, o), y = new File(
|
|
29
29
|
[o],
|
|
30
|
-
|
|
30
|
+
G,
|
|
31
31
|
{}
|
|
32
32
|
);
|
|
33
33
|
return y.response = v, y.uid = v, y;
|
|
@@ -48,8 +48,8 @@ const de = { class: "multiple-file-context" }, fe = { key: 0 }, ge = { key: 1 },
|
|
|
48
48
|
}), m.value.fileList = t, n.value = e;
|
|
49
49
|
});
|
|
50
50
|
}
|
|
51
|
-
L({ setValue:
|
|
52
|
-
let u = [],
|
|
51
|
+
L({ setValue: N });
|
|
52
|
+
let u = [], R;
|
|
53
53
|
function g(e) {
|
|
54
54
|
setTimeout(() => {
|
|
55
55
|
const t = m.value.fileList.findIndex(
|
|
@@ -58,32 +58,32 @@ const de = { class: "multiple-file-context" }, fe = { key: 0 }, ge = { key: 1 },
|
|
|
58
58
|
t >= 0 && m.value.fileList.splice(t, 1);
|
|
59
59
|
});
|
|
60
60
|
}
|
|
61
|
-
async function
|
|
61
|
+
async function $(e) {
|
|
62
62
|
if (i && i > 1 && u.length >= i)
|
|
63
|
-
return clearTimeout(
|
|
63
|
+
return clearTimeout(R), R = setTimeout(() => {
|
|
64
64
|
c.warning(
|
|
65
|
-
|
|
65
|
+
q || r("ap.apUpload.maxUploadFiles", {
|
|
66
66
|
maxCount: i
|
|
67
67
|
})
|
|
68
68
|
);
|
|
69
69
|
}), g(e), !1;
|
|
70
|
-
if (e.size >
|
|
70
|
+
if (e.size > E * 1024 * 1024)
|
|
71
71
|
return c.warning(
|
|
72
|
-
|
|
73
|
-
maxSize:
|
|
72
|
+
V || r("ap.apUpload.maxUploadFileSize", {
|
|
73
|
+
maxSize: E
|
|
74
74
|
})
|
|
75
75
|
), g(e), !1;
|
|
76
|
-
if (!
|
|
76
|
+
if (!ce(e, x))
|
|
77
77
|
return c.warning(
|
|
78
|
-
|
|
78
|
+
D || r("ap.apUpload.fileFormatNotSupported")
|
|
79
79
|
), g(e), !1;
|
|
80
|
-
if (typeof
|
|
80
|
+
if (typeof _ == "function" && await _(e) === !1)
|
|
81
81
|
return g(e), !1;
|
|
82
82
|
i && i === 1 && (u = [], n.value = void 0), u.push(e);
|
|
83
83
|
}
|
|
84
|
-
async function
|
|
85
|
-
if (p.value++, typeof
|
|
86
|
-
|
|
84
|
+
async function j(e) {
|
|
85
|
+
if (p.value++, typeof A == "function") {
|
|
86
|
+
A({
|
|
87
87
|
onProgress: (t) => {
|
|
88
88
|
setTimeout(() => {
|
|
89
89
|
e.onProgress({
|
|
@@ -92,7 +92,7 @@ const de = { class: "multiple-file-context" }, fe = { key: 0 }, ge = { key: 1 },
|
|
|
92
92
|
});
|
|
93
93
|
},
|
|
94
94
|
onError: (t) => {
|
|
95
|
-
c.warning(t || r("ap.apUpload.networkAnomaly")), setTimeout(() => {
|
|
95
|
+
w && c.warning(t || r("ap.apUpload.networkAnomaly")), setTimeout(() => {
|
|
96
96
|
e.onError({
|
|
97
97
|
name: t,
|
|
98
98
|
message: t
|
|
@@ -115,10 +115,10 @@ const de = { class: "multiple-file-context" }, fe = { key: 0 }, ge = { key: 1 },
|
|
|
115
115
|
return;
|
|
116
116
|
}
|
|
117
117
|
try {
|
|
118
|
-
const t = await
|
|
119
|
-
e.file.oss = t,
|
|
118
|
+
const t = await re(O);
|
|
119
|
+
e.file.oss = t, z({
|
|
120
120
|
file: e.file,
|
|
121
|
-
dirName:
|
|
121
|
+
dirName: I,
|
|
122
122
|
oss: t,
|
|
123
123
|
successCallBack(o) {
|
|
124
124
|
e.onSuccess(o), n.value = [
|
|
@@ -130,7 +130,7 @@ const de = { class: "multiple-file-context" }, fe = { key: 0 }, ge = { key: 1 },
|
|
|
130
130
|
}), p.value--;
|
|
131
131
|
},
|
|
132
132
|
errorCallBack(o) {
|
|
133
|
-
c.warning(o || r("ap.apUpload.networkAnomaly")), e.onError({
|
|
133
|
+
w && c.warning(o || r("ap.apUpload.networkAnomaly")), e.onError({
|
|
134
134
|
name: o,
|
|
135
135
|
message: o
|
|
136
136
|
}), p.value--;
|
|
@@ -142,7 +142,7 @@ const de = { class: "multiple-file-context" }, fe = { key: 0 }, ge = { key: 1 },
|
|
|
142
142
|
}
|
|
143
143
|
});
|
|
144
144
|
} catch (t) {
|
|
145
|
-
c.warning(
|
|
145
|
+
w && c.warning(
|
|
146
146
|
typeof t?.message == "string" ? t.message : r("ap.apUpload.networkAnomaly")
|
|
147
147
|
), e.onError({
|
|
148
148
|
name: t?.message || r("ap.apUpload.networkAnomaly"),
|
|
@@ -150,8 +150,8 @@ const de = { class: "multiple-file-context" }, fe = { key: 0 }, ge = { key: 1 },
|
|
|
150
150
|
}), p.value--;
|
|
151
151
|
}
|
|
152
152
|
}
|
|
153
|
-
function
|
|
154
|
-
if (
|
|
153
|
+
function W(e) {
|
|
154
|
+
if (F && F?.(e), e.response) {
|
|
155
155
|
if (Array.isArray(n.value)) {
|
|
156
156
|
const o = l.findIndex((v) => v.uid === e.uid);
|
|
157
157
|
o >= 0 && (n?.value.splice(o, 1), l.splice(o, 1)), n.value.length === 0 && (n.value = void 0);
|
|
@@ -163,16 +163,16 @@ const de = { class: "multiple-file-context" }, fe = { key: 0 }, ge = { key: 1 },
|
|
|
163
163
|
);
|
|
164
164
|
return u.splice(t, 1), Promise.resolve(!0);
|
|
165
165
|
}
|
|
166
|
-
return (e, t) => (
|
|
167
|
-
class:
|
|
166
|
+
return (e, t) => (h(), U("div", {
|
|
167
|
+
class: X({
|
|
168
168
|
[s(C)()]: !0,
|
|
169
|
-
[s(C)("admin")]: s(
|
|
169
|
+
[s(C)("admin")]: s(B) === "admin"
|
|
170
170
|
})
|
|
171
171
|
}, [
|
|
172
|
-
k(s(
|
|
172
|
+
k(s(ie), {
|
|
173
173
|
ref_key: "uploadRef",
|
|
174
174
|
ref: m,
|
|
175
|
-
accept: s(
|
|
175
|
+
accept: s(x),
|
|
176
176
|
multiple: "",
|
|
177
177
|
"max-count": s(i),
|
|
178
178
|
progress: {
|
|
@@ -180,27 +180,27 @@ const de = { class: "multiple-file-context" }, fe = { key: 0 }, ge = { key: 1 },
|
|
|
180
180
|
showInfo: !1,
|
|
181
181
|
strokeColor: "#0070FF"
|
|
182
182
|
},
|
|
183
|
-
"before-upload":
|
|
184
|
-
"custom-request":
|
|
185
|
-
onRemove:
|
|
183
|
+
"before-upload": $,
|
|
184
|
+
"custom-request": j,
|
|
185
|
+
onRemove: W
|
|
186
186
|
}, {
|
|
187
|
-
default:
|
|
188
|
-
|
|
189
|
-
k(s(
|
|
190
|
-
default:
|
|
191
|
-
k(s(
|
|
192
|
-
|
|
187
|
+
default: T(() => [
|
|
188
|
+
b("div", fe, [
|
|
189
|
+
k(s(le), { class: "file-btn" }, {
|
|
190
|
+
default: T(() => [
|
|
191
|
+
k(s(ue)),
|
|
192
|
+
Y(" " + M(s(P)), 1)
|
|
193
193
|
]),
|
|
194
194
|
_: 1
|
|
195
195
|
}),
|
|
196
|
-
|
|
196
|
+
b("div", {
|
|
197
197
|
class: "sub-title",
|
|
198
|
-
onClick: t[0] || (t[0] =
|
|
198
|
+
onClick: t[0] || (t[0] = Z(() => {
|
|
199
199
|
}, ["stop"]))
|
|
200
200
|
}, [
|
|
201
|
-
typeof s(d) == "string" ? (
|
|
202
|
-
(
|
|
203
|
-
])) :
|
|
201
|
+
typeof s(d) == "string" ? (h(), U("div", ge, M(s(d) || `${s(r)("ap.apUpload.supportExtension")}:${s(pe)(s(x))}`), 1)) : s(d) ? (h(), U("div", ve, [
|
|
202
|
+
(h(), te(oe(s(d))))
|
|
203
|
+
])) : ee("", !0)
|
|
204
204
|
])
|
|
205
205
|
])
|
|
206
206
|
]),
|
|
@@ -210,5 +210,5 @@ const de = { class: "multiple-file-context" }, fe = { key: 0 }, ge = { key: 1 },
|
|
|
210
210
|
}
|
|
211
211
|
});
|
|
212
212
|
export {
|
|
213
|
-
|
|
213
|
+
Fe as default
|
|
214
214
|
};
|
|
@@ -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
|
};
|