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