@aplus-frontend/ui 0.0.28 → 0.0.30
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-download/hooks/index.mjs +4 -3
- package/es/src/ap-download/interface.d.ts +2 -2
- package/es/src/ap-field/date/helper.mjs +5 -5
- package/es/src/ap-field/date-range/index.vue.mjs +15 -15
- package/es/src/ap-form/ap-form-list.vue.mjs +29 -21
- package/es/src/ap-form/ap-form.vue2.mjs +77 -77
- package/es/src/ap-form/interface.d.ts +4 -0
- package/es/src/ap-form/search-form/index.vue.mjs +123 -99
- package/es/src/ap-form/style/search-form.css +6 -0
- package/es/src/ap-table/hooks/use-table-paging.mjs +23 -21
- package/es/src/ap-upload/apUpload.vue.d.ts +3 -11
- package/es/src/ap-upload/apUpload.vue.mjs +42 -36
- package/es/src/ap-upload/components/MultipleFile.vue2.mjs +115 -102
- package/es/src/ap-upload/components/Picture.vue2.mjs +121 -111
- package/es/src/ap-upload/components/SingleFile.vue2.mjs +120 -109
- package/es/src/ap-upload/hooks/useOss.d.ts +9 -4
- package/es/src/ap-upload/hooks/useOss.mjs +52 -34
- package/es/src/ap-upload/styles/multiple-file.css +1 -1
- package/es/src/ap-upload/utils/accept.d.ts +3 -0
- package/es/src/ap-upload/utils/accept.mjs +35 -30
- package/es/src/business/ap-status/ApStatusGroup.vue.d.ts +7 -2
- package/es/src/business/ap-status/ApStatusGroup.vue2.mjs +7 -6
- package/es/src/business/ap-status/interface.d.ts +4 -1
- package/es/src/business/index.d.ts +41 -8
- package/es/src/config-provider/config-provider-props.d.ts +5 -1
- package/es/src/config-provider/config-provider-props.mjs +4 -0
- package/es/src/config-provider/config-provider.d.ts +10 -1
- package/es/src/config-provider/config-provider.mjs +9 -8
- package/es/src/config-provider/constants.d.ts +10 -0
- package/es/src/config-provider/hooks/use-global-config.d.ts +5 -1
- package/es/src/config-provider/index.d.ts +20 -1
- package/es/src/editable-table/style/index.css +3 -0
- package/es/src/locale/lang/en.mjs +24 -0
- package/es/src/locale/lang/zh-cn.mjs +24 -0
- package/es/src/theme/ap-form/search-form.css +6 -0
- package/es/src/theme/ap-upload/multiple-file.css +1 -1
- package/es/src/theme/editable-table/index.css +3 -0
- package/es/src/work-order-modal/createWorkOrder.d.ts +3 -1
- package/es/src/work-order-modal/interfaces.d.ts +3 -1
- package/es/src/work-order-modal/work-order-modal.vue.mjs +7 -7
- package/lib/src/ap-download/hooks/index.js +1 -1
- package/lib/src/ap-download/interface.d.ts +2 -2
- package/lib/src/ap-field/date/helper.js +1 -1
- package/lib/src/ap-field/date-range/index.vue.js +1 -1
- package/lib/src/ap-form/ap-form-list.vue.js +1 -1
- package/lib/src/ap-form/ap-form.vue2.js +1 -1
- package/lib/src/ap-form/interface.d.ts +4 -0
- package/lib/src/ap-form/search-form/index.vue.js +1 -1
- package/lib/src/ap-form/style/search-form.css +6 -0
- package/lib/src/ap-table/hooks/use-table-paging.js +1 -1
- package/lib/src/ap-upload/apUpload.vue.d.ts +3 -11
- 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/ap-upload/hooks/useOss.d.ts +9 -4
- package/lib/src/ap-upload/hooks/useOss.js +1 -1
- package/lib/src/ap-upload/styles/multiple-file.css +1 -1
- package/lib/src/ap-upload/utils/accept.d.ts +3 -0
- package/lib/src/ap-upload/utils/accept.js +1 -1
- package/lib/src/business/ap-status/ApStatusGroup.vue.d.ts +7 -2
- package/lib/src/business/ap-status/ApStatusGroup.vue2.js +1 -1
- package/lib/src/business/ap-status/interface.d.ts +4 -1
- package/lib/src/business/index.d.ts +41 -8
- package/lib/src/config-provider/config-provider-props.d.ts +5 -1
- package/lib/src/config-provider/config-provider-props.js +1 -1
- package/lib/src/config-provider/config-provider.d.ts +10 -1
- package/lib/src/config-provider/config-provider.js +1 -1
- package/lib/src/config-provider/constants.d.ts +10 -0
- package/lib/src/config-provider/hooks/use-global-config.d.ts +5 -1
- package/lib/src/config-provider/index.d.ts +20 -1
- package/lib/src/editable-table/style/index.css +3 -0
- package/lib/src/locale/lang/en.js +1 -1
- package/lib/src/locale/lang/zh-cn.js +1 -1
- package/lib/src/theme/ap-form/search-form.css +6 -0
- package/lib/src/theme/ap-upload/multiple-file.css +1 -1
- package/lib/src/theme/editable-table/index.css +3 -0
- package/lib/src/work-order-modal/createWorkOrder.d.ts +3 -1
- package/lib/src/work-order-modal/interfaces.d.ts +3 -1
- package/lib/src/work-order-modal/work-order-modal.vue.js +1 -1
- package/package.json +1 -1
|
@@ -1,213 +1,224 @@
|
|
|
1
|
-
import { defineComponent as
|
|
1
|
+
import { defineComponent as V, inject as s, ref as h, watch as ee, computed as te, openBlock as _, createElementBlock as A, normalizeClass as ae, unref as a, createElementVNode as i, toDisplayString as x, createCommentVNode as z, normalizeStyle as ne, createBlock as oe, withModifiers as le, createVNode as se } 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
|
|
7
|
-
import { DeleteOutlined as
|
|
8
|
-
import
|
|
3
|
+
import { getName as re, getReturnData as $ } from "../utils/returnData.mjs";
|
|
4
|
+
import { useOss as ie, useOssInit as ce } from "../hooks/useOss.mjs";
|
|
5
|
+
import { fileMatchesAccept as ue, getAcceptText as pe } from "../utils/accept.mjs";
|
|
6
|
+
import { message as u, Progress as ve } from "ant-design-vue";
|
|
7
|
+
import { DeleteOutlined as de } from "@ant-design/icons-vue";
|
|
8
|
+
import q from "../assets/single-file-icon.png.mjs";
|
|
9
9
|
import "../styles/single-file.css";
|
|
10
|
-
import {
|
|
11
|
-
|
|
10
|
+
import { useLocale as fe } from "../../config-provider/hooks/use-locale.mjs";
|
|
11
|
+
import { useNamespace as me } from "../../config-provider/hooks/use-namespace.mjs";
|
|
12
|
+
const ge = ["accept"], he = {
|
|
12
13
|
key: 0,
|
|
13
14
|
class: "state-un"
|
|
14
|
-
},
|
|
15
|
+
}, _e = ["src"], ke = { class: "state-un-title" }, ye = { class: "state-un-subtitle" }, De = {
|
|
15
16
|
key: 1,
|
|
16
17
|
class: "state-ing"
|
|
17
|
-
},
|
|
18
|
+
}, Ce = { class: "left" }, we = ["src"], Fe = { class: "center" }, Ue = { class: "center-progress" }, Te = /* @__PURE__ */ V({
|
|
18
19
|
__name: "SingleFile",
|
|
19
|
-
setup(
|
|
20
|
-
const { b:
|
|
21
|
-
|
|
22
|
-
() =>
|
|
20
|
+
setup(Ne) {
|
|
21
|
+
const { t: r } = fe(), { b: k } = me("ap-upload-single-file"), { put: M, client: B } = ie(), y = s("theme"), j = s("dirName"), D = s("accept") || "*", C = s("maxSize") ?? 500, G = s("title") || r("ap.apUpload.clickOrDragUpload"), w = s("subTitle"), n = s("value"), F = s("needName"), p = s("uploadingCount"), b = s("beforeUpload"), O = s("customRequest"), W = s("getOssAccess"), o = h(null);
|
|
22
|
+
ee(
|
|
23
|
+
() => n == null ? void 0 : n.value,
|
|
23
24
|
function(e) {
|
|
24
|
-
const t =
|
|
25
|
-
|
|
25
|
+
const t = re(F, e);
|
|
26
|
+
o.value === null && e && (l.value = 3, o.value = new File([e], t, {}));
|
|
26
27
|
}
|
|
27
28
|
);
|
|
28
|
-
const
|
|
29
|
+
const l = h(1), f = h(0), m = h(null), P = te(() => o.value && (n == null ? void 0 : n.value));
|
|
29
30
|
function H() {
|
|
30
31
|
var e;
|
|
31
|
-
|
|
32
|
+
l.value === 1 && ((e = m.value) == null || e.click());
|
|
32
33
|
}
|
|
33
|
-
function
|
|
34
|
+
function L(e) {
|
|
34
35
|
e.preventDefault(), e.stopPropagation();
|
|
35
36
|
}
|
|
36
37
|
function J(e) {
|
|
37
38
|
e.dataTransfer.dropEffect = "copy", e.preventDefault(), e.stopPropagation();
|
|
38
39
|
}
|
|
39
40
|
function K(e) {
|
|
40
|
-
|
|
41
|
+
R(e);
|
|
41
42
|
}
|
|
42
43
|
function Q(e) {
|
|
43
|
-
if (e.preventDefault(), e.stopPropagation(),
|
|
44
|
+
if (e.preventDefault(), e.stopPropagation(), l.value !== 1)
|
|
44
45
|
return;
|
|
45
|
-
var t = e.dataTransfer,
|
|
46
|
+
var t = e.dataTransfer, c = [], T = 0, I = t.files.length;
|
|
46
47
|
function v() {
|
|
47
|
-
|
|
48
|
+
T === I - 1 && K(c), T++;
|
|
48
49
|
}
|
|
49
50
|
if (t.items !== void 0)
|
|
50
|
-
for (var
|
|
51
|
-
var
|
|
52
|
-
if (
|
|
53
|
-
var
|
|
54
|
-
|
|
51
|
+
for (var U = 0; U < t.items.length; U++) {
|
|
52
|
+
var N = t.items[U];
|
|
53
|
+
if (N.kind === "file" && N.webkitGetAsEntry().isFile) {
|
|
54
|
+
var Z = N.getAsFile();
|
|
55
|
+
c.push(Z), v();
|
|
55
56
|
}
|
|
56
57
|
}
|
|
57
58
|
else
|
|
58
|
-
for (let
|
|
59
|
-
var
|
|
60
|
-
if (
|
|
61
|
-
|
|
59
|
+
for (let E = 0; E < I; E++) {
|
|
60
|
+
var g = t.files[E];
|
|
61
|
+
if (g.type)
|
|
62
|
+
c.push(g), v();
|
|
62
63
|
else
|
|
63
64
|
try {
|
|
64
|
-
var
|
|
65
|
-
|
|
65
|
+
var S = new FileReader();
|
|
66
|
+
S.readAsDataURL(g.slice(0, 3)), S.addEventListener(
|
|
66
67
|
"load",
|
|
67
|
-
function(
|
|
68
|
-
console.warn(
|
|
68
|
+
function(d) {
|
|
69
|
+
console.warn(d, "load"), c.push(g), v();
|
|
69
70
|
},
|
|
70
71
|
!1
|
|
71
|
-
),
|
|
72
|
+
), S.addEventListener(
|
|
72
73
|
"error",
|
|
73
|
-
function(
|
|
74
|
-
console.warn(
|
|
74
|
+
function(d) {
|
|
75
|
+
console.warn(d, "error"), u.warning(r("ap.apUpload.foldersNotSupported")), v();
|
|
75
76
|
},
|
|
76
77
|
!1
|
|
77
78
|
);
|
|
78
|
-
} catch (
|
|
79
|
-
console.warn(
|
|
79
|
+
} catch (d) {
|
|
80
|
+
console.warn(d), u.warning(r("ap.apUpload.foldersNotSupported")), v();
|
|
80
81
|
}
|
|
81
82
|
}
|
|
82
83
|
}
|
|
83
|
-
function
|
|
84
|
+
function X(e) {
|
|
84
85
|
const t = e.target;
|
|
85
|
-
|
|
86
|
+
R(t == null ? void 0 : t.files), m.value && (m.value.value = "");
|
|
86
87
|
}
|
|
87
|
-
async function
|
|
88
|
+
async function R(e) {
|
|
88
89
|
if (e != null && e.length) {
|
|
89
|
-
if (typeof
|
|
90
|
-
if (
|
|
90
|
+
if (typeof b == "function") {
|
|
91
|
+
if (b(e[0]) === !1)
|
|
91
92
|
return;
|
|
92
93
|
} else {
|
|
93
|
-
if (e[0].size >
|
|
94
|
-
|
|
94
|
+
if (e[0].size > C * 1024 * 1024) {
|
|
95
|
+
u.warning(
|
|
96
|
+
r("ap.apUpload.maxUploadFileSize", {
|
|
97
|
+
maxSize: C
|
|
98
|
+
})
|
|
99
|
+
);
|
|
95
100
|
return;
|
|
96
101
|
}
|
|
97
|
-
if (!
|
|
98
|
-
|
|
102
|
+
if (!ue(e[0], D)) {
|
|
103
|
+
u.warning(r("ap.apUpload.fileFormatNotSupported"));
|
|
99
104
|
return;
|
|
100
105
|
}
|
|
101
106
|
}
|
|
102
|
-
if (
|
|
103
|
-
|
|
107
|
+
if (o.value = e[0], l.value = 2, f.value = 0, n.value = "", p.value++, typeof O == "function") {
|
|
108
|
+
O({
|
|
104
109
|
onProgress: (t) => {
|
|
105
|
-
|
|
110
|
+
f.value = t;
|
|
106
111
|
},
|
|
107
112
|
onError: (t) => {
|
|
108
|
-
|
|
113
|
+
u.warning(t || r("ap.apUpload.networkAnomaly")), l.value = 1, o.value = null, p.value--;
|
|
109
114
|
},
|
|
110
115
|
onSuccess: (t) => {
|
|
111
|
-
|
|
112
|
-
|
|
116
|
+
n.value = $(
|
|
117
|
+
F,
|
|
113
118
|
t,
|
|
114
|
-
|
|
115
|
-
),
|
|
119
|
+
o.value.name
|
|
120
|
+
), l.value = 3, p.value--;
|
|
116
121
|
},
|
|
117
122
|
file: e[0]
|
|
118
123
|
});
|
|
119
124
|
return;
|
|
120
125
|
}
|
|
121
126
|
try {
|
|
122
|
-
await
|
|
123
|
-
file:
|
|
124
|
-
dirName:
|
|
125
|
-
oss:
|
|
127
|
+
await ce(W), M({
|
|
128
|
+
file: o.value,
|
|
129
|
+
dirName: j,
|
|
130
|
+
oss: B,
|
|
126
131
|
successCallBack(t) {
|
|
127
|
-
|
|
128
|
-
|
|
132
|
+
n.value = $(
|
|
133
|
+
F,
|
|
129
134
|
t,
|
|
130
|
-
|
|
131
|
-
),
|
|
135
|
+
o.value.name
|
|
136
|
+
), l.value = 3, p.value--;
|
|
132
137
|
},
|
|
133
138
|
errorCallBack(t) {
|
|
134
|
-
|
|
139
|
+
u.warning(t || r("ap.apUpload.networkAnomaly")), l.value = 1, o.value = null, p.value--;
|
|
135
140
|
},
|
|
136
141
|
progressCallBack(t) {
|
|
137
|
-
|
|
142
|
+
f.value = t;
|
|
138
143
|
}
|
|
139
144
|
});
|
|
140
145
|
} catch (t) {
|
|
141
|
-
|
|
146
|
+
u.warning(
|
|
147
|
+
typeof (t == null ? void 0 : t.message) == "string" ? t.message : r("ap.apUpload.networkAnomaly")
|
|
148
|
+
), l.value = 1, o.value = null, p.value--;
|
|
142
149
|
}
|
|
143
150
|
}
|
|
144
151
|
}
|
|
145
|
-
function
|
|
146
|
-
|
|
152
|
+
function Y() {
|
|
153
|
+
o.value && !(n != null && n.value) && B.pauseUpload(), l.value = 1, o.value = null, n.value = void 0;
|
|
147
154
|
}
|
|
148
155
|
return (e, t) => {
|
|
149
|
-
var
|
|
150
|
-
return
|
|
151
|
-
class:
|
|
152
|
-
[
|
|
153
|
-
[
|
|
154
|
-
[
|
|
156
|
+
var c;
|
|
157
|
+
return _(), A("div", {
|
|
158
|
+
class: ae({
|
|
159
|
+
[a(k)()]: !0,
|
|
160
|
+
[a(k)("admin")]: a(y) === "admin",
|
|
161
|
+
[a(k)("un")]: l.value === 1
|
|
155
162
|
}),
|
|
156
163
|
onClick: H,
|
|
157
|
-
onDragenter:
|
|
164
|
+
onDragenter: L,
|
|
158
165
|
onDragover: J,
|
|
159
|
-
onDragleave:
|
|
166
|
+
onDragleave: L,
|
|
160
167
|
onDrop: Q
|
|
161
168
|
}, [
|
|
162
|
-
|
|
169
|
+
i("input", {
|
|
163
170
|
style: { display: "none" },
|
|
164
171
|
type: "file",
|
|
165
172
|
ref_key: "fileRef",
|
|
166
|
-
ref:
|
|
167
|
-
accept:
|
|
168
|
-
onChange:
|
|
169
|
-
}, null, 40,
|
|
170
|
-
|
|
171
|
-
|
|
173
|
+
ref: m,
|
|
174
|
+
accept: a(D),
|
|
175
|
+
onChange: X
|
|
176
|
+
}, null, 40, ge),
|
|
177
|
+
l.value === 1 ? (_(), A("div", he, [
|
|
178
|
+
i("img", {
|
|
172
179
|
class: "state-un-icon",
|
|
173
|
-
src:
|
|
174
|
-
}, null, 8,
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
180
|
+
src: a(q)
|
|
181
|
+
}, null, 8, _e),
|
|
182
|
+
i("div", ke, x(a(G)), 1),
|
|
183
|
+
i("div", ye, x(typeof a(w) == "string" && a(w).length > 0 ? a(w) : `${a(r)("ap.apUpload.supportExtension")}:${a(pe)(
|
|
184
|
+
a(D)
|
|
185
|
+
)},${a(r)("ap.apUpload.maxWarnUploadFileSize", {
|
|
186
|
+
maxSize: a(C)
|
|
187
|
+
})}`), 1)
|
|
188
|
+
])) : z("", !0),
|
|
189
|
+
[2, 3].includes(l.value) ? (_(), A("div", De, [
|
|
190
|
+
i("div", Ce, [
|
|
191
|
+
i("img", { src: a(q) }, null, 8, we)
|
|
181
192
|
]),
|
|
182
|
-
|
|
183
|
-
|
|
193
|
+
i("div", Fe, [
|
|
194
|
+
i("div", {
|
|
184
195
|
class: "center-title",
|
|
185
196
|
style: ne({
|
|
186
|
-
color:
|
|
197
|
+
color: P.value ? "#0070FF" : "#182948"
|
|
187
198
|
})
|
|
188
|
-
},
|
|
189
|
-
|
|
190
|
-
|
|
199
|
+
}, x((c = o.value) == null ? void 0 : c.name), 5),
|
|
200
|
+
i("div", Ue, [
|
|
201
|
+
P.value ? z("", !0) : (_(), oe(a(ve), {
|
|
191
202
|
key: 0,
|
|
192
|
-
percent:
|
|
203
|
+
percent: f.value,
|
|
193
204
|
size: 4,
|
|
194
205
|
showInfo: !1,
|
|
195
|
-
trailColor:
|
|
196
|
-
strokeColor:
|
|
206
|
+
trailColor: a(y) === "admin" ? "#D9D9D9" : "#DEE4ED",
|
|
207
|
+
strokeColor: a(y) === "admin" ? "#34B77C" : "#0070FF"
|
|
197
208
|
}, null, 8, ["percent", "trailColor", "strokeColor"]))
|
|
198
209
|
])
|
|
199
210
|
]),
|
|
200
|
-
|
|
211
|
+
i("div", {
|
|
201
212
|
class: "right",
|
|
202
|
-
onClick:
|
|
213
|
+
onClick: le(Y, ["stop"])
|
|
203
214
|
}, [
|
|
204
|
-
|
|
215
|
+
se(a(de))
|
|
205
216
|
])
|
|
206
|
-
])) :
|
|
217
|
+
])) : z("", !0)
|
|
207
218
|
], 34);
|
|
208
219
|
};
|
|
209
220
|
}
|
|
210
221
|
});
|
|
211
222
|
export {
|
|
212
|
-
|
|
223
|
+
Te as default
|
|
213
224
|
};
|
|
@@ -1,9 +1,14 @@
|
|
|
1
|
-
import { Oss } from '@aplus-frontend/oss';
|
|
1
|
+
import { client, Oss } from '@aplus-frontend/oss';
|
|
2
|
+
import { Translator } from '../../config-provider';
|
|
3
|
+
import { Ref } from 'vue';
|
|
4
|
+
|
|
2
5
|
export type { Oss } from '@aplus-frontend/oss';
|
|
6
|
+
export type GetOssAccess = Parameters<typeof client.initOssClient>[0]['getOssAccess'];
|
|
7
|
+
export declare function injectLocaleToOss(tValue: Translator, langValue: Ref<string>): void;
|
|
3
8
|
declare function put({ file, dirName, oss, successCallBack, errorCallBack, progressCallBack }: {
|
|
4
9
|
file: File;
|
|
5
10
|
dirName: string;
|
|
6
|
-
oss:
|
|
11
|
+
oss: Oss;
|
|
7
12
|
successCallBack: (saveUrl: string, previewUrl: string) => void;
|
|
8
13
|
errorCallBack: (msg: string) => void;
|
|
9
14
|
progressCallBack: (p: number) => void;
|
|
@@ -12,8 +17,8 @@ export declare function useOss(): {
|
|
|
12
17
|
client: Oss;
|
|
13
18
|
put: typeof put;
|
|
14
19
|
};
|
|
15
|
-
export declare function useOssInit(getOssAccess:
|
|
20
|
+
export declare function useOssInit(getOssAccess: GetOssAccess): Promise<{
|
|
16
21
|
client: Oss;
|
|
17
22
|
put: typeof put;
|
|
18
23
|
}>;
|
|
19
|
-
export declare function getOssInstance(getOssAccess:
|
|
24
|
+
export declare function getOssInstance(getOssAccess: Parameters<typeof client.initOssClient>[0]['getOssAccess']): Promise<Oss>;
|
|
@@ -1,62 +1,80 @@
|
|
|
1
|
-
import { client as
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import { client as p, createOssInstance as m } from "@aplus-frontend/oss";
|
|
2
|
+
let e, l;
|
|
3
|
+
function y(a, s) {
|
|
4
|
+
e = a, l = s;
|
|
5
|
+
}
|
|
6
|
+
const w = {
|
|
7
|
+
"zh-cn": "zh_CN",
|
|
8
|
+
en: "en_US"
|
|
9
|
+
};
|
|
10
|
+
function c() {
|
|
11
|
+
return w[l.value] ?? "zh_CN";
|
|
12
|
+
}
|
|
13
|
+
async function g({
|
|
14
|
+
file: a,
|
|
4
15
|
dirName: s,
|
|
5
|
-
oss:
|
|
6
|
-
successCallBack:
|
|
7
|
-
errorCallBack:
|
|
16
|
+
oss: t,
|
|
17
|
+
successCallBack: r,
|
|
18
|
+
errorCallBack: o,
|
|
8
19
|
progressCallBack: u
|
|
9
20
|
}) {
|
|
21
|
+
if (!s) {
|
|
22
|
+
o("required dirName");
|
|
23
|
+
return;
|
|
24
|
+
}
|
|
10
25
|
try {
|
|
11
|
-
const n = await
|
|
12
|
-
fileName:
|
|
26
|
+
const n = await t.put({
|
|
27
|
+
fileName: a.name,
|
|
13
28
|
dirName: s,
|
|
14
|
-
data:
|
|
15
|
-
progressCallBack: (
|
|
16
|
-
u(
|
|
29
|
+
data: a,
|
|
30
|
+
progressCallBack: (i) => {
|
|
31
|
+
u(i);
|
|
17
32
|
}
|
|
18
33
|
});
|
|
19
34
|
if (n.status === 204)
|
|
20
35
|
return;
|
|
21
36
|
if (n.status === 200) {
|
|
22
|
-
const { saveUrl:
|
|
23
|
-
|
|
37
|
+
const { saveUrl: i, previewUrl: f } = n;
|
|
38
|
+
r(i, f);
|
|
24
39
|
} else
|
|
25
|
-
|
|
40
|
+
o((n == null ? void 0 : n.message) || e("ap.apUpload.networkAnomaly"));
|
|
26
41
|
} catch (n) {
|
|
27
|
-
|
|
42
|
+
o(n);
|
|
28
43
|
}
|
|
29
44
|
}
|
|
30
|
-
function
|
|
31
|
-
return { client:
|
|
45
|
+
function O() {
|
|
46
|
+
return { client: p, put: g };
|
|
32
47
|
}
|
|
33
|
-
async function
|
|
34
|
-
if (!
|
|
35
|
-
throw new Error("
|
|
36
|
-
return await
|
|
37
|
-
getOssAccess:
|
|
48
|
+
async function h(a) {
|
|
49
|
+
if (!a)
|
|
50
|
+
throw new Error(`${e("ap.apUpload.pleasePass")}getOssAccess`);
|
|
51
|
+
return await p.initOssClient({
|
|
52
|
+
getOssAccess: a,
|
|
53
|
+
locale: c(),
|
|
38
54
|
onFailure: (s) => {
|
|
39
55
|
throw new Error(
|
|
40
|
-
typeof (s == null ? void 0 : s.message) == "string" ? s.message : "
|
|
56
|
+
typeof (s == null ? void 0 : s.message) == "string" ? s.message : e("ap.apUpload.FailedToObtainOssTemporaryPermissions")
|
|
41
57
|
);
|
|
42
58
|
}
|
|
43
|
-
}),
|
|
59
|
+
}), O();
|
|
44
60
|
}
|
|
45
|
-
async function
|
|
46
|
-
if (!
|
|
47
|
-
throw new Error("
|
|
48
|
-
const s =
|
|
61
|
+
async function U(a) {
|
|
62
|
+
if (!a)
|
|
63
|
+
throw new Error(`${e("ap.apUpload.pleasePass")}getOssAccess`);
|
|
64
|
+
const s = m();
|
|
49
65
|
return await s.initOssClient({
|
|
50
|
-
getOssAccess:
|
|
51
|
-
|
|
66
|
+
getOssAccess: a,
|
|
67
|
+
locale: c(),
|
|
68
|
+
onFailure: (t) => {
|
|
52
69
|
throw new Error(
|
|
53
|
-
typeof (
|
|
70
|
+
typeof (t == null ? void 0 : t.message) == "string" ? t.message : e("ap.apUpload.FailedToObtainOssTemporaryPermissions")
|
|
54
71
|
);
|
|
55
72
|
}
|
|
56
73
|
}), s;
|
|
57
74
|
}
|
|
58
75
|
export {
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
76
|
+
U as getOssInstance,
|
|
77
|
+
y as injectLocaleToOss,
|
|
78
|
+
O as useOss,
|
|
79
|
+
h as useOssInit
|
|
62
80
|
};
|
|
@@ -1,51 +1,56 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
import r from "mime";
|
|
2
|
+
let a;
|
|
3
|
+
function f(t) {
|
|
4
|
+
a = t;
|
|
5
|
+
}
|
|
6
|
+
function y(t, i) {
|
|
7
|
+
var p, o, l, c;
|
|
8
|
+
const e = i.split(",").map((n) => n.trim());
|
|
9
|
+
for (const n of e) {
|
|
10
|
+
if (n === "*")
|
|
7
11
|
return !0;
|
|
8
|
-
if (
|
|
9
|
-
const [
|
|
10
|
-
if (
|
|
12
|
+
if (n.endsWith("/*")) {
|
|
13
|
+
const [s] = n.split("/"), [u] = t.type.split("/");
|
|
14
|
+
if (s === u)
|
|
11
15
|
return !0;
|
|
12
|
-
} else if (/^\./.test(
|
|
13
|
-
if (
|
|
16
|
+
} else if (/^\./.test(n)) {
|
|
17
|
+
if (t.type === r.getType(n))
|
|
14
18
|
return !0;
|
|
15
|
-
const
|
|
16
|
-
if (
|
|
19
|
+
const s = (p = t.name) == null ? void 0 : p.lastIndexOf(".");
|
|
20
|
+
if (s > -1 && ((o = t.name) == null ? void 0 : o.slice(s)) === n)
|
|
17
21
|
return !0;
|
|
18
22
|
} else {
|
|
19
|
-
if (
|
|
23
|
+
if (t.type === n)
|
|
20
24
|
return !0;
|
|
21
|
-
const
|
|
22
|
-
if (
|
|
23
|
-
(
|
|
24
|
-
).includes((
|
|
25
|
+
const s = (l = t.name) == null ? void 0 : l.lastIndexOf(".");
|
|
26
|
+
if (s > -1 && [...r.getAllExtensions(n) || []].map(
|
|
27
|
+
(m) => `.${m}`
|
|
28
|
+
).includes((c = t.name) == null ? void 0 : c.slice(s)))
|
|
25
29
|
return !0;
|
|
26
30
|
}
|
|
27
31
|
}
|
|
28
32
|
return !1;
|
|
29
33
|
}
|
|
30
|
-
function
|
|
34
|
+
function T(t) {
|
|
31
35
|
const i = {
|
|
32
|
-
image: "
|
|
33
|
-
video: "
|
|
34
|
-
audio: "
|
|
35
|
-
application: "
|
|
36
|
-
"*": "
|
|
36
|
+
image: a("ap.apUpload.pictureType"),
|
|
37
|
+
video: a("ap.apUpload.videoType"),
|
|
38
|
+
audio: a("ap.apUpload.audioType"),
|
|
39
|
+
application: a("ap.apUpload.documentType"),
|
|
40
|
+
"*": a("ap.apUpload.allTypes")
|
|
37
41
|
};
|
|
38
|
-
return
|
|
42
|
+
return t.split(",").map((e) => e.trim()).map((e) => {
|
|
39
43
|
if (e === "*")
|
|
40
44
|
return i[e];
|
|
41
45
|
if (e.endsWith("/*")) {
|
|
42
|
-
const [
|
|
43
|
-
return i[
|
|
46
|
+
const [p] = e.split("/");
|
|
47
|
+
return i[p] || p;
|
|
44
48
|
} else
|
|
45
|
-
return /^\./.test(e) ? e : [...
|
|
49
|
+
return /^\./.test(e) ? e : [...r.getAllExtensions(e) || []].map((p) => `.${p}`).join(",") || e;
|
|
46
50
|
}).join(",");
|
|
47
51
|
}
|
|
48
52
|
export {
|
|
49
|
-
|
|
50
|
-
|
|
53
|
+
y as fileMatchesAccept,
|
|
54
|
+
T as getAcceptText,
|
|
55
|
+
f as injectLocaleToAccept
|
|
51
56
|
};
|
|
@@ -1,18 +1,23 @@
|
|
|
1
|
-
import { ApStatusGroupProps,
|
|
1
|
+
import { ApStatusGroupProps, ApStatusProps } from './interface';
|
|
2
2
|
import { DefineComponent, ComponentOptionsMixin, PublicProps, ExtractPropTypes, PropType } from 'vue';
|
|
3
3
|
|
|
4
4
|
declare const _default: DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<ApStatusGroupProps>, {
|
|
5
5
|
currentValue: number;
|
|
6
6
|
padding: number;
|
|
7
7
|
statusList: null;
|
|
8
|
+
show: boolean;
|
|
8
9
|
}>, {}, unknown, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly< ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<ApStatusGroupProps>, {
|
|
9
10
|
currentValue: number;
|
|
10
11
|
padding: number;
|
|
11
12
|
statusList: null;
|
|
13
|
+
show: boolean;
|
|
12
14
|
}>>>, {
|
|
13
15
|
padding: number;
|
|
16
|
+
show: boolean;
|
|
14
17
|
currentValue: string | number;
|
|
15
|
-
statusList:
|
|
18
|
+
statusList: Required<Pick< ApStatusProps, "text" | "color"> & {
|
|
19
|
+
value: string | number;
|
|
20
|
+
}>[] | null;
|
|
16
21
|
}, {}>;
|
|
17
22
|
export default _default;
|
|
18
23
|
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|