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