@lingshugroup/web-plus 2.4.3 → 2.4.5
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/lib/index.css +1 -1
- package/lib/index.css.br +0 -0
- package/lib/index.css.gz +0 -0
- package/lib/node_modules/.pnpm/@vueuse_core@9.13.0_vue@3.5.24_typescript@5.9.3_/node_modules/@vueuse/core/index/index.cjs +1 -1
- package/lib/node_modules/.pnpm/@vueuse_core@9.13.0_vue@3.5.24_typescript@5.9.3_/node_modules/@vueuse/core/index/index.js +13 -12
- package/lib/node_modules/.pnpm/@vueuse_core@9.13.0_vue@3.5.24_typescript@5.9.3_/node_modules/@vueuse/core/index/index.js.br +0 -0
- package/lib/node_modules/.pnpm/@vueuse_core@9.13.0_vue@3.5.24_typescript@5.9.3_/node_modules/@vueuse/core/index/index.js.gz +0 -0
- package/lib/node_modules/.pnpm/@vueuse_shared@9.13.0_vue@3.5.24_typescript@5.9.3_/node_modules/@vueuse/shared/index/index.cjs +1 -1
- package/lib/node_modules/.pnpm/@vueuse_shared@9.13.0_vue@3.5.24_typescript@5.9.3_/node_modules/@vueuse/shared/index/index.js +64 -63
- package/lib/node_modules/.pnpm/@vueuse_shared@9.13.0_vue@3.5.24_typescript@5.9.3_/node_modules/@vueuse/shared/index/index.js.br +0 -0
- package/lib/node_modules/.pnpm/@vueuse_shared@9.13.0_vue@3.5.24_typescript@5.9.3_/node_modules/@vueuse/shared/index/index.js.gz +0 -0
- package/lib/node_modules/.pnpm/element-plus@2.11.8_vue@3.5.24_typescript@5.9.3_/node_modules/element-plus/es/components/image-viewer/index/index.cjs +1 -0
- package/lib/node_modules/.pnpm/element-plus@2.11.8_vue@3.5.24_typescript@5.9.3_/node_modules/element-plus/es/components/image-viewer/index/index.js +7 -0
- package/lib/node_modules/.pnpm/element-plus@2.11.8_vue@3.5.24_typescript@5.9.3_/node_modules/element-plus/es/components/image-viewer/src/image-viewer/index.cjs +1 -0
- package/lib/node_modules/.pnpm/element-plus@2.11.8_vue@3.5.24_typescript@5.9.3_/node_modules/element-plus/es/components/image-viewer/src/image-viewer/index.js +57 -0
- package/lib/node_modules/.pnpm/element-plus@2.11.8_vue@3.5.24_typescript@5.9.3_/node_modules/element-plus/es/components/image-viewer/src/image-viewer/index.js.br +0 -0
- package/lib/node_modules/.pnpm/element-plus@2.11.8_vue@3.5.24_typescript@5.9.3_/node_modules/element-plus/es/components/image-viewer/src/image-viewer/index.js.gz +0 -0
- package/lib/node_modules/.pnpm/element-plus@2.11.8_vue@3.5.24_typescript@5.9.3_/node_modules/element-plus/es/components/image-viewer/src/image-viewer2/index.cjs +1 -0
- package/lib/node_modules/.pnpm/element-plus@2.11.8_vue@3.5.24_typescript@5.9.3_/node_modules/element-plus/es/components/image-viewer/src/image-viewer2/index.js +404 -0
- package/lib/node_modules/.pnpm/element-plus@2.11.8_vue@3.5.24_typescript@5.9.3_/node_modules/element-plus/es/components/image-viewer/src/image-viewer2/index.js.br +0 -0
- package/lib/node_modules/.pnpm/element-plus@2.11.8_vue@3.5.24_typescript@5.9.3_/node_modules/element-plus/es/components/image-viewer/src/image-viewer2/index.js.gz +0 -0
- package/lib/packages/ls-components/components/upload/Index.vue/index.cjs +1 -1
- package/lib/packages/ls-components/components/upload/Index.vue/index.js +2 -2
- package/lib/packages/ls-components/components/upload/Index.vue/index2.cjs +1 -1
- package/lib/packages/ls-components/components/upload/Index.vue/index2.js +299 -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/lib/packages/ls-components/components/upload/types/index.cjs +1 -1
- package/lib/packages/ls-components/components/upload/types/index.js +15 -7
- package/lib/packages/ls-components/components/upload/types/index.js.br +0 -0
- package/lib/packages/ls-components/components/upload/types/index.js.gz +0 -0
- package/package.json +5 -1
|
@@ -1,47 +1,50 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
1
|
+
var Oe = Object.defineProperty;
|
|
2
|
+
var s = (Z, G) => Oe(Z, "name", { value: G, configurable: !0 });
|
|
3
3
|
/* empty css */
|
|
4
|
+
/* empty css */
|
|
4
5
|
/* empty css */
|
|
5
6
|
/* empty css */
|
|
6
7
|
/* empty css */
|
|
7
|
-
import { defineComponent as
|
|
8
|
-
import { lsUploadProps as
|
|
9
|
-
import { getVariable as
|
|
10
|
-
import { useNamespace as
|
|
11
|
-
import
|
|
12
|
-
import
|
|
13
|
-
import
|
|
8
|
+
import { defineComponent as je, useSlots as Ze, useAttrs as Ge, ref as q, reactive as fe, watch as ne, computed as u, resolveComponent as le, createElementBlock as f, openBlock as c, normalizeClass as O, unref as n, createVNode as h, createBlock as F, mergeProps as Ke, createSlots as We, withCtx as v, renderSlot as B, toDisplayString as j, Fragment as w, createCommentVNode as E, createTextVNode as D, createElementVNode as C, Teleport as Xe, toRefs as ve } from "vue";
|
|
9
|
+
import { lsUploadProps as Ye, UPLOAD_TYPE_MAP as Je, fileTypeMap as Qe, UPLOAD_STATUS_MAP as et, IMG_SUFFIX_LIST as tt } from "../types/index.js";
|
|
10
|
+
import { getVariable as it } from "../../_utils/config/index.js";
|
|
11
|
+
import { useNamespace as nt } from "../../_hooks/useNamespace/index.js";
|
|
12
|
+
import A from "../../button/Button.vue/index.js";
|
|
13
|
+
import pe from "../../icon/Index.vue/index.js";
|
|
14
|
+
import lt from "../../../../../preview_image/index.js";
|
|
14
15
|
/* empty css */
|
|
15
16
|
/* empty css */
|
|
16
|
-
import { ElUpload as
|
|
17
|
-
import { ElAvatar as
|
|
17
|
+
import { ElUpload as ot } from "../../../../../node_modules/.pnpm/element-plus@2.11.8_vue@3.5.24_typescript@5.9.3_/node_modules/element-plus/es/components/upload/index/index.js";
|
|
18
|
+
import { ElAvatar as st } from "../../../../../node_modules/.pnpm/element-plus@2.11.8_vue@3.5.24_typescript@5.9.3_/node_modules/element-plus/es/components/avatar/index/index.js";
|
|
19
|
+
import { ElIcon as at } from "../../../../../node_modules/.pnpm/element-plus@2.11.8_vue@3.5.24_typescript@5.9.3_/node_modules/element-plus/es/components/icon/index/index.js";
|
|
20
|
+
import { ElImageViewer as rt } from "../../../../../node_modules/.pnpm/element-plus@2.11.8_vue@3.5.24_typescript@5.9.3_/node_modules/element-plus/es/components/image-viewer/index/index.js";
|
|
18
21
|
import { ElMessage as x } from "../../../../../node_modules/.pnpm/element-plus@2.11.8_vue@3.5.24_typescript@5.9.3_/node_modules/element-plus/es/components/message/index/index.js";
|
|
19
|
-
const
|
|
22
|
+
const ut = { class: "ls-drag" }, ct = { class: "drag-txt ls-color-brand6" }, dt = {
|
|
20
23
|
key: 0,
|
|
21
24
|
class: "btn-picture-card"
|
|
22
|
-
},
|
|
25
|
+
}, mt = {
|
|
23
26
|
key: 0,
|
|
24
27
|
class: "ls-tip"
|
|
25
|
-
},
|
|
28
|
+
}, ft = ["src"], vt = { class: "el-upload-list__item-actions" }, pt = ["onClick"], gt = ["onClick"], Ft = ["onClick"], Bt = /* @__PURE__ */ je({
|
|
26
29
|
name: "LSUpload",
|
|
27
30
|
inheritAttrs: !1,
|
|
28
31
|
__name: "Index",
|
|
29
|
-
props:
|
|
30
|
-
emits: ["uploadErrorFunc", "onChangeFunc", "httpResponseFunc"],
|
|
31
|
-
setup(
|
|
32
|
-
const
|
|
32
|
+
props: Ye,
|
|
33
|
+
emits: ["uploadErrorFunc", "onChangeFunc", "httpResponseFunc", "onHandleCropper"],
|
|
34
|
+
setup(Z, { expose: G, emit: ge }) {
|
|
35
|
+
const K = Ze(), y = Ge(), Fe = nt("upload").b(), m = q(), d = q(!1), _ = fe({
|
|
33
36
|
isCover: !0,
|
|
34
37
|
accept: "",
|
|
35
38
|
disabled: !1
|
|
36
|
-
}), o =
|
|
39
|
+
}), o = fe({
|
|
37
40
|
uploadFileList: [],
|
|
38
41
|
initUploadStatus: !0,
|
|
39
42
|
showPreview: !1,
|
|
40
43
|
sourcePreview: "",
|
|
41
|
-
iconColor:
|
|
42
|
-
}), i =
|
|
43
|
-
|
|
44
|
-
() =>
|
|
44
|
+
iconColor: it("colorText1")
|
|
45
|
+
}), i = Z, T = ge;
|
|
46
|
+
ne(
|
|
47
|
+
() => y["file-list"],
|
|
45
48
|
(e) => {
|
|
46
49
|
o.uploadFileList = e || [];
|
|
47
50
|
},
|
|
@@ -50,159 +53,159 @@ const Ye = { class: "ls-drag" }, Je = { class: "drag-txt ls-color-brand6" }, Qe
|
|
|
50
53
|
deep: !0
|
|
51
54
|
}
|
|
52
55
|
);
|
|
53
|
-
const
|
|
56
|
+
const M = u(() => {
|
|
54
57
|
var e, t;
|
|
55
58
|
return !!((e = i == null ? void 0 : i.item) != null && e.isToast || typeof ((t = i == null ? void 0 : i.item) == null ? void 0 : t.isToast) > "u");
|
|
56
|
-
}),
|
|
59
|
+
}), b = u(() => {
|
|
57
60
|
var t;
|
|
58
61
|
const e = (t = i == null ? void 0 : i.item) == null ? void 0 : t.isCover;
|
|
59
62
|
return typeof e > "u" ? !0 : e;
|
|
60
|
-
}), L =
|
|
61
|
-
const e =
|
|
63
|
+
}), L = u(() => y.multiple), k = u(() => {
|
|
64
|
+
const e = y["auto-upload"];
|
|
62
65
|
return typeof e > "u" ? !0 : e;
|
|
63
|
-
}),
|
|
66
|
+
}), he = u(() => {
|
|
64
67
|
var e;
|
|
65
68
|
return ((e = i == null ? void 0 : i.item) == null ? void 0 : e.emptyFileMsg) || "";
|
|
66
|
-
}),
|
|
69
|
+
}), W = u(() => y["list-type"]), R = u(() => W.value === Je.picCard), ye = u(() => !W.value || W.value == "text"), z = u(() => {
|
|
67
70
|
var e;
|
|
68
71
|
return ((e = i == null ? void 0 : i.item) == null ? void 0 : e.limitFile) || [];
|
|
69
|
-
}),
|
|
72
|
+
}), be = u(() => {
|
|
70
73
|
var e;
|
|
71
74
|
return ((e = i == null ? void 0 : i.item) == null ? void 0 : e.limitFileMsg) || "";
|
|
72
|
-
}),
|
|
75
|
+
}), N = u(() => {
|
|
73
76
|
var e;
|
|
74
77
|
return ((e = i == null ? void 0 : i.item) == null ? void 0 : e.limitSize) || 2;
|
|
75
|
-
}),
|
|
78
|
+
}), Ce = u(() => {
|
|
76
79
|
var e;
|
|
77
80
|
return ((e = i == null ? void 0 : i.item) == null ? void 0 : e.limitSizeMsg) || "";
|
|
78
|
-
}),
|
|
81
|
+
}), X = u(() => {
|
|
79
82
|
var e;
|
|
80
83
|
return ((e = i == null ? void 0 : i.item) == null ? void 0 : e.limitUnit) || "MB";
|
|
81
|
-
}),
|
|
84
|
+
}), _e = u(() => {
|
|
82
85
|
var e;
|
|
83
86
|
return ((e = i == null ? void 0 : i.item) == null ? void 0 : e.limitNumMsg) || "";
|
|
84
|
-
}),
|
|
87
|
+
}), ke = u(() => {
|
|
85
88
|
var e;
|
|
86
89
|
return (e = i == null ? void 0 : i.item) == null ? void 0 : e.limitAllFail;
|
|
87
|
-
}),
|
|
90
|
+
}), oe = u(() => {
|
|
88
91
|
var e;
|
|
89
92
|
return ((e = i == null ? void 0 : i.item) == null ? void 0 : e.profile) || !1;
|
|
90
|
-
}),
|
|
93
|
+
}), I = u(() => y.drag), we = u(() => {
|
|
91
94
|
var e;
|
|
92
|
-
return ((e = i == null ? void 0 : i.item) == null ? void 0 : e.hideCoverBtn) &&
|
|
93
|
-
}),
|
|
94
|
-
const e =
|
|
95
|
+
return ((e = i == null ? void 0 : i.item) == null ? void 0 : e.hideCoverBtn) && b.value && o.uploadFileList.length > 0;
|
|
96
|
+
}), S = u(() => y.disabled), Y = u(() => {
|
|
97
|
+
const e = R.value ? "图片" : "文件";
|
|
95
98
|
let t = `选择${e}`;
|
|
96
|
-
return d.value ? t = "正在上传..." :
|
|
97
|
-
}),
|
|
99
|
+
return d.value ? t = "正在上传..." : b.value && !L.value ? k.value ? o.initUploadStatus ? t = "点击上传" : t = "重新上传" : o.initUploadStatus ? t = `选择${e}` : t = "重新上传" : k.value && (t = "点击上传"), t;
|
|
100
|
+
}), Le = u(() => {
|
|
98
101
|
let e = "不限制上传格式,";
|
|
99
|
-
return
|
|
100
|
-
}),
|
|
102
|
+
return R.value && (e = "文件须为图片格式,"), `${e}文件大小不超过${N.value}${X.value}`;
|
|
103
|
+
}), Se = u(() => {
|
|
101
104
|
var e;
|
|
102
105
|
return ((e = i == null ? void 0 : i.item) == null ? void 0 : e.tipContent) || "";
|
|
103
|
-
}),
|
|
106
|
+
}), J = u(() => {
|
|
104
107
|
var e;
|
|
105
108
|
return (e = i == null ? void 0 : i.item) == null ? void 0 : e.httpRequestFunc;
|
|
106
|
-
}),
|
|
109
|
+
}), Pe = u(() => {
|
|
107
110
|
var t;
|
|
108
|
-
const e = Number(
|
|
111
|
+
const e = Number(y.limit || 0);
|
|
109
112
|
return e ? ((t = i == null ? void 0 : i.item) == null ? void 0 : t.hideBtnReachLimit) && o.uploadFileList.length >= e : !1;
|
|
110
113
|
});
|
|
111
|
-
|
|
112
|
-
[
|
|
114
|
+
ne(
|
|
115
|
+
[b, J],
|
|
113
116
|
([e, t]) => {
|
|
114
|
-
|
|
117
|
+
_.isCover = e, t && t instanceof Function && (_["http-request"] = ze);
|
|
115
118
|
},
|
|
116
119
|
{
|
|
117
120
|
immediate: !0,
|
|
118
121
|
deep: !0
|
|
119
122
|
}
|
|
120
|
-
),
|
|
121
|
-
() =>
|
|
123
|
+
), ne(
|
|
124
|
+
() => z.value,
|
|
122
125
|
(e) => {
|
|
123
|
-
e && e.length > 0 &&
|
|
126
|
+
e && e.length > 0 && Ue(e);
|
|
124
127
|
},
|
|
125
128
|
{
|
|
126
129
|
immediate: !0,
|
|
127
130
|
deep: !0
|
|
128
131
|
}
|
|
129
132
|
);
|
|
130
|
-
function
|
|
131
|
-
|
|
132
|
-
const l =
|
|
133
|
-
l && (
|
|
133
|
+
function Ue(e) {
|
|
134
|
+
_.accept = "", e.forEach((t) => {
|
|
135
|
+
const l = Qe[t] || "";
|
|
136
|
+
l && (_.accept && (_.accept += ","), _.accept += l);
|
|
134
137
|
});
|
|
135
138
|
}
|
|
136
|
-
|
|
137
|
-
function
|
|
138
|
-
const { formRuleFunc: t, formValidateFunc: l } =
|
|
139
|
+
s(Ue, "updateFileAccept");
|
|
140
|
+
function V(e) {
|
|
141
|
+
const { formRuleFunc: t, formValidateFunc: l } = ve(i == null ? void 0 : i.item);
|
|
139
142
|
if (t && t.value instanceof Function && l && l.value instanceof Function) {
|
|
140
143
|
const a = t.value(), { message: r } = a;
|
|
141
144
|
a.message = e, l.value(), a.message = r;
|
|
142
145
|
}
|
|
143
|
-
|
|
146
|
+
T("uploadErrorFunc", e);
|
|
144
147
|
}
|
|
145
|
-
|
|
146
|
-
async function
|
|
148
|
+
s(V, "validateForm");
|
|
149
|
+
async function $e(e, t) {
|
|
147
150
|
if (d.value = !1, i.onExceed)
|
|
148
151
|
return i.onExceed(e, t);
|
|
149
|
-
const l = Number(
|
|
152
|
+
const l = Number(y.limit || 0);
|
|
150
153
|
let a = 0;
|
|
151
|
-
|
|
152
|
-
const r =
|
|
153
|
-
|
|
154
|
+
ke.value || (a = l - o.uploadFileList.length, a > 0 && (Ne(e.slice(0, a)), k.value && ee()));
|
|
155
|
+
const r = _e.value || `当前限制选择 ${l} 个文件,本次选择了 ${e.length} 个文件,已成功上传 ${a} 个文件`;
|
|
156
|
+
M.value ? setTimeout(() => {
|
|
154
157
|
x.warning(r);
|
|
155
|
-
}, 200) :
|
|
158
|
+
}, 200) : V(r);
|
|
156
159
|
}
|
|
157
|
-
|
|
158
|
-
function
|
|
160
|
+
s($e, "onExceedAction");
|
|
161
|
+
function Ee(e) {
|
|
159
162
|
if (i.beforeUpload) {
|
|
160
163
|
const l = i.beforeUpload(e);
|
|
161
|
-
return l &&
|
|
164
|
+
return l && b.value && !L.value && H(), l;
|
|
162
165
|
}
|
|
163
|
-
const t =
|
|
164
|
-
return t &&
|
|
166
|
+
const t = Q(e, !0);
|
|
167
|
+
return t && k.value && b.value && !L.value && H(), t;
|
|
165
168
|
}
|
|
166
|
-
|
|
167
|
-
function
|
|
169
|
+
s(Ee, "beforeUploadAction");
|
|
170
|
+
function Q(e, t) {
|
|
168
171
|
let l = !0;
|
|
169
|
-
const { size: a, name: r } = e,
|
|
170
|
-
let
|
|
171
|
-
switch (
|
|
172
|
+
const { size: a, name: r } = e, P = z.value.length > 0 && !se(r);
|
|
173
|
+
let U = !1;
|
|
174
|
+
switch (X.value) {
|
|
172
175
|
case "KB":
|
|
173
|
-
|
|
176
|
+
U = a / 1024 > N.value;
|
|
174
177
|
break;
|
|
175
178
|
case "MB":
|
|
176
|
-
|
|
179
|
+
U = a / 1024 / 1024 > N.value;
|
|
177
180
|
break;
|
|
178
181
|
default:
|
|
179
|
-
|
|
182
|
+
U = a / 1024 / 1024 / 1024 > N.value;
|
|
180
183
|
break;
|
|
181
184
|
}
|
|
182
|
-
if (
|
|
183
|
-
const p =
|
|
184
|
-
|
|
185
|
+
if (P) {
|
|
186
|
+
const p = be.value || `上传文件 ${e.name} 只能是 ${z.value.filter((ie) => ie).join(",").toLocaleLowerCase()} 格式!`;
|
|
187
|
+
M.value && t ? setTimeout(() => {
|
|
185
188
|
x.error(p);
|
|
186
|
-
}, 200) :
|
|
189
|
+
}, 200) : V(p), l = !1;
|
|
187
190
|
}
|
|
188
|
-
if (
|
|
189
|
-
const p =
|
|
190
|
-
|
|
191
|
+
if (U) {
|
|
192
|
+
const p = Ce.value || `上传文件 ${e.name} 大小不能超过 ${N.value}${X.value}!`;
|
|
193
|
+
M.value && t ? setTimeout(() => {
|
|
191
194
|
x.error(p);
|
|
192
|
-
}, 200) :
|
|
195
|
+
}, 200) : V(p), l = !1;
|
|
193
196
|
}
|
|
194
|
-
if (!
|
|
197
|
+
if (!P && R.value && !se(r, tt)) {
|
|
195
198
|
const p = `上传文件 ${e.name} 不是图片格式的文件!`;
|
|
196
|
-
|
|
199
|
+
M.value && t ? setTimeout(() => {
|
|
197
200
|
x.error(p);
|
|
198
|
-
}, 200) :
|
|
201
|
+
}, 200) : V(p), l = !1;
|
|
199
202
|
}
|
|
200
203
|
return l;
|
|
201
204
|
}
|
|
202
|
-
|
|
203
|
-
function
|
|
205
|
+
s(Q, "validateUploadFile");
|
|
206
|
+
function se(e, t) {
|
|
204
207
|
let l = [];
|
|
205
|
-
if (
|
|
208
|
+
if (z.value.length > 0 ? l = z.value : t && (l = t), l.length <= 0)
|
|
206
209
|
return !0;
|
|
207
210
|
for (let a = 0; a < l.length; a++) {
|
|
208
211
|
const r = (l[a] || "").toLowerCase();
|
|
@@ -211,203 +214,217 @@ const Ye = { class: "ls-drag" }, Je = { class: "drag-txt ls-color-brand6" }, Qe
|
|
|
211
214
|
}
|
|
212
215
|
return !1;
|
|
213
216
|
}
|
|
214
|
-
|
|
215
|
-
function
|
|
217
|
+
s(se, "fileTypeMatch");
|
|
218
|
+
function H(e, t) {
|
|
216
219
|
o.uploadFileList.splice(e || 0, t || o.uploadFileList.length - 1);
|
|
217
220
|
}
|
|
218
|
-
|
|
219
|
-
function
|
|
221
|
+
s(H, "updateCoverFileList");
|
|
222
|
+
function Ae(e, t) {
|
|
220
223
|
o.uploadFileList = t;
|
|
221
|
-
const l = e.raw &&
|
|
222
|
-
if (l &&
|
|
224
|
+
const l = e.raw && Q(e.raw, !k.value);
|
|
225
|
+
if (l && b.value && !L.value && H(), i.onChange)
|
|
223
226
|
return i.onChange(e, t);
|
|
224
227
|
const { size: a = 0 } = e;
|
|
225
228
|
if (a <= 0) {
|
|
226
|
-
|
|
227
|
-
const r =
|
|
228
|
-
|
|
229
|
+
ae();
|
|
230
|
+
const r = he.value || "禁止上传空文件,请检查后重新上传!";
|
|
231
|
+
M.value ? x.error(r) : V(r);
|
|
229
232
|
return;
|
|
230
233
|
}
|
|
231
|
-
e.raw && (!
|
|
234
|
+
e.raw && (!k.value && !l ? ae() : (e.blob = URL.createObjectURL(e.raw) || "", T("onChangeFunc", e)));
|
|
232
235
|
}
|
|
233
|
-
|
|
234
|
-
function
|
|
236
|
+
s(Ae, "onChangeAction");
|
|
237
|
+
function ae() {
|
|
235
238
|
let e = 0;
|
|
236
|
-
o.uploadFileList.length > 1 && (e = o.uploadFileList.length - 1),
|
|
239
|
+
o.uploadFileList.length > 1 && (e = o.uploadFileList.length - 1), H(e, 1), T("onChangeFunc", {});
|
|
237
240
|
}
|
|
238
|
-
|
|
239
|
-
function
|
|
241
|
+
s(ae, "setChangeRes");
|
|
242
|
+
function Te(e, t, l) {
|
|
240
243
|
d.value = !1, o.initUploadStatus = !1;
|
|
241
|
-
const { formRuleFunc: a, formValidateFunc: r } =
|
|
244
|
+
const { formRuleFunc: a, formValidateFunc: r } = ve(i == null ? void 0 : i.item);
|
|
242
245
|
if (a && a.value instanceof Function && r && r.value instanceof Function && r.value(), i.onSuccess)
|
|
243
246
|
return i.onSuccess(e, t, l);
|
|
244
247
|
}
|
|
245
|
-
|
|
246
|
-
function
|
|
248
|
+
s(Te, "onSuccessAction");
|
|
249
|
+
function Me(e, t, l) {
|
|
247
250
|
if (d.value = !1, i.onError)
|
|
248
251
|
return i.onError(e, t, l);
|
|
249
252
|
}
|
|
250
|
-
|
|
251
|
-
function
|
|
253
|
+
s(Me, "onErrorAction");
|
|
254
|
+
function Re(e, t) {
|
|
252
255
|
if (d.value = !1, o.initUploadStatus = !t.length, o.uploadFileList = o.uploadFileList.filter((l) => l.uid === e.uid || l.name === e.name ? null : l), i.onRemove)
|
|
253
256
|
return i.onRemove(e, t);
|
|
254
257
|
}
|
|
255
|
-
|
|
256
|
-
async function
|
|
258
|
+
s(Re, "onRemoveAction");
|
|
259
|
+
async function ze(e) {
|
|
257
260
|
const { file: t } = e;
|
|
258
261
|
if (!t)
|
|
259
262
|
return;
|
|
260
263
|
const { size: l } = t;
|
|
261
|
-
if (l <= 0 || !
|
|
264
|
+
if (l <= 0 || !Q(t, !1))
|
|
262
265
|
return;
|
|
263
266
|
if (i.httpRequest)
|
|
264
267
|
return i.httpRequest(e);
|
|
265
268
|
const a = new FormData();
|
|
266
|
-
if (a.append("file", t),
|
|
269
|
+
if (a.append("file", t), J.value instanceof Function) {
|
|
267
270
|
d.value = !0;
|
|
268
271
|
let r = {};
|
|
269
272
|
try {
|
|
270
|
-
r = await
|
|
271
|
-
} catch (
|
|
272
|
-
r =
|
|
273
|
+
r = await J.value(a);
|
|
274
|
+
} catch (P) {
|
|
275
|
+
r = P;
|
|
273
276
|
} finally {
|
|
274
|
-
d.value = !1,
|
|
277
|
+
d.value = !1, T("httpResponseFunc", r);
|
|
275
278
|
}
|
|
276
279
|
}
|
|
277
280
|
}
|
|
278
|
-
|
|
279
|
-
function
|
|
281
|
+
s(ze, "httpRequestAction");
|
|
282
|
+
function re() {
|
|
280
283
|
let e = !1;
|
|
281
284
|
for (let t = 0; t < o.uploadFileList.length; t++)
|
|
282
|
-
if (o.uploadFileList[t].status ===
|
|
285
|
+
if (o.uploadFileList[t].status === et.ready) {
|
|
283
286
|
e = !0;
|
|
284
287
|
break;
|
|
285
288
|
}
|
|
286
289
|
return e;
|
|
287
290
|
}
|
|
288
|
-
|
|
289
|
-
function
|
|
291
|
+
s(re, "hasReadyFile");
|
|
292
|
+
function ee() {
|
|
290
293
|
var e;
|
|
291
294
|
(e = m == null ? void 0 : m.value) == null || e.submit();
|
|
292
295
|
}
|
|
293
|
-
|
|
294
|
-
function
|
|
296
|
+
s(ee, "comfirmUpload");
|
|
297
|
+
function Ne(e) {
|
|
295
298
|
(e || []).forEach((t) => {
|
|
296
299
|
var l;
|
|
297
300
|
(l = m == null ? void 0 : m.value) == null || l.handleStart(t);
|
|
298
301
|
});
|
|
299
302
|
}
|
|
300
|
-
|
|
301
|
-
function
|
|
303
|
+
s(Ne, "comHandleStart");
|
|
304
|
+
function ue(e) {
|
|
302
305
|
m == null || m.value.handleRemove(e);
|
|
303
306
|
}
|
|
304
|
-
|
|
305
|
-
function
|
|
307
|
+
s(ue, "removeFile");
|
|
308
|
+
function Ie() {
|
|
306
309
|
o.uploadFileList.forEach((e) => {
|
|
307
310
|
var t;
|
|
308
311
|
if (e)
|
|
309
312
|
try {
|
|
310
|
-
(t = m == null ? void 0 : m.value) == null || t.abort(e),
|
|
313
|
+
(t = m == null ? void 0 : m.value) == null || t.abort(e), ue(e);
|
|
311
314
|
} catch {
|
|
312
315
|
}
|
|
313
316
|
});
|
|
314
317
|
}
|
|
315
|
-
|
|
316
|
-
function
|
|
318
|
+
s(Ie, "cancelUpload");
|
|
319
|
+
function Ve(e, t, l) {
|
|
317
320
|
if (d.value = !0, i.onProgress)
|
|
318
321
|
return i.onProgress(e, t, l);
|
|
319
322
|
}
|
|
320
|
-
|
|
321
|
-
function
|
|
323
|
+
s(Ve, "onProgressAction");
|
|
324
|
+
function Be(e) {
|
|
322
325
|
if (i.onPreview)
|
|
323
326
|
return i.onPreview(e);
|
|
324
|
-
if (
|
|
327
|
+
if (R.value) {
|
|
325
328
|
const { url: t } = e || {};
|
|
326
329
|
t && (o.sourcePreview = t, o.showPreview = !0);
|
|
327
330
|
}
|
|
328
331
|
}
|
|
329
|
-
|
|
330
|
-
function
|
|
332
|
+
s(Be, "onPreviewAction");
|
|
333
|
+
function De() {
|
|
331
334
|
o.showPreview = !1, o.sourcePreview = "";
|
|
332
335
|
}
|
|
333
|
-
|
|
336
|
+
s(De, "closePreview");
|
|
337
|
+
const te = q(!1), ce = q([]);
|
|
338
|
+
function xe(e, t) {
|
|
339
|
+
var l;
|
|
340
|
+
ce.value = [((l = o.uploadFileList[t]) == null ? void 0 : l.url) || (e == null ? void 0 : e.url)], te.value = !0;
|
|
341
|
+
}
|
|
342
|
+
s(xe, "onHandlePreview");
|
|
343
|
+
function He(e) {
|
|
344
|
+
ue(e);
|
|
345
|
+
}
|
|
346
|
+
s(He, "onHandleRemove");
|
|
347
|
+
function qe(e, t) {
|
|
348
|
+
T("onHandleCropper", e, t);
|
|
349
|
+
}
|
|
350
|
+
return s(qe, "onHandleCropper"), G({
|
|
334
351
|
uploadRef: m
|
|
335
352
|
}), (e, t) => {
|
|
336
|
-
const l =
|
|
353
|
+
const l = st, a = le("Crop"), r = at, P = le("ZoomIn"), U = le("Delete"), p = ot, ie = rt;
|
|
337
354
|
return c(), f("div", {
|
|
338
|
-
class:
|
|
339
|
-
n(
|
|
340
|
-
n(
|
|
341
|
-
n(
|
|
342
|
-
n(
|
|
343
|
-
n(
|
|
355
|
+
class: O([
|
|
356
|
+
n(Fe),
|
|
357
|
+
n(I) ? "ls-upload-drag" : "",
|
|
358
|
+
n(oe) ? "ls-profile" : "",
|
|
359
|
+
n(we) ? "hide-cover-btn" : "",
|
|
360
|
+
n(Pe) ? "hide-btn" : ""
|
|
344
361
|
])
|
|
345
362
|
}, [
|
|
346
|
-
|
|
363
|
+
h(p, Ke({
|
|
347
364
|
ref_key: "uploadRef",
|
|
348
365
|
ref: m
|
|
349
|
-
}, Object.assign(n(
|
|
350
|
-
"on-exceed":
|
|
351
|
-
"before-upload":
|
|
352
|
-
"on-change":
|
|
353
|
-
"on-success":
|
|
354
|
-
"on-error":
|
|
355
|
-
"on-remove":
|
|
356
|
-
"on-progress":
|
|
357
|
-
"on-preview":
|
|
358
|
-
}),
|
|
359
|
-
trigger:
|
|
360
|
-
n(
|
|
366
|
+
}, Object.assign(n(_), e.$attrs), {
|
|
367
|
+
"on-exceed": $e,
|
|
368
|
+
"before-upload": Ee,
|
|
369
|
+
"on-change": Ae,
|
|
370
|
+
"on-success": Te,
|
|
371
|
+
"on-error": Me,
|
|
372
|
+
"on-remove": Re,
|
|
373
|
+
"on-progress": Ve,
|
|
374
|
+
"on-preview": Be
|
|
375
|
+
}), We({
|
|
376
|
+
trigger: v(() => [
|
|
377
|
+
n(oe) ? e.item.defProfile && n(o).uploadFileList.length < 1 ? (c(), F(l, {
|
|
361
378
|
key: 1,
|
|
362
379
|
size: 60,
|
|
363
380
|
src: e.item.defProfile,
|
|
364
381
|
fit: "contain"
|
|
365
|
-
}, null, 8, ["src"])) :
|
|
366
|
-
n(
|
|
367
|
-
n(
|
|
368
|
-
n(d) ? (c(),
|
|
382
|
+
}, null, 8, ["src"])) : E("", !0) : (c(), f(w, { key: 0 }, [
|
|
383
|
+
n(K).trigger ? B(e.$slots, "trigger", { key: 1 }, void 0, !0) : (c(), f(w, { key: 0 }, [
|
|
384
|
+
n(I) ? (c(), f(w, { key: 0 }, [
|
|
385
|
+
n(d) ? (c(), F(A, {
|
|
369
386
|
key: 0,
|
|
370
387
|
text: "",
|
|
371
388
|
loading: n(d),
|
|
372
|
-
disabled: n(
|
|
373
|
-
}, null, 8, ["loading", "disabled"])) : (c(),
|
|
389
|
+
disabled: n(S)
|
|
390
|
+
}, null, 8, ["loading", "disabled"])) : (c(), F(pe, {
|
|
374
391
|
key: 1,
|
|
375
392
|
class: "upload-icon",
|
|
376
393
|
name: "UploadFilled",
|
|
377
394
|
size: "56",
|
|
378
395
|
color: "#E7E7E7"
|
|
379
396
|
})),
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
n(d) ?
|
|
383
|
-
t[
|
|
384
|
-
t[
|
|
397
|
+
C("div", ut, [
|
|
398
|
+
C("div", ct, j(n(Y)), 1),
|
|
399
|
+
n(d) ? E("", !0) : (c(), f(w, { key: 0 }, [
|
|
400
|
+
t[2] || (t[2] = D(" / ", -1)),
|
|
401
|
+
t[3] || (t[3] = C("div", { class: "drag-txt ls-color-text2" }, "拖拽到此区域", -1))
|
|
385
402
|
], 64))
|
|
386
403
|
])
|
|
387
|
-
], 64)) : (c(), f(
|
|
388
|
-
n(
|
|
389
|
-
n(d) ? (c(),
|
|
404
|
+
], 64)) : (c(), f(w, { key: 1 }, [
|
|
405
|
+
n(R) ? (c(), f("div", dt, [
|
|
406
|
+
n(d) ? (c(), F(A, {
|
|
390
407
|
key: 0,
|
|
391
408
|
text: "",
|
|
392
409
|
loading: n(d),
|
|
393
|
-
disabled: n(
|
|
394
|
-
}, null, 8, ["loading", "disabled"])) : (c(),
|
|
410
|
+
disabled: n(S)
|
|
411
|
+
}, null, 8, ["loading", "disabled"])) : (c(), F(pe, {
|
|
395
412
|
key: 1,
|
|
396
413
|
class: "upload-btn-plus",
|
|
397
414
|
name: "Plus",
|
|
398
415
|
size: 28,
|
|
399
416
|
color: n(o).iconColor
|
|
400
417
|
}, null, 8, ["color"])),
|
|
401
|
-
|
|
402
|
-
])) : (c(),
|
|
418
|
+
C("div", null, j(n(Y)), 1)
|
|
419
|
+
])) : (c(), F(A, {
|
|
403
420
|
key: 1,
|
|
404
421
|
plain: "",
|
|
405
422
|
icon: "upload",
|
|
406
423
|
loading: n(d),
|
|
407
|
-
disabled: n(
|
|
424
|
+
disabled: n(S)
|
|
408
425
|
}, {
|
|
409
|
-
default:
|
|
410
|
-
|
|
426
|
+
default: v(() => [
|
|
427
|
+
D(j(n(Y)), 1)
|
|
411
428
|
]),
|
|
412
429
|
_: 1
|
|
413
430
|
}, 8, ["loading", "disabled"]))
|
|
@@ -415,77 +432,139 @@ const Ye = { class: "ls-drag" }, Je = { class: "drag-txt ls-color-brand6" }, Qe
|
|
|
415
432
|
], 64))
|
|
416
433
|
], 64))
|
|
417
434
|
]),
|
|
418
|
-
default:
|
|
419
|
-
n(
|
|
420
|
-
!n(
|
|
435
|
+
default: v(() => [
|
|
436
|
+
n(K).default ? B(e.$slots, "default", { key: 1 }, void 0, !0) : (c(), f(w, { key: 0 }, [
|
|
437
|
+
!n(k) && (n(ye) || n(I)) ? (c(), f("div", {
|
|
421
438
|
key: 0,
|
|
422
|
-
class:
|
|
439
|
+
class: O(["upload-btn-handle", [n(I) ? "drag-css" : "nor-css", !n(b) || n(L) ? "multi-css" : ""]])
|
|
423
440
|
}, [
|
|
424
|
-
n(
|
|
425
|
-
!n(
|
|
441
|
+
n(I) ? (c(), f(w, { key: 1 }, [
|
|
442
|
+
!n(b) || n(L) ? (c(), F(A, {
|
|
426
443
|
key: 0,
|
|
427
444
|
type: "primary",
|
|
428
445
|
loading: n(d),
|
|
429
|
-
disabled: n(
|
|
430
|
-
onClick:
|
|
446
|
+
disabled: n(S),
|
|
447
|
+
onClick: Ie,
|
|
431
448
|
class: "ls-upload-btn-com ls-upload-btn-cancel"
|
|
432
449
|
}, {
|
|
433
|
-
default:
|
|
434
|
-
|
|
450
|
+
default: v(() => [...t[5] || (t[5] = [
|
|
451
|
+
D("取消上传", -1)
|
|
435
452
|
])]),
|
|
436
453
|
_: 1
|
|
437
|
-
}, 8, ["loading", "disabled"])) :
|
|
438
|
-
|
|
439
|
-
class:
|
|
454
|
+
}, 8, ["loading", "disabled"])) : E("", !0),
|
|
455
|
+
h(A, {
|
|
456
|
+
class: O(["start-upload ls-upload-btn-com ls-upload-btn-comfirm", { "is-ready": re() }]),
|
|
440
457
|
type: "primary",
|
|
441
458
|
loading: n(d),
|
|
442
|
-
disabled: n(
|
|
443
|
-
onClick:
|
|
459
|
+
disabled: n(S),
|
|
460
|
+
onClick: ee
|
|
444
461
|
}, {
|
|
445
|
-
default:
|
|
446
|
-
|
|
462
|
+
default: v(() => [...t[6] || (t[6] = [
|
|
463
|
+
D("开始上传", -1)
|
|
447
464
|
])]),
|
|
448
465
|
_: 1
|
|
449
466
|
}, 8, ["class", "loading", "disabled"])
|
|
450
|
-
], 64)) : (c(),
|
|
467
|
+
], 64)) : (c(), F(A, {
|
|
451
468
|
key: 0,
|
|
452
469
|
type: "primary",
|
|
453
|
-
class:
|
|
470
|
+
class: O(["ls-upload-btn-com ls-upload-btn-comfirm", { "is-ready": re() }]),
|
|
454
471
|
loading: n(d),
|
|
455
|
-
disabled: n(
|
|
456
|
-
onClick:
|
|
472
|
+
disabled: n(S),
|
|
473
|
+
onClick: ee
|
|
457
474
|
}, {
|
|
458
|
-
default:
|
|
459
|
-
|
|
475
|
+
default: v(() => [...t[4] || (t[4] = [
|
|
476
|
+
D("开始上传 ", -1)
|
|
460
477
|
])]),
|
|
461
478
|
_: 1
|
|
462
479
|
}, 8, ["class", "loading", "disabled"]))
|
|
463
|
-
], 2)) :
|
|
480
|
+
], 2)) : E("", !0)
|
|
464
481
|
], 64))
|
|
465
482
|
]),
|
|
466
|
-
tip:
|
|
467
|
-
n(
|
|
483
|
+
tip: v(() => [
|
|
484
|
+
n(K).tip ? B(e.$slots, "tip", { key: 1 }, void 0, !0) : (c(), f("div", mt, j(n(Se) || n(Le)), 1))
|
|
468
485
|
]),
|
|
469
486
|
_: 2
|
|
470
487
|
}, [
|
|
471
|
-
|
|
488
|
+
e.customFile ? {
|
|
472
489
|
name: "file",
|
|
473
|
-
fn:
|
|
474
|
-
|
|
475
|
-
|
|
490
|
+
fn: v(({ file: g, index: $ }) => {
|
|
491
|
+
var de;
|
|
492
|
+
return [
|
|
493
|
+
C("img", {
|
|
494
|
+
src: ((de = n(o).uploadFileList[$]) == null ? void 0 : de.url) || g.url,
|
|
495
|
+
class: "el-upload-list__item-thumbnail"
|
|
496
|
+
}, null, 8, ft),
|
|
497
|
+
C("div", vt, [
|
|
498
|
+
B(e.$slots, "default", {
|
|
499
|
+
file: g,
|
|
500
|
+
index: $
|
|
501
|
+
}, void 0, !0),
|
|
502
|
+
e.hasCropper ? (c(), f("span", {
|
|
503
|
+
key: 0,
|
|
504
|
+
class: "el-upload-list__item-cropper",
|
|
505
|
+
onClick: /* @__PURE__ */ s((me) => qe(g, $), "onClick")
|
|
506
|
+
}, [
|
|
507
|
+
h(r, null, {
|
|
508
|
+
default: v(() => [
|
|
509
|
+
h(a)
|
|
510
|
+
]),
|
|
511
|
+
_: 1
|
|
512
|
+
})
|
|
513
|
+
], 8, pt)) : E("", !0),
|
|
514
|
+
C("span", {
|
|
515
|
+
class: "el-upload-list__item-preview",
|
|
516
|
+
onClick: /* @__PURE__ */ s((me) => xe(g, $), "onClick")
|
|
517
|
+
}, [
|
|
518
|
+
h(r, null, {
|
|
519
|
+
default: v(() => [
|
|
520
|
+
h(P)
|
|
521
|
+
]),
|
|
522
|
+
_: 1
|
|
523
|
+
})
|
|
524
|
+
], 8, gt),
|
|
525
|
+
C("span", {
|
|
526
|
+
class: "el-upload-list__item-delete",
|
|
527
|
+
onClick: /* @__PURE__ */ s((me) => He(g), "onClick")
|
|
528
|
+
}, [
|
|
529
|
+
h(r, null, {
|
|
530
|
+
default: v(() => [
|
|
531
|
+
h(U)
|
|
532
|
+
]),
|
|
533
|
+
_: 1
|
|
534
|
+
})
|
|
535
|
+
], 8, Ft)
|
|
536
|
+
])
|
|
537
|
+
];
|
|
538
|
+
}),
|
|
476
539
|
key: "0"
|
|
477
|
-
} :
|
|
540
|
+
} : {
|
|
541
|
+
name: "file",
|
|
542
|
+
fn: v(({ file: g, index: $ }) => [
|
|
543
|
+
B(e.$slots, "file", {
|
|
544
|
+
file: g,
|
|
545
|
+
index: $
|
|
546
|
+
}, void 0, !0)
|
|
547
|
+
]),
|
|
548
|
+
key: "1"
|
|
549
|
+
}
|
|
478
550
|
]), 1040),
|
|
479
|
-
|
|
551
|
+
h(n(lt), {
|
|
480
552
|
modelValue: n(o).showPreview,
|
|
481
|
-
"onUpdate:modelValue": t[0] || (t[0] = (
|
|
553
|
+
"onUpdate:modelValue": t[0] || (t[0] = (g) => n(o).showPreview = g),
|
|
482
554
|
source: n(o).sourcePreview,
|
|
483
|
-
"on-close":
|
|
484
|
-
}, null, 8, ["modelValue", "source"])
|
|
555
|
+
"on-close": De
|
|
556
|
+
}, null, 8, ["modelValue", "source"]),
|
|
557
|
+
(c(), F(Xe, { to: "body" }, [
|
|
558
|
+
n(te) ? (c(), F(ie, {
|
|
559
|
+
key: 0,
|
|
560
|
+
"url-list": n(ce),
|
|
561
|
+
onClose: t[1] || (t[1] = (g) => te.value = !1)
|
|
562
|
+
}, null, 8, ["url-list"])) : E("", !0)
|
|
563
|
+
]))
|
|
485
564
|
], 2);
|
|
486
565
|
};
|
|
487
566
|
}
|
|
488
567
|
});
|
|
489
568
|
export {
|
|
490
|
-
|
|
569
|
+
Bt as default
|
|
491
570
|
};
|