@keyblade/pro-components 1.12.0-alpha.8 → 1.12.1-alpha.10
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/pro-image-upload/image-upload.vue.d.ts +34 -34
- package/es/pro-image-upload/image-upload.vue.js +105 -125
- package/es/pro-image-upload/index.d.ts +115 -115
- package/es/pro-keep-alive-router-view/index.d.ts +1 -1
- package/es/pro-layout/index.d.ts +1 -1
- package/es/pro-menu/index.d.ts +1 -1
- package/es/pro-page-container/index.d.ts +1 -1
- package/es/pro-page-header/index.d.ts +4 -4
- package/es/pro-page-header/pro-page-header.vue.d.ts +1 -1
- package/es/pro-reuse-tabs/index.d.ts +1 -1
- package/es/style.css +1 -1
- package/package.json +1 -1
- package/es/_virtual/_plugin-vue_export-helper.js +0 -9
- package/es/pro-image-upload/cropper.vue.d.ts +0 -41
- package/es/pro-image-upload/cropper.vue.js +0 -7
- package/es/pro-image-upload/cropper.vue2.js +0 -211
- package/es/pro-image-upload/cropper.vue3.js +0 -1
|
@@ -10,13 +10,6 @@ declare const _default: import('vue').DefineComponent<{
|
|
|
10
10
|
data: {
|
|
11
11
|
type: import('vue').PropType<Record<string, any>>;
|
|
12
12
|
};
|
|
13
|
-
disabled: {
|
|
14
|
-
type: import('vue').PropType<boolean>;
|
|
15
|
-
default: boolean | undefined;
|
|
16
|
-
};
|
|
17
|
-
tip: {
|
|
18
|
-
type: import('vue').PropType<string>;
|
|
19
|
-
};
|
|
20
13
|
onError: {
|
|
21
14
|
type: import('vue').PropType<(fileItem: FileItem) => void>;
|
|
22
15
|
};
|
|
@@ -42,6 +35,9 @@ declare const _default: import('vue').DefineComponent<{
|
|
|
42
35
|
type: import('vue').PropType<string>;
|
|
43
36
|
default: string | undefined;
|
|
44
37
|
};
|
|
38
|
+
tip: {
|
|
39
|
+
type: import('vue').PropType<string>;
|
|
40
|
+
};
|
|
45
41
|
accept: {
|
|
46
42
|
type: import('vue').PropType<string[]>;
|
|
47
43
|
default: () => string[];
|
|
@@ -57,6 +53,10 @@ declare const _default: import('vue').DefineComponent<{
|
|
|
57
53
|
limit: {
|
|
58
54
|
type: import('vue').PropType<number>;
|
|
59
55
|
};
|
|
56
|
+
disabled: {
|
|
57
|
+
type: import('vue').PropType<boolean>;
|
|
58
|
+
default: boolean | undefined;
|
|
59
|
+
};
|
|
60
60
|
hideInnerBeforeUploadLoading: {
|
|
61
61
|
type: import('vue').PropType<boolean>;
|
|
62
62
|
default: boolean | undefined;
|
|
@@ -122,6 +122,24 @@ declare const _default: import('vue').DefineComponent<{
|
|
|
122
122
|
download?: boolean | undefined;
|
|
123
123
|
showLink?: boolean | undefined;
|
|
124
124
|
listType?: import('@arco-design/web-vue/es/upload/interfaces').ListType | undefined;
|
|
125
|
+
readonly data?: Record<string, string | Blob> | ((fileItem: FileItem) => Record<string, string | Blob>) | undefined;
|
|
126
|
+
style?: unknown;
|
|
127
|
+
onChange?: ((fileList: FileItem[], fileItem: FileItem) => any) | undefined;
|
|
128
|
+
onError?: ((fileItem: FileItem) => any) | undefined;
|
|
129
|
+
onProgress?: ((fileItem: FileItem, ev?: ProgressEvent<EventTarget> | undefined) => any) | undefined;
|
|
130
|
+
readonly action?: string | undefined;
|
|
131
|
+
readonly headers?: Record<string, string> | undefined;
|
|
132
|
+
readonly name?: string | ((fileItem: FileItem) => string) | undefined;
|
|
133
|
+
readonly tip?: string | undefined;
|
|
134
|
+
readonly accept?: string | undefined;
|
|
135
|
+
onSuccess?: ((fileItem: FileItem) => any) | undefined;
|
|
136
|
+
readonly onBeforeUpload?: ((file: File) => boolean | Promise<boolean | File>) | undefined;
|
|
137
|
+
readonly customRequest?: ((option: import('@arco-design/web-vue').RequestOption) => import('@arco-design/web-vue').UploadRequest) | undefined;
|
|
138
|
+
readonly imageLoading?: "eager" | "lazy" | undefined;
|
|
139
|
+
readonly responseUrlKey?: string | ((fileItem: FileItem) => string) | undefined;
|
|
140
|
+
readonly customIcon?: import('@arco-design/web-vue').CustomIcon | undefined;
|
|
141
|
+
readonly onBeforeRemove?: ((fileItem: FileItem) => Promise<boolean>) | undefined;
|
|
142
|
+
readonly onButtonClick?: ((event: Event) => void | Promise<FileList>) | undefined;
|
|
125
143
|
key?: string | number | symbol | undefined;
|
|
126
144
|
ref?: import('vue').VNodeRef | undefined;
|
|
127
145
|
ref_for?: boolean | undefined;
|
|
@@ -165,24 +183,6 @@ declare const _default: import('vue').DefineComponent<{
|
|
|
165
183
|
[key: string]: any;
|
|
166
184
|
}>) => void)[] | undefined;
|
|
167
185
|
class?: unknown;
|
|
168
|
-
style?: unknown;
|
|
169
|
-
readonly data?: Record<string, string | Blob> | ((fileItem: FileItem) => Record<string, string | Blob>) | undefined;
|
|
170
|
-
readonly tip?: string | undefined;
|
|
171
|
-
onChange?: ((fileList: FileItem[], fileItem: FileItem) => any) | undefined;
|
|
172
|
-
onError?: ((fileItem: FileItem) => any) | undefined;
|
|
173
|
-
onProgress?: ((fileItem: FileItem, ev?: ProgressEvent<EventTarget> | undefined) => any) | undefined;
|
|
174
|
-
readonly action?: string | undefined;
|
|
175
|
-
readonly headers?: Record<string, string> | undefined;
|
|
176
|
-
readonly name?: string | ((fileItem: FileItem) => string) | undefined;
|
|
177
|
-
readonly accept?: string | undefined;
|
|
178
|
-
onSuccess?: ((fileItem: FileItem) => any) | undefined;
|
|
179
|
-
readonly onBeforeUpload?: ((file: File) => boolean | Promise<boolean | File>) | undefined;
|
|
180
|
-
readonly customRequest?: ((option: import('@arco-design/web-vue').RequestOption) => import('@arco-design/web-vue').UploadRequest) | undefined;
|
|
181
|
-
readonly imageLoading?: "eager" | "lazy" | undefined;
|
|
182
|
-
readonly responseUrlKey?: string | ((fileItem: FileItem) => string) | undefined;
|
|
183
|
-
readonly customIcon?: import('@arco-design/web-vue').CustomIcon | undefined;
|
|
184
|
-
readonly onBeforeRemove?: ((fileItem: FileItem) => Promise<boolean>) | undefined;
|
|
185
|
-
readonly onButtonClick?: ((event: Event) => void | Promise<FileList>) | undefined;
|
|
186
186
|
onExceedLimit?: ((fileList: FileItem[], files: File[]) => any) | undefined;
|
|
187
187
|
onPreview?: ((fileItem: FileItem) => any) | undefined;
|
|
188
188
|
"onUpdate:fileList"?: ((fileList: FileItem[]) => any) | undefined;
|
|
@@ -198,7 +198,7 @@ declare const _default: import('vue').DefineComponent<{
|
|
|
198
198
|
}>;
|
|
199
199
|
$root: import('vue').ComponentPublicInstance<{}, {}, {}, {}, {}, {}, {}, {}, false, import('vue').ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}, {}, string, {}>, {}, {}> | null;
|
|
200
200
|
$parent: import('vue').ComponentPublicInstance<{}, {}, {}, {}, {}, {}, {}, {}, false, import('vue').ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}, {}, string, {}>, {}, {}> | null;
|
|
201
|
-
$emit: ((event: "
|
|
201
|
+
$emit: ((event: "progress", fileItem: FileItem, ev?: ProgressEvent<EventTarget> | undefined) => void) & ((event: "success", fileItem: FileItem) => void) & ((event: "error", fileItem: FileItem) => void) & ((event: "preview", fileItem: FileItem) => void) & ((event: "change", fileList: FileItem[], fileItem: FileItem) => void) & ((event: "exceedLimit", fileList: FileItem[], files: File[]) => void) & ((event: "update:fileList", fileList: FileItem[]) => void);
|
|
202
202
|
$el: any;
|
|
203
203
|
$options: import('vue').ComponentOptionsBase<Readonly<{
|
|
204
204
|
fileList?: unknown;
|
|
@@ -440,13 +440,6 @@ declare const _default: import('vue').DefineComponent<{
|
|
|
440
440
|
data: {
|
|
441
441
|
type: import('vue').PropType<Record<string, any>>;
|
|
442
442
|
};
|
|
443
|
-
disabled: {
|
|
444
|
-
type: import('vue').PropType<boolean>;
|
|
445
|
-
default: boolean | undefined;
|
|
446
|
-
};
|
|
447
|
-
tip: {
|
|
448
|
-
type: import('vue').PropType<string>;
|
|
449
|
-
};
|
|
450
443
|
onError: {
|
|
451
444
|
type: import('vue').PropType<(fileItem: FileItem) => void>;
|
|
452
445
|
};
|
|
@@ -472,6 +465,9 @@ declare const _default: import('vue').DefineComponent<{
|
|
|
472
465
|
type: import('vue').PropType<string>;
|
|
473
466
|
default: string | undefined;
|
|
474
467
|
};
|
|
468
|
+
tip: {
|
|
469
|
+
type: import('vue').PropType<string>;
|
|
470
|
+
};
|
|
475
471
|
accept: {
|
|
476
472
|
type: import('vue').PropType<string[]>;
|
|
477
473
|
default: () => string[];
|
|
@@ -487,6 +483,10 @@ declare const _default: import('vue').DefineComponent<{
|
|
|
487
483
|
limit: {
|
|
488
484
|
type: import('vue').PropType<number>;
|
|
489
485
|
};
|
|
486
|
+
disabled: {
|
|
487
|
+
type: import('vue').PropType<boolean>;
|
|
488
|
+
default: boolean | undefined;
|
|
489
|
+
};
|
|
490
490
|
hideInnerBeforeUploadLoading: {
|
|
491
491
|
type: import('vue').PropType<boolean>;
|
|
492
492
|
default: boolean | undefined;
|
|
@@ -529,11 +529,11 @@ declare const _default: import('vue').DefineComponent<{
|
|
|
529
529
|
}>> & {
|
|
530
530
|
onCropperImgLoad?: ((value: File) => any) | undefined;
|
|
531
531
|
}, {
|
|
532
|
-
disabled: boolean;
|
|
533
532
|
name: string;
|
|
534
533
|
accept: string[];
|
|
535
534
|
multiple: boolean;
|
|
536
535
|
singleLimit: number;
|
|
536
|
+
disabled: boolean;
|
|
537
537
|
hideInnerBeforeUploadLoading: boolean;
|
|
538
538
|
}, {}>;
|
|
539
539
|
export default _default;
|
|
@@ -1,30 +1,29 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { Message as
|
|
3
|
-
import { conclude as
|
|
1
|
+
import { defineComponent as ne, ref as m, computed as C, watch as D, resolveComponent as oe, openBlock as te, createElementBlock as ie, createVNode as ue, normalizeClass as re } from "vue";
|
|
2
|
+
import { Message as U } from "@arco-design/web-vue";
|
|
3
|
+
import { conclude as b } from "vue-global-config";
|
|
4
4
|
import { EImageUploadInnerBeforeUploadStep as v } from "./types.js";
|
|
5
|
-
import { defaultImageUploadOptions as
|
|
6
|
-
import
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
const Oe = /* @__PURE__ */ ue({
|
|
5
|
+
import { defaultImageUploadOptions as x } from "./constant.js";
|
|
6
|
+
import { defaultImageUploadCheckOptions as de, defaultImageUploadCompressorOptions as se, defaultImageUploadCropOptions as ce, oneTravelImageCheckAndTransform as fe, oneTravelImageCompressor as ve } from "@keyblade/one-travel";
|
|
7
|
+
const me = "keyblade-pro-image-upload";
|
|
8
|
+
var G, J, K;
|
|
9
|
+
const Ee = /* @__PURE__ */ ne({
|
|
11
10
|
__name: "image-upload",
|
|
12
11
|
props: {
|
|
13
12
|
action: {},
|
|
14
13
|
handlerResponse: {},
|
|
15
14
|
headers: {},
|
|
16
15
|
data: {},
|
|
17
|
-
name: { default: (
|
|
16
|
+
name: { default: (G = x) == null ? void 0 : G.name },
|
|
18
17
|
tip: {},
|
|
19
18
|
accept: { default: () => {
|
|
20
19
|
var B;
|
|
21
|
-
return ((B =
|
|
20
|
+
return ((B = x) == null ? void 0 : B.accept) || [];
|
|
22
21
|
} },
|
|
23
|
-
multiple: { type: Boolean, default:
|
|
24
|
-
singleLimit: { default:
|
|
22
|
+
multiple: { type: Boolean, default: x.multiple },
|
|
23
|
+
singleLimit: { default: x.singleLimit },
|
|
25
24
|
limit: {},
|
|
26
|
-
disabled: { type: Boolean, default: (
|
|
27
|
-
hideInnerBeforeUploadLoading: { type: Boolean, default: (
|
|
25
|
+
disabled: { type: Boolean, default: (J = x) == null ? void 0 : J.disabled },
|
|
26
|
+
hideInnerBeforeUploadLoading: { type: Boolean, default: (K = x) == null ? void 0 : K.hideInnerBeforeUploadLoading },
|
|
28
27
|
checkOptions: {},
|
|
29
28
|
compressorOptions: {},
|
|
30
29
|
cropOptions: {},
|
|
@@ -36,75 +35,67 @@ const Oe = /* @__PURE__ */ ue({
|
|
|
36
35
|
onInnerBeforeUploadEnd: {}
|
|
37
36
|
},
|
|
38
37
|
emits: ["cropperImgLoad"],
|
|
39
|
-
setup(B, { expose:
|
|
40
|
-
const e = B, i = defineModel({ required: !0 }),
|
|
38
|
+
setup(B, { expose: X, emit: ge }) {
|
|
39
|
+
const e = B, i = defineModel({ required: !0 }), M = m(), Y = m(), O = m(), g = m(
|
|
41
40
|
[]
|
|
42
|
-
), o = m(), c = m(), d = m(),
|
|
43
|
-
var t,
|
|
44
|
-
const
|
|
45
|
-
return
|
|
46
|
-
selectCount:
|
|
47
|
-
}), 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,
|
|
41
|
+
), o = m(), c = m(), d = m(), Z = C(() => e.accept.map((a) => `.${a}`).join(",")), f = C(() => b([e.checkOptions, de]) || {}), p = C(() => b([e.compressorOptions, se]) || {}), y = C(() => b([e.cropOptions, ce]) || {}), _ = (a) => {
|
|
42
|
+
var t, u, s, r;
|
|
43
|
+
const n = (r = (s = (u = (t = M.value) == null ? void 0 : t.$el) == null ? void 0 : u.querySelector) == null ? void 0 : s.call(u, "input")) == null ? void 0 : r.files;
|
|
44
|
+
return n && n.length > 0 && (d.value = {
|
|
45
|
+
selectCount: n.length
|
|
46
|
+
}), 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) => {
|
|
48
47
|
try {
|
|
49
|
-
E(await
|
|
48
|
+
E(await le(a));
|
|
50
49
|
} catch {
|
|
51
50
|
w();
|
|
52
51
|
} finally {
|
|
53
|
-
|
|
52
|
+
L();
|
|
54
53
|
}
|
|
55
54
|
});
|
|
55
|
+
}, A = async (a) => {
|
|
56
|
+
const n = i.value.findIndex((t) => t.uid === a.uid);
|
|
57
|
+
return i.value.splice(n, 1), i.value = [...i.value], !1;
|
|
58
|
+
}, R = (a, n) => {
|
|
59
|
+
e != null && e.onExceed ? e == null || e.onExceed(a, n) : (U.error(`单次最多可选择${(e == null ? void 0 : e.limit) || 1}张图片`), i.value = a);
|
|
56
60
|
}, ee = async (a) => {
|
|
57
|
-
const l = i.value.findIndex((t) => t.uid === a.uid);
|
|
58
|
-
return i.value.splice(l, 1), i.value = [...i.value], !1;
|
|
59
|
-
}, ae = (a, l) => {
|
|
60
|
-
e != null && e.onExceed ? e == null || e.onExceed(a, l) : (x.error(`单次最多可选择${(e == null ? void 0 : e.limit) || 1}张图片`), i.value = a);
|
|
61
|
-
}, le = async (a) => {
|
|
62
61
|
if (e != null && e.onSuccess)
|
|
63
62
|
e == null || e.onSuccess(a);
|
|
64
63
|
else {
|
|
65
64
|
if (!(e != null && e.handlerResponse))
|
|
66
65
|
return;
|
|
67
|
-
const
|
|
68
|
-
|
|
66
|
+
const n = await e.handlerResponse(a.response), t = i.value.findIndex((u) => u.uid === a.uid);
|
|
67
|
+
n.success ? i.value[t] = {
|
|
69
68
|
...i.value[t],
|
|
70
|
-
...
|
|
69
|
+
...n
|
|
71
70
|
} : i.value.splice(t, 1);
|
|
72
71
|
}
|
|
73
|
-
},
|
|
72
|
+
}, ae = (a) => {
|
|
74
73
|
e != null && e.onError ? e == null || e.onError(a) : setTimeout(() => {
|
|
75
|
-
const
|
|
76
|
-
i.value.splice(
|
|
74
|
+
const n = i.value.findIndex((t) => t.uid === a.uid);
|
|
75
|
+
i.value.splice(n, 1);
|
|
77
76
|
});
|
|
78
|
-
},
|
|
79
|
-
|
|
80
|
-
}),
|
|
81
|
-
o.value === void 0 ? o.value = 0 : o.value + 1 >=
|
|
82
|
-
}, te = () => {
|
|
83
|
-
var a;
|
|
84
|
-
(a = g.value) == null || a.reject();
|
|
85
|
-
}, ie = (a) => {
|
|
86
|
-
var l;
|
|
87
|
-
(l = g.value) == null || l.resolve(a);
|
|
88
|
-
}, re = (a) => {
|
|
89
|
-
_("cropperImgLoad", a);
|
|
77
|
+
}, le = (a) => new Promise((n, t) => {
|
|
78
|
+
g.value.push({ file: a, resolve: n, reject: t }), g.value.length === 1 && !o.value && L();
|
|
79
|
+
}), L = () => {
|
|
80
|
+
o.value === void 0 ? o.value = 0 : o.value + 1 >= g.value.length ? (o.value = void 0, g.value = []) : o.value += 1;
|
|
90
81
|
};
|
|
91
|
-
|
|
92
|
-
var E, w,
|
|
93
|
-
if (o.value === void 0 ||
|
|
82
|
+
D(o, async () => {
|
|
83
|
+
var E, w, S, $, F, z, j, k, Q, H, W, P, T, q, N, V;
|
|
84
|
+
if (o.value === void 0 || g.value.length === 0)
|
|
94
85
|
return;
|
|
95
|
-
const a =
|
|
96
|
-
let s =
|
|
86
|
+
const a = g.value[o.value], { file: n, resolve: t, reject: u } = a;
|
|
87
|
+
let s = n.name, r = n;
|
|
97
88
|
if ((E = f.value) != null && E.enable) {
|
|
98
89
|
c.value = {
|
|
99
90
|
loading: !0,
|
|
100
91
|
text: `第${o.value + 1}张图片检测中,请稍等`
|
|
101
92
|
}, (w = e == null ? void 0 : e.onInnerBeforeUploadStart) == null || w.call(
|
|
102
93
|
e,
|
|
103
|
-
|
|
94
|
+
n,
|
|
104
95
|
o.value,
|
|
105
96
|
v.check
|
|
106
97
|
);
|
|
107
|
-
const
|
|
98
|
+
const l = await fe(n, n.name, {
|
|
108
99
|
imageMaxSize: f.value.maxSize,
|
|
109
100
|
imageAllowedType: f.value.allowedType,
|
|
110
101
|
imageMinWidth: f.value.minWidth,
|
|
@@ -112,39 +103,39 @@ const Oe = /* @__PURE__ */ ue({
|
|
|
112
103
|
imageMaxWidth: f.value.maxWidth,
|
|
113
104
|
imageMaxHeight: f.value.maxHeight
|
|
114
105
|
});
|
|
115
|
-
if (c.value = void 0, (
|
|
106
|
+
if (c.value = void 0, (S = e == null ? void 0 : e.onInnerBeforeUploadEnd) == null || S.call(
|
|
116
107
|
e,
|
|
117
|
-
|
|
108
|
+
n,
|
|
118
109
|
o.value,
|
|
119
110
|
v.check,
|
|
120
111
|
{
|
|
121
|
-
success:
|
|
122
|
-
error:
|
|
123
|
-
errorMessage:
|
|
112
|
+
success: l.success,
|
|
113
|
+
error: l == null ? void 0 : l.error,
|
|
114
|
+
errorMessage: l == null ? void 0 : l.errorMessage
|
|
124
115
|
}
|
|
125
|
-
), !
|
|
126
|
-
return (
|
|
127
|
-
if (
|
|
128
|
-
const
|
|
129
|
-
|
|
130
|
-
type:
|
|
116
|
+
), !l.success)
|
|
117
|
+
return ($ = f.value) != null && $.showErrorMessage && U.error((l == null ? void 0 : l.errorMessage) || "图片校验及转换失败"), u();
|
|
118
|
+
if (l != null && l.hasTransform) {
|
|
119
|
+
const I = s == null ? void 0 : s.split(".");
|
|
120
|
+
I.pop(), s = `${I.join(",")}.jpg`, r = new File([l.file], s, {
|
|
121
|
+
type: l.file.type
|
|
131
122
|
});
|
|
132
123
|
} else
|
|
133
|
-
|
|
124
|
+
r = l.file;
|
|
134
125
|
}
|
|
135
126
|
if ((F = y.value) != null && F.enable) {
|
|
136
127
|
(z = e == null ? void 0 : e.onInnerBeforeUploadStart) == null || z.call(
|
|
137
128
|
e,
|
|
138
|
-
|
|
129
|
+
n,
|
|
139
130
|
o.value,
|
|
140
131
|
v.crop
|
|
141
132
|
);
|
|
142
133
|
try {
|
|
143
|
-
(j = y.value) != null && j.customCrop ?
|
|
144
|
-
|
|
145
|
-
}), (
|
|
134
|
+
(j = y.value) != null && j.customCrop ? r = await y.value.customCrop(r) : r = await new Promise((l, I) => {
|
|
135
|
+
O.value = { file: r, resolve: l, reject: I };
|
|
136
|
+
}), (k = e == null ? void 0 : e.onInnerBeforeUploadEnd) == null || k.call(
|
|
146
137
|
e,
|
|
147
|
-
|
|
138
|
+
n,
|
|
148
139
|
o.value,
|
|
149
140
|
v.crop,
|
|
150
141
|
{
|
|
@@ -152,9 +143,9 @@ const Oe = /* @__PURE__ */ ue({
|
|
|
152
143
|
}
|
|
153
144
|
);
|
|
154
145
|
} catch {
|
|
155
|
-
return (
|
|
146
|
+
return (Q = e == null ? void 0 : e.onInnerBeforeUploadEnd) == null || Q.call(
|
|
156
147
|
e,
|
|
157
|
-
|
|
148
|
+
n,
|
|
158
149
|
o.value,
|
|
159
150
|
v.crop,
|
|
160
151
|
{
|
|
@@ -164,109 +155,98 @@ const Oe = /* @__PURE__ */ ue({
|
|
|
164
155
|
},
|
|
165
156
|
errorMessage: "图片剪裁失败"
|
|
166
157
|
}
|
|
167
|
-
), (
|
|
158
|
+
), (H = y.value) != null && H.showErrorMessage && U.error("图片剪裁失败"), u();
|
|
168
159
|
} finally {
|
|
169
|
-
|
|
160
|
+
O.value = void 0;
|
|
170
161
|
}
|
|
171
162
|
}
|
|
172
|
-
if ((
|
|
163
|
+
if ((W = p.value) != null && W.enable) {
|
|
173
164
|
c.value = {
|
|
174
165
|
loading: !0,
|
|
175
166
|
text: `第${o.value + 1}张图片处理中,请稍等`
|
|
176
167
|
}, (P = e == null ? void 0 : e.onInnerBeforeUploadStart) == null || P.call(
|
|
177
168
|
e,
|
|
178
|
-
|
|
169
|
+
n,
|
|
179
170
|
o.value,
|
|
180
171
|
v.compress
|
|
181
172
|
);
|
|
182
|
-
const
|
|
183
|
-
maxSize:
|
|
184
|
-
size:
|
|
185
|
-
excludeAllowedTypes: (T =
|
|
173
|
+
const l = await ve(r, {
|
|
174
|
+
maxSize: p.value.maxSize,
|
|
175
|
+
size: p.value.size,
|
|
176
|
+
excludeAllowedTypes: (T = p.value.excludeAllowedTypes) == null ? void 0 : T.map((I) => `image/${I}`)
|
|
186
177
|
});
|
|
187
178
|
if (c.value = void 0, (q = e == null ? void 0 : e.onInnerBeforeUploadEnd) == null || q.call(
|
|
188
179
|
e,
|
|
189
|
-
|
|
180
|
+
n,
|
|
190
181
|
o.value,
|
|
191
182
|
v.compress,
|
|
192
183
|
{
|
|
193
|
-
success:
|
|
184
|
+
success: l.success,
|
|
194
185
|
error: {
|
|
195
186
|
compress: !0
|
|
196
187
|
},
|
|
197
|
-
errorMessage:
|
|
188
|
+
errorMessage: l == null ? void 0 : l.errorMessage
|
|
198
189
|
}
|
|
199
|
-
), !
|
|
200
|
-
return (
|
|
201
|
-
|
|
202
|
-
type:
|
|
190
|
+
), !l.success)
|
|
191
|
+
return (N = p.value) != null && N.showErrorMessage && U.error((l == null ? void 0 : l.errorMessage) || "图片压缩失败"), u();
|
|
192
|
+
r = new File([l.file], s, {
|
|
193
|
+
type: l.file.type
|
|
203
194
|
});
|
|
204
195
|
}
|
|
205
|
-
c.value = void 0, (
|
|
196
|
+
c.value = void 0, (V = e == null ? void 0 : e.onInnerBeforeUploadEnd) == null || V.call(
|
|
206
197
|
e,
|
|
207
|
-
|
|
198
|
+
n,
|
|
208
199
|
o.value,
|
|
209
200
|
v.all,
|
|
210
201
|
{
|
|
211
202
|
success: !0
|
|
212
203
|
}
|
|
213
|
-
), t(
|
|
204
|
+
), t(r);
|
|
214
205
|
});
|
|
215
|
-
let
|
|
216
|
-
return
|
|
206
|
+
let h;
|
|
207
|
+
return D(
|
|
217
208
|
() => c.value,
|
|
218
209
|
() => {
|
|
219
210
|
var a;
|
|
220
|
-
c.value ?
|
|
211
|
+
c.value ? h = U.loading({
|
|
221
212
|
content: c.value.text,
|
|
222
213
|
id: "image-upload-id",
|
|
223
214
|
duration: 0
|
|
224
|
-
}) : (a =
|
|
215
|
+
}) : (a = h == null ? void 0 : h.close) == null || a.call(h);
|
|
225
216
|
}
|
|
226
|
-
),
|
|
227
|
-
uploadInsRef:
|
|
228
|
-
cropperInsRef:
|
|
229
|
-
}), (a,
|
|
230
|
-
const t =
|
|
231
|
-
return
|
|
232
|
-
|
|
233
|
-
class:
|
|
217
|
+
), X({
|
|
218
|
+
uploadInsRef: M,
|
|
219
|
+
cropperInsRef: Y
|
|
220
|
+
}), (a, n) => {
|
|
221
|
+
const t = oe("a-upload");
|
|
222
|
+
return te(), ie("div", null, [
|
|
223
|
+
ue(t, {
|
|
224
|
+
class: re([`${me}-upload`]),
|
|
234
225
|
ref_key: "uploadInsRef",
|
|
235
|
-
ref:
|
|
226
|
+
ref: M,
|
|
236
227
|
"list-type": "picture-card",
|
|
237
228
|
tip: a.tip || "上传",
|
|
238
229
|
"image-preview": "",
|
|
239
230
|
"file-list": i.value,
|
|
240
|
-
"onUpdate:fileList":
|
|
231
|
+
"onUpdate:fileList": n[0] || (n[0] = (u) => i.value = u),
|
|
241
232
|
action: a.action,
|
|
242
233
|
headers: a.headers,
|
|
243
234
|
data: a.data,
|
|
244
235
|
name: a.name,
|
|
245
|
-
accept:
|
|
236
|
+
accept: Z.value,
|
|
246
237
|
multiple: a.multiple,
|
|
247
238
|
limit: a.limit,
|
|
248
239
|
disabled: a.disabled,
|
|
249
|
-
"on-before-upload":
|
|
250
|
-
"on-before-remove":
|
|
251
|
-
onExceedLimit:
|
|
252
|
-
onSuccess:
|
|
253
|
-
onError:
|
|
254
|
-
}, null, 8, ["class", "tip", "file-list", "action", "headers", "data", "name", "accept", "multiple", "limit", "disabled"])
|
|
255
|
-
g.value && o.value !== void 0 ? (J(), ve(ge, {
|
|
256
|
-
key: 0,
|
|
257
|
-
ref_key: "cropperInsRef",
|
|
258
|
-
ref: O,
|
|
259
|
-
file: g.value.file,
|
|
260
|
-
index: o.value,
|
|
261
|
-
options: y.value,
|
|
262
|
-
onCancel: te,
|
|
263
|
-
onConfirm: ie,
|
|
264
|
-
onImgLoad: re
|
|
265
|
-
}, null, 8, ["file", "index", "options"])) : me("", !0)
|
|
240
|
+
"on-before-upload": _,
|
|
241
|
+
"on-before-remove": A,
|
|
242
|
+
onExceedLimit: R,
|
|
243
|
+
onSuccess: ee,
|
|
244
|
+
onError: ae
|
|
245
|
+
}, null, 8, ["class", "tip", "file-list", "action", "headers", "data", "name", "accept", "multiple", "limit", "disabled"])
|
|
266
246
|
]);
|
|
267
247
|
};
|
|
268
248
|
}
|
|
269
249
|
});
|
|
270
250
|
export {
|
|
271
|
-
|
|
251
|
+
Ee as default
|
|
272
252
|
};
|