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