@lemon30_npm/csit-vue3 1.0.60 → 1.0.64
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 +1103 -879
- package/dist/index.css +1 -1
- package/dist/lib/ci-common-list/ci-common-list-pagination/index.css +0 -0
- package/dist/lib/ci-common-list/ci-common-list-pagination/index.vue.js +1 -1
- package/dist/lib/ci-common-list/ci-common-list-pagination/index.vue2.js +1 -1
- package/dist/lib/ci-common-list/ci-common-list-query/index.css +1 -1
- package/dist/lib/ci-common-list/ci-common-list-query/index.vue.js +1 -1
- package/dist/lib/ci-common-list/ci-common-list-query/index.vue2.js +1 -1
- package/dist/lib/ci-dictionary-select/index.css +1 -0
- package/dist/lib/ci-dictionary-select/index.vue.js +1 -1
- package/dist/lib/ci-dictionary-select/index.vue2.js +95 -45
- package/dist/lib/ci-element-plus/ci-choose-all-select/index.css +1 -0
- package/dist/lib/ci-element-plus/ci-choose-all-select/index.js +9 -0
- package/dist/lib/ci-element-plus/ci-choose-all-select/index.vue.js +7 -0
- package/dist/lib/ci-element-plus/ci-choose-all-select/index.vue2.js +113 -0
- package/dist/lib/ci-upload/computed/index.js +21 -9
- package/dist/lib/ci-upload/hooks/useFileSize.js +10 -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 +199 -164
- package/dist/lib/ci-upload/props/index.js +12 -3
- package/dist/lib/components/index.js +25 -22
- package/dist/lib/styles/reset-elementPlus/index.css +1 -1
- package/dist/types/src/components/components-project/ci-dictionary-select/index.vue.d.ts +5 -2
- package/dist/types/src/components/components-project/ci-dictionary-select/type.d.ts +2 -0
- package/dist/types/src/components/components-project/ci-element-plus/ci-choose-all-select/index.d.ts +8 -0
- package/dist/types/src/components/components-project/ci-element-plus/ci-choose-all-select/index.vue.d.ts +36 -0
- package/dist/types/src/components/components-project/ci-element-plus/ci-choose-all-select/model/index.d.ts +1 -0
- package/dist/types/src/components/components-project/ci-element-plus/ci-choose-all-select/type.d.ts +17 -0
- package/dist/types/src/components/components-project/ci-upload/computed/index.d.ts +0 -1
- package/dist/types/src/components/components-project/ci-upload/hooks/useFileSize.d.ts +3 -0
- package/dist/types/src/components/components-project/ci-upload/index.vue.d.ts +4 -0
- package/dist/types/src/components/components-project/ci-upload/props/index.d.ts +4 -0
- package/dist/types/src/components/components-project/ci-upload/type.d.ts +4 -0
- package/dist/types/src/views-demo/usedemo-ci-choose-all-select/index.vue.d.ts +2 -0
- package/dist/types/src/views-demo/usedemo-ci-choose-all-select/routes/index.d.ts +13 -0
- package/package.json +8 -1
|
@@ -1,49 +1,50 @@
|
|
|
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
|
-
|
|
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 = {
|
|
19
20
|
key: 0,
|
|
20
21
|
class: "tip-slot-textInfo"
|
|
21
|
-
},
|
|
22
|
+
}, Re = {
|
|
22
23
|
key: 1,
|
|
23
24
|
class: "default-tip-slot-textInfo"
|
|
24
|
-
},
|
|
25
|
+
}, Ve = { class: "upload-btn-text" }, Fe = {
|
|
25
26
|
key: 0,
|
|
26
27
|
class: "tip-slot-textInfo"
|
|
27
|
-
},
|
|
28
|
+
}, Ke = {
|
|
28
29
|
key: 1,
|
|
29
30
|
class: "default-tip-slot-textInfo"
|
|
30
|
-
},
|
|
31
|
+
}, Me = { class: "file-item-top" }, qe = { class: "file-name-file-icon" }, Ae = ["src"], He = { class: "top-right" }, Oe = {
|
|
31
32
|
key: 0,
|
|
32
33
|
class: "file-size"
|
|
33
|
-
},
|
|
34
|
+
}, We = {
|
|
34
35
|
key: 1,
|
|
35
36
|
class: "file-operate-btn"
|
|
36
|
-
},
|
|
37
|
+
}, je = { class: "file-status-icon-wrapper" }, Ge = { class: "uploading-percentage" }, Je = ["onClick"], Qe = {
|
|
37
38
|
key: 0,
|
|
38
39
|
class: "file-item-bottom file-progress-bar"
|
|
39
|
-
},
|
|
40
|
+
}, Xe = {
|
|
40
41
|
key: 0,
|
|
41
42
|
class: "file-item-bottom file-progress-bar download-progress-bar"
|
|
42
|
-
},
|
|
43
|
+
}, Ye = {
|
|
43
44
|
name: "CiUpload"
|
|
44
|
-
},
|
|
45
|
-
...
|
|
46
|
-
props: /* @__PURE__ */
|
|
45
|
+
}, kt = /* @__PURE__ */ pe({
|
|
46
|
+
...Ye,
|
|
47
|
+
props: /* @__PURE__ */ fe({
|
|
47
48
|
action: {},
|
|
48
49
|
downloadUrl: {},
|
|
49
50
|
data: {},
|
|
@@ -66,54 +67,68 @@ const Le = { class: "CiUpload" }, $e = {
|
|
|
66
67
|
drag: { type: Boolean },
|
|
67
68
|
disabled: { type: Boolean },
|
|
68
69
|
readonly: { type: Boolean },
|
|
69
|
-
axiosInstance: {}
|
|
70
|
-
|
|
70
|
+
axiosInstance: {},
|
|
71
|
+
minSize: {},
|
|
72
|
+
showFileNameEllipsisTooltip: { type: Boolean },
|
|
73
|
+
maxFileNameLength: {},
|
|
74
|
+
minFileNameLength: {}
|
|
75
|
+
}, Te),
|
|
71
76
|
emits: ["update:fileList", "onSuccess", "onRemove", "onChange", "onError", "onCustomDownload"],
|
|
72
|
-
setup(
|
|
73
|
-
const
|
|
74
|
-
|
|
75
|
-
checkUploadStatus:
|
|
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
|
|
76
81
|
});
|
|
77
|
-
const { retryUpload:
|
|
78
|
-
|
|
79
|
-
() =>
|
|
82
|
+
const { retryUpload: Y } = Ne(S, r, i);
|
|
83
|
+
ye(
|
|
84
|
+
() => i.fileList,
|
|
80
85
|
(e) => {
|
|
81
|
-
|
|
86
|
+
S.value = e.map((t) => ({ ...t }));
|
|
82
87
|
},
|
|
83
88
|
{ immediate: !0 }
|
|
84
89
|
);
|
|
85
|
-
const
|
|
90
|
+
const I = (e) => {
|
|
86
91
|
var t;
|
|
87
|
-
(t =
|
|
88
|
-
},
|
|
89
|
-
if (
|
|
90
|
-
|
|
92
|
+
(t = F.value) == null || t.handleRemove(e);
|
|
93
|
+
}, R = (e) => {
|
|
94
|
+
if (i.customDownload) {
|
|
95
|
+
r("onCustomDownload", e);
|
|
91
96
|
return;
|
|
92
97
|
}
|
|
93
|
-
e.downloadPercentage = 0, e.status = "downloading",
|
|
98
|
+
e.downloadPercentage = 0, e.status = "downloading", ze(
|
|
94
99
|
{
|
|
95
100
|
fileKey: e.fileKey || "当前此条数据没有fileKey字段",
|
|
96
101
|
fileName: e.fileName || "当前此条数据没有fileName字段"
|
|
97
102
|
},
|
|
98
|
-
|
|
103
|
+
i.downloadUrl,
|
|
99
104
|
(t) => {
|
|
100
105
|
e.downloadPercentage = t, t === 100 && (e.status = "success");
|
|
101
106
|
},
|
|
102
107
|
(t) => {
|
|
103
108
|
e.status = "success";
|
|
104
109
|
},
|
|
105
|
-
|
|
110
|
+
i.axiosInstance
|
|
106
111
|
);
|
|
107
|
-
},
|
|
108
|
-
const t =
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
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;
|
|
115
130
|
}), !1);
|
|
116
|
-
},
|
|
131
|
+
}, x = (e, t) => f.value ? !0 : Le.confirm(
|
|
117
132
|
`确定删除 ${e.fileName || e.name} 文件?`,
|
|
118
133
|
"确定删除",
|
|
119
134
|
{
|
|
@@ -126,96 +141,96 @@ const Le = { class: "CiUpload" }, $e = {
|
|
|
126
141
|
// 用户点击“确定”按钮,允许删除
|
|
127
142
|
() => !1
|
|
128
143
|
// 用户点击“取消”按钮,取消删除
|
|
129
|
-
),
|
|
130
|
-
|
|
131
|
-
},
|
|
132
|
-
t.status = "fail", t.percentage = 0,
|
|
133
|
-
|
|
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);
|
|
134
149
|
});
|
|
135
|
-
},
|
|
136
|
-
var p,
|
|
150
|
+
}, oe = (e, t, c) => {
|
|
151
|
+
var p, g, w;
|
|
137
152
|
if (!e) return;
|
|
138
|
-
const
|
|
139
|
-
|
|
140
|
-
},
|
|
141
|
-
e.status === "success" && !e.response || (
|
|
142
|
-
},
|
|
143
|
-
|
|
144
|
-
}, { hasRealDefaultSlot:
|
|
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);
|
|
145
160
|
return (e, t) => {
|
|
146
|
-
const
|
|
147
|
-
return s(), l("div",
|
|
148
|
-
e.readonly ? n("", !0) : (s(),
|
|
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({
|
|
149
164
|
key: 0,
|
|
150
165
|
class: ["ci-el-upload-component", { "is-disabled": e.disabled }],
|
|
151
166
|
ref_key: "uploadRef",
|
|
152
|
-
ref:
|
|
167
|
+
ref: F,
|
|
153
168
|
action: e.action,
|
|
154
169
|
data: e.data,
|
|
155
170
|
headers: e.headers,
|
|
156
|
-
"file-list":
|
|
171
|
+
"file-list": S.value,
|
|
157
172
|
accept: e.accept,
|
|
158
173
|
limit: e.limit,
|
|
159
174
|
multiple: e.multiple,
|
|
160
175
|
drag: e.drag,
|
|
161
176
|
disabled: e.disabled,
|
|
162
|
-
"before-upload": y(
|
|
163
|
-
"before-remove":
|
|
164
|
-
"on-success":
|
|
165
|
-
"on-change":
|
|
166
|
-
"on-remove":
|
|
167
|
-
"on-exceed":
|
|
168
|
-
"on-error":
|
|
169
|
-
"http-request": y(
|
|
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),
|
|
170
185
|
"show-file-list": !1
|
|
171
|
-
}, e.$attrs),
|
|
172
|
-
default:
|
|
173
|
-
y(
|
|
174
|
-
e.drag ? (s(), l(
|
|
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 }, [
|
|
175
190
|
t[0] || (t[0] = a("img", {
|
|
176
191
|
class: "upload-btn-icon",
|
|
177
|
-
src:
|
|
192
|
+
src: A,
|
|
178
193
|
alt: ""
|
|
179
194
|
}, null, -1)),
|
|
180
195
|
t[1] || (t[1] = a("img", {
|
|
181
196
|
class: "upload-btn-icon-hover",
|
|
182
|
-
src:
|
|
197
|
+
src: H,
|
|
183
198
|
alt: ""
|
|
184
199
|
}, null, -1)),
|
|
185
200
|
t[2] || (t[2] = a("img", {
|
|
186
201
|
class: "upload-btn-icon-disabled",
|
|
187
|
-
src:
|
|
202
|
+
src: O,
|
|
188
203
|
alt: ""
|
|
189
204
|
}, null, -1)),
|
|
190
205
|
t[3] || (t[3] = a("div", { class: "drag-text-info" }, [
|
|
191
206
|
a("span", { class: "drag-text-info-click" }, "点击上传"),
|
|
192
207
|
a("span", { class: "drag-text-info-black" }, "或将文件拖拽到这里上传")
|
|
193
208
|
], -1)),
|
|
194
|
-
e.$slots.tip ? (s(), l("div",
|
|
195
|
-
|
|
196
|
-
])) : (s(), l("div",
|
|
197
|
-
], 64)) : (s(),
|
|
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, {
|
|
198
213
|
key: 1,
|
|
199
214
|
class: "upload-btn",
|
|
200
215
|
disabled: e.disabled
|
|
201
216
|
}, {
|
|
202
|
-
default:
|
|
217
|
+
default: m(() => [
|
|
203
218
|
t[4] || (t[4] = a("img", {
|
|
204
219
|
class: "upload-btn-icon",
|
|
205
|
-
src:
|
|
220
|
+
src: A,
|
|
206
221
|
alt: ""
|
|
207
222
|
}, null, -1)),
|
|
208
223
|
t[5] || (t[5] = a("img", {
|
|
209
224
|
class: "upload-btn-icon-hover",
|
|
210
|
-
src:
|
|
225
|
+
src: H,
|
|
211
226
|
alt: ""
|
|
212
227
|
}, null, -1)),
|
|
213
228
|
t[6] || (t[6] = a("img", {
|
|
214
229
|
class: "upload-btn-icon-disabled",
|
|
215
|
-
src:
|
|
230
|
+
src: O,
|
|
216
231
|
alt: ""
|
|
217
232
|
}, null, -1)),
|
|
218
|
-
a("span",
|
|
233
|
+
a("span", Ve, b(e.uploadBtnText), 1)
|
|
219
234
|
]),
|
|
220
235
|
_: 1,
|
|
221
236
|
__: [4, 5, 6]
|
|
@@ -226,159 +241,179 @@ const Le = { class: "CiUpload" }, $e = {
|
|
|
226
241
|
}, [
|
|
227
242
|
e.drag ? void 0 : {
|
|
228
243
|
name: "tip",
|
|
229
|
-
fn:
|
|
230
|
-
e.$slots.tip ? (s(), l("div",
|
|
231
|
-
|
|
232
|
-
])) : (s(), l("div",
|
|
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))
|
|
233
248
|
]),
|
|
234
249
|
key: "0"
|
|
235
250
|
},
|
|
236
|
-
|
|
237
|
-
name:
|
|
238
|
-
fn:
|
|
239
|
-
|
|
251
|
+
M(y(ne), (o, d) => ({
|
|
252
|
+
name: d,
|
|
253
|
+
fn: m((h) => [
|
|
254
|
+
P(e.$slots, d, we(he(h || {})), void 0, !0)
|
|
240
255
|
])
|
|
241
256
|
}))
|
|
242
257
|
]), 1040, ["class", "action", "data", "headers", "file-list", "accept", "limit", "multiple", "drag", "disabled", "before-upload", "http-request"])),
|
|
243
|
-
|
|
258
|
+
S.value.length ? (s(), l("div", {
|
|
244
259
|
key: 1,
|
|
245
|
-
class:
|
|
260
|
+
class: $(["custom-file-list-default", { "is-readonly": e.readonly }])
|
|
246
261
|
}, [
|
|
247
|
-
(s(!0), l(
|
|
262
|
+
(s(!0), l(v, null, M(S.value, (o) => (s(), l("div", {
|
|
248
263
|
class: "file-item-wrapper",
|
|
249
264
|
key: o.uid
|
|
250
265
|
}, [
|
|
251
|
-
a("div",
|
|
252
|
-
a("div",
|
|
266
|
+
a("div", Me, [
|
|
267
|
+
a("div", qe, [
|
|
253
268
|
e.showFileExtIcon ? (s(), l("img", {
|
|
254
269
|
key: 0,
|
|
255
270
|
class: "file-icon",
|
|
256
|
-
src: y(
|
|
257
|
-
}, null, 8,
|
|
258
|
-
|
|
271
|
+
src: y($e)(o.fileName || o.name)
|
|
272
|
+
}, null, 8, Ae)) : n("", !0),
|
|
273
|
+
e.showFileNameEllipsisTooltip ? (s(), L(g, {
|
|
274
|
+
key: 2,
|
|
275
|
+
effect: "dark",
|
|
276
|
+
content: o.fileName || o.name,
|
|
277
|
+
placement: "right"
|
|
278
|
+
}, {
|
|
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)
|
|
284
|
+
}, {
|
|
285
|
+
default: m(() => [
|
|
286
|
+
_(b(o.fileName || o.name), 1)
|
|
287
|
+
]),
|
|
288
|
+
_: 2
|
|
289
|
+
}, 1032, ["class", "disabled", "onClick"])
|
|
290
|
+
]),
|
|
291
|
+
_: 2
|
|
292
|
+
}, 1032, ["content"])) : (s(), L(p, {
|
|
293
|
+
key: 1,
|
|
259
294
|
class: "top-left file-name",
|
|
260
295
|
disabled: o.status === "downloading" || o.status === "uploading",
|
|
261
|
-
onClick: (
|
|
296
|
+
onClick: (d) => R(o)
|
|
262
297
|
}, {
|
|
263
|
-
default:
|
|
264
|
-
|
|
298
|
+
default: m(() => [
|
|
299
|
+
_(b(o.fileName || o.name), 1)
|
|
265
300
|
]),
|
|
266
301
|
_: 2
|
|
267
|
-
}, 1032, ["disabled", "onClick"])
|
|
302
|
+
}, 1032, ["disabled", "onClick"]))
|
|
268
303
|
]),
|
|
269
|
-
a("div",
|
|
270
|
-
e.showFileSize ? (s(), l("span",
|
|
271
|
-
o.status !== "fail" ? (s(), l("div",
|
|
272
|
-
o.status !== "uploading" ? (s(), l(
|
|
273
|
-
e.showPreviewBtn ? (s(), l(
|
|
274
|
-
|
|
275
|
-
onClick: (
|
|
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)
|
|
276
311
|
}, {
|
|
277
|
-
default:
|
|
278
|
-
|
|
312
|
+
default: m(() => t[7] || (t[7] = [
|
|
313
|
+
_(" 在线预览 ")
|
|
279
314
|
])),
|
|
280
315
|
_: 2,
|
|
281
316
|
__: [7]
|
|
282
317
|
}, 1032, ["onClick"]),
|
|
283
|
-
|
|
318
|
+
N(w, { direction: "vertical" })
|
|
284
319
|
], 64)) : n("", !0),
|
|
285
|
-
e.showDownloadBtn ? (s(), l(
|
|
286
|
-
|
|
320
|
+
e.showDownloadBtn ? (s(), l(v, { key: 1 }, [
|
|
321
|
+
N(p, {
|
|
287
322
|
disabled: o.status === "downloading",
|
|
288
|
-
onClick: (
|
|
323
|
+
onClick: (d) => R(o)
|
|
289
324
|
}, {
|
|
290
|
-
default:
|
|
291
|
-
|
|
325
|
+
default: m(() => [
|
|
326
|
+
_(b(o.status === "downloading" && e.showDownloadProgress && e.customDownload ? `下载中...${o.downloadPercentage || 0}%` : "下载"), 1)
|
|
292
327
|
]),
|
|
293
328
|
_: 2
|
|
294
329
|
}, 1032, ["disabled", "onClick"]),
|
|
295
|
-
e.showDeleteBtn && !e.readonly ? (s(),
|
|
330
|
+
e.showDeleteBtn && !e.readonly ? (s(), L(w, {
|
|
296
331
|
key: 0,
|
|
297
332
|
direction: "vertical"
|
|
298
333
|
})) : n("", !0)
|
|
299
334
|
], 64)) : n("", !0),
|
|
300
|
-
e.showDeleteBtn && !e.readonly ? (s(),
|
|
335
|
+
e.showDeleteBtn && !e.readonly ? (s(), L(p, {
|
|
301
336
|
key: 2,
|
|
302
|
-
onClick: (
|
|
337
|
+
onClick: (d) => I(o)
|
|
303
338
|
}, {
|
|
304
|
-
default:
|
|
305
|
-
|
|
339
|
+
default: m(() => t[8] || (t[8] = [
|
|
340
|
+
_("删除")
|
|
306
341
|
])),
|
|
307
342
|
_: 2,
|
|
308
343
|
__: [8]
|
|
309
344
|
}, 1032, ["onClick"])) : n("", !0)
|
|
310
345
|
], 64)) : n("", !0)
|
|
311
346
|
])) : n("", !0),
|
|
312
|
-
a("div",
|
|
347
|
+
a("div", je, [
|
|
313
348
|
o.status === "uploading" ? (s(), l("div", {
|
|
314
349
|
key: 0,
|
|
315
|
-
class:
|
|
350
|
+
class: $(o.status)
|
|
316
351
|
}, [
|
|
317
352
|
t[9] || (t[9] = a("img", {
|
|
318
353
|
class: "uploading-icon",
|
|
319
|
-
src:
|
|
354
|
+
src: be
|
|
320
355
|
}, null, -1)),
|
|
321
|
-
a("span",
|
|
356
|
+
a("span", Ge, b(o.percentage) + "%", 1)
|
|
322
357
|
], 2)) : n("", !0),
|
|
323
|
-
e.readonly ? n("", !0) : (s(), l(
|
|
358
|
+
e.readonly ? n("", !0) : (s(), l(v, { key: 1 }, [
|
|
324
359
|
o.status === "success" || o.status === "downloading" ? (s(), l("span", {
|
|
325
360
|
key: 0,
|
|
326
|
-
class:
|
|
361
|
+
class: $(o.status)
|
|
327
362
|
}, t[10] || (t[10] = [
|
|
328
363
|
a("img", {
|
|
329
364
|
class: "success-icon",
|
|
330
|
-
src:
|
|
365
|
+
src: Be
|
|
331
366
|
}, null, -1)
|
|
332
367
|
]), 2)) : n("", !0)
|
|
333
368
|
], 64)),
|
|
334
369
|
o.status === "fail" ? (s(), l("div", {
|
|
335
370
|
key: 2,
|
|
336
|
-
class:
|
|
371
|
+
class: $(["fail-icon-wrapper", o.status])
|
|
337
372
|
}, [
|
|
338
|
-
|
|
339
|
-
onClick: (
|
|
373
|
+
N(p, {
|
|
374
|
+
onClick: (d) => I(o)
|
|
340
375
|
}, {
|
|
341
|
-
default:
|
|
342
|
-
|
|
376
|
+
default: m(() => t[11] || (t[11] = [
|
|
377
|
+
_(" 删除 ")
|
|
343
378
|
])),
|
|
344
379
|
_: 2,
|
|
345
380
|
__: [11]
|
|
346
381
|
}, 1032, ["onClick"]),
|
|
347
|
-
|
|
382
|
+
N(g, {
|
|
348
383
|
effect: "dark",
|
|
349
384
|
content: "点击重新上传",
|
|
350
385
|
placement: "bottom"
|
|
351
386
|
}, {
|
|
352
|
-
default:
|
|
387
|
+
default: m(() => [
|
|
353
388
|
a("img", {
|
|
354
389
|
class: "retry-icon",
|
|
355
|
-
src:
|
|
356
|
-
onClick: (
|
|
357
|
-
}, null, 8,
|
|
390
|
+
src: Se,
|
|
391
|
+
onClick: (d) => y(Y)(o)
|
|
392
|
+
}, null, 8, Je)
|
|
358
393
|
]),
|
|
359
394
|
_: 2
|
|
360
395
|
}, 1024),
|
|
361
396
|
t[12] || (t[12] = a("img", {
|
|
362
397
|
class: "fail-icon",
|
|
363
|
-
src:
|
|
398
|
+
src: Ce
|
|
364
399
|
}, null, -1))
|
|
365
400
|
], 2)) : n("", !0)
|
|
366
401
|
])
|
|
367
402
|
])
|
|
368
403
|
]),
|
|
369
|
-
e.showUploadProgress ? (s(), l(
|
|
370
|
-
o.status === "uploading" ? (s(), l("div",
|
|
404
|
+
e.showUploadProgress ? (s(), l(v, { key: 0 }, [
|
|
405
|
+
o.status === "uploading" ? (s(), l("div", Qe, [
|
|
371
406
|
a("div", {
|
|
372
407
|
class: "file-progress-inner",
|
|
373
|
-
style:
|
|
408
|
+
style: q({ width: (o.percentage || 0) + "%" })
|
|
374
409
|
}, null, 4)
|
|
375
410
|
])) : n("", !0)
|
|
376
411
|
], 64)) : n("", !0),
|
|
377
|
-
e.showDownloadProgress ? (s(), l(
|
|
378
|
-
o.status === "downloading" ? (s(), l("div",
|
|
412
|
+
e.showDownloadProgress ? (s(), l(v, { key: 1 }, [
|
|
413
|
+
o.status === "downloading" ? (s(), l("div", Xe, [
|
|
379
414
|
a("div", {
|
|
380
415
|
class: "file-progress-inner",
|
|
381
|
-
style:
|
|
416
|
+
style: q({ width: (o.downloadPercentage || 0) + "%" })
|
|
382
417
|
}, null, 4)
|
|
383
418
|
])) : n("", !0)
|
|
384
419
|
], 64)) : n("", !0)
|
|
@@ -389,5 +424,5 @@ const Le = { class: "CiUpload" }, $e = {
|
|
|
389
424
|
}
|
|
390
425
|
});
|
|
391
426
|
export {
|
|
392
|
-
|
|
427
|
+
kt as default
|
|
393
428
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const
|
|
1
|
+
const e = {
|
|
2
2
|
// 请求 URL - 默认值: 是我本机本地跑一个 Node 服务, 提供了一个上传接口
|
|
3
3
|
action: "http://localhost:3001/upload",
|
|
4
4
|
// 下载 URL - 默认值: 是我本机本地跑一个 Node 服务, 提供了一个下载接口
|
|
@@ -47,8 +47,17 @@ const o = {
|
|
|
47
47
|
* 若传入了:将使用该实例发起上传请求(支持统一拦截器等配置)
|
|
48
48
|
* 若未传入:则默认使用全局的 axios 对象
|
|
49
49
|
*/
|
|
50
|
-
axiosInstance: void 0
|
|
50
|
+
axiosInstance: void 0,
|
|
51
|
+
// 限制上传文件最小大小(单位 byte)- 默认 0: 代表: 不支持上传空文件, 则就是必须大于 0;
|
|
52
|
+
minSize: 0,
|
|
53
|
+
// 0 代表: 不支持上传空文件, 则就是必须大于 0; 如果开发者配置的值大于0, 则就是: 大于等于minSize即可.
|
|
54
|
+
// 文件名区域超过最大宽度时是否省略号 和 Tooltip 展示
|
|
55
|
+
showFileNameEllipsisTooltip: !1,
|
|
56
|
+
// 限制上传的文件名最大长度 - 默认 0: 代表: 不限制文件名长度; 如果开发者配置的值大于0, 则就是: 文件名长度必须小于等于maxFileNameLength即可.
|
|
57
|
+
maxFileNameLength: 0,
|
|
58
|
+
// 限制上传的文件名最小长度 - 默认 0: 代表: 不限制文件名长度; 如果开发者配置的值大于0, 则就是: 文件名长度必须大于等于minFileNameLength即可.
|
|
59
|
+
minFileNameLength: 0
|
|
51
60
|
};
|
|
52
61
|
export {
|
|
53
|
-
|
|
62
|
+
e as defaultProps
|
|
54
63
|
};
|