@lingshugroup/web-plus 1.4.4 → 1.5.0
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/lib/index.css +1 -1
- package/lib/index.css.br +0 -0
- package/lib/index.css.gz +0 -0
- package/lib/packages/ls-components/components/upload/Index.vue/index.cjs +1 -1
- package/lib/packages/ls-components/components/upload/Index.vue/index.js +3 -3
- package/lib/packages/ls-components/components/upload/Index.vue/index2.cjs +1 -1
- package/lib/packages/ls-components/components/upload/Index.vue/index2.js +204 -191
- package/lib/packages/ls-components/components/upload/Index.vue/index2.js.br +0 -0
- package/lib/packages/ls-components/components/upload/Index.vue/index2.js.gz +0 -0
- package/lib/types/components/_types/index.d.ts +2 -2
- package/lib/types/components/breadcrumb/types.d.ts +3 -2
- package/lib/types/components/menu/types.d.ts +1 -0
- package/lib/types/components/upload/types.d.ts +1 -0
- package/package.json +1 -1
|
@@ -1,69 +1,69 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
1
|
+
var Me = Object.defineProperty;
|
|
2
|
+
var u = (q, O) => Me(q, "name", { value: O, configurable: !0 });
|
|
3
3
|
/* empty css */
|
|
4
4
|
/* empty css */
|
|
5
5
|
/* empty css */
|
|
6
6
|
/* empty css */
|
|
7
|
-
import { defineComponent as
|
|
8
|
-
import { lsUploadProps as
|
|
9
|
-
import { getVariable as
|
|
10
|
-
import { useNamespace as
|
|
11
|
-
import
|
|
12
|
-
import
|
|
13
|
-
import
|
|
7
|
+
import { defineComponent as Re, useSlots as _e, useAttrs as ze, ref as ne, reactive as le, watch as J, computed as s, openBlock as c, createElementBlock as m, normalizeClass as N, unref as n, createVNode as Q, mergeProps as Ne, createSlots as Ve, withCtx as p, Fragment as k, createBlock as F, createElementVNode as V, toDisplayString as B, createTextVNode as $, createCommentVNode as D, renderSlot as I, toRefs as oe } from "vue";
|
|
8
|
+
import { lsUploadProps as Be, UPLOAD_TYPE_MAP as De, fileTypeMap as Ie, UPLOAD_STATUS_MAP as qe, IMG_SUFFIX_LIST as Oe } from "../types/index.js";
|
|
9
|
+
import { getVariable as je } from "../../_utils/config/index.js";
|
|
10
|
+
import { useNamespace as He } from "../../_hooks/useNamespace/index.js";
|
|
11
|
+
import S from "../../button/Button.vue/index.js";
|
|
12
|
+
import ae from "../../icon/Index.vue/index.js";
|
|
13
|
+
import Ge from "../../../../../preview_image/index.js";
|
|
14
14
|
/* empty css */
|
|
15
15
|
/* empty css */
|
|
16
16
|
import { ElMessage as x } from "../../../../../node_modules/.pnpm/element-plus@2.8.1_vue@3.5.13_typescript@5.5.4_/node_modules/element-plus/es/components/message/index/index.js";
|
|
17
|
-
import { ElAvatar as
|
|
18
|
-
import { ElUpload as
|
|
19
|
-
const
|
|
17
|
+
import { ElAvatar as Ke } from "../../../../../node_modules/.pnpm/element-plus@2.8.1_vue@3.5.13_typescript@5.5.4_/node_modules/element-plus/es/components/avatar/index/index.js";
|
|
18
|
+
import { ElUpload as We } from "../../../../../node_modules/.pnpm/element-plus@2.8.1_vue@3.5.13_typescript@5.5.4_/node_modules/element-plus/es/components/upload/index/index.js";
|
|
19
|
+
const Xe = { class: "ls-drag" }, Ye = { class: "drag-txt ls-color-brand6" }, Je = {
|
|
20
20
|
key: 0,
|
|
21
21
|
class: "btn-picture-card"
|
|
22
|
-
},
|
|
22
|
+
}, Qe = {
|
|
23
23
|
key: 0,
|
|
24
24
|
class: "ls-tip"
|
|
25
|
-
},
|
|
25
|
+
}, Ft = /* @__PURE__ */ Re({
|
|
26
26
|
name: "LSUpload",
|
|
27
27
|
inheritAttrs: !1,
|
|
28
28
|
__name: "Index",
|
|
29
|
-
props:
|
|
29
|
+
props: Be,
|
|
30
30
|
emits: ["uploadErrorFunc", "onChangeFunc", "httpResponseFunc"],
|
|
31
|
-
setup(q, { expose: O, emit:
|
|
32
|
-
const M =
|
|
31
|
+
setup(q, { expose: O, emit: se }) {
|
|
32
|
+
const M = _e(), y = ze(), re = He("upload").b(), f = ne(), d = ne(!1), b = le({
|
|
33
33
|
isCover: !0,
|
|
34
34
|
accept: "",
|
|
35
35
|
disabled: !1
|
|
36
|
-
}),
|
|
36
|
+
}), o = le({
|
|
37
37
|
uploadFileList: [],
|
|
38
38
|
initUploadStatus: !0,
|
|
39
39
|
showPreview: !1,
|
|
40
40
|
sourcePreview: "",
|
|
41
|
-
iconColor:
|
|
42
|
-
}), i = q, R =
|
|
43
|
-
|
|
41
|
+
iconColor: je("colorText1")
|
|
42
|
+
}), i = q, R = se;
|
|
43
|
+
J(
|
|
44
44
|
() => y["file-list"],
|
|
45
45
|
(e) => {
|
|
46
|
-
|
|
46
|
+
o.uploadFileList = e || [];
|
|
47
47
|
},
|
|
48
48
|
{
|
|
49
49
|
immediate: !0,
|
|
50
50
|
deep: !0
|
|
51
51
|
}
|
|
52
52
|
);
|
|
53
|
-
const
|
|
53
|
+
const L = s(() => {
|
|
54
54
|
var e, t;
|
|
55
|
-
return ((
|
|
55
|
+
return !!((e = i == null ? void 0 : i.item) != null && e.isToast || typeof ((t = i == null ? void 0 : i.item) == null ? void 0 : t.isToast) > "u");
|
|
56
56
|
}), v = s(() => {
|
|
57
57
|
var t;
|
|
58
58
|
const e = (t = i == null ? void 0 : i.item) == null ? void 0 : t.isCover;
|
|
59
59
|
return typeof e > "u" ? !0 : e;
|
|
60
|
-
}),
|
|
60
|
+
}), w = s(() => y.multiple), h = s(() => {
|
|
61
61
|
const e = y["auto-upload"];
|
|
62
62
|
return typeof e > "u" ? !0 : e;
|
|
63
63
|
}), ue = s(() => {
|
|
64
64
|
var e;
|
|
65
65
|
return ((e = i == null ? void 0 : i.item) == null ? void 0 : e.emptyFileMsg) || "";
|
|
66
|
-
}), j = s(() => y["list-type"]),
|
|
66
|
+
}), j = s(() => y["list-type"]), P = s(() => j.value === De.picCard), ce = s(() => !j.value || j.value == "text"), U = s(() => {
|
|
67
67
|
var e;
|
|
68
68
|
return ((e = i == null ? void 0 : i.item) == null ? void 0 : e.limitFile) || [];
|
|
69
69
|
}), de = s(() => {
|
|
@@ -75,90 +75,96 @@ const Ke = { class: "ls-drag" }, We = { class: "drag-txt ls-color-brand6" }, Xe
|
|
|
75
75
|
}), fe = s(() => {
|
|
76
76
|
var e;
|
|
77
77
|
return ((e = i == null ? void 0 : i.item) == null ? void 0 : e.limitSizeMsg) || "";
|
|
78
|
-
}),
|
|
78
|
+
}), H = s(() => {
|
|
79
79
|
var e;
|
|
80
80
|
return ((e = i == null ? void 0 : i.item) == null ? void 0 : e.limitUnit) || "MB";
|
|
81
81
|
}), me = s(() => {
|
|
82
82
|
var e;
|
|
83
83
|
return ((e = i == null ? void 0 : i.item) == null ? void 0 : e.limitNumMsg) || "";
|
|
84
|
-
}),
|
|
84
|
+
}), ve = s(() => {
|
|
85
|
+
var e;
|
|
86
|
+
return (e = i == null ? void 0 : i.item) == null ? void 0 : e.limitAllFail;
|
|
87
|
+
}), Z = s(() => {
|
|
85
88
|
var e;
|
|
86
89
|
return ((e = i == null ? void 0 : i.item) == null ? void 0 : e.profile) || !1;
|
|
87
|
-
}), E = s(() => y.drag),
|
|
90
|
+
}), E = s(() => y.drag), ge = s(() => {
|
|
88
91
|
var e;
|
|
89
|
-
return ((e = i == null ? void 0 : i.item) == null ? void 0 : e.hideCoverBtn) && v.value &&
|
|
90
|
-
}), C = s(() => y.disabled),
|
|
91
|
-
const e =
|
|
92
|
+
return ((e = i == null ? void 0 : i.item) == null ? void 0 : e.hideCoverBtn) && v.value && o.uploadFileList.length > 0;
|
|
93
|
+
}), C = s(() => y.disabled), G = s(() => {
|
|
94
|
+
const e = P.value ? "图片" : "文件";
|
|
92
95
|
let t = `选择${e}`;
|
|
93
|
-
return d.value ? t = "正在上传..." : v.value && !
|
|
94
|
-
}), ge = s(() => {
|
|
95
|
-
let e = "不限制上传格式,";
|
|
96
|
-
return L.value && (e = "文件须为图片格式,"), `${e}文件大小不超过${A.value}${G.value}`;
|
|
96
|
+
return d.value ? t = "正在上传..." : v.value && !w.value ? h.value ? o.initUploadStatus ? t = "点击上传" : t = "重新上传" : o.initUploadStatus ? t = `选择${e}` : t = "重新上传" : h.value && (t = "点击上传"), t;
|
|
97
97
|
}), pe = s(() => {
|
|
98
|
+
let e = "不限制上传格式,";
|
|
99
|
+
return P.value && (e = "文件须为图片格式,"), `${e}文件大小不超过${A.value}${H.value}`;
|
|
100
|
+
}), Fe = s(() => {
|
|
98
101
|
var e;
|
|
99
102
|
return ((e = i == null ? void 0 : i.item) == null ? void 0 : e.tipContent) || "";
|
|
100
103
|
}), K = s(() => {
|
|
101
104
|
var e;
|
|
102
105
|
return (e = i == null ? void 0 : i.item) == null ? void 0 : e.httpRequestFunc;
|
|
103
106
|
});
|
|
104
|
-
|
|
107
|
+
J(
|
|
105
108
|
[v, K],
|
|
106
109
|
([e, t]) => {
|
|
107
|
-
b.isCover = e, t && t instanceof Function && (b["http-request"] =
|
|
110
|
+
b.isCover = e, t && t instanceof Function && (b["http-request"] = Le);
|
|
108
111
|
},
|
|
109
112
|
{
|
|
110
113
|
immediate: !0,
|
|
111
114
|
deep: !0
|
|
112
115
|
}
|
|
113
|
-
),
|
|
116
|
+
), J(
|
|
114
117
|
() => U.value,
|
|
115
118
|
(e) => {
|
|
116
|
-
e && e.length > 0 &&
|
|
119
|
+
e && e.length > 0 && ye(e);
|
|
117
120
|
},
|
|
118
121
|
{
|
|
119
122
|
immediate: !0,
|
|
120
123
|
deep: !0
|
|
121
124
|
}
|
|
122
125
|
);
|
|
123
|
-
function
|
|
126
|
+
function ye(e) {
|
|
124
127
|
b.accept = "", e.forEach((t) => {
|
|
125
|
-
const
|
|
126
|
-
|
|
128
|
+
const l = Ie[t] || "";
|
|
129
|
+
l && (b.accept && (b.accept += ","), b.accept += l);
|
|
127
130
|
});
|
|
128
131
|
}
|
|
129
|
-
|
|
132
|
+
u(ye, "updateFileAccept");
|
|
130
133
|
function T(e) {
|
|
131
|
-
const { formRuleFunc: t, formValidateFunc:
|
|
132
|
-
if (t && t.value instanceof Function &&
|
|
133
|
-
const a = t.value(), { message:
|
|
134
|
-
a.message = e,
|
|
134
|
+
const { formRuleFunc: t, formValidateFunc: l } = oe(i == null ? void 0 : i.item);
|
|
135
|
+
if (t && t.value instanceof Function && l && l.value instanceof Function) {
|
|
136
|
+
const a = t.value(), { message: r } = a;
|
|
137
|
+
a.message = e, l.value(), a.message = r;
|
|
135
138
|
}
|
|
136
139
|
R("uploadErrorFunc", e);
|
|
137
140
|
}
|
|
138
|
-
|
|
139
|
-
function
|
|
141
|
+
u(T, "validateForm");
|
|
142
|
+
async function be(e, t) {
|
|
140
143
|
if (d.value = !1, i.onExceed)
|
|
141
144
|
return i.onExceed(e, t);
|
|
142
|
-
const
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
}
|
|
145
|
+
const l = Number(y.limit || 0);
|
|
146
|
+
let a = 0;
|
|
147
|
+
ve.value || (a = l - o.uploadFileList.length, a > 0 && (Pe(e.slice(0, a)), h.value && X()));
|
|
148
|
+
const r = me.value || `当前限制选择 ${l} 个文件,本次选择了 ${e.length} 个文件,已成功上传 ${a} 个文件`;
|
|
149
|
+
L.value ? setTimeout(() => {
|
|
150
|
+
x.warning(r);
|
|
151
|
+
}, 200) : T(r);
|
|
146
152
|
}
|
|
147
|
-
|
|
148
|
-
function
|
|
153
|
+
u(be, "onExceedAction");
|
|
154
|
+
function he(e) {
|
|
149
155
|
if (i.beforeUpload) {
|
|
150
|
-
const
|
|
151
|
-
return
|
|
156
|
+
const l = i.beforeUpload(e);
|
|
157
|
+
return l && v.value && !w.value && _(), l;
|
|
152
158
|
}
|
|
153
159
|
const t = W(e, !0);
|
|
154
|
-
return t &&
|
|
160
|
+
return t && h.value && v.value && !w.value && _(), t;
|
|
155
161
|
}
|
|
156
|
-
|
|
162
|
+
u(he, "beforeUploadAction");
|
|
157
163
|
function W(e, t) {
|
|
158
|
-
let
|
|
159
|
-
const { size: a, name:
|
|
164
|
+
let l = !0;
|
|
165
|
+
const { size: a, name: r } = e, Y = U.value.length > 0 && !ee(r);
|
|
160
166
|
let z = !1;
|
|
161
|
-
switch (
|
|
167
|
+
switch (H.value) {
|
|
162
168
|
case "KB":
|
|
163
169
|
z = a / 1024 > A.value;
|
|
164
170
|
break;
|
|
@@ -169,214 +175,221 @@ const Ke = { class: "ls-drag" }, We = { class: "drag-txt ls-color-brand6" }, Xe
|
|
|
169
175
|
z = a / 1024 / 1024 / 1024 > A.value;
|
|
170
176
|
break;
|
|
171
177
|
}
|
|
172
|
-
if (
|
|
173
|
-
const g = de.value || `上传文件 ${e.name} 只能是 ${U.value.filter((
|
|
174
|
-
|
|
178
|
+
if (Y) {
|
|
179
|
+
const g = de.value || `上传文件 ${e.name} 只能是 ${U.value.filter((xe) => xe).join(",").toLocaleLowerCase()} 格式!`;
|
|
180
|
+
L.value && t ? setTimeout(() => {
|
|
175
181
|
x.error(g);
|
|
176
|
-
}, 200) : T(g),
|
|
182
|
+
}, 200) : T(g), l = !1;
|
|
177
183
|
}
|
|
178
184
|
if (z) {
|
|
179
|
-
const g = fe.value || `上传文件 ${e.name} 大小不能超过 ${A.value}${
|
|
180
|
-
|
|
185
|
+
const g = fe.value || `上传文件 ${e.name} 大小不能超过 ${A.value}${H.value}!`;
|
|
186
|
+
L.value && t ? setTimeout(() => {
|
|
181
187
|
x.error(g);
|
|
182
|
-
}, 200) : T(g),
|
|
188
|
+
}, 200) : T(g), l = !1;
|
|
183
189
|
}
|
|
184
|
-
if (
|
|
190
|
+
if (P.value && !ee(r, Oe)) {
|
|
185
191
|
const g = `上传文件 ${e.name} 不是图片格式的文件!`;
|
|
186
|
-
|
|
192
|
+
L.value && t ? setTimeout(() => {
|
|
187
193
|
x.error(g);
|
|
188
|
-
}, 200) : T(g),
|
|
194
|
+
}, 200) : T(g), l = !1;
|
|
189
195
|
}
|
|
190
|
-
return
|
|
196
|
+
return l;
|
|
191
197
|
}
|
|
192
|
-
|
|
193
|
-
function
|
|
194
|
-
let
|
|
195
|
-
if (U.value.length > 0 ?
|
|
198
|
+
u(W, "validateUploadFile");
|
|
199
|
+
function ee(e, t) {
|
|
200
|
+
let l = [];
|
|
201
|
+
if (U.value.length > 0 ? l = U.value : t && (l = t), l.length <= 0)
|
|
196
202
|
return !0;
|
|
197
|
-
for (let a = 0; a <
|
|
198
|
-
const
|
|
199
|
-
if (e.toLowerCase().endsWith(
|
|
203
|
+
for (let a = 0; a < l.length; a++) {
|
|
204
|
+
const r = (l[a] || "").toLowerCase();
|
|
205
|
+
if (e.toLowerCase().endsWith(r))
|
|
200
206
|
return !0;
|
|
201
207
|
}
|
|
202
208
|
return !1;
|
|
203
209
|
}
|
|
204
|
-
|
|
210
|
+
u(ee, "fileTypeMatch");
|
|
205
211
|
function _(e, t) {
|
|
206
|
-
|
|
212
|
+
o.uploadFileList.splice(e || 0, t || o.uploadFileList.length - 1);
|
|
207
213
|
}
|
|
208
|
-
|
|
209
|
-
function
|
|
210
|
-
|
|
211
|
-
const
|
|
212
|
-
if (
|
|
214
|
+
u(_, "updateCoverFileList");
|
|
215
|
+
function ke(e, t) {
|
|
216
|
+
o.uploadFileList = t;
|
|
217
|
+
const l = e.raw && W(e.raw, !h.value);
|
|
218
|
+
if (l && v.value && !w.value && _(), i.onChange)
|
|
213
219
|
return i.onChange(e, t);
|
|
214
220
|
const { size: a = 0 } = e;
|
|
215
221
|
if (a <= 0) {
|
|
216
|
-
|
|
217
|
-
const
|
|
218
|
-
|
|
222
|
+
te();
|
|
223
|
+
const r = ue.value || "禁止上传空文件,请检查后重新上传!";
|
|
224
|
+
L.value ? x.error(r) : T(r);
|
|
219
225
|
return;
|
|
220
226
|
}
|
|
221
|
-
e.raw && (!
|
|
227
|
+
e.raw && (!h.value && !l ? te() : (e.blob = URL.createObjectURL(e.raw) || "", R("onChangeFunc", e)));
|
|
222
228
|
}
|
|
223
|
-
|
|
224
|
-
function
|
|
229
|
+
u(ke, "onChangeAction");
|
|
230
|
+
function te() {
|
|
225
231
|
let e = 0;
|
|
226
|
-
|
|
232
|
+
o.uploadFileList.length > 1 && (e = o.uploadFileList.length - 1), _(e, 1), R("onChangeFunc", {});
|
|
227
233
|
}
|
|
228
|
-
|
|
229
|
-
function
|
|
230
|
-
d.value = !1,
|
|
231
|
-
const { formRuleFunc: a, formValidateFunc:
|
|
232
|
-
if (a && a.value instanceof Function &&
|
|
233
|
-
return i.onSuccess(e, t,
|
|
234
|
+
u(te, "setChangeRes");
|
|
235
|
+
function we(e, t, l) {
|
|
236
|
+
d.value = !1, o.initUploadStatus = !1;
|
|
237
|
+
const { formRuleFunc: a, formValidateFunc: r } = oe(i == null ? void 0 : i.item);
|
|
238
|
+
if (a && a.value instanceof Function && r && r.value instanceof Function && r.value(), i.onSuccess)
|
|
239
|
+
return i.onSuccess(e, t, l);
|
|
234
240
|
}
|
|
235
|
-
|
|
236
|
-
function
|
|
241
|
+
u(we, "onSuccessAction");
|
|
242
|
+
function Ce(e, t, l) {
|
|
237
243
|
if (d.value = !1, i.onError)
|
|
238
|
-
return i.onError(e, t,
|
|
244
|
+
return i.onError(e, t, l);
|
|
239
245
|
}
|
|
240
|
-
|
|
241
|
-
function
|
|
242
|
-
if (
|
|
246
|
+
u(Ce, "onErrorAction");
|
|
247
|
+
function Se(e, t) {
|
|
248
|
+
if (o.initUploadStatus = !t.length, o.uploadFileList = o.uploadFileList.filter((l) => l.uid === e.uid || l.name === e.name ? null : l), i.onRemove)
|
|
243
249
|
return i.onRemove(e, t);
|
|
244
250
|
}
|
|
245
|
-
|
|
246
|
-
async function
|
|
251
|
+
u(Se, "onRemoveAction");
|
|
252
|
+
async function Le(e) {
|
|
247
253
|
const { file: t } = e;
|
|
248
254
|
if (!t)
|
|
249
255
|
return;
|
|
250
|
-
const { size:
|
|
251
|
-
if (
|
|
256
|
+
const { size: l } = t;
|
|
257
|
+
if (l <= 0 || !W(t, !1))
|
|
252
258
|
return;
|
|
253
259
|
if (i.httpRequest)
|
|
254
260
|
return i.httpRequest(e);
|
|
255
261
|
const a = new FormData();
|
|
256
262
|
if (a.append("file", t), K.value instanceof Function) {
|
|
257
263
|
d.value = !0;
|
|
258
|
-
let
|
|
264
|
+
let r = {};
|
|
259
265
|
try {
|
|
260
|
-
|
|
261
|
-
} catch (
|
|
262
|
-
|
|
266
|
+
r = await K.value(a);
|
|
267
|
+
} catch (Y) {
|
|
268
|
+
r = Y;
|
|
263
269
|
} finally {
|
|
264
|
-
d.value = !1, R("httpResponseFunc",
|
|
270
|
+
d.value = !1, R("httpResponseFunc", r);
|
|
265
271
|
}
|
|
266
272
|
}
|
|
267
273
|
}
|
|
268
|
-
|
|
269
|
-
function
|
|
274
|
+
u(Le, "httpRequestAction");
|
|
275
|
+
function ie() {
|
|
270
276
|
let e = !1;
|
|
271
|
-
for (let t = 0; t <
|
|
272
|
-
if (
|
|
277
|
+
for (let t = 0; t < o.uploadFileList.length; t++)
|
|
278
|
+
if (o.uploadFileList[t].status === qe.ready) {
|
|
273
279
|
e = !0;
|
|
274
280
|
break;
|
|
275
281
|
}
|
|
276
282
|
return e;
|
|
277
283
|
}
|
|
278
|
-
|
|
279
|
-
function
|
|
284
|
+
u(ie, "hasReadyFile");
|
|
285
|
+
function X() {
|
|
280
286
|
var e;
|
|
281
287
|
(e = f == null ? void 0 : f.value) == null || e.submit();
|
|
282
288
|
}
|
|
283
|
-
|
|
284
|
-
function
|
|
289
|
+
u(X, "comfirmUpload");
|
|
290
|
+
function Pe(e) {
|
|
291
|
+
(e || []).forEach((t) => {
|
|
292
|
+
var l;
|
|
293
|
+
(l = f == null ? void 0 : f.value) == null || l.handleStart(t);
|
|
294
|
+
});
|
|
295
|
+
}
|
|
296
|
+
u(Pe, "comHandleStart");
|
|
297
|
+
function Ue(e) {
|
|
285
298
|
f == null || f.value.handleRemove(e);
|
|
286
299
|
}
|
|
287
|
-
|
|
288
|
-
function
|
|
289
|
-
|
|
300
|
+
u(Ue, "removeFile");
|
|
301
|
+
function Ae() {
|
|
302
|
+
o.uploadFileList.forEach((e) => {
|
|
290
303
|
var t;
|
|
291
304
|
if (e)
|
|
292
305
|
try {
|
|
293
|
-
(t = f == null ? void 0 : f.value) == null || t.abort(e),
|
|
306
|
+
(t = f == null ? void 0 : f.value) == null || t.abort(e), Ue(e);
|
|
294
307
|
} catch {
|
|
295
308
|
}
|
|
296
309
|
});
|
|
297
310
|
}
|
|
298
|
-
|
|
299
|
-
function
|
|
311
|
+
u(Ae, "cancelUpload");
|
|
312
|
+
function Ee(e, t, l) {
|
|
300
313
|
if (d.value = !0, i.onProgress)
|
|
301
|
-
return i.onProgress(e, t,
|
|
314
|
+
return i.onProgress(e, t, l);
|
|
302
315
|
}
|
|
303
|
-
|
|
304
|
-
function
|
|
316
|
+
u(Ee, "onProgressAction");
|
|
317
|
+
function Te(e) {
|
|
305
318
|
if (i.onPreview)
|
|
306
319
|
return i.onPreview(e);
|
|
307
|
-
if (
|
|
320
|
+
if (P.value) {
|
|
308
321
|
const { url: t } = e;
|
|
309
|
-
|
|
322
|
+
o.sourcePreview = t, o.showPreview = !0;
|
|
310
323
|
}
|
|
311
324
|
}
|
|
312
|
-
|
|
313
|
-
function
|
|
314
|
-
|
|
325
|
+
u(Te, "onPreviewAction");
|
|
326
|
+
function $e() {
|
|
327
|
+
o.showPreview = !1, o.sourcePreview = "";
|
|
315
328
|
}
|
|
316
|
-
return
|
|
329
|
+
return u($e, "closePreview"), O({
|
|
317
330
|
uploadRef: f
|
|
318
331
|
}), (e, t) => {
|
|
319
|
-
const
|
|
332
|
+
const l = Ke, a = We;
|
|
320
333
|
return c(), m("div", {
|
|
321
|
-
class:
|
|
334
|
+
class: N([n(re), n(E) ? "ls-upload-drag" : "", n(Z) ? "ls-profile" : "", n(ge) ? "hide-cover-btn" : ""])
|
|
322
335
|
}, [
|
|
323
|
-
|
|
336
|
+
Q(a, Ne({
|
|
324
337
|
ref_key: "uploadRef",
|
|
325
338
|
ref: f
|
|
326
339
|
}, Object.assign(n(b), e.$attrs), {
|
|
327
|
-
"on-exceed":
|
|
328
|
-
"before-upload":
|
|
329
|
-
"on-change":
|
|
330
|
-
"on-success":
|
|
331
|
-
"on-error":
|
|
332
|
-
"on-remove":
|
|
333
|
-
"on-progress":
|
|
334
|
-
"on-preview":
|
|
335
|
-
}),
|
|
340
|
+
"on-exceed": be,
|
|
341
|
+
"before-upload": he,
|
|
342
|
+
"on-change": ke,
|
|
343
|
+
"on-success": we,
|
|
344
|
+
"on-error": Ce,
|
|
345
|
+
"on-remove": Se,
|
|
346
|
+
"on-progress": Ee,
|
|
347
|
+
"on-preview": Te
|
|
348
|
+
}), Ve({
|
|
336
349
|
trigger: p(() => [
|
|
337
|
-
n(
|
|
350
|
+
n(Z) ? e.item.defProfile && n(o).uploadFileList.length < 1 ? (c(), F(l, {
|
|
338
351
|
key: 1,
|
|
339
352
|
size: 60,
|
|
340
353
|
src: e.item.defProfile,
|
|
341
354
|
fit: "contain"
|
|
342
|
-
}, null, 8, ["src"])) :
|
|
343
|
-
n(M).trigger ?
|
|
344
|
-
n(E) ? (c(), m(
|
|
345
|
-
n(d) ? (c(), F(
|
|
355
|
+
}, null, 8, ["src"])) : D("", !0) : (c(), m(k, { key: 0 }, [
|
|
356
|
+
n(M).trigger ? I(e.$slots, "trigger", { key: 1 }, void 0, !0) : (c(), m(k, { key: 0 }, [
|
|
357
|
+
n(E) ? (c(), m(k, { key: 0 }, [
|
|
358
|
+
n(d) ? (c(), F(S, {
|
|
346
359
|
key: 0,
|
|
347
360
|
text: "",
|
|
348
361
|
loading: n(d),
|
|
349
362
|
disabled: n(C)
|
|
350
|
-
}, null, 8, ["loading", "disabled"])) : (c(), F(
|
|
363
|
+
}, null, 8, ["loading", "disabled"])) : (c(), F(ae, {
|
|
351
364
|
key: 1,
|
|
352
365
|
class: "upload-icon",
|
|
353
366
|
name: "UploadFilled",
|
|
354
367
|
size: "56",
|
|
355
368
|
color: "#E7E7E7"
|
|
356
369
|
})),
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
n(d) ?
|
|
370
|
+
V("div", Xe, [
|
|
371
|
+
V("div", Ye, B(n(G)), 1),
|
|
372
|
+
n(d) ? D("", !0) : (c(), m(k, { key: 0 }, [
|
|
360
373
|
t[1] || (t[1] = $(" / ")),
|
|
361
|
-
t[2] || (t[2] =
|
|
374
|
+
t[2] || (t[2] = V("div", { class: "drag-txt ls-color-text2" }, "拖拽到此区域", -1))
|
|
362
375
|
], 64))
|
|
363
376
|
])
|
|
364
|
-
], 64)) : (c(), m(
|
|
365
|
-
n(
|
|
366
|
-
n(d) ? (c(), F(
|
|
377
|
+
], 64)) : (c(), m(k, { key: 1 }, [
|
|
378
|
+
n(P) ? (c(), m("div", Je, [
|
|
379
|
+
n(d) ? (c(), F(S, {
|
|
367
380
|
key: 0,
|
|
368
381
|
text: "",
|
|
369
382
|
loading: n(d),
|
|
370
383
|
disabled: n(C)
|
|
371
|
-
}, null, 8, ["loading", "disabled"])) : (c(), F(
|
|
384
|
+
}, null, 8, ["loading", "disabled"])) : (c(), F(ae, {
|
|
372
385
|
key: 1,
|
|
373
386
|
class: "upload-btn-plus",
|
|
374
387
|
name: "Plus",
|
|
375
388
|
size: 28,
|
|
376
|
-
color: n(
|
|
389
|
+
color: n(o).iconColor
|
|
377
390
|
}, null, 8, ["color"])),
|
|
378
|
-
|
|
379
|
-
])) : (c(), F(
|
|
391
|
+
V("div", null, B(n(G)), 1)
|
|
392
|
+
])) : (c(), F(S, {
|
|
380
393
|
key: 1,
|
|
381
394
|
plain: "",
|
|
382
395
|
icon: "upload",
|
|
@@ -384,7 +397,7 @@ const Ke = { class: "ls-drag" }, We = { class: "drag-txt ls-color-brand6" }, Xe
|
|
|
384
397
|
disabled: n(C)
|
|
385
398
|
}, {
|
|
386
399
|
default: p(() => [
|
|
387
|
-
$(
|
|
400
|
+
$(B(n(G)), 1)
|
|
388
401
|
]),
|
|
389
402
|
_: 1
|
|
390
403
|
}, 8, ["loading", "disabled"]))
|
|
@@ -393,76 +406,76 @@ const Ke = { class: "ls-drag" }, We = { class: "drag-txt ls-color-brand6" }, Xe
|
|
|
393
406
|
], 64))
|
|
394
407
|
]),
|
|
395
408
|
default: p(() => [
|
|
396
|
-
n(M).default ?
|
|
397
|
-
!n(
|
|
409
|
+
n(M).default ? I(e.$slots, "default", { key: 1 }, void 0, !0) : (c(), m(k, { key: 0 }, [
|
|
410
|
+
!n(h) && (n(ce) || n(E)) ? (c(), m("div", {
|
|
398
411
|
key: 0,
|
|
399
|
-
class:
|
|
412
|
+
class: N(["upload-btn-handle", [n(E) ? "drag-css" : "nor-css", !n(v) || n(w) ? "multi-css" : ""]])
|
|
400
413
|
}, [
|
|
401
|
-
n(E) ? (c(), m(
|
|
402
|
-
!n(v) || n(
|
|
414
|
+
n(E) ? (c(), m(k, { key: 1 }, [
|
|
415
|
+
!n(v) || n(w) ? (c(), F(S, {
|
|
403
416
|
key: 0,
|
|
404
417
|
type: "primary",
|
|
405
418
|
loading: n(d),
|
|
406
419
|
disabled: n(C),
|
|
407
|
-
onClick:
|
|
420
|
+
onClick: Ae,
|
|
408
421
|
class: "ls-upload-btn-com ls-upload-btn-cancel"
|
|
409
422
|
}, {
|
|
410
423
|
default: p(() => t[4] || (t[4] = [
|
|
411
424
|
$("取消上传")
|
|
412
425
|
])),
|
|
413
426
|
_: 1
|
|
414
|
-
}, 8, ["loading", "disabled"])) :
|
|
415
|
-
|
|
416
|
-
class:
|
|
427
|
+
}, 8, ["loading", "disabled"])) : D("", !0),
|
|
428
|
+
Q(S, {
|
|
429
|
+
class: N(["start-upload ls-upload-btn-com ls-upload-btn-comfirm", { "is-ready": ie() }]),
|
|
417
430
|
type: "primary",
|
|
418
431
|
loading: n(d),
|
|
419
432
|
disabled: n(C),
|
|
420
|
-
onClick:
|
|
433
|
+
onClick: X
|
|
421
434
|
}, {
|
|
422
435
|
default: p(() => t[5] || (t[5] = [
|
|
423
436
|
$("开始上传")
|
|
424
437
|
])),
|
|
425
438
|
_: 1
|
|
426
439
|
}, 8, ["class", "loading", "disabled"])
|
|
427
|
-
], 64)) : (c(), F(
|
|
440
|
+
], 64)) : (c(), F(S, {
|
|
428
441
|
key: 0,
|
|
429
442
|
type: "primary",
|
|
430
|
-
class:
|
|
443
|
+
class: N(["ls-upload-btn-com ls-upload-btn-comfirm", { "is-ready": ie() }]),
|
|
431
444
|
loading: n(d),
|
|
432
445
|
disabled: n(C),
|
|
433
|
-
onClick:
|
|
446
|
+
onClick: X
|
|
434
447
|
}, {
|
|
435
448
|
default: p(() => t[3] || (t[3] = [
|
|
436
449
|
$("开始上传 ")
|
|
437
450
|
])),
|
|
438
451
|
_: 1
|
|
439
452
|
}, 8, ["class", "loading", "disabled"]))
|
|
440
|
-
], 2)) :
|
|
453
|
+
], 2)) : D("", !0)
|
|
441
454
|
], 64))
|
|
442
455
|
]),
|
|
443
456
|
tip: p(() => [
|
|
444
|
-
n(M).tip ?
|
|
457
|
+
n(M).tip ? I(e.$slots, "tip", { key: 1 }, void 0, !0) : (c(), m("div", Qe, B(n(Fe) || n(pe)), 1))
|
|
445
458
|
]),
|
|
446
459
|
_: 2
|
|
447
460
|
}, [
|
|
448
461
|
n(M).file ? {
|
|
449
462
|
name: "file",
|
|
450
463
|
fn: p(() => [
|
|
451
|
-
|
|
464
|
+
I(e.$slots, "file", {}, void 0, !0)
|
|
452
465
|
]),
|
|
453
466
|
key: "0"
|
|
454
467
|
} : void 0
|
|
455
468
|
]), 1040),
|
|
456
|
-
|
|
457
|
-
modelValue: n(
|
|
458
|
-
"onUpdate:modelValue": t[0] || (t[0] = (
|
|
459
|
-
source: n(
|
|
460
|
-
"on-close":
|
|
469
|
+
Q(n(Ge), {
|
|
470
|
+
modelValue: n(o).showPreview,
|
|
471
|
+
"onUpdate:modelValue": t[0] || (t[0] = (r) => n(o).showPreview = r),
|
|
472
|
+
source: n(o).sourcePreview,
|
|
473
|
+
"on-close": $e
|
|
461
474
|
}, null, 8, ["modelValue", "source"])
|
|
462
475
|
], 2);
|
|
463
476
|
};
|
|
464
477
|
}
|
|
465
478
|
});
|
|
466
479
|
export {
|
|
467
|
-
|
|
480
|
+
Ft as default
|
|
468
481
|
};
|