@aplus-frontend/ui 7.10.4 → 7.10.6

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 (59) hide show
  1. package/es/src/ap-field/interface.d.ts +1 -1
  2. package/es/src/ap-field/slider/index.vue.d.ts +196 -412
  3. package/es/src/ap-field/slider/index.vue.mjs +50 -39
  4. package/es/src/business/ap-appendix/ap-appendix.vue2.mjs +68 -67
  5. package/es/src/business/ap-attachment/ApAttachment.d.ts +2 -8
  6. package/es/src/business/ap-attachment/ApAttachment.mjs +46 -40
  7. package/es/src/business/ap-attachment/constans.d.ts +1 -4
  8. package/es/src/business/ap-attachment/constans.mjs +3 -6
  9. package/es/src/business/ap-attachment/index.d.ts +3 -12
  10. package/es/src/business/ap-ladder/components/RenderValue.mjs +25 -22
  11. package/es/src/business/ap-ladder/utils.d.ts +1 -0
  12. package/es/src/business/ap-ladder/utils.mjs +10 -9
  13. package/es/src/business/ap-title/ApTitle.vue.d.ts +1 -1
  14. package/es/src/business/ap-title/index.d.ts +3 -3
  15. package/es/src/business/ap-title/interface.d.ts +1 -1
  16. package/es/src/business/ap-upload/apUpload.vue.d.ts +9 -0
  17. package/es/src/business/ap-upload/apUpload.vue.mjs +22 -18
  18. package/es/src/business/ap-upload/components/MultipleFile.vue2.mjs +128 -123
  19. package/es/src/business/ap-upload/components/Picture.vue2.mjs +150 -147
  20. package/es/src/business/ap-upload/components/SingleFile.vue2.mjs +130 -127
  21. package/es/src/business/ap-upload/hooks/useOss.d.ts +2 -1
  22. package/es/src/business/ap-upload/hooks/useOss.mjs +52 -51
  23. package/es/src/business/ap-upload-file/ap-upload-single/ap-upload-single.vue.mjs +11 -10
  24. package/es/src/business/ap-upload-file/hook/useOss.d.ts +6 -1
  25. package/es/src/business/ap-upload-file/hook/useOss.mjs +19 -16
  26. package/es/src/business/ap-upload-file/interface.d.ts +3 -1
  27. package/es/src/business/ap-upload-file/utils/upload.mjs +22 -20
  28. package/es/src/version.d.ts +1 -1
  29. package/es/src/version.mjs +1 -1
  30. package/lib/src/ap-field/interface.d.ts +1 -1
  31. package/lib/src/ap-field/slider/index.vue.d.ts +196 -412
  32. package/lib/src/ap-field/slider/index.vue.js +1 -1
  33. package/lib/src/business/ap-appendix/ap-appendix.vue2.js +1 -1
  34. package/lib/src/business/ap-attachment/ApAttachment.d.ts +2 -8
  35. package/lib/src/business/ap-attachment/ApAttachment.js +1 -1
  36. package/lib/src/business/ap-attachment/constans.d.ts +1 -4
  37. package/lib/src/business/ap-attachment/constans.js +1 -1
  38. package/lib/src/business/ap-attachment/index.d.ts +3 -12
  39. package/lib/src/business/ap-ladder/components/RenderValue.js +1 -1
  40. package/lib/src/business/ap-ladder/utils.d.ts +1 -0
  41. package/lib/src/business/ap-ladder/utils.js +1 -1
  42. package/lib/src/business/ap-title/ApTitle.vue.d.ts +1 -1
  43. package/lib/src/business/ap-title/index.d.ts +3 -3
  44. package/lib/src/business/ap-title/interface.d.ts +1 -1
  45. package/lib/src/business/ap-upload/apUpload.vue.d.ts +9 -0
  46. package/lib/src/business/ap-upload/apUpload.vue.js +1 -1
  47. package/lib/src/business/ap-upload/components/MultipleFile.vue2.js +1 -1
  48. package/lib/src/business/ap-upload/components/Picture.vue2.js +1 -1
  49. package/lib/src/business/ap-upload/components/SingleFile.vue2.js +1 -1
  50. package/lib/src/business/ap-upload/hooks/useOss.d.ts +2 -1
  51. package/lib/src/business/ap-upload/hooks/useOss.js +1 -1
  52. package/lib/src/business/ap-upload-file/ap-upload-single/ap-upload-single.vue.js +1 -1
  53. package/lib/src/business/ap-upload-file/hook/useOss.d.ts +6 -1
  54. package/lib/src/business/ap-upload-file/hook/useOss.js +1 -1
  55. package/lib/src/business/ap-upload-file/interface.d.ts +3 -1
  56. package/lib/src/business/ap-upload-file/utils/upload.js +1 -1
  57. package/lib/src/version.d.ts +1 -1
  58. package/lib/src/version.js +1 -1
  59. package/package.json +3 -3
@@ -1,93 +1,93 @@
1
- import { defineComponent as X, inject as a, ref as Y, watch as Z, nextTick as ee, createElementBlock as U, openBlock as w, normalizeClass as oe, unref as s, createVNode as x, withCtx as k, createElementVNode as I, createTextVNode as te, toDisplayString as M, withModifiers as ae, createCommentVNode as se, createBlock as ne, resolveDynamicComponent as re } from "vue";
2
- import { UploadOutlined as le, VerticalAlignBottomOutlined as ie } from "@ant-design/icons-vue";
3
- import { message as c, Upload as ue, Button as ce } from "@aplus-frontend/antdv";
1
+ import { defineComponent as Y, inject as a, ref as Z, watch as ee, nextTick as oe, createElementBlock as b, openBlock as x, normalizeClass as te, unref as n, createVNode as y, withCtx as U, createElementVNode as S, createTextVNode as ae, toDisplayString as L, withModifiers as se, createCommentVNode as ne, createBlock as re, resolveDynamicComponent as le } from "vue";
2
+ import { UploadOutlined as ie, VerticalAlignBottomOutlined as ce } from "@ant-design/icons-vue";
3
+ import { message as p, Upload as ue, Button as pe } from "@aplus-frontend/antdv";
4
4
  import "../../../config-provider/index.mjs";
5
- import { useOss as pe, getOssInstance as S } from "../hooks/useOss.mjs";
6
- import de from "../style/index.mjs";
7
- import { fileMatchesAccept as me, getAcceptText as fe } from "../utils/accept.mjs";
8
- import { getPath as ge, getName as he, getReturnData as L } from "../utils/returnData.mjs";
9
- import { useGlobalConfig as ve } from "../../../config-provider/hooks/use-global-config.mjs";
10
- import { useLocale as we } from "../../../config-provider/hooks/use-locale.mjs";
11
- import { useNamespace as xe } from "../../../config-provider/hooks/use-namespace.mjs";
12
- const ye = { class: "multiple-file-context" }, Ce = { key: 0 }, Ue = { key: 1 }, Le = /* @__PURE__ */ X({
5
+ import { useOss as de, getOssInstance as z } from "../hooks/useOss.mjs";
6
+ import me from "../style/index.mjs";
7
+ import { fileMatchesAccept as fe, getAcceptText as ge } from "../utils/accept.mjs";
8
+ import { getPath as he, getName as ve, getReturnData as B } from "../utils/returnData.mjs";
9
+ import { useGlobalConfig as we } from "../../../config-provider/hooks/use-global-config.mjs";
10
+ import { useLocale as xe } from "../../../config-provider/hooks/use-locale.mjs";
11
+ import { useNamespace as ye } from "../../../config-provider/hooks/use-namespace.mjs";
12
+ const ke = { class: "multiple-file-context" }, Ce = { key: 0 }, be = { key: 1 }, ze = /* @__PURE__ */ Y({
13
13
  __name: "MultipleFile",
14
- setup(ke, { expose: z }) {
15
- const E = ve(
14
+ setup(Ue, { expose: D }) {
15
+ const N = we(
16
16
  "downloadCenterTriggerConfig"
17
- ), { t: r } = we(), { b: B } = xe("ap-upload-multiple-file"), D = de("ap-upload"), { put: O } = pe(), P = a("dirName"), V = a("baseDirName"), y = a("accept") || "*", N = a("maxSize") ?? 500, q = a("title") || r("ap.apUpload.uploadFile"), m = a("subTitle"), l = a("maxCount") ?? 10, p = a("uploadingCount"), b = a("beforeUpload"), _ = a("customRequest"), F = a("getOssAccess"), j = a("maxSizeErrorMsg"), $ = a("maxCountErrorMsg"), G = a("acceptErrorMsg"), T = a("onRemove"), C = a("showUploadErrorMsg"), n = a("value"), i = [], f = a("needName"), d = Y(null);
18
- Z(
19
- () => n?.value,
17
+ ), { t: l } = xe(), { b: O } = ye("ap-upload-multiple-file"), P = me("ap-upload"), { put: V } = de(), q = a("dirName"), j = a("baseDirName"), k = a("accept") || "*", E = a("maxSize") ?? 500, $ = a("title") || l("ap.apUpload.uploadFile"), f = a("subTitle"), i = a("maxCount") ?? 10, d = a("uploadingCount"), _ = a("beforeUpload"), F = a("customRequest"), g = a("getOssAccess"), G = a("maxSizeErrorMsg"), W = a("maxCountErrorMsg"), H = a("acceptErrorMsg"), T = a("onRemove"), C = a("showUploadErrorMsg"), A = a("bucket"), r = a("value"), c = [], h = a("needName"), m = Z(null);
18
+ ee(
19
+ () => r?.value,
20
20
  function(e) {
21
- !d?.value?.fileList?.length && e && A(e);
21
+ !m?.value?.fileList?.length && e && R(e);
22
22
  },
23
23
  { immediate: !0 }
24
24
  );
25
- function A(e) {
25
+ function R(e) {
26
26
  if (!e) {
27
- u = [], d.value.fileList = [], n.value = void 0, i.splice(0, i.length);
27
+ u = [], m.value.fileList = [], r.value = void 0, c.splice(0, c.length);
28
28
  return;
29
29
  }
30
- ee(() => {
30
+ oe(() => {
31
31
  const o = e.map((t) => {
32
- const h = ge(f, t), Q = he(f, t), v = new File(
32
+ const s = he(h, t), M = ve(h, t), w = new File(
33
33
  [t],
34
- Q,
34
+ M,
35
35
  {}
36
36
  );
37
- return v.response = h, v.uid = h, v.status = "done", v;
37
+ return w.response = s, w.uid = s, w.status = "done", w;
38
38
  });
39
- if (l && o.length > l) {
40
- c.warning(
41
- r("ap.apUpload.fileInitializationException", {
42
- maxCount: l
39
+ if (i && o.length > i) {
40
+ p.warning(
41
+ l("ap.apUpload.fileInitializationException", {
42
+ maxCount: i
43
43
  })
44
44
  );
45
45
  return;
46
46
  }
47
47
  o.forEach((t) => {
48
- u.push(t), i.push({
48
+ u.push(t), c.push({
49
49
  uid: t.uid,
50
50
  path: t.response
51
51
  });
52
- }), d.value.fileList = o, n.value = e;
52
+ }), m.value.fileList = o, r.value = e;
53
53
  });
54
54
  }
55
- z({ setValue: A });
56
- let u = [], R;
57
- function g(e) {
55
+ D({ setValue: R });
56
+ let u = [], I;
57
+ function v(e) {
58
58
  setTimeout(() => {
59
- const o = d.value.fileList.findIndex(
59
+ const o = m.value.fileList.findIndex(
60
60
  (t) => t.uid === e.uid
61
61
  );
62
- o >= 0 && d.value.fileList.splice(o, 1);
62
+ o >= 0 && m.value.fileList.splice(o, 1);
63
63
  });
64
64
  }
65
- async function W(e) {
66
- if (l && l > 1 && u.length >= l)
67
- return clearTimeout(R), R = setTimeout(() => {
68
- c.warning(
69
- $ || r("ap.apUpload.maxUploadFiles", {
70
- maxCount: l
65
+ async function J(e) {
66
+ if (i && i > 1 && u.length >= i)
67
+ return clearTimeout(I), I = setTimeout(() => {
68
+ p.warning(
69
+ W || l("ap.apUpload.maxUploadFiles", {
70
+ maxCount: i
71
71
  })
72
72
  );
73
- }), g(e), !1;
74
- if (e.size > N * 1024 * 1024)
75
- return c.warning(
76
- j || r("ap.apUpload.maxUploadFileSize", {
77
- maxSize: N
73
+ }), v(e), !1;
74
+ if (e.size > E * 1024 * 1024)
75
+ return p.warning(
76
+ G || l("ap.apUpload.maxUploadFileSize", {
77
+ maxSize: E
78
78
  })
79
- ), g(e), !1;
80
- if (!me(e, y))
81
- return c.warning(
82
- G || r("ap.apUpload.fileFormatNotSupported")
83
- ), g(e), !1;
84
- if (typeof b == "function" && await b(e) === !1)
85
- return g(e), !1;
86
- l && l === 1 && (u = [], n.value = void 0), u.push(e);
79
+ ), v(e), !1;
80
+ if (!fe(e, k))
81
+ return p.warning(
82
+ H || l("ap.apUpload.fileFormatNotSupported")
83
+ ), v(e), !1;
84
+ if (typeof _ == "function" && await _(e) === !1)
85
+ return v(e), !1;
86
+ i && i === 1 && (u = [], r.value = void 0), u.push(e);
87
87
  }
88
- async function H(e) {
89
- if (p.value++, typeof _ == "function") {
90
- _({
88
+ async function K(e) {
89
+ if (d.value++, typeof F == "function") {
90
+ F({
91
91
  onProgress: (o) => {
92
92
  setTimeout(() => {
93
93
  e.onProgress({
@@ -96,70 +96,71 @@ const ye = { class: "multiple-file-context" }, Ce = { key: 0 }, Ue = { key: 1 },
96
96
  });
97
97
  },
98
98
  onError: (o) => {
99
- C && c.warning(o || r("ap.apUpload.networkAnomaly")), setTimeout(() => {
99
+ C && p.warning(o || l("ap.apUpload.networkAnomaly")), setTimeout(() => {
100
100
  e.onError({
101
101
  name: o,
102
102
  message: o
103
103
  });
104
- }), p.value--;
104
+ }), d.value--;
105
105
  },
106
106
  onSuccess: (o) => {
107
107
  setTimeout(() => {
108
108
  e.onSuccess(o);
109
- }), n.value = [
110
- ...n.value || [],
111
- L(f, o, e.file.name)
112
- ], i.push({
109
+ }), r.value = [
110
+ ...r.value || [],
111
+ B(h, o, e.file.name)
112
+ ], c.push({
113
113
  uid: e.file.uid,
114
114
  path: o
115
- }), p.value--;
115
+ }), d.value--;
116
116
  },
117
117
  file: e.file
118
118
  });
119
119
  return;
120
120
  }
121
121
  try {
122
- const o = await S(F);
123
- e.file.oss = o, O({
122
+ const o = await (A ? g(A) : g()), t = await z(async () => o);
123
+ e.file.oss = t, V({
124
124
  file: e.file,
125
- dirName: P,
126
- oss: o,
127
- successCallBack(t) {
128
- e.onSuccess(t), n.value = [
129
- ...n.value || [],
130
- L(f, t, e.file.name)
131
- ], i.push({
125
+ dirName: q,
126
+ oss: t,
127
+ successCallBack(s) {
128
+ e.onSuccess(s), r.value = [
129
+ ...r.value || [],
130
+ B(h, s, e.file.name)
131
+ ], c.push({
132
132
  uid: e.file.uid,
133
- path: t
134
- }), p.value--;
133
+ path: s
134
+ }), d.value--;
135
135
  },
136
- errorCallBack(t) {
137
- C && c.warning(t || r("ap.apUpload.networkAnomaly")), e.onError({
138
- name: t,
139
- message: t
140
- }), p.value--;
136
+ errorCallBack(s) {
137
+ C && p.warning(s || l("ap.apUpload.networkAnomaly")), e.onError({
138
+ name: s,
139
+ message: s
140
+ }), d.value--;
141
141
  },
142
- progressCallBack(t) {
142
+ progressCallBack(s) {
143
143
  e.onProgress({
144
- percent: t
144
+ percent: s
145
145
  });
146
146
  },
147
- baseDirName: V
147
+ baseDirName: j,
148
+ bucket: o?.bucket
148
149
  });
149
150
  } catch (o) {
150
- C && c.warning(
151
- typeof o?.message == "string" ? o.message : r("ap.apUpload.networkAnomaly")
151
+ C && p.warning(
152
+ typeof o?.message == "string" ? o.message : l("ap.apUpload.networkAnomaly")
152
153
  ), e.onError({
153
- name: o?.message || r("ap.apUpload.networkAnomaly"),
154
- message: o?.message || r("ap.apUpload.networkAnomaly")
155
- }), p.value--;
154
+ name: o?.message || l("ap.apUpload.networkAnomaly"),
155
+ message: o?.message || l("ap.apUpload.networkAnomaly")
156
+ }), d.value--;
156
157
  }
157
158
  }
158
- function J(e) {
159
+ function Q(e) {
159
160
  if (T && T?.(e), e.response) {
160
- if (Array.isArray(n.value)) {
161
- const t = i.findIndex((h) => h.uid === e.uid);
162
- t >= 0 && (n?.value.splice(t, 1), i.splice(t, 1)), n.value.length === 0 && (n.value = void 0);
161
+ if (Array.isArray(r.value)) {
162
+ const t = c.findIndex((s) => s.uid === e.uid);
163
+ t >= 0 && (r?.value.splice(t, 1), c.splice(t, 1)), r.value.length === 0 && (r.value = void 0);
163
164
  }
164
165
  } else
165
166
  e?.oss?.pauseUpload();
@@ -168,64 +169,68 @@ const ye = { class: "multiple-file-context" }, Ce = { key: 0 }, Ue = { key: 1 },
168
169
  );
169
170
  return u.splice(o, 1), Promise.resolve(!0);
170
171
  }
171
- const K = async (e) => {
172
- if (E.value?.trigger) {
172
+ const X = async (e) => {
173
+ if (N.value?.trigger) {
173
174
  let o = [e].map((t) => ({
174
175
  objectName: t.response,
175
176
  fileName: t.name
176
177
  }));
177
- E.value?.trigger?.(o);
178
- } else
179
- (await S(F)).downloadFile([
178
+ N.value?.trigger?.(o);
179
+ } else {
180
+ const o = e.response?.match(/^([^:]+):(.*)$/), t = o?.[1], s = o?.[2] ?? e.response;
181
+ (await z(
182
+ () => t ? g?.(t) : g?.()
183
+ )).downloadFile([
180
184
  {
181
- path: e.response,
185
+ path: s,
182
186
  fileName: e.name
183
187
  }
184
188
  ]);
189
+ }
185
190
  };
186
- return (e, o) => (w(), U("div", {
187
- class: oe({
188
- [s(B)()]: !0,
189
- [s(D) ?? ""]: !0
191
+ return (e, o) => (x(), b("div", {
192
+ class: te({
193
+ [n(O)()]: !0,
194
+ [n(P) ?? ""]: !0
190
195
  })
191
196
  }, [
192
- x(s(ue), {
197
+ y(n(ue), {
193
198
  ref_key: "uploadRef",
194
- ref: d,
195
- accept: s(y),
199
+ ref: m,
200
+ accept: n(k),
196
201
  multiple: "",
197
- "max-count": s(l),
202
+ "max-count": n(i),
198
203
  progress: {
199
204
  strokeWidth: 3,
200
205
  showInfo: !1,
201
206
  strokeColor: "#0070FF"
202
207
  },
203
- "before-upload": W,
204
- "custom-request": H,
208
+ "before-upload": J,
209
+ "custom-request": K,
205
210
  "show-upload-list": { showDownloadIcon: !0, showRemoveIcon: !0 },
206
- onRemove: J,
207
- onDownload: K
211
+ onRemove: Q,
212
+ onDownload: X
208
213
  }, {
209
- downloadIcon: k(() => [
210
- x(s(ie))
214
+ downloadIcon: U(() => [
215
+ y(n(ce))
211
216
  ]),
212
- default: k(() => [
213
- I("div", ye, [
214
- x(s(ce), { class: "file-btn" }, {
215
- default: k(() => [
216
- x(s(le)),
217
- te(" " + M(s(q)), 1)
217
+ default: U(() => [
218
+ S("div", ke, [
219
+ y(n(pe), { class: "file-btn" }, {
220
+ default: U(() => [
221
+ y(n(ie)),
222
+ ae(" " + L(n($)), 1)
218
223
  ]),
219
224
  _: 1
220
225
  }),
221
- I("div", {
226
+ S("div", {
222
227
  class: "sub-title",
223
- onClick: o[0] || (o[0] = ae(() => {
228
+ onClick: o[0] || (o[0] = se(() => {
224
229
  }, ["stop"]))
225
230
  }, [
226
- typeof s(m) == "string" ? (w(), U("div", Ce, M(s(m) || `${s(r)("ap.apUpload.supportExtension")}:${s(fe)(s(y))}`), 1)) : s(m) ? (w(), U("div", Ue, [
227
- (w(), ne(re(s(m))))
228
- ])) : se("", !0)
231
+ typeof n(f) == "string" ? (x(), b("div", Ce, L(n(f) || `${n(l)("ap.apUpload.supportExtension")}:${n(ge)(n(k))}`), 1)) : n(f) ? (x(), b("div", be, [
232
+ (x(), re(le(n(f))))
233
+ ])) : ne("", !0)
229
234
  ])
230
235
  ])
231
236
  ]),
@@ -235,5 +240,5 @@ const ye = { class: "multiple-file-context" }, Ce = { key: 0 }, Ue = { key: 1 },
235
240
  }
236
241
  });
237
242
  export {
238
- Le as default
243
+ ze as default
239
244
  };