@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.
- package/dist/csit-vue3.js +834 -765
- package/dist/index.css +1 -1
- package/dist/lib/ci-upload/hooks/rules/createUploadRules.js +14 -0
- package/dist/lib/ci-upload/hooks/rules/fileNameLengthRule.js +15 -0
- package/dist/lib/ci-upload/hooks/rules/maxSizeRule.js +8 -0
- package/dist/lib/ci-upload/hooks/rules/minSizeRule.js +8 -0
- package/dist/lib/ci-upload/hooks/rules/typeRule.js +10 -0
- package/dist/lib/ci-upload/hooks/useAbortUploadFlow.js +13 -0
- package/dist/lib/ci-upload/hooks/useConfirmBeforeUpload.js +11 -0
- package/dist/lib/ci-upload/hooks/useUploadValidateFail.js +12 -0
- package/dist/lib/ci-upload/index.css +1 -1
- package/dist/lib/ci-upload/index.vue.js +2 -2
- package/dist/lib/ci-upload/index.vue2.js +210 -199
- package/dist/lib/ci-upload/props/index.js +11 -1
- package/dist/lib/styles/reset-elementPlus/index.css +1 -1
- package/dist/types/src/components/components-project/ci-upload/hooks/rules/createUploadRules.d.ts +2 -0
- package/dist/types/src/components/components-project/ci-upload/hooks/rules/fileNameLengthRule.d.ts +2 -0
- package/dist/types/src/components/components-project/ci-upload/hooks/rules/maxSizeRule.d.ts +2 -0
- package/dist/types/src/components/components-project/ci-upload/hooks/rules/minSizeRule.d.ts +2 -0
- package/dist/types/src/components/components-project/ci-upload/hooks/rules/typeRule.d.ts +2 -0
- package/dist/types/src/components/components-project/ci-upload/hooks/rules/types.d.ts +2 -0
- package/dist/types/src/components/components-project/ci-upload/hooks/useAbortUploadFlow.d.ts +20 -0
- package/dist/types/src/components/components-project/ci-upload/hooks/useConfirmBeforeUpload.d.ts +1 -0
- package/dist/types/src/components/components-project/ci-upload/hooks/useUploadValidateFail.d.ts +19 -0
- package/dist/types/src/components/components-project/ci-upload/index.vue.d.ts +2 -0
- package/dist/types/src/components/components-project/ci-upload/props/index.d.ts +10 -0
- package/dist/types/src/components/components-project/ci-upload/type.d.ts +10 -0
- package/dist/types/src/config/config-system/projectSettings.d.ts +2 -0
- package/package.json +1 -1
|
@@ -1,50 +1,54 @@
|
|
|
1
|
-
import { ElUpload as
|
|
2
|
-
import { defineComponent as
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import { ElMessageBox as
|
|
11
|
-
import { useUpload as
|
|
12
|
-
import { useUploadRetry as
|
|
13
|
-
import { downloadFileWithAxios as
|
|
14
|
-
import { getFileIconByName as
|
|
15
|
-
import { useExposeMethods as
|
|
16
|
-
import { useCiUploadComputed as
|
|
17
|
-
import { defaultProps as
|
|
18
|
-
import { useFileSize as
|
|
19
|
-
|
|
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
|
-
},
|
|
26
|
+
}, Te = {
|
|
23
27
|
key: 1,
|
|
24
28
|
class: "default-tip-slot-textInfo"
|
|
25
|
-
},
|
|
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
|
-
},
|
|
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
|
-
},
|
|
38
|
+
}, Oe = {
|
|
35
39
|
key: 1,
|
|
36
40
|
class: "file-operate-btn"
|
|
37
|
-
},
|
|
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
|
-
},
|
|
44
|
+
}, Qe = {
|
|
41
45
|
key: 0,
|
|
42
46
|
class: "file-item-bottom file-progress-bar download-progress-bar"
|
|
43
|
-
},
|
|
47
|
+
}, Xe = {
|
|
44
48
|
name: "CiUpload"
|
|
45
|
-
},
|
|
46
|
-
...
|
|
47
|
-
props: /* @__PURE__ */
|
|
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
|
-
|
|
78
|
+
minFileNameLength: {},
|
|
79
|
+
confirmBeforeUpload: { type: Boolean },
|
|
80
|
+
confirmBeforeUploadText: {}
|
|
81
|
+
}, Ne),
|
|
76
82
|
emits: ["update:fileList", "onSuccess", "onRemove", "onChange", "onError", "onCustomDownload"],
|
|
77
|
-
setup(
|
|
78
|
-
const { formatFileSize:
|
|
79
|
-
|
|
80
|
-
checkUploadStatus:
|
|
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:
|
|
83
|
-
|
|
88
|
+
const { retryUpload: A } = Be(k, r, i);
|
|
89
|
+
de(
|
|
84
90
|
() => i.fileList,
|
|
85
91
|
(e) => {
|
|
86
|
-
|
|
92
|
+
k.value = e.map((o) => ({ ...o }));
|
|
87
93
|
},
|
|
88
94
|
{ immediate: !0 }
|
|
89
95
|
);
|
|
90
|
-
const
|
|
91
|
-
var
|
|
92
|
-
(
|
|
93
|
-
},
|
|
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",
|
|
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
|
-
(
|
|
105
|
-
e.downloadPercentage =
|
|
110
|
+
(o) => {
|
|
111
|
+
e.downloadPercentage = o, o === 100 && (e.status = "success");
|
|
106
112
|
},
|
|
107
|
-
(
|
|
113
|
+
(o) => {
|
|
108
114
|
e.status = "success";
|
|
109
115
|
},
|
|
110
116
|
i.axiosInstance
|
|
111
117
|
);
|
|
112
|
-
},
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
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
|
-
),
|
|
145
|
-
|
|
146
|
-
},
|
|
147
|
-
|
|
148
|
-
r("update:fileList", [...
|
|
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
|
-
},
|
|
151
|
-
var p,
|
|
161
|
+
}, J = (e, o, u) => {
|
|
162
|
+
var p, b, B;
|
|
152
163
|
if (!e) return;
|
|
153
|
-
const
|
|
154
|
-
|
|
155
|
-
},
|
|
156
|
-
e.status === "success" && !e.response || (r("update:fileList",
|
|
157
|
-
},
|
|
158
|
-
r("update:fileList",
|
|
159
|
-
}, { hasRealDefaultSlot:
|
|
160
|
-
return (e,
|
|
161
|
-
const
|
|
162
|
-
return s(), l("div",
|
|
163
|
-
e.readonly ? n("", !0) : (s(),
|
|
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:
|
|
178
|
+
ref: D,
|
|
168
179
|
action: e.action,
|
|
169
180
|
data: e.data,
|
|
170
181
|
headers: e.headers,
|
|
171
|
-
"file-list":
|
|
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":
|
|
178
|
-
"before-remove":
|
|
179
|
-
"on-success":
|
|
180
|
-
"on-change":
|
|
181
|
-
"on-remove":
|
|
182
|
-
"on-exceed":
|
|
183
|
-
"on-error":
|
|
184
|
-
"http-request":
|
|
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),
|
|
187
|
-
default:
|
|
188
|
-
|
|
189
|
-
e.drag ? (s(), l(
|
|
190
|
-
|
|
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:
|
|
203
|
+
src: L,
|
|
193
204
|
alt: ""
|
|
194
205
|
}, null, -1)),
|
|
195
|
-
|
|
206
|
+
o[1] || (o[1] = a("img", {
|
|
196
207
|
class: "upload-btn-icon-hover",
|
|
197
|
-
src:
|
|
208
|
+
src: R,
|
|
198
209
|
alt: ""
|
|
199
210
|
}, null, -1)),
|
|
200
|
-
|
|
211
|
+
o[2] || (o[2] = a("img", {
|
|
201
212
|
class: "upload-btn-icon-disabled",
|
|
202
|
-
src:
|
|
213
|
+
src: T,
|
|
203
214
|
alt: ""
|
|
204
215
|
}, null, -1)),
|
|
205
|
-
|
|
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",
|
|
210
|
-
|
|
211
|
-
])) : (s(), l("div",
|
|
212
|
-
], 64)) : (s(),
|
|
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:
|
|
218
|
-
|
|
228
|
+
default: d(() => [
|
|
229
|
+
o[4] || (o[4] = a("img", {
|
|
219
230
|
class: "upload-btn-icon",
|
|
220
|
-
src:
|
|
231
|
+
src: L,
|
|
221
232
|
alt: ""
|
|
222
233
|
}, null, -1)),
|
|
223
|
-
|
|
234
|
+
o[5] || (o[5] = a("img", {
|
|
224
235
|
class: "upload-btn-icon-hover",
|
|
225
|
-
src:
|
|
236
|
+
src: R,
|
|
226
237
|
alt: ""
|
|
227
238
|
}, null, -1)),
|
|
228
|
-
|
|
239
|
+
o[6] || (o[6] = a("img", {
|
|
229
240
|
class: "upload-btn-icon-disabled",
|
|
230
|
-
src:
|
|
241
|
+
src: T,
|
|
231
242
|
alt: ""
|
|
232
243
|
}, null, -1)),
|
|
233
|
-
a("span",
|
|
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:
|
|
245
|
-
e.$slots.tip ? (s(), l("div",
|
|
246
|
-
|
|
247
|
-
])) : (s(), l("div", Ke,
|
|
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
|
-
|
|
252
|
-
name:
|
|
253
|
-
fn:
|
|
254
|
-
|
|
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
|
-
|
|
269
|
+
k.value.length ? (s(), l("div", {
|
|
259
270
|
key: 1,
|
|
260
|
-
class:
|
|
271
|
+
class: C(["custom-file-list-default", { "is-readonly": e.readonly }])
|
|
261
272
|
}, [
|
|
262
|
-
(s(!0), l(
|
|
273
|
+
(s(!0), l(g, null, z(k.value, (t) => (s(), l("div", {
|
|
263
274
|
class: "file-item-wrapper",
|
|
264
|
-
key:
|
|
275
|
+
key: t.uid
|
|
265
276
|
}, [
|
|
266
|
-
a("div",
|
|
267
|
-
a("div",
|
|
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:
|
|
272
|
-
}, null, 8,
|
|
273
|
-
e.showFileNameEllipsisTooltip ? (s(),
|
|
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:
|
|
287
|
+
content: t.fileName || t.name,
|
|
277
288
|
placement: "right"
|
|
278
289
|
}, {
|
|
279
|
-
default:
|
|
280
|
-
|
|
281
|
-
class:
|
|
282
|
-
disabled:
|
|
283
|
-
onClick: (
|
|
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:
|
|
286
|
-
|
|
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(),
|
|
303
|
+
}, 1032, ["content"])) : (s(), w(p, {
|
|
293
304
|
key: 1,
|
|
294
305
|
class: "top-left file-name",
|
|
295
|
-
disabled:
|
|
296
|
-
onClick: (
|
|
306
|
+
disabled: t.status === "downloading" || t.status === "uploading",
|
|
307
|
+
onClick: (c) => N(t)
|
|
297
308
|
}, {
|
|
298
|
-
default:
|
|
299
|
-
|
|
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",
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
e.showPreviewBtn ? (s(), l(
|
|
309
|
-
|
|
310
|
-
onClick: (
|
|
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:
|
|
313
|
-
|
|
323
|
+
default: d(() => o[7] || (o[7] = [
|
|
324
|
+
v(" 在线预览 ")
|
|
314
325
|
])),
|
|
315
326
|
_: 2,
|
|
316
327
|
__: [7]
|
|
317
328
|
}, 1032, ["onClick"]),
|
|
318
|
-
|
|
329
|
+
h(B, { direction: "vertical" })
|
|
319
330
|
], 64)) : n("", !0),
|
|
320
|
-
e.showDownloadBtn ? (s(), l(
|
|
321
|
-
|
|
322
|
-
disabled:
|
|
323
|
-
onClick: (
|
|
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:
|
|
326
|
-
|
|
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(),
|
|
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(),
|
|
346
|
+
e.showDeleteBtn && !e.readonly ? (s(), w(p, {
|
|
336
347
|
key: 2,
|
|
337
|
-
onClick: (
|
|
348
|
+
onClick: (c) => S(t)
|
|
338
349
|
}, {
|
|
339
|
-
default:
|
|
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",
|
|
348
|
-
|
|
358
|
+
a("div", We, [
|
|
359
|
+
t.status === "uploading" ? (s(), l("div", {
|
|
349
360
|
key: 0,
|
|
350
|
-
class:
|
|
361
|
+
class: C(t.status)
|
|
351
362
|
}, [
|
|
352
|
-
|
|
363
|
+
o[9] || (o[9] = a("img", {
|
|
353
364
|
class: "uploading-icon",
|
|
354
|
-
src:
|
|
365
|
+
src: ge
|
|
355
366
|
}, null, -1)),
|
|
356
|
-
a("span",
|
|
367
|
+
a("span", je, y(t.percentage) + "%", 1)
|
|
357
368
|
], 2)) : n("", !0),
|
|
358
|
-
e.readonly ? n("", !0) : (s(), l(
|
|
359
|
-
|
|
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:
|
|
362
|
-
},
|
|
372
|
+
class: C(t.status)
|
|
373
|
+
}, o[10] || (o[10] = [
|
|
363
374
|
a("img", {
|
|
364
375
|
class: "success-icon",
|
|
365
|
-
src:
|
|
376
|
+
src: ye
|
|
366
377
|
}, null, -1)
|
|
367
378
|
]), 2)) : n("", !0)
|
|
368
379
|
], 64)),
|
|
369
|
-
|
|
380
|
+
t.status === "fail" ? (s(), l("div", {
|
|
370
381
|
key: 2,
|
|
371
|
-
class:
|
|
382
|
+
class: C(["fail-icon-wrapper", t.status])
|
|
372
383
|
}, [
|
|
373
|
-
|
|
374
|
-
onClick: (
|
|
384
|
+
h(p, {
|
|
385
|
+
onClick: (c) => S(t)
|
|
375
386
|
}, {
|
|
376
|
-
default:
|
|
377
|
-
|
|
387
|
+
default: d(() => o[11] || (o[11] = [
|
|
388
|
+
v(" 删除 ")
|
|
378
389
|
])),
|
|
379
390
|
_: 2,
|
|
380
391
|
__: [11]
|
|
381
392
|
}, 1032, ["onClick"]),
|
|
382
|
-
|
|
393
|
+
h(b, {
|
|
383
394
|
effect: "dark",
|
|
384
395
|
content: "点击重新上传",
|
|
385
396
|
placement: "bottom"
|
|
386
397
|
}, {
|
|
387
|
-
default:
|
|
398
|
+
default: d(() => [
|
|
388
399
|
a("img", {
|
|
389
400
|
class: "retry-icon",
|
|
390
|
-
src:
|
|
391
|
-
onClick: (
|
|
392
|
-
}, null, 8,
|
|
401
|
+
src: ke,
|
|
402
|
+
onClick: (c) => f(A)(t)
|
|
403
|
+
}, null, 8, Ge)
|
|
393
404
|
]),
|
|
394
405
|
_: 2
|
|
395
406
|
}, 1024),
|
|
396
|
-
|
|
407
|
+
o[12] || (o[12] = a("img", {
|
|
397
408
|
class: "fail-icon",
|
|
398
|
-
src:
|
|
409
|
+
src: we
|
|
399
410
|
}, null, -1))
|
|
400
411
|
], 2)) : n("", !0)
|
|
401
412
|
])
|
|
402
413
|
])
|
|
403
414
|
]),
|
|
404
|
-
e.showUploadProgress ? (s(), l(
|
|
405
|
-
|
|
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:
|
|
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(
|
|
413
|
-
|
|
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:
|
|
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
|
-
|
|
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
|