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