@lingshugroup/web-plus 2.4.4 → 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.
Files changed (32) hide show
  1. package/lib/index.css +1 -1
  2. package/lib/index.css.br +0 -0
  3. package/lib/index.css.gz +0 -0
  4. 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
  5. 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
  6. 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
  7. 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
  8. 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
  9. 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
  10. 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
  11. 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
  12. 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
  13. 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
  14. 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
  15. 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
  16. 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
  17. 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
  18. 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
  19. 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
  20. 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
  21. 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
  22. package/lib/packages/ls-components/components/upload/Index.vue/index.cjs +1 -1
  23. package/lib/packages/ls-components/components/upload/Index.vue/index.js +2 -2
  24. package/lib/packages/ls-components/components/upload/Index.vue/index2.cjs +1 -1
  25. package/lib/packages/ls-components/components/upload/Index.vue/index2.js +299 -220
  26. package/lib/packages/ls-components/components/upload/Index.vue/index2.js.br +0 -0
  27. package/lib/packages/ls-components/components/upload/Index.vue/index2.js.gz +0 -0
  28. package/lib/packages/ls-components/components/upload/types/index.cjs +1 -1
  29. package/lib/packages/ls-components/components/upload/types/index.js +15 -7
  30. package/lib/packages/ls-components/components/upload/types/index.js.br +0 -0
  31. package/lib/packages/ls-components/components/upload/types/index.js.gz +0 -0
  32. package/package.json +1 -1
@@ -1,47 +1,50 @@
1
- var Re = Object.defineProperty;
2
- var u = (O, j) => Re(O, "name", { value: j, configurable: !0 });
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 _e, useSlots as ze, useAttrs as Ne, ref as ne, reactive as le, watch as J, computed as s, createElementBlock as f, openBlock as c, normalizeClass as B, unref as n, createVNode as Q, mergeProps as Be, createSlots as Ve, withCtx as F, renderSlot as V, toDisplayString as D, Fragment as k, createCommentVNode as I, createBlock as h, createTextVNode as $, createElementVNode as q, toRefs as oe } from "vue";
8
- import { lsUploadProps as De, UPLOAD_TYPE_MAP as Ie, fileTypeMap as qe, UPLOAD_STATUS_MAP as Oe, IMG_SUFFIX_LIST as je } from "../types/index.js";
9
- import { getVariable as He } from "../../_utils/config/index.js";
10
- import { useNamespace as Ge } from "../../_hooks/useNamespace/index.js";
11
- import C from "../../button/Button.vue/index.js";
12
- import ae from "../../icon/Index.vue/index.js";
13
- import Ke from "../../../../../preview_image/index.js";
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 We } 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";
17
- import { ElAvatar as Xe } 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";
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 Ye = { class: "ls-drag" }, Je = { class: "drag-txt ls-color-brand6" }, Qe = {
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
- }, Ze = {
25
+ }, mt = {
23
26
  key: 0,
24
27
  class: "ls-tip"
25
- }, ht = /* @__PURE__ */ _e({
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: De,
30
- emits: ["uploadErrorFunc", "onChangeFunc", "httpResponseFunc"],
31
- setup(O, { expose: j, emit: se }) {
32
- const M = ze(), v = Ne(), re = Ge("upload").b(), m = ne(), d = ne(!1), y = le({
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 = le({
39
+ }), o = fe({
37
40
  uploadFileList: [],
38
41
  initUploadStatus: !0,
39
42
  showPreview: !1,
40
43
  sourcePreview: "",
41
- iconColor: He("colorText1")
42
- }), i = O, R = se;
43
- J(
44
- () => v["file-list"],
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 S = s(() => {
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
- }), g = s(() => {
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 = s(() => v.multiple), b = s(() => {
61
- const e = v["auto-upload"];
63
+ }), L = u(() => y.multiple), k = u(() => {
64
+ const e = y["auto-upload"];
62
65
  return typeof e > "u" ? !0 : e;
63
- }), ue = s(() => {
66
+ }), he = u(() => {
64
67
  var e;
65
68
  return ((e = i == null ? void 0 : i.item) == null ? void 0 : e.emptyFileMsg) || "";
66
- }), H = s(() => v["list-type"]), P = s(() => H.value === Ie.picCard), ce = s(() => !H.value || H.value == "text"), U = s(() => {
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
- }), de = s(() => {
72
+ }), be = u(() => {
70
73
  var e;
71
74
  return ((e = i == null ? void 0 : i.item) == null ? void 0 : e.limitFileMsg) || "";
72
- }), A = s(() => {
75
+ }), N = u(() => {
73
76
  var e;
74
77
  return ((e = i == null ? void 0 : i.item) == null ? void 0 : e.limitSize) || 2;
75
- }), me = s(() => {
78
+ }), Ce = u(() => {
76
79
  var e;
77
80
  return ((e = i == null ? void 0 : i.item) == null ? void 0 : e.limitSizeMsg) || "";
78
- }), G = s(() => {
81
+ }), X = u(() => {
79
82
  var e;
80
83
  return ((e = i == null ? void 0 : i.item) == null ? void 0 : e.limitUnit) || "MB";
81
- }), fe = s(() => {
84
+ }), _e = u(() => {
82
85
  var e;
83
86
  return ((e = i == null ? void 0 : i.item) == null ? void 0 : e.limitNumMsg) || "";
84
- }), ve = s(() => {
87
+ }), ke = u(() => {
85
88
  var e;
86
89
  return (e = i == null ? void 0 : i.item) == null ? void 0 : e.limitAllFail;
87
- }), Z = s(() => {
90
+ }), oe = u(() => {
88
91
  var e;
89
92
  return ((e = i == null ? void 0 : i.item) == null ? void 0 : e.profile) || !1;
90
- }), E = s(() => v.drag), ge = s(() => {
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) && g.value && o.uploadFileList.length > 0;
93
- }), w = s(() => v.disabled), K = s(() => {
94
- const e = P.value ? "图片" : "文件";
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 = "正在上传..." : g.value && !L.value ? b.value ? o.initUploadStatus ? t = "点击上传" : t = "重新上传" : o.initUploadStatus ? t = `选择${e}` : t = "重新上传" : b.value && (t = "点击上传"), t;
97
- }), pe = s(() => {
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 P.value && (e = "文件须为图片格式,"), `${e}文件大小不超过${A.value}${G.value}`;
100
- }), Fe = s(() => {
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
- }), W = s(() => {
106
+ }), J = u(() => {
104
107
  var e;
105
108
  return (e = i == null ? void 0 : i.item) == null ? void 0 : e.httpRequestFunc;
106
- }), he = s(() => {
109
+ }), Pe = u(() => {
107
110
  var t;
108
- const e = Number(v.limit || 0);
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
- J(
112
- [g, W],
114
+ ne(
115
+ [b, J],
113
116
  ([e, t]) => {
114
- y.isCover = e, t && t instanceof Function && (y["http-request"] = Pe);
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
- ), J(
121
- () => U.value,
123
+ ), ne(
124
+ () => z.value,
122
125
  (e) => {
123
- e && e.length > 0 && ye(e);
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 ye(e) {
131
- y.accept = "", e.forEach((t) => {
132
- const l = qe[t] || "";
133
- l && (y.accept && (y.accept += ","), y.accept += 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
- u(ye, "updateFileAccept");
137
- function T(e) {
138
- const { formRuleFunc: t, formValidateFunc: l } = oe(i == null ? void 0 : i.item);
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
- R("uploadErrorFunc", e);
146
+ T("uploadErrorFunc", e);
144
147
  }
145
- u(T, "validateForm");
146
- async function be(e, t) {
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(v.limit || 0);
152
+ const l = Number(y.limit || 0);
150
153
  let a = 0;
151
- ve.value || (a = l - o.uploadFileList.length, a > 0 && (Ue(e.slice(0, a)), b.value && Y()));
152
- const r = fe.value || `当前限制选择 ${l} 个文件,本次选择了 ${e.length} 个文件,已成功上传 ${a} 个文件`;
153
- S.value ? setTimeout(() => {
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) : T(r);
158
+ }, 200) : V(r);
156
159
  }
157
- u(be, "onExceedAction");
158
- function ke(e) {
160
+ s($e, "onExceedAction");
161
+ function Ee(e) {
159
162
  if (i.beforeUpload) {
160
163
  const l = i.beforeUpload(e);
161
- return l && g.value && !L.value && _(), l;
164
+ return l && b.value && !L.value && H(), l;
162
165
  }
163
- const t = X(e, !0);
164
- return t && b.value && g.value && !L.value && _(), t;
166
+ const t = Q(e, !0);
167
+ return t && k.value && b.value && !L.value && H(), t;
165
168
  }
166
- u(ke, "beforeUploadAction");
167
- function X(e, t) {
169
+ s(Ee, "beforeUploadAction");
170
+ function Q(e, t) {
168
171
  let l = !0;
169
- const { size: a, name: r } = e, z = U.value.length > 0 && !ee(r);
170
- let N = !1;
171
- switch (G.value) {
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
- N = a / 1024 > A.value;
176
+ U = a / 1024 > N.value;
174
177
  break;
175
178
  case "MB":
176
- N = a / 1024 / 1024 > A.value;
179
+ U = a / 1024 / 1024 > N.value;
177
180
  break;
178
181
  default:
179
- N = a / 1024 / 1024 / 1024 > A.value;
182
+ U = a / 1024 / 1024 / 1024 > N.value;
180
183
  break;
181
184
  }
182
- if (z) {
183
- const p = de.value || `上传文件 ${e.name} 只能是 ${U.value.filter((Me) => Me).join(",").toLocaleLowerCase()} 格式!`;
184
- S.value && t ? setTimeout(() => {
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) : T(p), l = !1;
189
+ }, 200) : V(p), l = !1;
187
190
  }
188
- if (N) {
189
- const p = me.value || `上传文件 ${e.name} 大小不能超过 ${A.value}${G.value}!`;
190
- S.value && t ? setTimeout(() => {
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) : T(p), l = !1;
195
+ }, 200) : V(p), l = !1;
193
196
  }
194
- if (!z && P.value && !ee(r, je)) {
197
+ if (!P && R.value && !se(r, tt)) {
195
198
  const p = `上传文件 ${e.name} 不是图片格式的文件!`;
196
- S.value && t ? setTimeout(() => {
199
+ M.value && t ? setTimeout(() => {
197
200
  x.error(p);
198
- }, 200) : T(p), l = !1;
201
+ }, 200) : V(p), l = !1;
199
202
  }
200
203
  return l;
201
204
  }
202
- u(X, "validateUploadFile");
203
- function ee(e, t) {
205
+ s(Q, "validateUploadFile");
206
+ function se(e, t) {
204
207
  let l = [];
205
- if (U.value.length > 0 ? l = U.value : t && (l = t), l.length <= 0)
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
- u(ee, "fileTypeMatch");
215
- function _(e, t) {
217
+ s(se, "fileTypeMatch");
218
+ function H(e, t) {
216
219
  o.uploadFileList.splice(e || 0, t || o.uploadFileList.length - 1);
217
220
  }
218
- u(_, "updateCoverFileList");
219
- function Le(e, t) {
221
+ s(H, "updateCoverFileList");
222
+ function Ae(e, t) {
220
223
  o.uploadFileList = t;
221
- const l = e.raw && X(e.raw, !b.value);
222
- if (l && g.value && !L.value && _(), i.onChange)
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
- te();
227
- const r = ue.value || "禁止上传空文件,请检查后重新上传!";
228
- S.value ? x.error(r) : T(r);
229
+ ae();
230
+ const r = he.value || "禁止上传空文件,请检查后重新上传!";
231
+ M.value ? x.error(r) : V(r);
229
232
  return;
230
233
  }
231
- e.raw && (!b.value && !l ? te() : (e.blob = URL.createObjectURL(e.raw) || "", R("onChangeFunc", e)));
234
+ e.raw && (!k.value && !l ? ae() : (e.blob = URL.createObjectURL(e.raw) || "", T("onChangeFunc", e)));
232
235
  }
233
- u(Le, "onChangeAction");
234
- function te() {
236
+ s(Ae, "onChangeAction");
237
+ function ae() {
235
238
  let e = 0;
236
- o.uploadFileList.length > 1 && (e = o.uploadFileList.length - 1), _(e, 1), R("onChangeFunc", {});
239
+ o.uploadFileList.length > 1 && (e = o.uploadFileList.length - 1), H(e, 1), T("onChangeFunc", {});
237
240
  }
238
- u(te, "setChangeRes");
239
- function we(e, t, l) {
241
+ s(ae, "setChangeRes");
242
+ function Te(e, t, l) {
240
243
  d.value = !1, o.initUploadStatus = !1;
241
- const { formRuleFunc: a, formValidateFunc: r } = oe(i == null ? void 0 : i.item);
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
- u(we, "onSuccessAction");
246
- function Ce(e, t, l) {
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
- u(Ce, "onErrorAction");
251
- function Se(e, t) {
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
- u(Se, "onRemoveAction");
256
- async function Pe(e) {
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 || !X(t, !1))
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), W.value instanceof Function) {
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 W.value(a);
271
- } catch (z) {
272
- r = z;
273
+ r = await J.value(a);
274
+ } catch (P) {
275
+ r = P;
273
276
  } finally {
274
- d.value = !1, R("httpResponseFunc", r);
277
+ d.value = !1, T("httpResponseFunc", r);
275
278
  }
276
279
  }
277
280
  }
278
- u(Pe, "httpRequestAction");
279
- function ie() {
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 === Oe.ready) {
285
+ if (o.uploadFileList[t].status === et.ready) {
283
286
  e = !0;
284
287
  break;
285
288
  }
286
289
  return e;
287
290
  }
288
- u(ie, "hasReadyFile");
289
- function Y() {
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
- u(Y, "comfirmUpload");
294
- function Ue(e) {
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
- u(Ue, "comHandleStart");
301
- function Ae(e) {
303
+ s(Ne, "comHandleStart");
304
+ function ue(e) {
302
305
  m == null || m.value.handleRemove(e);
303
306
  }
304
- u(Ae, "removeFile");
305
- function Ee() {
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), Ae(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
- u(Ee, "cancelUpload");
316
- function Te(e, t, l) {
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
- u(Te, "onProgressAction");
321
- function $e(e) {
323
+ s(Ve, "onProgressAction");
324
+ function Be(e) {
322
325
  if (i.onPreview)
323
326
  return i.onPreview(e);
324
- if (P.value) {
327
+ if (R.value) {
325
328
  const { url: t } = e || {};
326
329
  t && (o.sourcePreview = t, o.showPreview = !0);
327
330
  }
328
331
  }
329
- u($e, "onPreviewAction");
330
- function xe() {
332
+ s(Be, "onPreviewAction");
333
+ function De() {
331
334
  o.showPreview = !1, o.sourcePreview = "";
332
335
  }
333
- return u(xe, "closePreview"), j({
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 = Xe, a = We;
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: B([
339
- n(re),
340
- n(E) ? "ls-upload-drag" : "",
341
- n(Z) ? "ls-profile" : "",
342
- n(ge) ? "hide-cover-btn" : "",
343
- n(he) ? "hide-btn" : ""
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
- Q(a, Be({
363
+ h(p, Ke({
347
364
  ref_key: "uploadRef",
348
365
  ref: m
349
- }, Object.assign(n(y), e.$attrs), {
350
- "on-exceed": be,
351
- "before-upload": ke,
352
- "on-change": Le,
353
- "on-success": we,
354
- "on-error": Ce,
355
- "on-remove": Se,
356
- "on-progress": Te,
357
- "on-preview": $e
358
- }), Ve({
359
- trigger: F(() => [
360
- n(Z) ? e.item.defProfile && n(o).uploadFileList.length < 1 ? (c(), h(l, {
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"])) : I("", !0) : (c(), f(k, { key: 0 }, [
366
- n(M).trigger ? V(e.$slots, "trigger", { key: 1 }, void 0, !0) : (c(), f(k, { key: 0 }, [
367
- n(E) ? (c(), f(k, { key: 0 }, [
368
- n(d) ? (c(), h(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(w)
373
- }, null, 8, ["loading", "disabled"])) : (c(), h(ae, {
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
- q("div", Ye, [
381
- q("div", Je, D(n(K)), 1),
382
- n(d) ? I("", !0) : (c(), f(k, { key: 0 }, [
383
- t[1] || (t[1] = $("   /   ", -1)),
384
- t[2] || (t[2] = q("div", { class: "drag-txt ls-color-text2" }, "拖拽到此区域", -1))
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(k, { key: 1 }, [
388
- n(P) ? (c(), f("div", Qe, [
389
- n(d) ? (c(), h(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(w)
394
- }, null, 8, ["loading", "disabled"])) : (c(), h(ae, {
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
- q("div", null, D(n(K)), 1)
402
- ])) : (c(), h(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(w)
424
+ disabled: n(S)
408
425
  }, {
409
- default: F(() => [
410
- $(D(n(K)), 1)
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: F(() => [
419
- n(M).default ? V(e.$slots, "default", { key: 1 }, void 0, !0) : (c(), f(k, { key: 0 }, [
420
- !n(b) && (n(ce) || n(E)) ? (c(), f("div", {
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: B(["upload-btn-handle", [n(E) ? "drag-css" : "nor-css", !n(g) || n(L) ? "multi-css" : ""]])
439
+ class: O(["upload-btn-handle", [n(I) ? "drag-css" : "nor-css", !n(b) || n(L) ? "multi-css" : ""]])
423
440
  }, [
424
- n(E) ? (c(), f(k, { key: 1 }, [
425
- !n(g) || n(L) ? (c(), h(C, {
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(w),
430
- onClick: Ee,
446
+ disabled: n(S),
447
+ onClick: Ie,
431
448
  class: "ls-upload-btn-com ls-upload-btn-cancel"
432
449
  }, {
433
- default: F(() => [...t[4] || (t[4] = [
434
- $("取消上传", -1)
450
+ default: v(() => [...t[5] || (t[5] = [
451
+ D("取消上传", -1)
435
452
  ])]),
436
453
  _: 1
437
- }, 8, ["loading", "disabled"])) : I("", !0),
438
- Q(C, {
439
- class: B(["start-upload ls-upload-btn-com ls-upload-btn-comfirm", { "is-ready": ie() }]),
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(w),
443
- onClick: Y
459
+ disabled: n(S),
460
+ onClick: ee
444
461
  }, {
445
- default: F(() => [...t[5] || (t[5] = [
446
- $("开始上传", -1)
462
+ default: v(() => [...t[6] || (t[6] = [
463
+ D("开始上传", -1)
447
464
  ])]),
448
465
  _: 1
449
466
  }, 8, ["class", "loading", "disabled"])
450
- ], 64)) : (c(), h(C, {
467
+ ], 64)) : (c(), F(A, {
451
468
  key: 0,
452
469
  type: "primary",
453
- class: B(["ls-upload-btn-com ls-upload-btn-comfirm", { "is-ready": ie() }]),
470
+ class: O(["ls-upload-btn-com ls-upload-btn-comfirm", { "is-ready": re() }]),
454
471
  loading: n(d),
455
- disabled: n(w),
456
- onClick: Y
472
+ disabled: n(S),
473
+ onClick: ee
457
474
  }, {
458
- default: F(() => [...t[3] || (t[3] = [
459
- $("开始上传 ", -1)
475
+ default: v(() => [...t[4] || (t[4] = [
476
+ D("开始上传 ", -1)
460
477
  ])]),
461
478
  _: 1
462
479
  }, 8, ["class", "loading", "disabled"]))
463
- ], 2)) : I("", !0)
480
+ ], 2)) : E("", !0)
464
481
  ], 64))
465
482
  ]),
466
- tip: F(() => [
467
- n(M).tip ? V(e.$slots, "tip", { key: 1 }, void 0, !0) : (c(), f("div", Ze, D(n(Fe) || n(pe)), 1))
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
- n(M).file ? {
488
+ e.customFile ? {
472
489
  name: "file",
473
- fn: F(() => [
474
- V(e.$slots, "file", {}, void 0, !0)
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
- } : void 0
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
- Q(n(Ke), {
551
+ h(n(lt), {
480
552
  modelValue: n(o).showPreview,
481
- "onUpdate:modelValue": t[0] || (t[0] = (r) => n(o).showPreview = r),
553
+ "onUpdate:modelValue": t[0] || (t[0] = (g) => n(o).showPreview = g),
482
554
  source: n(o).sourcePreview,
483
- "on-close": xe
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
- ht as default
569
+ Bt as default
491
570
  };