@lingshugroup/web-plus 1.0.14 → 1.0.16

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