@keyblade/pro-components 1.12.1-alpha.18 → 1.12.1-alpha.19
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/index.d.ts +0 -1
- package/es/index.js +20 -27
- package/es/pro-image-upload/constant.d.ts +0 -1
- package/es/pro-image-upload/image-upload.vue.d.ts +38 -125
- package/es/pro-image-upload/image-upload.vue.js +58 -55
- package/es/pro-image-upload/index.d.ts +133 -268
- package/es/pro-image-upload/index.js +6 -6
- package/es/pro-image-upload/types.d.ts +0 -1
- package/es/pro-keep-alive-router-view/index.d.ts +0 -1
- package/es/pro-keep-alive-router-view/index.js +4 -4
- package/es/pro-keep-alive-router-view/pro-keep-alive-router-view.vue.d.ts +0 -1
- package/es/pro-layout/hooks.d.ts +0 -1
- package/es/pro-layout/index.d.ts +0 -1
- package/es/pro-layout/index.js +8 -8
- package/es/pro-layout/pro-layout.vue.d.ts +0 -1
- package/es/pro-layout/pro-layout.vue3.js +1 -1
- package/es/pro-menu/index.d.ts +0 -1
- package/es/pro-menu/index.js +5 -5
- package/es/pro-menu/pro-menu.vue.d.ts +0 -1
- package/es/pro-menu/pro-menu.vue3.js +1 -1
- package/es/pro-page-container/index.d.ts +1 -2
- package/es/pro-page-container/index.js +5 -5
- package/es/pro-page-container/pro-page-container.vue.d.ts +1 -2
- package/es/pro-page-container/pro-page-container.vue3.js +1 -1
- package/es/pro-page-header/index.d.ts +13 -14
- package/es/pro-page-header/index.js +8 -8
- package/es/pro-page-header/pro-page-header.vue.d.ts +5 -6
- package/es/pro-page-header/pro-page-header.vue3.js +1 -1
- package/es/pro-reuse-tabs/index.d.ts +1 -2
- package/es/pro-reuse-tabs/index.js +5 -5
- package/es/pro-reuse-tabs/pro-reuse-tabs.vue.d.ts +1 -2
- package/es/pro-reuse-tabs/pro-reuse-tabs.vue3.js +1 -1
- package/es/style.css +1 -1
- package/package.json +1 -1
- package/es/pro-layout/pro-layout.vue2.js +0 -1
- package/es/pro-menu/pro-menu.vue2.js +0 -1
- package/es/pro-page-container/pro-page-container.vue2.js +0 -1
- package/es/pro-page-header/pro-page-header.vue2.js +0 -1
- package/es/pro-reuse-tabs/pro-reuse-tabs.vue2.js +0 -1
package/es/index.d.ts
CHANGED
package/es/index.js
CHANGED
|
@@ -1,33 +1,26 @@
|
|
|
1
|
-
import { ProPageHeader as
|
|
2
|
-
import { default as U } from "./pro-page-header/index.js";
|
|
1
|
+
import { ProPageHeader as e } from "./pro-page-header/index.js";
|
|
3
2
|
import { ProKeepAliveRouterView as r } from "./pro-keep-alive-router-view/index.js";
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import { default as A } from "./pro-menu/index.js";
|
|
9
|
-
import { ProPageContainer as m } from "./pro-page-container/index.js";
|
|
10
|
-
import { default as H } from "./pro-page-container/index.js";
|
|
11
|
-
import { ProReuseTabs as f } from "./pro-reuse-tabs/index.js";
|
|
12
|
-
import { default as L } from "./pro-reuse-tabs/index.js";
|
|
3
|
+
import { ProLayout as m } from "./pro-layout/index.js";
|
|
4
|
+
import { ProMenu as t } from "./pro-menu/index.js";
|
|
5
|
+
import { ProPageContainer as i } from "./pro-page-container/index.js";
|
|
6
|
+
import { ProReuseTabs as s } from "./pro-reuse-tabs/index.js";
|
|
13
7
|
import { ProImageUpload as u } from "./pro-image-upload/index.js";
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
e.use(o), e.use(r), e.use(t), e.use(a), e.use(m), e.use(f), e.use(u);
|
|
8
|
+
import { EImageUploadInnerBeforeUploadStep as U } from "./pro-image-upload/types.js";
|
|
9
|
+
import { defaultImageUploadOptions as b } from "./pro-image-upload/constant.js";
|
|
10
|
+
const p = {
|
|
11
|
+
install(o) {
|
|
12
|
+
o.use(e), o.use(r), o.use(m), o.use(t), o.use(i), o.use(s), o.use(u);
|
|
20
13
|
}
|
|
21
14
|
};
|
|
22
15
|
export {
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
16
|
+
U as EImageUploadInnerBeforeUploadStep,
|
|
17
|
+
u as ProImageUpload,
|
|
18
|
+
r as ProKeepAliveRouterView,
|
|
19
|
+
m as ProLayout,
|
|
20
|
+
t as ProMenu,
|
|
21
|
+
i as ProPageContainer,
|
|
22
|
+
e as ProPageHeader,
|
|
23
|
+
s as ProReuseTabs,
|
|
24
|
+
p as default,
|
|
25
|
+
b as defaultImageUploadOptions
|
|
33
26
|
};
|
|
@@ -1,59 +1,59 @@
|
|
|
1
1
|
import { FileItem } from '@arco-design/web-vue';
|
|
2
2
|
import { EImageUploadInnerBeforeUploadStep } from './types';
|
|
3
3
|
import { ImageUploadCheckOptions, ImageUploadCompressorOptions, ImageUploadCropOptions } from '@keyblade/one-travel';
|
|
4
|
-
|
|
5
|
-
declare const _default: import('vue').DefineComponent<import('vue').ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
|
|
4
|
+
type __VLS_Props = {
|
|
6
5
|
/** 上传地址 */
|
|
7
6
|
action: string;
|
|
8
7
|
/** 处理响应 */
|
|
9
|
-
handlerResponse?: (
|
|
10
|
-
[key: string]: any;
|
|
8
|
+
handlerResponse?: (response: any) => Promise<{
|
|
11
9
|
/** 是否成功 */
|
|
12
10
|
success: boolean;
|
|
13
11
|
/** 图片地址 */
|
|
14
|
-
url?: string
|
|
12
|
+
url?: string;
|
|
15
13
|
/** 错误消息(如果不传,请自行提示错误消息) */
|
|
16
|
-
errorMessage?: string
|
|
17
|
-
|
|
14
|
+
errorMessage?: string;
|
|
15
|
+
/** 其他字段 */
|
|
16
|
+
[key: string]: any;
|
|
17
|
+
}>;
|
|
18
18
|
/** 设置上传的请求头部 */
|
|
19
|
-
headers?: Record<string, any
|
|
19
|
+
headers?: Record<string, any>;
|
|
20
20
|
/** 上传时附带的额外参数 */
|
|
21
|
-
data?: Record<string, any
|
|
21
|
+
data?: Record<string, any>;
|
|
22
22
|
/** 上传的文件字段名 - 默认: file */
|
|
23
|
-
name?: string
|
|
23
|
+
name?: string;
|
|
24
24
|
/** 提示文字 */
|
|
25
|
-
tip?: string
|
|
25
|
+
tip?: string;
|
|
26
26
|
/** 接受上传的文件类型 - 默认: ['jpg', 'jpeg', 'png', 'bmp', 'heif', 'heic', 'gif', 'webp'] */
|
|
27
|
-
accept?: string[]
|
|
27
|
+
accept?: string[];
|
|
28
28
|
/** 是否支持多选文件 - 默认: true */
|
|
29
|
-
multiple?: boolean
|
|
29
|
+
multiple?: boolean;
|
|
30
30
|
/** 单次最大限制 - 默认: 10 */
|
|
31
|
-
singleLimit?: number
|
|
31
|
+
singleLimit?: number;
|
|
32
32
|
/** 最大允许上传个数 */
|
|
33
|
-
limit?: number
|
|
33
|
+
limit?: number;
|
|
34
34
|
/** 是否禁用 - 默认: false */
|
|
35
|
-
disabled?: boolean
|
|
35
|
+
disabled?: boolean;
|
|
36
36
|
/** 隐藏内置上传文件之前的loading效果 - 默认: false */
|
|
37
|
-
hideInnerBeforeUploadLoading?: boolean
|
|
37
|
+
hideInnerBeforeUploadLoading?: boolean;
|
|
38
38
|
/** 校验选项 */
|
|
39
|
-
checkOptions?: ImageUploadCheckOptions
|
|
39
|
+
checkOptions?: ImageUploadCheckOptions;
|
|
40
40
|
/** 压缩选项 */
|
|
41
|
-
compressorOptions?: ImageUploadCompressorOptions
|
|
41
|
+
compressorOptions?: ImageUploadCompressorOptions;
|
|
42
42
|
/** 剪裁选项 */
|
|
43
|
-
cropOptions?: ImageUploadCropOptions
|
|
43
|
+
cropOptions?: ImageUploadCropOptions;
|
|
44
44
|
/** 文件列表移除文件时的钩子 */
|
|
45
45
|
/** 文件上传成功时的钩子 */
|
|
46
|
-
onSuccess?: (
|
|
46
|
+
onSuccess?: (fileItem: FileItem) => void;
|
|
47
47
|
/** 文件上传失败时的钩子 */
|
|
48
|
-
onError?: (
|
|
48
|
+
onError?: (fileItem: FileItem) => void;
|
|
49
49
|
/** 文件超出个数限制时的钩子 */
|
|
50
|
-
onExceed?: (
|
|
50
|
+
onExceed?: (fileList: FileItem[], files: File[]) => void;
|
|
51
51
|
/** 上传文件之前的钩子,参数为上传的文件,若返回 false 或者返回 Promise 且被 reject,则停止上传。*/
|
|
52
|
-
onBeforeUpload?: (
|
|
52
|
+
onBeforeUpload?: (file: File) => boolean | Promise<any>;
|
|
53
53
|
/** 内置上传文件之前开始 */
|
|
54
|
-
onInnerBeforeUploadStart?: (
|
|
54
|
+
onInnerBeforeUploadStart?: (file: File, index: number, type: EImageUploadInnerBeforeUploadStep) => void;
|
|
55
55
|
/** 内置上传文件之前结束 */
|
|
56
|
-
onInnerBeforeUploadEnd?: (
|
|
56
|
+
onInnerBeforeUploadEnd?: (file: File, index: number, type: EImageUploadInnerBeforeUploadStep, result: {
|
|
57
57
|
success: boolean;
|
|
58
58
|
error?: {
|
|
59
59
|
size?: boolean;
|
|
@@ -64,15 +64,12 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
|
|
|
64
64
|
crop?: boolean;
|
|
65
65
|
};
|
|
66
66
|
errorMessage?: string;
|
|
67
|
-
}) => void
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
disabled: boolean | undefined;
|
|
74
|
-
hideInnerBeforeUploadLoading: boolean | undefined;
|
|
75
|
-
}>>, {
|
|
67
|
+
}) => void;
|
|
68
|
+
};
|
|
69
|
+
type __VLS_PublicProps = {
|
|
70
|
+
modelValue: FileItem[];
|
|
71
|
+
} & __VLS_Props;
|
|
72
|
+
declare const _default: import('vue').DefineComponent<__VLS_PublicProps, {
|
|
76
73
|
uploadInsRef: import('vue').Ref<import('vue').CreateComponentPublicInstanceWithMixins<Readonly<{
|
|
77
74
|
fileList?: unknown;
|
|
78
75
|
defaultFileList?: unknown;
|
|
@@ -550,79 +547,12 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
|
|
|
550
547
|
}> | undefined>;
|
|
551
548
|
cropperInsRef: import('vue').Ref<any, any>;
|
|
552
549
|
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
553
|
-
|
|
554
|
-
}
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
/** 处理响应 */
|
|
558
|
-
handlerResponse?: ((response: any) => Promise<{
|
|
559
|
-
[key: string]: any;
|
|
560
|
-
/** 是否成功 */
|
|
561
|
-
success: boolean;
|
|
562
|
-
/** 图片地址 */
|
|
563
|
-
url?: string | undefined;
|
|
564
|
-
/** 错误消息(如果不传,请自行提示错误消息) */
|
|
565
|
-
errorMessage?: string | undefined;
|
|
566
|
-
}>) | undefined;
|
|
567
|
-
/** 设置上传的请求头部 */
|
|
568
|
-
headers?: Record<string, any> | undefined;
|
|
569
|
-
/** 上传时附带的额外参数 */
|
|
570
|
-
data?: Record<string, any> | undefined;
|
|
571
|
-
/** 上传的文件字段名 - 默认: file */
|
|
572
|
-
name?: string | undefined;
|
|
573
|
-
/** 提示文字 */
|
|
574
|
-
tip?: string | undefined;
|
|
575
|
-
/** 接受上传的文件类型 - 默认: ['jpg', 'jpeg', 'png', 'bmp', 'heif', 'heic', 'gif', 'webp'] */
|
|
576
|
-
accept?: string[] | undefined;
|
|
577
|
-
/** 是否支持多选文件 - 默认: true */
|
|
578
|
-
multiple?: boolean | undefined;
|
|
579
|
-
/** 单次最大限制 - 默认: 10 */
|
|
580
|
-
singleLimit?: number | undefined;
|
|
581
|
-
/** 最大允许上传个数 */
|
|
582
|
-
limit?: number | undefined;
|
|
583
|
-
/** 是否禁用 - 默认: false */
|
|
584
|
-
disabled?: boolean | undefined;
|
|
585
|
-
/** 隐藏内置上传文件之前的loading效果 - 默认: false */
|
|
586
|
-
hideInnerBeforeUploadLoading?: boolean | undefined;
|
|
587
|
-
/** 校验选项 */
|
|
588
|
-
checkOptions?: ImageUploadCheckOptions | undefined;
|
|
589
|
-
/** 压缩选项 */
|
|
590
|
-
compressorOptions?: ImageUploadCompressorOptions | undefined;
|
|
591
|
-
/** 剪裁选项 */
|
|
592
|
-
cropOptions?: ImageUploadCropOptions | undefined;
|
|
593
|
-
/** 文件列表移除文件时的钩子 */
|
|
594
|
-
/** 文件上传成功时的钩子 */
|
|
595
|
-
onSuccess?: ((fileItem: FileItem) => void) | undefined;
|
|
596
|
-
/** 文件上传失败时的钩子 */
|
|
597
|
-
onError?: ((fileItem: FileItem) => void) | undefined;
|
|
598
|
-
/** 文件超出个数限制时的钩子 */
|
|
599
|
-
onExceed?: ((fileList: FileItem[], files: File[]) => void) | undefined;
|
|
600
|
-
/** 上传文件之前的钩子,参数为上传的文件,若返回 false 或者返回 Promise 且被 reject,则停止上传。*/
|
|
601
|
-
onBeforeUpload?: ((file: File) => boolean | Promise<any>) | undefined;
|
|
602
|
-
/** 内置上传文件之前开始 */
|
|
603
|
-
onInnerBeforeUploadStart?: ((file: File, index: number, type: EImageUploadInnerBeforeUploadStep) => void) | undefined;
|
|
604
|
-
/** 内置上传文件之前结束 */
|
|
605
|
-
onInnerBeforeUploadEnd?: ((file: File, index: number, type: EImageUploadInnerBeforeUploadStep, result: {
|
|
606
|
-
success: boolean;
|
|
607
|
-
error?: {
|
|
608
|
-
size?: boolean;
|
|
609
|
-
format?: boolean;
|
|
610
|
-
transform?: boolean;
|
|
611
|
-
pixel?: boolean;
|
|
612
|
-
compress?: boolean;
|
|
613
|
-
crop?: boolean;
|
|
614
|
-
};
|
|
615
|
-
errorMessage?: string;
|
|
616
|
-
}) => void) | undefined;
|
|
617
|
-
}>, {
|
|
618
|
-
name: string | undefined;
|
|
619
|
-
accept: () => string[];
|
|
620
|
-
multiple: boolean | undefined;
|
|
621
|
-
singleLimit: number | undefined;
|
|
622
|
-
disabled: boolean | undefined;
|
|
623
|
-
hideInnerBeforeUploadLoading: boolean | undefined;
|
|
624
|
-
}>>> & Readonly<{
|
|
550
|
+
"update:modelValue": (value: FileItem[]) => any;
|
|
551
|
+
} & {
|
|
552
|
+
cropperImgLoad: (value: File) => any;
|
|
553
|
+
}, string, import('vue').PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
625
554
|
onCropperImgLoad?: ((value: File) => any) | undefined;
|
|
555
|
+
"onUpdate:modelValue"?: ((value: FileItem[]) => any) | undefined;
|
|
626
556
|
}>, {
|
|
627
557
|
name: string;
|
|
628
558
|
accept: string[];
|
|
@@ -630,22 +560,5 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
|
|
|
630
560
|
singleLimit: number;
|
|
631
561
|
disabled: boolean;
|
|
632
562
|
hideInnerBeforeUploadLoading: boolean;
|
|
633
|
-
}, {}, {}, {}, string, import('vue').ComponentProvideOptions,
|
|
563
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLDivElement>;
|
|
634
564
|
export default _default;
|
|
635
|
-
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
636
|
-
type __VLS_TypePropsToRuntimeProps<T> = {
|
|
637
|
-
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
|
638
|
-
type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
|
|
639
|
-
} : {
|
|
640
|
-
type: import('vue').PropType<T[K]>;
|
|
641
|
-
required: true;
|
|
642
|
-
};
|
|
643
|
-
};
|
|
644
|
-
type __VLS_WithDefaults<P, D> = {
|
|
645
|
-
[K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_Prettify<P[K] & {
|
|
646
|
-
default: D[K];
|
|
647
|
-
}> : P[K];
|
|
648
|
-
};
|
|
649
|
-
type __VLS_Prettify<T> = {
|
|
650
|
-
[K in keyof T]: T[K];
|
|
651
|
-
} & {};
|
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
import { defineComponent as
|
|
1
|
+
import { defineComponent as oe, mergeModels as D, useModel as te, ref as m, computed as M, watch as G, resolveComponent as ie, openBlock as ue, createElementBlock as re, createVNode as de, normalizeClass as se } from "vue";
|
|
2
2
|
import { Message as U } from "@arco-design/web-vue";
|
|
3
3
|
import { conclude as b } from "vue-global-config";
|
|
4
|
-
import { EImageUploadInnerBeforeUploadStep as
|
|
4
|
+
import { EImageUploadInnerBeforeUploadStep as v } from "./types.js";
|
|
5
5
|
import { defaultImageUploadOptions as x } from "./constant.js";
|
|
6
|
-
import { defaultImageUploadCheckOptions as
|
|
7
|
-
const
|
|
8
|
-
var
|
|
9
|
-
const
|
|
6
|
+
import { defaultImageUploadCheckOptions as ce, defaultImageUploadCompressorOptions as fe, defaultImageUploadCropOptions as ve, oneTravelImageCheckAndTransform as me, oneTravelImageCompressor as ge } from "@keyblade/one-travel";
|
|
7
|
+
const he = "keyblade-pro-image-upload";
|
|
8
|
+
var J, K, X;
|
|
9
|
+
const Me = /* @__PURE__ */ oe({
|
|
10
10
|
__name: "image-upload",
|
|
11
|
-
props: {
|
|
11
|
+
props: /* @__PURE__ */ D({
|
|
12
12
|
action: {},
|
|
13
13
|
handlerResponse: {},
|
|
14
14
|
headers: {},
|
|
15
15
|
data: {},
|
|
16
|
-
name: { default: (
|
|
16
|
+
name: { default: (J = x) == null ? void 0 : J.name },
|
|
17
17
|
tip: {},
|
|
18
18
|
accept: { default: () => {
|
|
19
19
|
var B;
|
|
@@ -22,8 +22,8 @@ const Ee = /* @__PURE__ */ ne({
|
|
|
22
22
|
multiple: { type: Boolean, default: x.multiple },
|
|
23
23
|
singleLimit: { default: x.singleLimit },
|
|
24
24
|
limit: {},
|
|
25
|
-
disabled: { type: Boolean, default: (
|
|
26
|
-
hideInnerBeforeUploadLoading: { type: Boolean, default: (
|
|
25
|
+
disabled: { type: Boolean, default: (K = x) == null ? void 0 : K.disabled },
|
|
26
|
+
hideInnerBeforeUploadLoading: { type: Boolean, default: (X = x) == null ? void 0 : X.hideInnerBeforeUploadLoading },
|
|
27
27
|
checkOptions: {},
|
|
28
28
|
compressorOptions: {},
|
|
29
29
|
cropOptions: {},
|
|
@@ -33,31 +33,34 @@ const Ee = /* @__PURE__ */ ne({
|
|
|
33
33
|
onBeforeUpload: {},
|
|
34
34
|
onInnerBeforeUploadStart: {},
|
|
35
35
|
onInnerBeforeUploadEnd: {}
|
|
36
|
-
},
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
36
|
+
}, {
|
|
37
|
+
modelValue: { required: !0 },
|
|
38
|
+
modelModifiers: {}
|
|
39
|
+
}),
|
|
40
|
+
emits: /* @__PURE__ */ D(["cropperImgLoad"], ["update:modelValue"]),
|
|
41
|
+
setup(B, { expose: Y, emit: Ie }) {
|
|
42
|
+
const i = te(B, "modelValue"), e = B, C = m(), Z = m(), O = m(), g = m(
|
|
40
43
|
[]
|
|
41
|
-
), o =
|
|
44
|
+
), o = m(), c = m(), d = m(), _ = M(() => e.accept.map((a) => `.${a}`).join(",")), f = M(() => b([e.checkOptions, ce]) || {}), p = M(() => b([e.compressorOptions, fe]) || {}), y = M(() => b([e.cropOptions, ve]) || {}), A = (a) => {
|
|
42
45
|
var t, u, s, r;
|
|
43
|
-
const n = (r = (s = (u = (t =
|
|
46
|
+
const n = (r = (s = (u = (t = C.value) == null ? void 0 : t.$el) == null ? void 0 : u.querySelector) == null ? void 0 : s.call(u, "input")) == null ? void 0 : r.files;
|
|
44
47
|
return n && n.length > 0 && (d.value = {
|
|
45
48
|
selectCount: n.length
|
|
46
49
|
}), e != null && e.onBeforeUpload ? e == null ? void 0 : e.onBeforeUpload(a) : d.value && (e != null && e.singleLimit) && d.value.selectCount > (e == null ? void 0 : e.singleLimit) ? (d.value.handleIndex === void 0 ? (d.value.handleIndex = 0, U.error(`单次最多可选择${e == null ? void 0 : e.singleLimit}张图片`)) : d.value.handleIndex += 1, d.value.handleIndex === d.value.selectCount - 1 && (d.value = void 0), !1) : new Promise(async (E, w) => {
|
|
47
50
|
try {
|
|
48
|
-
E(await
|
|
51
|
+
E(await ne(a));
|
|
49
52
|
} catch {
|
|
50
53
|
w();
|
|
51
54
|
} finally {
|
|
52
55
|
L();
|
|
53
56
|
}
|
|
54
57
|
});
|
|
55
|
-
},
|
|
58
|
+
}, R = async (a) => {
|
|
56
59
|
const n = i.value.findIndex((t) => t.uid === a.uid);
|
|
57
60
|
return i.value.splice(n, 1), i.value = [...i.value], !1;
|
|
58
|
-
},
|
|
61
|
+
}, ee = (a, n) => {
|
|
59
62
|
e != null && e.onExceed ? e == null || e.onExceed(a, n) : (U.error(`单次最多可选择${(e == null ? void 0 : e.limit) || 1}张图片`), i.value = a);
|
|
60
|
-
},
|
|
63
|
+
}, ae = async (a) => {
|
|
61
64
|
if (e != null && e.onSuccess)
|
|
62
65
|
e == null || e.onSuccess(a);
|
|
63
66
|
else {
|
|
@@ -69,18 +72,18 @@ const Ee = /* @__PURE__ */ ne({
|
|
|
69
72
|
...n
|
|
70
73
|
} : i.value.splice(t, 1);
|
|
71
74
|
}
|
|
72
|
-
},
|
|
75
|
+
}, le = (a) => {
|
|
73
76
|
e != null && e.onError ? e == null || e.onError(a) : setTimeout(() => {
|
|
74
77
|
const n = i.value.findIndex((t) => t.uid === a.uid);
|
|
75
78
|
i.value.splice(n, 1);
|
|
76
79
|
});
|
|
77
|
-
},
|
|
80
|
+
}, ne = (a) => new Promise((n, t) => {
|
|
78
81
|
g.value.push({ file: a, resolve: n, reject: t }), g.value.length === 1 && !o.value && L();
|
|
79
82
|
}), L = () => {
|
|
80
83
|
o.value === void 0 ? o.value = 0 : o.value + 1 >= g.value.length ? (o.value = void 0, g.value = []) : o.value += 1;
|
|
81
84
|
};
|
|
82
|
-
|
|
83
|
-
var E, w, S, $, F, z, j, k, Q, H, W, P, T,
|
|
85
|
+
G(o, async () => {
|
|
86
|
+
var E, w, S, $, F, z, j, k, Q, H, V, W, P, T, q, N;
|
|
84
87
|
if (o.value === void 0 || g.value.length === 0)
|
|
85
88
|
return;
|
|
86
89
|
const a = g.value[o.value], { file: n, resolve: t, reject: u } = a;
|
|
@@ -93,9 +96,9 @@ const Ee = /* @__PURE__ */ ne({
|
|
|
93
96
|
e,
|
|
94
97
|
n,
|
|
95
98
|
o.value,
|
|
96
|
-
|
|
99
|
+
v.check
|
|
97
100
|
);
|
|
98
|
-
const l = await
|
|
101
|
+
const l = await me(n, n.name, {
|
|
99
102
|
imageMaxSize: f.value.maxSize,
|
|
100
103
|
imageAllowedType: f.value.allowedType,
|
|
101
104
|
imageMinWidth: f.value.minWidth,
|
|
@@ -107,7 +110,7 @@ const Ee = /* @__PURE__ */ ne({
|
|
|
107
110
|
e,
|
|
108
111
|
n,
|
|
109
112
|
o.value,
|
|
110
|
-
|
|
113
|
+
v.check,
|
|
111
114
|
{
|
|
112
115
|
success: l.success,
|
|
113
116
|
error: l == null ? void 0 : l.error,
|
|
@@ -128,7 +131,7 @@ const Ee = /* @__PURE__ */ ne({
|
|
|
128
131
|
e,
|
|
129
132
|
n,
|
|
130
133
|
o.value,
|
|
131
|
-
|
|
134
|
+
v.crop
|
|
132
135
|
);
|
|
133
136
|
try {
|
|
134
137
|
(j = y.value) != null && j.customCrop ? r = await y.value.customCrop(r) : r = await new Promise((l, I) => {
|
|
@@ -137,7 +140,7 @@ const Ee = /* @__PURE__ */ ne({
|
|
|
137
140
|
e,
|
|
138
141
|
n,
|
|
139
142
|
o.value,
|
|
140
|
-
|
|
143
|
+
v.crop,
|
|
141
144
|
{
|
|
142
145
|
success: !1
|
|
143
146
|
}
|
|
@@ -147,7 +150,7 @@ const Ee = /* @__PURE__ */ ne({
|
|
|
147
150
|
e,
|
|
148
151
|
n,
|
|
149
152
|
o.value,
|
|
150
|
-
|
|
153
|
+
v.crop,
|
|
151
154
|
{
|
|
152
155
|
success: !1,
|
|
153
156
|
error: {
|
|
@@ -160,26 +163,26 @@ const Ee = /* @__PURE__ */ ne({
|
|
|
160
163
|
O.value = void 0;
|
|
161
164
|
}
|
|
162
165
|
}
|
|
163
|
-
if ((
|
|
166
|
+
if ((V = p.value) != null && V.enable) {
|
|
164
167
|
c.value = {
|
|
165
168
|
loading: !0,
|
|
166
169
|
text: `第${o.value + 1}张图片处理中,请稍等`
|
|
167
|
-
}, (
|
|
170
|
+
}, (W = e == null ? void 0 : e.onInnerBeforeUploadStart) == null || W.call(
|
|
168
171
|
e,
|
|
169
172
|
n,
|
|
170
173
|
o.value,
|
|
171
|
-
|
|
174
|
+
v.compress
|
|
172
175
|
);
|
|
173
|
-
const l = await
|
|
176
|
+
const l = await ge(r, {
|
|
174
177
|
maxSize: p.value.maxSize,
|
|
175
178
|
size: p.value.size,
|
|
176
|
-
excludeAllowedTypes: (
|
|
179
|
+
excludeAllowedTypes: (P = p.value.excludeAllowedTypes) == null ? void 0 : P.map((I) => `image/${I}`)
|
|
177
180
|
});
|
|
178
|
-
if (c.value = void 0, (
|
|
181
|
+
if (c.value = void 0, (T = e == null ? void 0 : e.onInnerBeforeUploadEnd) == null || T.call(
|
|
179
182
|
e,
|
|
180
183
|
n,
|
|
181
184
|
o.value,
|
|
182
|
-
|
|
185
|
+
v.compress,
|
|
183
186
|
{
|
|
184
187
|
success: l.success,
|
|
185
188
|
error: {
|
|
@@ -193,18 +196,18 @@ const Ee = /* @__PURE__ */ ne({
|
|
|
193
196
|
type: l.file.type
|
|
194
197
|
});
|
|
195
198
|
}
|
|
196
|
-
c.value = void 0, (
|
|
199
|
+
c.value = void 0, (N = e == null ? void 0 : e.onInnerBeforeUploadEnd) == null || N.call(
|
|
197
200
|
e,
|
|
198
201
|
n,
|
|
199
202
|
o.value,
|
|
200
|
-
|
|
203
|
+
v.all,
|
|
201
204
|
{
|
|
202
205
|
success: !0
|
|
203
206
|
}
|
|
204
207
|
), t(r);
|
|
205
208
|
});
|
|
206
209
|
let h;
|
|
207
|
-
return
|
|
210
|
+
return G(
|
|
208
211
|
() => c.value,
|
|
209
212
|
() => {
|
|
210
213
|
var a;
|
|
@@ -214,16 +217,16 @@ const Ee = /* @__PURE__ */ ne({
|
|
|
214
217
|
duration: 0
|
|
215
218
|
}) : (a = h == null ? void 0 : h.close) == null || a.call(h);
|
|
216
219
|
}
|
|
217
|
-
),
|
|
218
|
-
uploadInsRef:
|
|
219
|
-
cropperInsRef:
|
|
220
|
+
), Y({
|
|
221
|
+
uploadInsRef: C,
|
|
222
|
+
cropperInsRef: Z
|
|
220
223
|
}), (a, n) => {
|
|
221
|
-
const t =
|
|
222
|
-
return
|
|
223
|
-
|
|
224
|
-
class:
|
|
224
|
+
const t = ie("a-upload");
|
|
225
|
+
return ue(), re("div", null, [
|
|
226
|
+
de(t, {
|
|
227
|
+
class: se([`${he}-upload`]),
|
|
225
228
|
ref_key: "uploadInsRef",
|
|
226
|
-
ref:
|
|
229
|
+
ref: C,
|
|
227
230
|
"list-type": "picture-card",
|
|
228
231
|
tip: a.tip || "上传",
|
|
229
232
|
"image-preview": "",
|
|
@@ -233,20 +236,20 @@ const Ee = /* @__PURE__ */ ne({
|
|
|
233
236
|
headers: a.headers,
|
|
234
237
|
data: a.data,
|
|
235
238
|
name: a.name,
|
|
236
|
-
accept:
|
|
239
|
+
accept: _.value,
|
|
237
240
|
multiple: a.multiple,
|
|
238
241
|
limit: a.limit,
|
|
239
242
|
disabled: a.disabled,
|
|
240
|
-
"on-before-upload":
|
|
241
|
-
"on-before-remove":
|
|
242
|
-
onExceedLimit:
|
|
243
|
-
onSuccess:
|
|
244
|
-
onError:
|
|
243
|
+
"on-before-upload": A,
|
|
244
|
+
"on-before-remove": R,
|
|
245
|
+
onExceedLimit: ee,
|
|
246
|
+
onSuccess: ae,
|
|
247
|
+
onError: le
|
|
245
248
|
}, null, 8, ["class", "tip", "file-list", "action", "headers", "data", "name", "accept", "multiple", "limit", "disabled"])
|
|
246
249
|
]);
|
|
247
250
|
};
|
|
248
251
|
}
|
|
249
252
|
});
|
|
250
253
|
export {
|
|
251
|
-
|
|
254
|
+
Me as default
|
|
252
255
|
};
|