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