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