@lemon30_npm/csit-vue3 1.0.63 → 1.0.65

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.
@@ -1,50 +1,50 @@
1
- import { ElUpload as se, ElButton as le, ElLink as ae, ElTooltip as ie, ElDivider as ne } from "element-plus/es";
2
- import { defineComponent as re, mergeDefaults as de, useSlots as ue, ref as D, watch as me, createElementBlock as l, openBlock as s, createBlock as b, createCommentVNode as i, mergeProps as pe, unref as c, createSlots as ce, withCtx as u, renderSlot as z, Fragment as f, createElementVNode as a, toDisplayString as y, renderList as U, normalizeProps as fe, guardReactiveProps as ge, normalizeClass as C, createTextVNode as B, createVNode as S, normalizeStyle as R, nextTick as L } from "vue";
3
- import I from "./icons/icon-upload-btn.svg.js";
4
- import K from "./icons/icon-upload-btn-hover.svg.js";
5
- import V from "./icons/icon-upload-btn-disabled.svg.js";
6
- import ye from "./icons/icon-loading-blue.svg.js";
7
- import ve from "./icons/icon-upload-success.svg.js";
8
- import ke from "./icons/icon-upload-retry.svg.js";
9
- import we from "./icons/icon-upload-fail.svg.js";
10
- import { ElMessageBox as he, ElMessage as _ } from "element-plus";
11
- import { useUpload as be } from "./hooks/useUpload.js";
12
- import { useUploadRetry as Be } from "./hooks/useUploadRetry.js";
13
- import { downloadFileWithAxios as Se } from "./utils/file.js";
14
- import { getFileIconByName as Ce } from "./utils/file-icon-maps.js";
15
- import { useExposeMethods as _e } from "./expose/index.js";
16
- import { useCiUploadComputed as ze } from "./computed/index.js";
17
- import { defaultProps as Le } from "./props/index.js";
18
- import { useFileSize as Ee } from "./hooks/useFileSize.js";
19
- const Ne = { class: "CiUpload" }, $e = {
1
+ import { ElUpload as re, ElButton as de, ElLink as ue, ElTooltip as me, ElDivider as ce } from "element-plus/es";
2
+ import { defineComponent as pe, mergeDefaults as fe, useSlots as ge, ref as V, watch as ye, createElementBlock as l, openBlock as s, createBlock as L, createCommentVNode as n, mergeProps as ve, unref as y, createSlots as ke, withCtx as m, renderSlot as P, Fragment as v, createElementVNode as a, toDisplayString as b, renderList as M, normalizeProps as we, guardReactiveProps as he, normalizeClass as $, createTextVNode as _, createVNode as N, normalizeStyle as q, nextTick as D } from "vue";
3
+ import A from "./icons/icon-upload-btn.svg.js";
4
+ import H from "./icons/icon-upload-btn-hover.svg.js";
5
+ import O from "./icons/icon-upload-btn-disabled.svg.js";
6
+ import be from "./icons/icon-loading-blue.svg.js";
7
+ import Be from "./icons/icon-upload-success.svg.js";
8
+ import Se from "./icons/icon-upload-retry.svg.js";
9
+ import Ce from "./icons/icon-upload-fail.svg.js";
10
+ import { ElMessageBox as Le, ElMessage as z } from "element-plus";
11
+ import { useUpload as _e } from "./hooks/useUpload.js";
12
+ import { useUploadRetry as Ne } from "./hooks/useUploadRetry.js";
13
+ import { downloadFileWithAxios as ze } from "./utils/file.js";
14
+ import { getFileIconByName as $e } from "./utils/file-icon-maps.js";
15
+ import { useExposeMethods as De } from "./expose/index.js";
16
+ import { useCiUploadComputed as Ee } from "./computed/index.js";
17
+ import { defaultProps as Te } from "./props/index.js";
18
+ import { useFileSize as Pe } from "./hooks/useFileSize.js";
19
+ const Ue = { class: "CiUpload" }, Ie = {
20
20
  key: 0,
21
21
  class: "tip-slot-textInfo"
22
- }, De = {
22
+ }, Re = {
23
23
  key: 1,
24
24
  class: "default-tip-slot-textInfo"
25
- }, Te = { class: "upload-btn-text" }, Pe = {
25
+ }, Ve = { class: "upload-btn-text" }, Fe = {
26
26
  key: 0,
27
27
  class: "tip-slot-textInfo"
28
- }, Ue = {
28
+ }, Ke = {
29
29
  key: 1,
30
30
  class: "default-tip-slot-textInfo"
31
- }, Re = { class: "file-item-top" }, Ie = { class: "file-name-file-icon" }, Ke = ["src"], Ve = { class: "top-right" }, Me = {
31
+ }, Me = { class: "file-item-top" }, qe = { class: "file-name-file-icon" }, Ae = ["src"], He = { class: "top-right" }, Oe = {
32
32
  key: 0,
33
33
  class: "file-size"
34
- }, qe = {
34
+ }, We = {
35
35
  key: 1,
36
36
  class: "file-operate-btn"
37
- }, Ae = { class: "file-status-icon-wrapper" }, He = { class: "uploading-percentage" }, We = ["onClick"], Oe = {
37
+ }, je = { class: "file-status-icon-wrapper" }, Ge = { class: "uploading-percentage" }, Je = ["onClick"], Qe = {
38
38
  key: 0,
39
39
  class: "file-item-bottom file-progress-bar"
40
- }, je = {
40
+ }, Xe = {
41
41
  key: 0,
42
42
  class: "file-item-bottom file-progress-bar download-progress-bar"
43
- }, Fe = {
43
+ }, Ye = {
44
44
  name: "CiUpload"
45
- }, mt = /* @__PURE__ */ re({
46
- ...Fe,
47
- props: /* @__PURE__ */ de({
45
+ }, kt = /* @__PURE__ */ pe({
46
+ ...Ye,
47
+ props: /* @__PURE__ */ fe({
48
48
  action: {},
49
49
  downloadUrl: {},
50
50
  data: {},
@@ -69,58 +69,66 @@ const Ne = { class: "CiUpload" }, $e = {
69
69
  readonly: { type: Boolean },
70
70
  axiosInstance: {},
71
71
  minSize: {},
72
- showFileNameEllipsisTooltip: { type: Boolean }
73
- }, Le),
72
+ showFileNameEllipsisTooltip: { type: Boolean },
73
+ maxFileNameLength: {},
74
+ minFileNameLength: {}
75
+ }, Te),
74
76
  emits: ["update:fileList", "onSuccess", "onRemove", "onChange", "onError", "onCustomDownload"],
75
- setup(M, { expose: q, emit: A }) {
76
- const { formatFileSize: E } = Ee(), H = ue(), T = D(), v = D(!1), k = D([]), { checkUploadStatus: W } = _e(k), n = M, { customHttpRequest: O } = be(n.axiosInstance), d = A;
77
- q({
78
- checkUploadStatus: W
77
+ setup(W, { expose: j, emit: G }) {
78
+ const { formatFileSize: U } = Pe(), J = ge(), F = V(), f = V(!1), S = V([]), { checkUploadStatus: Q } = De(S), i = W, { customHttpRequest: X } = _e(i.axiosInstance), r = G;
79
+ j({
80
+ checkUploadStatus: Q
79
81
  });
80
- const { retryUpload: j } = Be(k, d, n);
81
- me(
82
- () => n.fileList,
82
+ const { retryUpload: Y } = Ne(S, r, i);
83
+ ye(
84
+ () => i.fileList,
83
85
  (e) => {
84
- k.value = e.map((t) => ({ ...t }));
86
+ S.value = e.map((t) => ({ ...t }));
85
87
  },
86
88
  { immediate: !0 }
87
89
  );
88
- const N = (e) => {
90
+ const I = (e) => {
89
91
  var t;
90
- (t = T.value) == null || t.handleRemove(e);
91
- }, $ = (e) => {
92
- if (n.customDownload) {
93
- d("onCustomDownload", e);
92
+ (t = F.value) == null || t.handleRemove(e);
93
+ }, R = (e) => {
94
+ if (i.customDownload) {
95
+ r("onCustomDownload", e);
94
96
  return;
95
97
  }
96
- e.downloadPercentage = 0, e.status = "downloading", Se(
98
+ e.downloadPercentage = 0, e.status = "downloading", ze(
97
99
  {
98
100
  fileKey: e.fileKey || "当前此条数据没有fileKey字段",
99
101
  fileName: e.fileName || "当前此条数据没有fileName字段"
100
102
  },
101
- n.downloadUrl,
103
+ i.downloadUrl,
102
104
  (t) => {
103
105
  e.downloadPercentage = t, t === 100 && (e.status = "success");
104
106
  },
105
107
  (t) => {
106
108
  e.status = "success";
107
109
  },
108
- n.axiosInstance
110
+ i.axiosInstance
109
111
  );
110
- }, F = (e) => {
111
- console.log("开始上传文件:", e);
112
- const t = n.accept.split(",").map((o) => o.trim().toLowerCase()), m = e.type.toLowerCase(), g = e.name.toLowerCase();
113
- return t.some((o) => m === o || g.endsWith(o)) ? e.size < n.minSize || e.size === 0 ? (e.size === 0 ? _.error("文件大小不能为空") : _.error(`文件大小不能小于 ${E(n.minSize)}`), v.value = !0, L(() => {
114
- const o = n.fileList.filter((r) => r.uid !== e.uid);
115
- d("update:fileList", o), v.value = !1;
116
- }), !1) : e.size <= n.maxSize ? !0 : (_.error(`文件大小超出限制,最大文件大小为${E(n.maxSize)}`), v.value = !0, L(() => {
117
- const o = n.fileList.filter((r) => r.uid !== e.uid);
118
- d("update:fileList", o), v.value = !1;
119
- }), !1) : (_.error("不支持上传该类型文件"), v.value = !0, L(() => {
120
- const o = n.fileList.filter((r) => r.uid !== e.uid);
121
- d("update:fileList", o), v.value = !1;
112
+ }, Z = (e) => {
113
+ const t = i.accept.split(",").map((u) => u.trim().toLowerCase()), c = e.type.toLowerCase(), k = e.name.toLowerCase();
114
+ if (!t.some((u) => c === u || k.endsWith(u)))
115
+ return z.error("不支持上传该类型文件"), f.value = !0, D(() => {
116
+ const u = i.fileList.filter((B) => B.uid !== e.uid);
117
+ r("update:fileList", u), f.value = !1;
118
+ }), !1;
119
+ const g = e.name || "", w = g.lastIndexOf("."), d = (w > 0 ? g.slice(0, w) : g).length, h = i.maxFileNameLength, C = i.minFileNameLength;
120
+ let E = !0, T = "";
121
+ return h > 0 && C > 0 ? (d > h || d < C) && (E = !1, T = `文件名长度需在 ${C} 到 ${h} 个字符之间`) : h > 0 ? d > h && (E = !1, T = `文件名长度不能超过 ${h} 个字符`) : C > 0 && d < C && (E = !1, T = `文件名长度不能小于 ${C} 个字符`), E ? e.size < i.minSize || e.size === 0 ? (e.size === 0 ? z.error("文件大小不能为空") : z.error(`文件大小不能小于 ${U(i.minSize)}`), f.value = !0, D(() => {
122
+ const u = i.fileList.filter((B) => B.uid !== e.uid);
123
+ r("update:fileList", u), f.value = !1;
124
+ }), !1) : e.size <= i.maxSize ? !0 : (z.error(`文件大小超出限制,最大文件大小为${U(i.maxSize)}`), f.value = !0, D(() => {
125
+ const u = i.fileList.filter((B) => B.uid !== e.uid);
126
+ r("update:fileList", u), f.value = !1;
127
+ }), !1) : (z.error(T), f.value = !0, D(() => {
128
+ const u = i.fileList.filter((B) => B.uid !== e.uid);
129
+ r("update:fileList", u), f.value = !1;
122
130
  }), !1);
123
- }, G = (e, t) => v.value ? !0 : he.confirm(
131
+ }, x = (e, t) => f.value ? !0 : Le.confirm(
124
132
  `确定删除 ${e.fileName || e.name} 文件?`,
125
133
  "确定删除",
126
134
  {
@@ -133,96 +141,96 @@ const Ne = { class: "CiUpload" }, $e = {
133
141
  // 用户点击“确定”按钮,允许删除
134
142
  () => !1
135
143
  // 用户点击“取消”按钮,取消删除
136
- ), J = (e, t) => {
137
- _.error(`文件数量超出限制,最大文件数量为${n.limit}个`);
138
- }, Q = (e, t, m) => {
139
- t.status = "fail", t.percentage = 0, L(() => {
140
- d("update:fileList", [...m, t]), d("onError", t, m);
144
+ ), ee = (e, t) => {
145
+ z.error(`文件数量超出限制,最大文件数量为${i.limit}个`);
146
+ }, te = (e, t, c) => {
147
+ t.status = "fail", t.percentage = 0, D(() => {
148
+ r("update:fileList", [...c, t]), r("onError", t, c);
141
149
  });
142
- }, X = (e, t, m) => {
143
- var p, w, h;
150
+ }, oe = (e, t, c) => {
151
+ var p, g, w;
144
152
  if (!e) return;
145
- const g = m.find((o) => o.uid === t.uid);
146
- g && (g.fileName = ((p = e == null ? void 0 : e.data) == null ? void 0 : p.fileName) || t.name, g.fileKey = ((w = e == null ? void 0 : e.data) == null ? void 0 : w.fileKey) || "当前接口没有返回fileKey字段", g.fileSize = ((h = e == null ? void 0 : e.data) == null ? void 0 : h.fileSize) || t.size), d("update:fileList", m), d("onSuccess", t, m);
147
- }, Y = (e, t) => {
148
- e.status === "success" && !e.response || (d("update:fileList", t), d("onChange", e, t));
149
- }, Z = (e, t) => {
150
- d("update:fileList", t), d("onRemove", e, t);
151
- }, { hasRealDefaultSlot: x, finalBeforeUpload: ee, defaultTipSlotTextInfo: P, otherSlots: te } = ze(n, H, F);
153
+ const k = c.find((o) => o.uid === t.uid);
154
+ k && (k.fileName = ((p = e == null ? void 0 : e.data) == null ? void 0 : p.fileName) || t.name, k.fileKey = ((g = e == null ? void 0 : e.data) == null ? void 0 : g.fileKey) || "当前接口没有返回fileKey字段", k.fileSize = ((w = e == null ? void 0 : e.data) == null ? void 0 : w.fileSize) || t.size), r("update:fileList", c), r("onSuccess", t, c);
155
+ }, se = (e, t) => {
156
+ e.status === "success" && !e.response || (r("update:fileList", t), r("onChange", e, t));
157
+ }, le = (e, t) => {
158
+ r("update:fileList", t), r("onRemove", e, t);
159
+ }, { hasRealDefaultSlot: ae, finalBeforeUpload: ie, defaultTipSlotTextInfo: K, otherSlots: ne } = Ee(i, J, Z);
152
160
  return (e, t) => {
153
- const m = le, g = se, p = ae, w = ie, h = ne;
154
- return s(), l("div", Ne, [
155
- e.readonly ? i("", !0) : (s(), b(g, pe({
161
+ const c = de, k = re, p = ue, g = me, w = ce;
162
+ return s(), l("div", Ue, [
163
+ e.readonly ? n("", !0) : (s(), L(k, ve({
156
164
  key: 0,
157
165
  class: ["ci-el-upload-component", { "is-disabled": e.disabled }],
158
166
  ref_key: "uploadRef",
159
- ref: T,
167
+ ref: F,
160
168
  action: e.action,
161
169
  data: e.data,
162
170
  headers: e.headers,
163
- "file-list": k.value,
171
+ "file-list": S.value,
164
172
  accept: e.accept,
165
173
  limit: e.limit,
166
174
  multiple: e.multiple,
167
175
  drag: e.drag,
168
176
  disabled: e.disabled,
169
- "before-upload": c(ee),
170
- "before-remove": G,
171
- "on-success": X,
172
- "on-change": Y,
173
- "on-remove": Z,
174
- "on-exceed": J,
175
- "on-error": Q,
176
- "http-request": c(O),
177
+ "before-upload": y(ie),
178
+ "before-remove": x,
179
+ "on-success": oe,
180
+ "on-change": se,
181
+ "on-remove": le,
182
+ "on-exceed": ee,
183
+ "on-error": te,
184
+ "http-request": y(X),
177
185
  "show-file-list": !1
178
- }, e.$attrs), ce({
179
- default: u(() => [
180
- c(x) ? z(e.$slots, "default", { key: 0 }, void 0, !0) : (s(), l(f, { key: 1 }, [
181
- e.drag ? (s(), l(f, { key: 0 }, [
186
+ }, e.$attrs), ke({
187
+ default: m(() => [
188
+ y(ae) ? P(e.$slots, "default", { key: 0 }, void 0, !0) : (s(), l(v, { key: 1 }, [
189
+ e.drag ? (s(), l(v, { key: 0 }, [
182
190
  t[0] || (t[0] = a("img", {
183
191
  class: "upload-btn-icon",
184
- src: I,
192
+ src: A,
185
193
  alt: ""
186
194
  }, null, -1)),
187
195
  t[1] || (t[1] = a("img", {
188
196
  class: "upload-btn-icon-hover",
189
- src: K,
197
+ src: H,
190
198
  alt: ""
191
199
  }, null, -1)),
192
200
  t[2] || (t[2] = a("img", {
193
201
  class: "upload-btn-icon-disabled",
194
- src: V,
202
+ src: O,
195
203
  alt: ""
196
204
  }, null, -1)),
197
205
  t[3] || (t[3] = a("div", { class: "drag-text-info" }, [
198
206
  a("span", { class: "drag-text-info-click" }, "点击上传"),
199
207
  a("span", { class: "drag-text-info-black" }, "或将文件拖拽到这里上传")
200
208
  ], -1)),
201
- e.$slots.tip ? (s(), l("div", $e, [
202
- z(e.$slots, "tip", {}, void 0, !0)
203
- ])) : (s(), l("div", De, y(c(P)), 1))
204
- ], 64)) : (s(), b(m, {
209
+ e.$slots.tip ? (s(), l("div", Ie, [
210
+ P(e.$slots, "tip", {}, void 0, !0)
211
+ ])) : (s(), l("div", Re, b(y(K)), 1))
212
+ ], 64)) : (s(), L(c, {
205
213
  key: 1,
206
214
  class: "upload-btn",
207
215
  disabled: e.disabled
208
216
  }, {
209
- default: u(() => [
217
+ default: m(() => [
210
218
  t[4] || (t[4] = a("img", {
211
219
  class: "upload-btn-icon",
212
- src: I,
220
+ src: A,
213
221
  alt: ""
214
222
  }, null, -1)),
215
223
  t[5] || (t[5] = a("img", {
216
224
  class: "upload-btn-icon-hover",
217
- src: K,
225
+ src: H,
218
226
  alt: ""
219
227
  }, null, -1)),
220
228
  t[6] || (t[6] = a("img", {
221
229
  class: "upload-btn-icon-disabled",
222
- src: V,
230
+ src: O,
223
231
  alt: ""
224
232
  }, null, -1)),
225
- a("span", Te, y(e.uploadBtnText), 1)
233
+ a("span", Ve, b(e.uploadBtnText), 1)
226
234
  ]),
227
235
  _: 1,
228
236
  __: [4, 5, 6]
@@ -233,188 +241,188 @@ const Ne = { class: "CiUpload" }, $e = {
233
241
  }, [
234
242
  e.drag ? void 0 : {
235
243
  name: "tip",
236
- fn: u(() => [
237
- e.$slots.tip ? (s(), l("div", Pe, [
238
- z(e.$slots, "tip", {}, void 0, !0)
239
- ])) : (s(), l("div", Ue, y(c(P)), 1))
244
+ fn: m(() => [
245
+ e.$slots.tip ? (s(), l("div", Fe, [
246
+ P(e.$slots, "tip", {}, void 0, !0)
247
+ ])) : (s(), l("div", Ke, b(y(K)), 1))
240
248
  ]),
241
249
  key: "0"
242
250
  },
243
- U(c(te), (o, r) => ({
244
- name: r,
245
- fn: u((oe) => [
246
- z(e.$slots, r, fe(ge(oe || {})), void 0, !0)
251
+ M(y(ne), (o, d) => ({
252
+ name: d,
253
+ fn: m((h) => [
254
+ P(e.$slots, d, we(he(h || {})), void 0, !0)
247
255
  ])
248
256
  }))
249
257
  ]), 1040, ["class", "action", "data", "headers", "file-list", "accept", "limit", "multiple", "drag", "disabled", "before-upload", "http-request"])),
250
- k.value.length ? (s(), l("div", {
258
+ S.value.length ? (s(), l("div", {
251
259
  key: 1,
252
- class: C(["custom-file-list-default", { "is-readonly": e.readonly }])
260
+ class: $(["custom-file-list-default", { "is-readonly": e.readonly }])
253
261
  }, [
254
- (s(!0), l(f, null, U(k.value, (o) => (s(), l("div", {
262
+ (s(!0), l(v, null, M(S.value, (o) => (s(), l("div", {
255
263
  class: "file-item-wrapper",
256
264
  key: o.uid
257
265
  }, [
258
- a("div", Re, [
259
- a("div", Ie, [
266
+ a("div", Me, [
267
+ a("div", qe, [
260
268
  e.showFileExtIcon ? (s(), l("img", {
261
269
  key: 0,
262
270
  class: "file-icon",
263
- src: c(Ce)(o.fileName || o.name)
264
- }, null, 8, Ke)) : i("", !0),
265
- e.showFileNameEllipsisTooltip ? (s(), b(w, {
271
+ src: y($e)(o.fileName || o.name)
272
+ }, null, 8, Ae)) : n("", !0),
273
+ e.showFileNameEllipsisTooltip ? (s(), L(g, {
266
274
  key: 2,
267
275
  effect: "dark",
268
276
  content: o.fileName || o.name,
269
277
  placement: "right"
270
278
  }, {
271
- default: u(() => [
272
- S(p, {
273
- class: C(["top-left file-name", { "is-show-file-name-ellipsis-tooltip": e.showFileNameEllipsisTooltip }]),
279
+ default: m(() => [
280
+ N(p, {
281
+ class: $(["top-left file-name", { "is-show-file-name-ellipsis-tooltip": e.showFileNameEllipsisTooltip }]),
274
282
  disabled: o.status === "downloading" || o.status === "uploading",
275
- onClick: (r) => $(o)
283
+ onClick: (d) => R(o)
276
284
  }, {
277
- default: u(() => [
278
- B(y(o.fileName || o.name), 1)
285
+ default: m(() => [
286
+ _(b(o.fileName || o.name), 1)
279
287
  ]),
280
288
  _: 2
281
289
  }, 1032, ["class", "disabled", "onClick"])
282
290
  ]),
283
291
  _: 2
284
- }, 1032, ["content"])) : (s(), b(p, {
292
+ }, 1032, ["content"])) : (s(), L(p, {
285
293
  key: 1,
286
294
  class: "top-left file-name",
287
295
  disabled: o.status === "downloading" || o.status === "uploading",
288
- onClick: (r) => $(o)
296
+ onClick: (d) => R(o)
289
297
  }, {
290
- default: u(() => [
291
- B(y(o.fileName || o.name), 1)
298
+ default: m(() => [
299
+ _(b(o.fileName || o.name), 1)
292
300
  ]),
293
301
  _: 2
294
302
  }, 1032, ["disabled", "onClick"]))
295
303
  ]),
296
- a("div", Ve, [
297
- e.showFileSize ? (s(), l("span", Me, y(c(E)(o.fileSize || o.size)), 1)) : i("", !0),
298
- o.status !== "fail" ? (s(), l("div", qe, [
299
- o.status !== "uploading" ? (s(), l(f, { key: 0 }, [
300
- e.showPreviewBtn ? (s(), l(f, { key: 0 }, [
301
- S(p, {
302
- onClick: (r) => N(o)
304
+ a("div", He, [
305
+ e.showFileSize ? (s(), l("span", Oe, b(y(U)(o.fileSize || o.size)), 1)) : n("", !0),
306
+ o.status !== "fail" ? (s(), l("div", We, [
307
+ o.status !== "uploading" ? (s(), l(v, { key: 0 }, [
308
+ e.showPreviewBtn ? (s(), l(v, { key: 0 }, [
309
+ N(p, {
310
+ onClick: (d) => I(o)
303
311
  }, {
304
- default: u(() => t[7] || (t[7] = [
305
- B(" 在线预览 ")
312
+ default: m(() => t[7] || (t[7] = [
313
+ _(" 在线预览 ")
306
314
  ])),
307
315
  _: 2,
308
316
  __: [7]
309
317
  }, 1032, ["onClick"]),
310
- S(h, { direction: "vertical" })
311
- ], 64)) : i("", !0),
312
- e.showDownloadBtn ? (s(), l(f, { key: 1 }, [
313
- S(p, {
318
+ N(w, { direction: "vertical" })
319
+ ], 64)) : n("", !0),
320
+ e.showDownloadBtn ? (s(), l(v, { key: 1 }, [
321
+ N(p, {
314
322
  disabled: o.status === "downloading",
315
- onClick: (r) => $(o)
323
+ onClick: (d) => R(o)
316
324
  }, {
317
- default: u(() => [
318
- B(y(o.status === "downloading" && e.showDownloadProgress && e.customDownload ? `下载中...${o.downloadPercentage || 0}%` : "下载"), 1)
325
+ default: m(() => [
326
+ _(b(o.status === "downloading" && e.showDownloadProgress && e.customDownload ? `下载中...${o.downloadPercentage || 0}%` : "下载"), 1)
319
327
  ]),
320
328
  _: 2
321
329
  }, 1032, ["disabled", "onClick"]),
322
- e.showDeleteBtn && !e.readonly ? (s(), b(h, {
330
+ e.showDeleteBtn && !e.readonly ? (s(), L(w, {
323
331
  key: 0,
324
332
  direction: "vertical"
325
- })) : i("", !0)
326
- ], 64)) : i("", !0),
327
- e.showDeleteBtn && !e.readonly ? (s(), b(p, {
333
+ })) : n("", !0)
334
+ ], 64)) : n("", !0),
335
+ e.showDeleteBtn && !e.readonly ? (s(), L(p, {
328
336
  key: 2,
329
- onClick: (r) => N(o)
337
+ onClick: (d) => I(o)
330
338
  }, {
331
- default: u(() => t[8] || (t[8] = [
332
- B("删除")
339
+ default: m(() => t[8] || (t[8] = [
340
+ _("删除")
333
341
  ])),
334
342
  _: 2,
335
343
  __: [8]
336
- }, 1032, ["onClick"])) : i("", !0)
337
- ], 64)) : i("", !0)
338
- ])) : i("", !0),
339
- a("div", Ae, [
344
+ }, 1032, ["onClick"])) : n("", !0)
345
+ ], 64)) : n("", !0)
346
+ ])) : n("", !0),
347
+ a("div", je, [
340
348
  o.status === "uploading" ? (s(), l("div", {
341
349
  key: 0,
342
- class: C(o.status)
350
+ class: $(o.status)
343
351
  }, [
344
352
  t[9] || (t[9] = a("img", {
345
353
  class: "uploading-icon",
346
- src: ye
354
+ src: be
347
355
  }, null, -1)),
348
- a("span", He, y(o.percentage) + "%", 1)
349
- ], 2)) : i("", !0),
350
- e.readonly ? i("", !0) : (s(), l(f, { key: 1 }, [
356
+ a("span", Ge, b(o.percentage) + "%", 1)
357
+ ], 2)) : n("", !0),
358
+ e.readonly ? n("", !0) : (s(), l(v, { key: 1 }, [
351
359
  o.status === "success" || o.status === "downloading" ? (s(), l("span", {
352
360
  key: 0,
353
- class: C(o.status)
361
+ class: $(o.status)
354
362
  }, t[10] || (t[10] = [
355
363
  a("img", {
356
364
  class: "success-icon",
357
- src: ve
365
+ src: Be
358
366
  }, null, -1)
359
- ]), 2)) : i("", !0)
367
+ ]), 2)) : n("", !0)
360
368
  ], 64)),
361
369
  o.status === "fail" ? (s(), l("div", {
362
370
  key: 2,
363
- class: C(["fail-icon-wrapper", o.status])
371
+ class: $(["fail-icon-wrapper", o.status])
364
372
  }, [
365
- S(p, {
366
- onClick: (r) => N(o)
373
+ N(p, {
374
+ onClick: (d) => I(o)
367
375
  }, {
368
- default: u(() => t[11] || (t[11] = [
369
- B(" 删除 ")
376
+ default: m(() => t[11] || (t[11] = [
377
+ _(" 删除 ")
370
378
  ])),
371
379
  _: 2,
372
380
  __: [11]
373
381
  }, 1032, ["onClick"]),
374
- S(w, {
382
+ N(g, {
375
383
  effect: "dark",
376
384
  content: "点击重新上传",
377
385
  placement: "bottom"
378
386
  }, {
379
- default: u(() => [
387
+ default: m(() => [
380
388
  a("img", {
381
389
  class: "retry-icon",
382
- src: ke,
383
- onClick: (r) => c(j)(o)
384
- }, null, 8, We)
390
+ src: Se,
391
+ onClick: (d) => y(Y)(o)
392
+ }, null, 8, Je)
385
393
  ]),
386
394
  _: 2
387
395
  }, 1024),
388
396
  t[12] || (t[12] = a("img", {
389
397
  class: "fail-icon",
390
- src: we
398
+ src: Ce
391
399
  }, null, -1))
392
- ], 2)) : i("", !0)
400
+ ], 2)) : n("", !0)
393
401
  ])
394
402
  ])
395
403
  ]),
396
- e.showUploadProgress ? (s(), l(f, { key: 0 }, [
397
- o.status === "uploading" ? (s(), l("div", Oe, [
404
+ e.showUploadProgress ? (s(), l(v, { key: 0 }, [
405
+ o.status === "uploading" ? (s(), l("div", Qe, [
398
406
  a("div", {
399
407
  class: "file-progress-inner",
400
- style: R({ width: (o.percentage || 0) + "%" })
408
+ style: q({ width: (o.percentage || 0) + "%" })
401
409
  }, null, 4)
402
- ])) : i("", !0)
403
- ], 64)) : i("", !0),
404
- e.showDownloadProgress ? (s(), l(f, { key: 1 }, [
405
- o.status === "downloading" ? (s(), l("div", je, [
410
+ ])) : n("", !0)
411
+ ], 64)) : n("", !0),
412
+ e.showDownloadProgress ? (s(), l(v, { key: 1 }, [
413
+ o.status === "downloading" ? (s(), l("div", Xe, [
406
414
  a("div", {
407
415
  class: "file-progress-inner",
408
- style: R({ width: (o.downloadPercentage || 0) + "%" })
416
+ style: q({ width: (o.downloadPercentage || 0) + "%" })
409
417
  }, null, 4)
410
- ])) : i("", !0)
411
- ], 64)) : i("", !0)
418
+ ])) : n("", !0)
419
+ ], 64)) : n("", !0)
412
420
  ]))), 128))
413
- ], 2)) : i("", !0)
421
+ ], 2)) : n("", !0)
414
422
  ]);
415
423
  };
416
424
  }
417
425
  });
418
426
  export {
419
- mt as default
427
+ kt as default
420
428
  };
@@ -52,7 +52,11 @@ const e = {
52
52
  minSize: 0,
53
53
  // 0 代表: 不支持上传空文件, 则就是必须大于 0; 如果开发者配置的值大于0, 则就是: 大于等于minSize即可.
54
54
  // 文件名区域超过最大宽度时是否省略号 和 Tooltip 展示
55
- showFileNameEllipsisTooltip: !1
55
+ showFileNameEllipsisTooltip: !1,
56
+ // 限制上传的文件名最大长度 - 默认 0: 代表: 不限制文件名长度; 如果开发者配置的值大于0, 则就是: 文件名长度必须小于等于maxFileNameLength即可.
57
+ maxFileNameLength: 0,
58
+ // 限制上传的文件名最小长度 - 默认 0: 代表: 不限制文件名长度; 如果开发者配置的值大于0, 则就是: 文件名长度必须大于等于minFileNameLength即可.
59
+ minFileNameLength: 0
56
60
  };
57
61
  export {
58
62
  e as defaultProps