@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.
@@ -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: "error", fileItem: FileItem) => void) & ((event: "success", fileItem: FileItem) => void) & ((event: "progress", fileItem: FileItem, ev?: ProgressEvent<EventTarget> | undefined) => 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);
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 ue, ref as m, computed as M, watch as G, resolveComponent as de, openBlock as J, createElementBlock as se, createVNode as ce, normalizeClass as fe, createBlock as ve, createCommentVNode as me } from "vue";
2
- import { Message as x } from "@arco-design/web-vue";
3
- import { conclude as L } from "vue-global-config";
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 U } from "./constant.js";
6
- import ge from "./cropper.vue.js";
7
- import { defaultImageUploadCheckOptions as pe, defaultImageUploadCompressorOptions as Ie, defaultImageUploadCropOptions as he, oneTravelImageCheckAndTransform as xe, oneTravelImageCompressor as Ue } from "@keyblade/one-travel";
8
- const Ce = "keyblade-pro-image-upload";
9
- var K, X, Y;
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: (K = U) == null ? void 0 : K.name },
16
+ name: { default: (G = x) == null ? void 0 : G.name },
18
17
  tip: {},
19
18
  accept: { default: () => {
20
19
  var B;
21
- return ((B = U) == null ? void 0 : B.accept) || [];
20
+ return ((B = x) == null ? void 0 : B.accept) || [];
22
21
  } },
23
- multiple: { type: Boolean, default: U.multiple },
24
- singleLimit: { default: U.singleLimit },
22
+ multiple: { type: Boolean, default: x.multiple },
23
+ singleLimit: { default: x.singleLimit },
25
24
  limit: {},
26
- disabled: { type: Boolean, default: (X = U) == null ? void 0 : X.disabled },
27
- hideInnerBeforeUploadLoading: { type: Boolean, default: (Y = U) == null ? void 0 : Y.hideInnerBeforeUploadLoading },
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: Z, emit: _ }) {
40
- const e = B, i = defineModel({ required: !0 }), S = m(), O = m(), g = m(), p = m(
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(), A = M(() => e.accept.map((a) => `.${a}`).join(",")), f = M(() => L([e.checkOptions, pe]) || {}), C = M(() => L([e.compressorOptions, Ie]) || {}), y = M(() => L([e.cropOptions, he]) || {}), R = (a) => {
43
- var t, r, s, u;
44
- const l = (u = (s = (r = (t = S.value) == null ? void 0 : t.$el) == null ? void 0 : r.querySelector) == null ? void 0 : s.call(r, "input")) == null ? void 0 : u.files;
45
- return l && l.length > 0 && (d.value = {
46
- selectCount: l.length
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, x.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) => {
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 oe(a));
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 l = await e.handlerResponse(a.response), t = i.value.findIndex((r) => r.uid === a.uid);
68
- l.success ? i.value[t] = {
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
- ...l
69
+ ...n
71
70
  } : i.value.splice(t, 1);
72
71
  }
73
- }, ne = (a) => {
72
+ }, ae = (a) => {
74
73
  e != null && e.onError ? e == null || e.onError(a) : setTimeout(() => {
75
- const l = i.value.findIndex((t) => t.uid === a.uid);
76
- i.value.splice(l, 1);
74
+ const n = i.value.findIndex((t) => t.uid === a.uid);
75
+ i.value.splice(n, 1);
77
76
  });
78
- }, oe = (a) => new Promise((l, t) => {
79
- p.value.push({ file: a, resolve: l, reject: t }), p.value.length === 1 && !o.value && $();
80
- }), $ = () => {
81
- o.value === void 0 ? o.value = 0 : o.value + 1 >= p.value.length ? (o.value = void 0, p.value = []) : 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
- G(o, async () => {
92
- var E, w, b, k, F, z, j, Q, H, W, N, P, T, q, V, D;
93
- if (o.value === void 0 || p.value.length === 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 = p.value[o.value], { file: l, resolve: t, reject: r } = a;
96
- let s = l.name, u = l;
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
- l,
94
+ n,
104
95
  o.value,
105
96
  v.check
106
97
  );
107
- const n = await xe(l, l.name, {
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, (b = e == null ? void 0 : e.onInnerBeforeUploadEnd) == null || b.call(
106
+ if (c.value = void 0, (S = e == null ? void 0 : e.onInnerBeforeUploadEnd) == null || S.call(
116
107
  e,
117
- l,
108
+ n,
118
109
  o.value,
119
110
  v.check,
120
111
  {
121
- success: n.success,
122
- error: n == null ? void 0 : n.error,
123
- errorMessage: n == null ? void 0 : n.errorMessage
112
+ success: l.success,
113
+ error: l == null ? void 0 : l.error,
114
+ errorMessage: l == null ? void 0 : l.errorMessage
124
115
  }
125
- ), !n.success)
126
- return (k = f.value) != null && k.showErrorMessage && x.error((n == null ? void 0 : n.errorMessage) || "图片校验及转换失败"), r();
127
- if (n != null && n.hasTransform) {
128
- const h = s == null ? void 0 : s.split(".");
129
- h.pop(), s = `${h.join(",")}.jpg`, u = new File([n.file], s, {
130
- type: n.file.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
- u = n.file;
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
- l,
129
+ n,
139
130
  o.value,
140
131
  v.crop
141
132
  );
142
133
  try {
143
- (j = y.value) != null && j.customCrop ? u = await y.value.customCrop(u) : u = await new Promise((n, h) => {
144
- g.value = { file: u, resolve: n, reject: h };
145
- }), (Q = e == null ? void 0 : e.onInnerBeforeUploadEnd) == null || Q.call(
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
- l,
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 (H = e == null ? void 0 : e.onInnerBeforeUploadEnd) == null || H.call(
146
+ return (Q = e == null ? void 0 : e.onInnerBeforeUploadEnd) == null || Q.call(
156
147
  e,
157
- l,
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
- ), (W = y.value) != null && W.showErrorMessage && x.error("图片剪裁失败"), r();
158
+ ), (H = y.value) != null && H.showErrorMessage && U.error("图片剪裁失败"), u();
168
159
  } finally {
169
- g.value = void 0;
160
+ O.value = void 0;
170
161
  }
171
162
  }
172
- if ((N = C.value) != null && N.enable) {
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
- l,
169
+ n,
179
170
  o.value,
180
171
  v.compress
181
172
  );
182
- const n = await Ue(u, {
183
- maxSize: C.value.maxSize,
184
- size: C.value.size,
185
- excludeAllowedTypes: (T = C.value.excludeAllowedTypes) == null ? void 0 : T.map((h) => `image/${h}`)
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
- l,
180
+ n,
190
181
  o.value,
191
182
  v.compress,
192
183
  {
193
- success: n.success,
184
+ success: l.success,
194
185
  error: {
195
186
  compress: !0
196
187
  },
197
- errorMessage: n == null ? void 0 : n.errorMessage
188
+ errorMessage: l == null ? void 0 : l.errorMessage
198
189
  }
199
- ), !n.success)
200
- return (V = C.value) != null && V.showErrorMessage && x.error((n == null ? void 0 : n.errorMessage) || "图片压缩失败"), r();
201
- u = new File([n.file], s, {
202
- type: n.file.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, (D = e == null ? void 0 : e.onInnerBeforeUploadEnd) == null || D.call(
196
+ c.value = void 0, (V = e == null ? void 0 : e.onInnerBeforeUploadEnd) == null || V.call(
206
197
  e,
207
- l,
198
+ n,
208
199
  o.value,
209
200
  v.all,
210
201
  {
211
202
  success: !0
212
203
  }
213
- ), t(u);
204
+ ), t(r);
214
205
  });
215
- let I;
216
- return G(
206
+ let h;
207
+ return D(
217
208
  () => c.value,
218
209
  () => {
219
210
  var a;
220
- c.value ? I = x.loading({
211
+ c.value ? h = U.loading({
221
212
  content: c.value.text,
222
213
  id: "image-upload-id",
223
214
  duration: 0
224
- }) : (a = I == null ? void 0 : I.close) == null || a.call(I);
215
+ }) : (a = h == null ? void 0 : h.close) == null || a.call(h);
225
216
  }
226
- ), Z({
227
- uploadInsRef: S,
228
- cropperInsRef: O
229
- }), (a, l) => {
230
- const t = de("a-upload");
231
- return J(), se("div", null, [
232
- ce(t, {
233
- class: fe([`${Ce}-upload`]),
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: S,
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": l[0] || (l[0] = (r) => i.value = r),
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: A.value,
236
+ accept: Z.value,
246
237
  multiple: a.multiple,
247
238
  limit: a.limit,
248
239
  disabled: a.disabled,
249
- "on-before-upload": R,
250
- "on-before-remove": ee,
251
- onExceedLimit: ae,
252
- onSuccess: le,
253
- onError: ne
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
- Oe as default
251
+ Ee as default
272
252
  };