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