@lingshugroup/web-plus 1.0.18 → 1.0.20
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 +3 -1
- 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/dialog/Index.vue/index.cjs +1 -1
- package/lib/packages/ls-components/components/dialog/Index.vue/index.js +2 -2
- package/lib/packages/ls-components/components/dialog/Index.vue/index2.cjs +1 -1
- package/lib/packages/ls-components/components/dialog/Index.vue/index2.js +44 -39
- package/lib/packages/ls-components/components/dialog/Index.vue/index2.js.br +0 -0
- package/lib/packages/ls-components/components/dialog/Index.vue/index2.js.gz +0 -0
- package/lib/packages/ls-components/components/dialog/types/index.cjs +1 -1
- package/lib/packages/ls-components/components/dialog/types/index.js +10 -6
- package/lib/packages/ls-components/components/form/Form.vue/index.cjs +1 -1
- package/lib/packages/ls-components/components/form/Form.vue/index.js +2 -2
- package/lib/packages/ls-components/components/form/Form.vue/index2.cjs +1 -1
- package/lib/packages/ls-components/components/form/Form.vue/index2.js +109 -103
- package/lib/packages/ls-components/components/form/Form.vue/index2.js.br +0 -0
- package/lib/packages/ls-components/components/form/Form.vue/index2.js.gz +0 -0
- package/lib/packages/ls-components/components/form/types/index.cjs +1 -1
- package/lib/packages/ls-components/components/form/types/index.js +6 -0
- package/lib/packages/ls-components/components/form/types/index.js.br +0 -0
- package/lib/packages/ls-components/components/form/types/index.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 +152 -150
- 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,35 +1,34 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
1
|
+
var Te = Object.defineProperty;
|
|
2
|
+
var r = (F, W) => Te(F, "name", { value: W, 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
|
|
7
|
+
import { defineComponent as $e, useSlots as Me, useAttrs as Re, ref as ne, reactive as le, watch as J, computed as s, resolveComponent as ze, openBlock as c, createElementBlock as p, normalizeClass as D, unref as o, createVNode as Q, mergeProps as Be, createSlots as Ie, withCtx as w, Fragment as S, createBlock as y, createElementVNode as j, toDisplayString as N, createTextVNode as R, createCommentVNode as q, renderSlot as O, toRefs as ae, pushScopeId as Ve, popScopeId as De } from "vue";
|
|
8
|
+
import { lsUploadProps as Ne, UPLOAD_TYPE_MAP as qe, fileTypeMap as Oe, UPLOAD_STATUS_MAP as je, IMG_SUFFIX_LIST as We } from "../types/index.js";
|
|
9
|
+
import { getVariable as Ge } from "../../_utils/config/index.js";
|
|
10
|
+
import { useNamespace as He } from "../../_hooks/useNamespace/index.js";
|
|
11
11
|
import x from "../../button/Button.vue/index.js";
|
|
12
12
|
import se from "../../icon/Index.vue/index.js";
|
|
13
13
|
/* empty css */
|
|
14
14
|
/* empty css */
|
|
15
|
-
import He from "../../../../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/merge/index.js";
|
|
16
15
|
import { ElMessage as z } from "../../../../../node_modules/.pnpm/element-plus@2.8.1_vue@3.4.38_typescript@5.5.4_/node_modules/element-plus/es/components/message/index/index.js";
|
|
17
16
|
import { ElAvatar as Ke } from "../../../../../node_modules/.pnpm/element-plus@2.8.1_vue@3.4.38_typescript@5.5.4_/node_modules/element-plus/es/components/avatar/index/index.js";
|
|
18
17
|
import { ElUpload as Xe } from "../../../../../node_modules/.pnpm/element-plus@2.8.1_vue@3.4.38_typescript@5.5.4_/node_modules/element-plus/es/components/upload/index/index.js";
|
|
19
|
-
const Ye = /* @__PURE__ */
|
|
18
|
+
const Ye = /* @__PURE__ */ r((F) => (Ve("data-v-7dbf6132"), F = F(), De(), F), "_withScopeId"), Je = { class: "ls-drag" }, Qe = { class: "drag-txt ls-color-brand6" }, Ze = /* @__PURE__ */ Ye(() => /* @__PURE__ */ j("div", { class: "drag-txt ls-color-text2" }, "拖拽到此区域", -1)), et = {
|
|
20
19
|
key: 0,
|
|
21
20
|
class: "btn-picture-card"
|
|
22
21
|
}, tt = {
|
|
23
22
|
key: 0,
|
|
24
23
|
class: "ls-tip"
|
|
25
|
-
},
|
|
24
|
+
}, yt = /* @__PURE__ */ $e({
|
|
26
25
|
name: "LSUpload",
|
|
27
26
|
inheritAttrs: !1,
|
|
28
27
|
__name: "Index",
|
|
29
|
-
props:
|
|
28
|
+
props: Ne,
|
|
30
29
|
emits: ["uploadErrorFunc", "onChangeFunc", "httpResponseFunc"],
|
|
31
|
-
setup(F, { expose:
|
|
32
|
-
const B =
|
|
30
|
+
setup(F, { expose: W, emit: re }) {
|
|
31
|
+
const B = Me(), b = Re(), ue = He("upload").b(), v = ne(), d = ne(!1), P = le({
|
|
33
32
|
isCover: !0,
|
|
34
33
|
accept: "",
|
|
35
34
|
disabled: !1
|
|
@@ -39,8 +38,8 @@ const Ye = /* @__PURE__ */ s((F) => (Ie("data-v-52217f7f"), F = F(), Ve(), F), "
|
|
|
39
38
|
showPreview: !1,
|
|
40
39
|
typePreview: "",
|
|
41
40
|
sourcePreview: "",
|
|
42
|
-
iconColor:
|
|
43
|
-
}),
|
|
41
|
+
iconColor: Ge("colorText1")
|
|
42
|
+
}), t = F, I = re;
|
|
44
43
|
J(
|
|
45
44
|
() => b["file-list"],
|
|
46
45
|
(e) => {
|
|
@@ -51,61 +50,64 @@ const Ye = /* @__PURE__ */ s((F) => (Ie("data-v-52217f7f"), F = F(), Ve(), F), "
|
|
|
51
50
|
deep: !0
|
|
52
51
|
}
|
|
53
52
|
);
|
|
54
|
-
const U =
|
|
55
|
-
var e,
|
|
56
|
-
return (((e =
|
|
57
|
-
}), g =
|
|
58
|
-
var
|
|
59
|
-
const e = (
|
|
53
|
+
const U = s(() => {
|
|
54
|
+
var e, i;
|
|
55
|
+
return (((e = t == null ? void 0 : t.item) == null ? void 0 : e.isToast) || typeof ((i = t == null ? void 0 : t.item) == null ? void 0 : i.isToast)) === "undefined";
|
|
56
|
+
}), g = s(() => {
|
|
57
|
+
var i;
|
|
58
|
+
const e = (i = t == null ? void 0 : t.item) == null ? void 0 : i.isCover;
|
|
60
59
|
return typeof e > "u" ? !0 : e;
|
|
61
|
-
}), C =
|
|
60
|
+
}), C = s(() => b.multiple), L = s(() => {
|
|
62
61
|
const e = b["auto-upload"];
|
|
63
62
|
return typeof e > "u" ? !0 : e;
|
|
64
|
-
}), ce =
|
|
63
|
+
}), ce = s(() => {
|
|
65
64
|
var e;
|
|
66
|
-
return ((e =
|
|
67
|
-
}), G =
|
|
65
|
+
return ((e = t == null ? void 0 : t.item) == null ? void 0 : e.emptyFileMsg) || "";
|
|
66
|
+
}), G = s(() => b["list-type"]), k = s(() => G.value === qe.picCard), de = s(() => !G.value || G.value == "text"), A = s(() => {
|
|
68
67
|
var e;
|
|
69
|
-
return ((e =
|
|
70
|
-
}), fe =
|
|
68
|
+
return ((e = t == null ? void 0 : t.item) == null ? void 0 : e.limitFile) || [];
|
|
69
|
+
}), fe = s(() => {
|
|
71
70
|
var e;
|
|
72
|
-
return ((e =
|
|
73
|
-
}), E =
|
|
71
|
+
return ((e = t == null ? void 0 : t.item) == null ? void 0 : e.limitFileMsg) || "";
|
|
72
|
+
}), E = s(() => {
|
|
74
73
|
var e;
|
|
75
|
-
return ((e =
|
|
76
|
-
}), me =
|
|
74
|
+
return ((e = t == null ? void 0 : t.item) == null ? void 0 : e.limitSize) || 2;
|
|
75
|
+
}), me = s(() => {
|
|
77
76
|
var e;
|
|
78
|
-
return ((e =
|
|
79
|
-
}), H =
|
|
77
|
+
return ((e = t == null ? void 0 : t.item) == null ? void 0 : e.limitSizeMsg) || "";
|
|
78
|
+
}), H = s(() => {
|
|
80
79
|
var e;
|
|
81
|
-
return ((e =
|
|
82
|
-
}), ve =
|
|
80
|
+
return ((e = t == null ? void 0 : t.item) == null ? void 0 : e.limitUnit) || "MB";
|
|
81
|
+
}), ve = s(() => {
|
|
83
82
|
var e;
|
|
84
|
-
return ((e =
|
|
85
|
-
}), Z =
|
|
83
|
+
return ((e = t == null ? void 0 : t.item) == null ? void 0 : e.limitNumMsg) || "";
|
|
84
|
+
}), Z = s(() => {
|
|
86
85
|
var e;
|
|
87
|
-
return ((e =
|
|
88
|
-
}), T =
|
|
86
|
+
return ((e = t == null ? void 0 : t.item) == null ? void 0 : e.profile) || !1;
|
|
87
|
+
}), T = s(() => b.drag), pe = s(() => {
|
|
89
88
|
var e;
|
|
90
|
-
return ((e =
|
|
91
|
-
}), _ =
|
|
89
|
+
return ((e = t == null ? void 0 : t.item) == null ? void 0 : e.hideCoverBtn) && g.value && l.uploadFileList.length > 0;
|
|
90
|
+
}), _ = s(() => b.disabled), K = s(() => {
|
|
92
91
|
const e = k.value ? "图片" : "文件";
|
|
93
|
-
let
|
|
94
|
-
return d.value ?
|
|
95
|
-
}), ge =
|
|
92
|
+
let i = `选择${e}`;
|
|
93
|
+
return d.value ? i = "正在上传..." : g.value && !C.value ? L.value ? l.initUploadStatus ? i = "点击上传" : i = "重新上传" : l.initUploadStatus ? i = `选择${e}` : i = "重新上传" : L.value && (i = "点击上传"), i;
|
|
94
|
+
}), ge = s(() => {
|
|
96
95
|
let e = "不限制上传格式,";
|
|
97
96
|
return k.value && (e = "文件须为图片格式,"), `${e}文件大小不超过${E.value}${H.value}`;
|
|
98
|
-
}),
|
|
97
|
+
}), he = s(() => {
|
|
99
98
|
var e;
|
|
100
|
-
return (e =
|
|
101
|
-
}),
|
|
99
|
+
return ((e = t == null ? void 0 : t.item) == null ? void 0 : e.tipContent) || "";
|
|
100
|
+
}), X = s(() => {
|
|
102
101
|
var e;
|
|
103
|
-
return (e =
|
|
102
|
+
return (e = t == null ? void 0 : t.item) == null ? void 0 : e.httpRequestFunc;
|
|
103
|
+
}), $ = s(() => {
|
|
104
|
+
var e;
|
|
105
|
+
return (e = t == null ? void 0 : t.item) == null ? void 0 : e.textPreview;
|
|
104
106
|
});
|
|
105
107
|
J(
|
|
106
108
|
[g, X],
|
|
107
|
-
([e,
|
|
108
|
-
P.isCover = e,
|
|
109
|
+
([e, i]) => {
|
|
110
|
+
P.isCover = e, i && i instanceof Function && (P["http-request"] = Le);
|
|
109
111
|
},
|
|
110
112
|
{
|
|
111
113
|
immediate: !0,
|
|
@@ -114,48 +116,48 @@ const Ye = /* @__PURE__ */ s((F) => (Ie("data-v-52217f7f"), F = F(), Ve(), F), "
|
|
|
114
116
|
), J(
|
|
115
117
|
() => A.value,
|
|
116
118
|
(e) => {
|
|
117
|
-
e && e.length > 0 &&
|
|
119
|
+
e && e.length > 0 && we(e);
|
|
118
120
|
},
|
|
119
121
|
{
|
|
120
122
|
immediate: !0,
|
|
121
123
|
deep: !0
|
|
122
124
|
}
|
|
123
125
|
);
|
|
124
|
-
function
|
|
125
|
-
P.accept = "", e.forEach((
|
|
126
|
-
const n =
|
|
126
|
+
function we(e) {
|
|
127
|
+
P.accept = "", e.forEach((i) => {
|
|
128
|
+
const n = Oe[i] || "";
|
|
127
129
|
n && (P.accept && (P.accept += ","), P.accept += n);
|
|
128
130
|
});
|
|
129
131
|
}
|
|
130
|
-
|
|
132
|
+
r(we, "updateFileAccept");
|
|
131
133
|
function M(e) {
|
|
132
|
-
const { formRuleFunc:
|
|
133
|
-
if (
|
|
134
|
-
const a =
|
|
134
|
+
const { formRuleFunc: i, formValidateFunc: n } = ae(t == null ? void 0 : t.item);
|
|
135
|
+
if (i && i.value instanceof Function && n && n.value instanceof Function) {
|
|
136
|
+
const a = i.value(), { message: u } = a;
|
|
135
137
|
a.message = e, n.value(), a.message = u;
|
|
136
138
|
}
|
|
137
139
|
I("uploadErrorFunc", e);
|
|
138
140
|
}
|
|
139
|
-
|
|
140
|
-
function
|
|
141
|
-
if (d.value = !1,
|
|
142
|
-
return
|
|
143
|
-
const n = `当前限制选择 ${b.limit} 个文件,本次选择了 ${e.length} 个文件,共选择了 ${e.length +
|
|
141
|
+
r(M, "validateForm");
|
|
142
|
+
function ye(e, i) {
|
|
143
|
+
if (d.value = !1, t.onExceed)
|
|
144
|
+
return t.onExceed(e, i);
|
|
145
|
+
const n = `当前限制选择 ${b.limit} 个文件,本次选择了 ${e.length} 个文件,共选择了 ${e.length + i.length} 个文件` || ve.value;
|
|
144
146
|
U.value ? setTimeout(() => {
|
|
145
147
|
z.warning(n);
|
|
146
148
|
}, 200) : M(n);
|
|
147
149
|
}
|
|
148
|
-
|
|
149
|
-
function
|
|
150
|
-
if (
|
|
151
|
-
const n =
|
|
150
|
+
r(ye, "onExceedAction");
|
|
151
|
+
function Fe(e) {
|
|
152
|
+
if (t.beforeUpload) {
|
|
153
|
+
const n = t.beforeUpload(e);
|
|
152
154
|
return n && g.value && !C.value && V(), n;
|
|
153
155
|
}
|
|
154
|
-
const
|
|
155
|
-
return
|
|
156
|
+
const i = Y(e, !0);
|
|
157
|
+
return i && L.value && g.value && !C.value && V(), i;
|
|
156
158
|
}
|
|
157
|
-
|
|
158
|
-
function Y(e,
|
|
159
|
+
r(Fe, "beforeUploadAction");
|
|
160
|
+
function Y(e, i) {
|
|
159
161
|
let n = !0;
|
|
160
162
|
const { size: a, name: u } = e, f = A.value.length > 0 && !ee(u);
|
|
161
163
|
let m = !1;
|
|
@@ -171,29 +173,29 @@ const Ye = /* @__PURE__ */ s((F) => (Ie("data-v-52217f7f"), F = F(), Ve(), F), "
|
|
|
171
173
|
break;
|
|
172
174
|
}
|
|
173
175
|
if (f) {
|
|
174
|
-
const h = fe.value || `上传文件 ${e.name} 只能是 ${A.value.filter((
|
|
175
|
-
U.value &&
|
|
176
|
+
const h = fe.value || `上传文件 ${e.name} 只能是 ${A.value.filter((Ee) => Ee).join(",").toLocaleLowerCase()} 格式!`;
|
|
177
|
+
U.value && i ? setTimeout(() => {
|
|
176
178
|
z.error(h);
|
|
177
179
|
}, 200) : M(h), n = !1;
|
|
178
180
|
}
|
|
179
181
|
if (m) {
|
|
180
182
|
const h = me.value || `上传文件 ${e.name} 大小不能超过 ${E.value}${H.value}!`;
|
|
181
|
-
U.value &&
|
|
183
|
+
U.value && i ? setTimeout(() => {
|
|
182
184
|
z.error(h);
|
|
183
185
|
}, 200) : M(h), n = !1;
|
|
184
186
|
}
|
|
185
187
|
if (k.value && !ee(u, We)) {
|
|
186
188
|
const h = `上传文件 ${e.name} 不是图片格式的文件!`;
|
|
187
|
-
U.value &&
|
|
189
|
+
U.value && i ? setTimeout(() => {
|
|
188
190
|
z.error(h);
|
|
189
191
|
}, 200) : M(h), n = !1;
|
|
190
192
|
}
|
|
191
193
|
return n;
|
|
192
194
|
}
|
|
193
|
-
|
|
194
|
-
function ee(e,
|
|
195
|
+
r(Y, "validateUploadFile");
|
|
196
|
+
function ee(e, i) {
|
|
195
197
|
let n = [];
|
|
196
|
-
if (A.value.length > 0 ? n = A.value :
|
|
198
|
+
if (A.value.length > 0 ? n = A.value : i && (n = i), n.length <= 0)
|
|
197
199
|
return !0;
|
|
198
200
|
for (let a = 0; a < n.length; a++) {
|
|
199
201
|
const u = (n[a] || "").toLowerCase();
|
|
@@ -202,16 +204,16 @@ const Ye = /* @__PURE__ */ s((F) => (Ie("data-v-52217f7f"), F = F(), Ve(), F), "
|
|
|
202
204
|
}
|
|
203
205
|
return !1;
|
|
204
206
|
}
|
|
205
|
-
|
|
206
|
-
function V(e,
|
|
207
|
-
l.uploadFileList.splice(e || 0,
|
|
207
|
+
r(ee, "fileTypeMatch");
|
|
208
|
+
function V(e, i) {
|
|
209
|
+
l.uploadFileList.splice(e || 0, i || l.uploadFileList.length - 1);
|
|
208
210
|
}
|
|
209
|
-
|
|
210
|
-
function
|
|
211
|
-
l.uploadFileList =
|
|
211
|
+
r(V, "updateCoverFileList");
|
|
212
|
+
function be(e, i) {
|
|
213
|
+
l.uploadFileList = i;
|
|
212
214
|
const n = e.raw && Y(e.raw, !L.value);
|
|
213
|
-
if (n && g.value && !C.value && V(),
|
|
214
|
-
return
|
|
215
|
+
if (n && g.value && !C.value && V(), t.onChange)
|
|
216
|
+
return t.onChange(e, i);
|
|
215
217
|
const { size: a } = e;
|
|
216
218
|
if (a <= 0) {
|
|
217
219
|
te();
|
|
@@ -221,51 +223,51 @@ const Ye = /* @__PURE__ */ s((F) => (Ie("data-v-52217f7f"), F = F(), Ve(), F), "
|
|
|
221
223
|
}
|
|
222
224
|
e.raw && (!L.value && !n ? te() : (e.blob = URL.createObjectURL(e.raw) || "", I("onChangeFunc", e)));
|
|
223
225
|
}
|
|
224
|
-
|
|
226
|
+
r(be, "onChangeAction");
|
|
225
227
|
function te() {
|
|
226
228
|
let e = 0;
|
|
227
229
|
l.uploadFileList.length > 1 && (e = l.uploadFileList.length - 1), V(e, 1), I("onChangeFunc", {});
|
|
228
230
|
}
|
|
229
|
-
|
|
230
|
-
function
|
|
231
|
+
r(te, "setChangeRes");
|
|
232
|
+
function Pe(e, i, n) {
|
|
231
233
|
d.value = !1, l.initUploadStatus = !1;
|
|
232
|
-
const { formRuleFunc: a, formValidateFunc: u } = ae(
|
|
233
|
-
if (a && a.value instanceof Function && u && u.value instanceof Function && u.value(),
|
|
234
|
-
return
|
|
234
|
+
const { formRuleFunc: a, formValidateFunc: u } = ae(t == null ? void 0 : t.item);
|
|
235
|
+
if (a && a.value instanceof Function && u && u.value instanceof Function && u.value(), t.onSuccess)
|
|
236
|
+
return t.onSuccess(e, i, n);
|
|
235
237
|
}
|
|
236
|
-
|
|
237
|
-
function
|
|
238
|
-
if (d.value = !1,
|
|
239
|
-
return
|
|
238
|
+
r(Pe, "onSuccessAction");
|
|
239
|
+
function ke(e, i, n) {
|
|
240
|
+
if (d.value = !1, t.onError)
|
|
241
|
+
return t.onError(e, i, n);
|
|
240
242
|
}
|
|
241
|
-
|
|
242
|
-
function
|
|
243
|
-
if (l.initUploadStatus = !
|
|
244
|
-
return
|
|
243
|
+
r(ke, "onErrorAction");
|
|
244
|
+
function Se(e, i) {
|
|
245
|
+
if (l.initUploadStatus = !i.length, l.uploadFileList = l.uploadFileList.filter((n) => n.uid === e.uid || n.name === e.name ? null : n), t.onRemove)
|
|
246
|
+
return t.onRemove(e, i);
|
|
245
247
|
}
|
|
246
|
-
|
|
247
|
-
function
|
|
248
|
-
if (
|
|
249
|
-
return
|
|
250
|
-
const { raw:
|
|
251
|
-
|
|
248
|
+
r(Se, "onRemoveAction");
|
|
249
|
+
function Ce(e) {
|
|
250
|
+
if (t.onPreview)
|
|
251
|
+
return t.onPreview(e);
|
|
252
|
+
const { raw: i, url: n, blob: a, name: u } = e, { type: f } = i || {};
|
|
253
|
+
i ? $.value && $.value.length > 0 ? f != null && f.startsWith("image") ? (l.typePreview = "image", l.sourcePreview = k.value ? [n] : [a], l.showPreview = !0) : $.value.includes("pdf") && f == "application/pdf" ? (l.typePreview = "pdf", l.sourcePreview = a, l.showPreview = !0) : $.value.includes("xlsx") && ["application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"].includes(f) ? (l.typePreview = "xlsx", fetch(a).then((m) => m.blob()).then((m) => {
|
|
252
254
|
l.sourcePreview = new File([m], u, { type: f }), l.showPreview = !0;
|
|
253
255
|
})) : $.value.includes("docx") && f == "application/vnd.openxmlformats-officedocument.wordprocessingml.document" && (l.typePreview = "docx", fetch(a).then((m) => m.blob()).then((m) => m.arrayBuffer()).then((m) => {
|
|
254
256
|
l.sourcePreview = m, l.showPreview = !0;
|
|
255
257
|
})) : k.value && f != null && f.startsWith("image") && (l.typePreview = "image", l.sourcePreview = [n], l.showPreview = !0) : k.value && (l.typePreview = "image", l.sourcePreview = [n], l.showPreview = !0);
|
|
256
258
|
}
|
|
257
|
-
|
|
258
|
-
async function
|
|
259
|
-
const { file:
|
|
260
|
-
if (!
|
|
259
|
+
r(Ce, "onPreviewAction");
|
|
260
|
+
async function Le(e) {
|
|
261
|
+
const { file: i } = e;
|
|
262
|
+
if (!i)
|
|
261
263
|
return;
|
|
262
|
-
const { size: n } =
|
|
263
|
-
if (n <= 0 || !Y(
|
|
264
|
+
const { size: n } = i;
|
|
265
|
+
if (n <= 0 || !Y(i, !1))
|
|
264
266
|
return;
|
|
265
|
-
if (
|
|
266
|
-
return
|
|
267
|
+
if (t.httpRequest)
|
|
268
|
+
return t.httpRequest(e);
|
|
267
269
|
const a = new FormData();
|
|
268
|
-
if (a.append("file",
|
|
270
|
+
if (a.append("file", i), X.value instanceof Function) {
|
|
269
271
|
d.value = !0;
|
|
270
272
|
let u = {};
|
|
271
273
|
try {
|
|
@@ -277,64 +279,64 @@ const Ye = /* @__PURE__ */ s((F) => (Ie("data-v-52217f7f"), F = F(), Ve(), F), "
|
|
|
277
279
|
}
|
|
278
280
|
}
|
|
279
281
|
}
|
|
280
|
-
|
|
282
|
+
r(Le, "httpRequestAction");
|
|
281
283
|
function ie() {
|
|
282
284
|
let e = !1;
|
|
283
|
-
for (let
|
|
284
|
-
if (l.uploadFileList[
|
|
285
|
+
for (let i = 0; i < l.uploadFileList.length; i++)
|
|
286
|
+
if (l.uploadFileList[i].status === je.ready) {
|
|
285
287
|
e = !0;
|
|
286
288
|
break;
|
|
287
289
|
}
|
|
288
290
|
return e;
|
|
289
291
|
}
|
|
290
|
-
|
|
292
|
+
r(ie, "hasReadyFile");
|
|
291
293
|
function oe() {
|
|
292
294
|
var e;
|
|
293
295
|
(e = v == null ? void 0 : v.value) == null || e.submit();
|
|
294
296
|
}
|
|
295
|
-
|
|
296
|
-
function
|
|
297
|
+
r(oe, "comfirmUpload");
|
|
298
|
+
function _e(e) {
|
|
297
299
|
v == null || v.value.handleRemove(e);
|
|
298
300
|
}
|
|
299
|
-
|
|
300
|
-
function
|
|
301
|
+
r(_e, "removeFile");
|
|
302
|
+
function xe() {
|
|
301
303
|
l.uploadFileList.forEach((e) => {
|
|
302
|
-
var
|
|
304
|
+
var i;
|
|
303
305
|
if (e)
|
|
304
306
|
try {
|
|
305
|
-
(
|
|
307
|
+
(i = v == null ? void 0 : v.value) == null || i.abort(e), _e(e);
|
|
306
308
|
} catch {
|
|
307
309
|
}
|
|
308
310
|
});
|
|
309
311
|
}
|
|
310
|
-
|
|
311
|
-
function
|
|
312
|
+
r(xe, "cancelUpload");
|
|
313
|
+
function Ue() {
|
|
312
314
|
d.value = !0;
|
|
313
315
|
}
|
|
314
|
-
|
|
315
|
-
function
|
|
316
|
+
r(Ue, "onProgressAction");
|
|
317
|
+
function Ae() {
|
|
316
318
|
l.showPreview = !1, l.sourcePreview = "";
|
|
317
319
|
}
|
|
318
|
-
return
|
|
320
|
+
return r(Ae, "closePreview"), W({
|
|
319
321
|
uploadRef: v
|
|
320
|
-
}), (e,
|
|
321
|
-
const n = Ke, a = Xe, u =
|
|
322
|
+
}), (e, i) => {
|
|
323
|
+
const n = Ke, a = Xe, u = ze("LSPreview");
|
|
322
324
|
return c(), p("div", {
|
|
323
325
|
class: D([o(ue), o(T) ? "ls-upload-drag" : "", o(Z) ? "ls-profile" : "", o(pe) ? "hide-cover-btn" : ""])
|
|
324
326
|
}, [
|
|
325
|
-
Q(a,
|
|
327
|
+
Q(a, Be({
|
|
326
328
|
ref_key: "uploadRef",
|
|
327
329
|
ref: v
|
|
328
|
-
},
|
|
329
|
-
"on-exceed":
|
|
330
|
-
"before-upload":
|
|
331
|
-
"on-change":
|
|
332
|
-
"on-success":
|
|
333
|
-
"on-error":
|
|
334
|
-
"on-remove":
|
|
335
|
-
"on-preview":
|
|
336
|
-
"on-progress":
|
|
337
|
-
}),
|
|
330
|
+
}, Object.assign(o(P), e.$attrs), {
|
|
331
|
+
"on-exceed": ye,
|
|
332
|
+
"before-upload": Fe,
|
|
333
|
+
"on-change": be,
|
|
334
|
+
"on-success": Pe,
|
|
335
|
+
"on-error": ke,
|
|
336
|
+
"on-remove": Se,
|
|
337
|
+
"on-preview": Ce,
|
|
338
|
+
"on-progress": Ue
|
|
339
|
+
}), Ie({
|
|
338
340
|
trigger: w(() => [
|
|
339
341
|
o(Z) ? e.item.defProfile && o(l).uploadFileList.length < 1 ? (c(), y(n, {
|
|
340
342
|
key: 1,
|
|
@@ -356,8 +358,8 @@ const Ye = /* @__PURE__ */ s((F) => (Ie("data-v-52217f7f"), F = F(), Ve(), F), "
|
|
|
356
358
|
size: "56",
|
|
357
359
|
color: "#E7E7E7"
|
|
358
360
|
})),
|
|
359
|
-
|
|
360
|
-
|
|
361
|
+
j("div", Je, [
|
|
362
|
+
j("div", Qe, N(o(K)), 1),
|
|
361
363
|
o(d) ? q("", !0) : (c(), p(S, { key: 0 }, [
|
|
362
364
|
R(" / "),
|
|
363
365
|
Ze
|
|
@@ -377,7 +379,7 @@ const Ye = /* @__PURE__ */ s((F) => (Ie("data-v-52217f7f"), F = F(), Ve(), F), "
|
|
|
377
379
|
size: 28,
|
|
378
380
|
color: o(l).iconColor
|
|
379
381
|
}, null, 8, ["color"])),
|
|
380
|
-
|
|
382
|
+
j("div", null, N(o(K)), 1)
|
|
381
383
|
])) : (c(), y(x, {
|
|
382
384
|
key: 1,
|
|
383
385
|
plain: "",
|
|
@@ -406,7 +408,7 @@ const Ye = /* @__PURE__ */ s((F) => (Ie("data-v-52217f7f"), F = F(), Ve(), F), "
|
|
|
406
408
|
type: "primary",
|
|
407
409
|
loading: o(d),
|
|
408
410
|
disabled: o(_),
|
|
409
|
-
onClick:
|
|
411
|
+
onClick: xe,
|
|
410
412
|
class: "ls-upload-btn-com ls-upload-btn-cancel"
|
|
411
413
|
}, {
|
|
412
414
|
default: w(() => [
|
|
@@ -443,7 +445,7 @@ const Ye = /* @__PURE__ */ s((F) => (Ie("data-v-52217f7f"), F = F(), Ve(), F), "
|
|
|
443
445
|
], 64))
|
|
444
446
|
]),
|
|
445
447
|
tip: w(() => [
|
|
446
|
-
o(B).tip ? O(e.$slots, "tip", { key: 1 }, void 0, !0) : (c(), p("div", tt, N(o(ge)), 1))
|
|
448
|
+
o(B).tip ? O(e.$slots, "tip", { key: 1 }, void 0, !0) : (c(), p("div", tt, N(o(he) || o(ge)), 1))
|
|
447
449
|
]),
|
|
448
450
|
_: 2
|
|
449
451
|
}, [
|
|
@@ -457,8 +459,8 @@ const Ye = /* @__PURE__ */ s((F) => (Ie("data-v-52217f7f"), F = F(), Ve(), F), "
|
|
|
457
459
|
]), 1040),
|
|
458
460
|
Q(u, {
|
|
459
461
|
modelValue: o(l).showPreview,
|
|
460
|
-
"onUpdate:modelValue":
|
|
461
|
-
"on-close":
|
|
462
|
+
"onUpdate:modelValue": i[0] || (i[0] = (f) => o(l).showPreview = f),
|
|
463
|
+
"on-close": Ae,
|
|
462
464
|
type: o(l).typePreview,
|
|
463
465
|
source: o(l).sourcePreview
|
|
464
466
|
}, null, 8, ["modelValue", "type", "source"])
|
|
@@ -467,5 +469,5 @@ const Ye = /* @__PURE__ */ s((F) => (Ie("data-v-52217f7f"), F = F(), Ve(), F), "
|
|
|
467
469
|
}
|
|
468
470
|
});
|
|
469
471
|
export {
|
|
470
|
-
|
|
472
|
+
yt as default
|
|
471
473
|
};
|
|
Binary file
|
|
Binary file
|