@lingshugroup/web-plus 1.0.13 → 1.0.15

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