@lemon30_npm/csit-vue3 1.0.65 → 1.0.67

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