@aplus-frontend/ui 7.10.4 → 7.10.6
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-field/interface.d.ts +1 -1
- package/es/src/ap-field/slider/index.vue.d.ts +196 -412
- package/es/src/ap-field/slider/index.vue.mjs +50 -39
- package/es/src/business/ap-appendix/ap-appendix.vue2.mjs +68 -67
- package/es/src/business/ap-attachment/ApAttachment.d.ts +2 -8
- package/es/src/business/ap-attachment/ApAttachment.mjs +46 -40
- package/es/src/business/ap-attachment/constans.d.ts +1 -4
- package/es/src/business/ap-attachment/constans.mjs +3 -6
- package/es/src/business/ap-attachment/index.d.ts +3 -12
- package/es/src/business/ap-ladder/components/RenderValue.mjs +25 -22
- package/es/src/business/ap-ladder/utils.d.ts +1 -0
- package/es/src/business/ap-ladder/utils.mjs +10 -9
- package/es/src/business/ap-title/ApTitle.vue.d.ts +1 -1
- package/es/src/business/ap-title/index.d.ts +3 -3
- package/es/src/business/ap-title/interface.d.ts +1 -1
- package/es/src/business/ap-upload/apUpload.vue.d.ts +9 -0
- package/es/src/business/ap-upload/apUpload.vue.mjs +22 -18
- package/es/src/business/ap-upload/components/MultipleFile.vue2.mjs +128 -123
- package/es/src/business/ap-upload/components/Picture.vue2.mjs +150 -147
- package/es/src/business/ap-upload/components/SingleFile.vue2.mjs +130 -127
- package/es/src/business/ap-upload/hooks/useOss.d.ts +2 -1
- package/es/src/business/ap-upload/hooks/useOss.mjs +52 -51
- package/es/src/business/ap-upload-file/ap-upload-single/ap-upload-single.vue.mjs +11 -10
- package/es/src/business/ap-upload-file/hook/useOss.d.ts +6 -1
- package/es/src/business/ap-upload-file/hook/useOss.mjs +19 -16
- package/es/src/business/ap-upload-file/interface.d.ts +3 -1
- package/es/src/business/ap-upload-file/utils/upload.mjs +22 -20
- package/es/src/version.d.ts +1 -1
- package/es/src/version.mjs +1 -1
- package/lib/src/ap-field/interface.d.ts +1 -1
- package/lib/src/ap-field/slider/index.vue.d.ts +196 -412
- package/lib/src/ap-field/slider/index.vue.js +1 -1
- package/lib/src/business/ap-appendix/ap-appendix.vue2.js +1 -1
- package/lib/src/business/ap-attachment/ApAttachment.d.ts +2 -8
- package/lib/src/business/ap-attachment/ApAttachment.js +1 -1
- package/lib/src/business/ap-attachment/constans.d.ts +1 -4
- package/lib/src/business/ap-attachment/constans.js +1 -1
- package/lib/src/business/ap-attachment/index.d.ts +3 -12
- package/lib/src/business/ap-ladder/components/RenderValue.js +1 -1
- package/lib/src/business/ap-ladder/utils.d.ts +1 -0
- package/lib/src/business/ap-ladder/utils.js +1 -1
- package/lib/src/business/ap-title/ApTitle.vue.d.ts +1 -1
- package/lib/src/business/ap-title/index.d.ts +3 -3
- package/lib/src/business/ap-title/interface.d.ts +1 -1
- package/lib/src/business/ap-upload/apUpload.vue.d.ts +9 -0
- package/lib/src/business/ap-upload/apUpload.vue.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/business/ap-upload/components/SingleFile.vue2.js +1 -1
- package/lib/src/business/ap-upload/hooks/useOss.d.ts +2 -1
- package/lib/src/business/ap-upload/hooks/useOss.js +1 -1
- package/lib/src/business/ap-upload-file/ap-upload-single/ap-upload-single.vue.js +1 -1
- package/lib/src/business/ap-upload-file/hook/useOss.d.ts +6 -1
- package/lib/src/business/ap-upload-file/hook/useOss.js +1 -1
- package/lib/src/business/ap-upload-file/interface.d.ts +3 -1
- package/lib/src/business/ap-upload-file/utils/upload.js +1 -1
- package/lib/src/version.d.ts +1 -1
- package/lib/src/version.js +1 -1
- package/package.json +3 -3
|
@@ -1,30 +1,33 @@
|
|
|
1
1
|
import { createOssInstance as r } from "@aplus-frontend/oss";
|
|
2
|
-
let
|
|
3
|
-
function
|
|
4
|
-
|
|
2
|
+
let a, c, n;
|
|
3
|
+
function g(e, t, s) {
|
|
4
|
+
a = e, c = t, s && (n = s);
|
|
5
5
|
}
|
|
6
6
|
const i = {
|
|
7
7
|
"zh-cn": "zh_CN",
|
|
8
8
|
en: "en_US"
|
|
9
9
|
};
|
|
10
|
-
function
|
|
11
|
-
return i[
|
|
10
|
+
function l() {
|
|
11
|
+
return i[c.value] ?? "zh_CN";
|
|
12
12
|
}
|
|
13
|
-
async function
|
|
14
|
-
if (!
|
|
15
|
-
throw new Error(`${
|
|
16
|
-
const s = r();
|
|
13
|
+
async function O({ bucket: e } = {}) {
|
|
14
|
+
if (!n)
|
|
15
|
+
throw new Error(`${a("ap.apUpload.pleasePass")}getOssAccess`);
|
|
16
|
+
const t = await (e ? n(e) : n()), s = r();
|
|
17
17
|
return await s.initOssClient({
|
|
18
|
-
getOssAccess: t,
|
|
19
|
-
locale:
|
|
20
|
-
onFailure: (
|
|
18
|
+
getOssAccess: async () => t,
|
|
19
|
+
locale: l(),
|
|
20
|
+
onFailure: (o) => {
|
|
21
21
|
throw new Error(
|
|
22
|
-
typeof
|
|
22
|
+
typeof o?.message == "string" ? o.message : a("ap.apUpload.FailedToObtainOssTemporaryPermissions")
|
|
23
23
|
);
|
|
24
24
|
}
|
|
25
|
-
}),
|
|
25
|
+
}), {
|
|
26
|
+
oss: s,
|
|
27
|
+
bucket: t?.bucket
|
|
28
|
+
};
|
|
26
29
|
}
|
|
27
30
|
export {
|
|
28
|
-
|
|
29
|
-
|
|
31
|
+
O as getOssInstance,
|
|
32
|
+
g as injectHookOss
|
|
30
33
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { UploadFile, UploadChangeParam, UploadProps } from '@aplus-frontend/antdv';
|
|
2
2
|
import { accessCreate } from '@aplus-frontend/oss';
|
|
3
3
|
import { VNodeChild } from 'vue';
|
|
4
|
-
export type ApUploadGetOssAccess = () => Promise<accessCreate>;
|
|
4
|
+
export type ApUploadGetOssAccess = (bucket?: string) => Promise<accessCreate>;
|
|
5
5
|
type Parameters<T extends (...args: any) => any> = T extends (...args: infer P) => any ? P : never;
|
|
6
6
|
export type ApUploadFile<T = any> = UploadFile<T> & {
|
|
7
7
|
ossDestroy?: () => any;
|
|
@@ -11,6 +11,7 @@ export type ApUploadCustomRequest = (option: Omit<Parameters<Exclude<UploadProps
|
|
|
11
11
|
file?: ApUploadFile;
|
|
12
12
|
}, props?: {
|
|
13
13
|
dirName?: string;
|
|
14
|
+
bucket?: string;
|
|
14
15
|
}) => void;
|
|
15
16
|
export type ApUploadBaseProps<T = any> = {
|
|
16
17
|
dirName: string;
|
|
@@ -23,6 +24,7 @@ export type ApUploadBaseProps<T = any> = {
|
|
|
23
24
|
customRequest?: ApUploadCustomRequest;
|
|
24
25
|
maxSizeErrorMsg?: string;
|
|
25
26
|
acceptErrorMsg?: string;
|
|
27
|
+
bucket?: string;
|
|
26
28
|
};
|
|
27
29
|
export type ApUploadSingleProps<T = any> = ApUploadBaseProps<T> & {
|
|
28
30
|
title?: VNodeChild;
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { message as i } from "@aplus-frontend/antdv";
|
|
2
|
-
import { getOssInstance as
|
|
3
|
-
import { fileMatchesAccept as
|
|
2
|
+
import { getOssInstance as d } from "../hook/useOss.mjs";
|
|
3
|
+
import { fileMatchesAccept as x } from "./accept.mjs";
|
|
4
4
|
let o;
|
|
5
|
-
function
|
|
5
|
+
function C(e) {
|
|
6
6
|
o = e;
|
|
7
7
|
}
|
|
8
8
|
function m(e, r, a) {
|
|
9
9
|
e.status = r, e.error = a;
|
|
10
10
|
}
|
|
11
|
-
function
|
|
11
|
+
function z(e, r, a) {
|
|
12
12
|
if (a?.maxCount && a.maxCount > 1 && r.length >= a.maxCount) {
|
|
13
13
|
const t = a?.maxCountErrorMsg || o("ap.apUpload.maxUploadFiles", {
|
|
14
14
|
maxCount: a.maxCount
|
|
@@ -21,42 +21,44 @@ function S(e, r, a) {
|
|
|
21
21
|
});
|
|
22
22
|
return i.warning(t), m(e, "error", t), !1;
|
|
23
23
|
}
|
|
24
|
-
if (!
|
|
24
|
+
if (!x(e, a.accept)) {
|
|
25
25
|
const t = a?.acceptErrorMsg || o("ap.apUpload.fileFormatNotSupported");
|
|
26
26
|
return i.warning(t), m(e, "error", t), !1;
|
|
27
27
|
}
|
|
28
28
|
return !0;
|
|
29
29
|
}
|
|
30
|
-
const
|
|
31
|
-
const { file: a, onError: t, onProgress:
|
|
30
|
+
const M = async (e, r) => {
|
|
31
|
+
const { file: a, onError: t, onProgress: l, onSuccess: g } = e;
|
|
32
32
|
try {
|
|
33
|
-
const
|
|
33
|
+
const { oss: c, bucket: u } = await d({
|
|
34
|
+
bucket: r?.bucket
|
|
35
|
+
}), s = await c?.put({
|
|
34
36
|
dirName: r?.dirName,
|
|
35
37
|
fileName: a?.name,
|
|
36
38
|
data: a,
|
|
37
|
-
progressCallBack: (
|
|
38
|
-
|
|
39
|
-
percent:
|
|
39
|
+
progressCallBack: (n) => {
|
|
40
|
+
l?.({
|
|
41
|
+
percent: n
|
|
40
42
|
});
|
|
41
43
|
}
|
|
42
44
|
});
|
|
43
|
-
if (
|
|
45
|
+
if (s.status === 204)
|
|
44
46
|
return;
|
|
45
|
-
if (
|
|
46
|
-
const { saveUrl:
|
|
47
|
-
|
|
47
|
+
if (s.status === 200) {
|
|
48
|
+
const { saveUrl: n } = s, f = u && n ? `${u}:${n}` : n;
|
|
49
|
+
g?.({
|
|
48
50
|
fileName: a?.name,
|
|
49
|
-
path:
|
|
51
|
+
path: f
|
|
50
52
|
});
|
|
51
53
|
} else
|
|
52
|
-
t?.(
|
|
54
|
+
t?.(s?.message || o("ap.apUpload.networkAnomaly"));
|
|
53
55
|
} catch (c) {
|
|
54
56
|
t?.(c);
|
|
55
57
|
}
|
|
56
58
|
};
|
|
57
59
|
export {
|
|
58
60
|
m as changeFileStatus,
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
61
|
+
C as injectUtilUpload,
|
|
62
|
+
z as uploadBeforeUpload,
|
|
63
|
+
M as uploadCustomRequest
|
|
62
64
|
};
|
package/es/src/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const _default: "7.10.
|
|
1
|
+
declare const _default: "7.10.6";
|
|
2
2
|
export default _default;
|
package/es/src/version.mjs
CHANGED
|
@@ -211,7 +211,7 @@ export type ApFieldTreeSelectExpose = Omit<ApFieldSelectExpose, 'request'> & {
|
|
|
211
211
|
*/
|
|
212
212
|
request: (currentNode?: LegacyDataNode, clear?: boolean) => Promise<void>;
|
|
213
213
|
};
|
|
214
|
-
export type ApFieldSliderProps = BasicApFieldProps<SliderProps
|
|
214
|
+
export type ApFieldSliderProps = BasicApFieldProps<Partial<SliderProps>> & {
|
|
215
215
|
emptyText?: string;
|
|
216
216
|
defaultValue?: number | [number, number];
|
|
217
217
|
};
|