@aplus-frontend/ui 7.10.3 → 7.10.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/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-attachment/ApAttachment.d.ts +2 -8
  5. package/es/src/business/ap-attachment/ApAttachment.mjs +46 -40
  6. package/es/src/business/ap-attachment/constans.d.ts +1 -4
  7. package/es/src/business/ap-attachment/constans.mjs +3 -6
  8. package/es/src/business/ap-attachment/index.d.ts +3 -12
  9. package/es/src/business/ap-download/ap-download.vue.d.ts +2 -1
  10. package/es/src/business/ap-download/ap-download.vue.mjs +10 -10
  11. package/es/src/business/ap-image/ApImage.vue2.mjs +49 -46
  12. package/es/src/business/ap-image/hooks/useOss.d.ts +1 -1
  13. package/es/src/business/ap-image/hooks/useOss.mjs +30 -28
  14. package/es/src/business/ap-image/interface.d.ts +1 -1
  15. package/es/src/business/ap-ladder/components/RenderValue.mjs +25 -22
  16. package/es/src/business/ap-ladder/utils.d.ts +1 -0
  17. package/es/src/business/ap-ladder/utils.mjs +10 -9
  18. package/es/src/business/ap-title/ApTitle.vue.d.ts +1 -1
  19. package/es/src/business/ap-title/index.d.ts +3 -3
  20. package/es/src/business/ap-title/interface.d.ts +1 -1
  21. package/es/src/business/ap-upload/apUpload.vue.d.ts +10 -1
  22. package/es/src/business/ap-upload/apUpload.vue.mjs +22 -18
  23. package/es/src/business/ap-upload/components/MultipleFile.vue2.mjs +128 -123
  24. package/es/src/business/ap-upload/components/Picture.vue2.mjs +150 -147
  25. package/es/src/business/ap-upload/components/SingleFile.vue2.mjs +130 -127
  26. package/es/src/business/ap-upload/hooks/useOss.d.ts +2 -1
  27. package/es/src/business/ap-upload/hooks/useOss.mjs +52 -51
  28. package/es/src/business/ap-upload-file/ap-upload-single/ap-upload-single.vue.mjs +11 -10
  29. package/es/src/business/ap-upload-file/hook/useOss.d.ts +6 -1
  30. package/es/src/business/ap-upload-file/hook/useOss.mjs +19 -16
  31. package/es/src/business/ap-upload-file/interface.d.ts +3 -1
  32. package/es/src/business/ap-upload-file/utils/upload.mjs +22 -20
  33. package/es/src/config-provider/constants.d.ts +2 -2
  34. package/es/src/version.d.ts +1 -1
  35. package/es/src/version.mjs +1 -1
  36. package/lib/src/ap-field/interface.d.ts +1 -1
  37. package/lib/src/ap-field/slider/index.vue.d.ts +196 -412
  38. package/lib/src/ap-field/slider/index.vue.js +1 -1
  39. package/lib/src/business/ap-attachment/ApAttachment.d.ts +2 -8
  40. package/lib/src/business/ap-attachment/ApAttachment.js +1 -1
  41. package/lib/src/business/ap-attachment/constans.d.ts +1 -4
  42. package/lib/src/business/ap-attachment/constans.js +1 -1
  43. package/lib/src/business/ap-attachment/index.d.ts +3 -12
  44. package/lib/src/business/ap-download/ap-download.vue.d.ts +2 -1
  45. package/lib/src/business/ap-download/ap-download.vue.js +1 -1
  46. package/lib/src/business/ap-image/ApImage.vue2.js +1 -1
  47. package/lib/src/business/ap-image/hooks/useOss.d.ts +1 -1
  48. package/lib/src/business/ap-image/hooks/useOss.js +1 -1
  49. package/lib/src/business/ap-image/interface.d.ts +1 -1
  50. package/lib/src/business/ap-ladder/components/RenderValue.js +1 -1
  51. package/lib/src/business/ap-ladder/utils.d.ts +1 -0
  52. package/lib/src/business/ap-ladder/utils.js +1 -1
  53. package/lib/src/business/ap-title/ApTitle.vue.d.ts +1 -1
  54. package/lib/src/business/ap-title/index.d.ts +3 -3
  55. package/lib/src/business/ap-title/interface.d.ts +1 -1
  56. package/lib/src/business/ap-upload/apUpload.vue.d.ts +10 -1
  57. package/lib/src/business/ap-upload/apUpload.vue.js +1 -1
  58. package/lib/src/business/ap-upload/components/MultipleFile.vue2.js +1 -1
  59. package/lib/src/business/ap-upload/components/Picture.vue2.js +1 -1
  60. package/lib/src/business/ap-upload/components/SingleFile.vue2.js +1 -1
  61. package/lib/src/business/ap-upload/hooks/useOss.d.ts +2 -1
  62. package/lib/src/business/ap-upload/hooks/useOss.js +1 -1
  63. package/lib/src/business/ap-upload-file/ap-upload-single/ap-upload-single.vue.js +1 -1
  64. package/lib/src/business/ap-upload-file/hook/useOss.d.ts +6 -1
  65. package/lib/src/business/ap-upload-file/hook/useOss.js +1 -1
  66. package/lib/src/business/ap-upload-file/interface.d.ts +3 -1
  67. package/lib/src/business/ap-upload-file/utils/upload.js +1 -1
  68. package/lib/src/config-provider/constants.d.ts +2 -2
  69. package/lib/src/version.d.ts +1 -1
  70. package/lib/src/version.js +1 -1
  71. package/package.json +3 -3
@@ -1,228 +1,231 @@
1
- import { defineComponent as se, inject as o, ref as g, watch as re, computed as ie, createElementBlock as N, openBlock as h, normalizeClass as ce, unref as t, createElementVNode as r, createCommentVNode as E, toDisplayString as b, normalizeStyle as ue, createBlock as pe, withModifiers as de, createVNode as ve } from "vue";
2
- import { DeleteOutlined as fe } from "@ant-design/icons-vue";
3
- import { message as c, Progress as me } from "@aplus-frontend/antdv";
1
+ import { defineComponent as re, inject as o, ref as h, watch as ce, computed as ie, createElementBlock as S, openBlock as k, normalizeClass as ue, unref as a, createElementVNode as r, createCommentVNode as E, toDisplayString as x, normalizeStyle as pe, createBlock as de, withModifiers as ve, createVNode as fe } from "vue";
2
+ import { DeleteOutlined as me } from "@ant-design/icons-vue";
3
+ import { message as p, Progress as ge } from "@aplus-frontend/antdv";
4
4
  import "../../../config-provider/index.mjs";
5
- import { useToken as ge } from "../../../config-provider/hooks/use-token.mjs";
6
- import $ from "../assets/single-file-icon.png.mjs";
7
- import { useOss as he, useOssInit as _e } from "../hooks/useOss.mjs";
8
- import ke from "../style/index.mjs";
9
- import { fileMatchesAccept as ye, getAcceptText as we } from "../utils/accept.mjs";
10
- import { getName as Ue, getReturnData as q } from "../utils/returnData.mjs";
11
- import { useLocale as De } from "../../../config-provider/hooks/use-locale.mjs";
12
- import { useNamespace as Ce } from "../../../config-provider/hooks/use-namespace.mjs";
13
- const Fe = ["accept"], Se = {
5
+ import { useToken as he } from "../../../config-provider/hooks/use-token.mjs";
6
+ import j from "../assets/single-file-icon.png.mjs";
7
+ import { useOss as ke, getOssInstance as _e } from "../hooks/useOss.mjs";
8
+ import ye from "../style/index.mjs";
9
+ import { fileMatchesAccept as we, getAcceptText as Ue } from "../utils/accept.mjs";
10
+ import { getName as De, getReturnData as G } from "../utils/returnData.mjs";
11
+ import { useLocale as Ce } from "../../../config-provider/hooks/use-locale.mjs";
12
+ import { useNamespace as be } from "../../../config-provider/hooks/use-namespace.mjs";
13
+ const Fe = ["accept"], Ne = {
14
14
  key: 0,
15
15
  class: "state-un"
16
- }, Ne = ["src"], Ee = { class: "state-un-title" }, be = { class: "state-un-subtitle" }, xe = {
16
+ }, Se = ["src"], Ee = { class: "state-un-title" }, xe = { class: "state-un-subtitle" }, ze = {
17
17
  key: 1,
18
18
  class: "state-ing"
19
- }, ze = { class: "left" }, Ae = ["src"], Re = { class: "center" }, Be = { class: "center-progress" }, Je = /* @__PURE__ */ se({
19
+ }, Ae = { class: "left" }, Re = ["src"], Be = { class: "center" }, Me = { class: "center-progress" }, Ke = /* @__PURE__ */ re({
20
20
  __name: "SingleFile",
21
- setup(Me, { expose: j }) {
22
- const { t: s } = De(), { b: x } = Ce("ap-upload-single-file"), G = ke("ap-upload"), { put: W, client: z } = he(), H = o("dirName"), J = o("baseDirName"), _ = o("accept") || "*", k = o("maxSize") ?? 500, K = o("title") || s("ap.apUpload.clickOrDragUpload"), y = o("subTitle"), { token: A } = ge(), i = o("value"), w = o("needName"), u = o("uploadingCount"), R = o("beforeUpload"), B = o("customRequest"), Q = o("getOssAccess"), X = o("maxSizeErrorMsg"), Y = o("acceptErrorMsg"), M = o("onRemove"), U = o("showUploadErrorMsg"), l = g(null);
23
- re(
24
- () => i?.value,
21
+ setup(Pe, { expose: W }) {
22
+ const { t: s } = Ce(), { b: z } = be("ap-upload-single-file"), H = ye("ap-upload"), { put: J } = ke(), K = o("dirName"), Q = o("baseDirName"), _ = o("accept") || "*", y = o("maxSize") ?? 500, X = o("title") || s("ap.apUpload.clickOrDragUpload"), w = o("subTitle"), { token: A } = he(), c = o("value"), U = o("needName"), d = o("uploadingCount"), R = o("beforeUpload"), B = o("customRequest"), M = o("getOssAccess"), Y = o("maxSizeErrorMsg"), Z = o("acceptErrorMsg"), P = o("onRemove"), D = o("showUploadErrorMsg"), T = o("bucket"), n = h(null);
23
+ let O;
24
+ ce(
25
+ () => c?.value,
25
26
  function(e) {
26
- l.value === null && e && P(e);
27
+ n.value === null && e && L(e);
27
28
  },
28
29
  { immediate: !0 }
29
30
  );
30
- function P(e) {
31
+ function L(e) {
31
32
  e ? setTimeout(() => {
32
- const a = Ue(w, e);
33
- n.value = 3, l.value = new File([e], a, {}), i.value = e;
34
- }) : (n.value = 1, l.value = null, i.value = void 0);
33
+ const t = De(U, e);
34
+ l.value = 3, n.value = new File([e], t, {}), c.value = e;
35
+ }) : (l.value = 1, n.value = null, c.value = void 0);
35
36
  }
36
- j({ setValue: P });
37
- const n = g(1), d = g(0), v = g(null), T = ie(() => l.value && i?.value);
38
- function Z() {
39
- n.value === 1 && v.value?.click();
37
+ W({ setValue: L });
38
+ const l = h(1), f = h(0), m = h(null), V = ie(() => n.value && c?.value);
39
+ function ee() {
40
+ l.value === 1 && m.value?.click();
40
41
  }
41
- function O(e) {
42
+ function I(e) {
42
43
  e.preventDefault(), e.stopPropagation();
43
44
  }
44
- function ee(e) {
45
+ function te(e) {
45
46
  e.dataTransfer.dropEffect = "copy", e.preventDefault(), e.stopPropagation();
46
47
  }
47
48
  function ae(e) {
48
- L(e);
49
+ $(e);
49
50
  }
50
- function te(e) {
51
- if (e.preventDefault(), e.stopPropagation(), n.value !== 1)
51
+ function oe(e) {
52
+ if (e.preventDefault(), e.stopPropagation(), l.value !== 1)
52
53
  return;
53
- var a = e.dataTransfer, f = [], V = 0, I = a.files.length;
54
- function p() {
55
- V === I - 1 && ae(f), V++;
54
+ var t = e.dataTransfer, u = [], i = 0, q = t.files.length;
55
+ function v() {
56
+ i === q - 1 && ae(u), i++;
56
57
  }
57
- if (a.items !== void 0)
58
- for (var D = 0; D < a.items.length; D++) {
59
- var C = a.items[D];
60
- if (C.kind === "file" && C.webkitGetAsEntry().isFile) {
61
- var ne = C.getAsFile();
62
- f.push(ne), p();
58
+ if (t.items !== void 0)
59
+ for (var C = 0; C < t.items.length; C++) {
60
+ var b = t.items[C];
61
+ if (b.kind === "file" && b.webkitGetAsEntry().isFile) {
62
+ var se = b.getAsFile();
63
+ u.push(se), v();
63
64
  }
64
65
  }
65
66
  else
66
- for (let S = 0; S < I; S++) {
67
- var m = a.files[S];
68
- if (m.type)
69
- f.push(m), p();
67
+ for (let N = 0; N < q; N++) {
68
+ var g = t.files[N];
69
+ if (g.type)
70
+ u.push(g), v();
70
71
  else
71
72
  try {
72
73
  var F = new FileReader();
73
- F.readAsDataURL(m.slice(0, 3)), F.addEventListener(
74
+ F.readAsDataURL(g.slice(0, 3)), F.addEventListener(
74
75
  "load",
75
76
  function() {
76
- f.push(m), p();
77
+ u.push(g), v();
77
78
  },
78
79
  !1
79
80
  ), F.addEventListener(
80
81
  "error",
81
82
  function() {
82
- c.warning(s("ap.apUpload.foldersNotSupported")), p();
83
+ p.warning(s("ap.apUpload.foldersNotSupported")), v();
83
84
  },
84
85
  !1
85
86
  );
86
87
  } catch {
87
- c.warning(s("ap.apUpload.foldersNotSupported")), p();
88
+ p.warning(s("ap.apUpload.foldersNotSupported")), v();
88
89
  }
89
90
  }
90
91
  }
91
- async function oe(e) {
92
- const a = e.target;
93
- await L(a?.files), v.value && (v.value.value = "");
92
+ async function ne(e) {
93
+ const t = e.target;
94
+ await $(t?.files), m.value && (m.value.value = "");
94
95
  }
95
- async function L(e) {
96
+ async function $(e) {
96
97
  if (e?.length) {
97
- if (e[0].size > k * 1024 * 1024) {
98
- c.warning(
99
- X || s("ap.apUpload.maxUploadFileSize", {
100
- maxSize: k
98
+ if (e[0].size > y * 1024 * 1024) {
99
+ p.warning(
100
+ Y || s("ap.apUpload.maxUploadFileSize", {
101
+ maxSize: y
101
102
  })
102
103
  );
103
104
  return;
104
105
  }
105
- if (!ye(e[0], _)) {
106
- c.warning(
107
- Y || s("ap.apUpload.fileFormatNotSupported")
106
+ if (!we(e[0], _)) {
107
+ p.warning(
108
+ Z || s("ap.apUpload.fileFormatNotSupported")
108
109
  );
109
110
  return;
110
111
  }
111
112
  if (typeof R == "function" && await R(e[0]) === !1)
112
113
  return;
113
- if (l.value = e[0], n.value = 2, d.value = 0, u.value++, typeof B == "function") {
114
+ if (n.value = e[0], l.value = 2, f.value = 0, d.value++, typeof B == "function") {
114
115
  B({
115
- onProgress: (a) => {
116
- d.value = a;
116
+ onProgress: (t) => {
117
+ f.value = t;
117
118
  },
118
- onError: (a) => {
119
- U && c.warning(a || s("ap.apUpload.networkAnomaly")), n.value = 1, l.value = null, u.value--;
119
+ onError: (t) => {
120
+ D && p.warning(t || s("ap.apUpload.networkAnomaly")), l.value = 1, n.value = null, d.value--;
120
121
  },
121
- onSuccess: (a) => {
122
- i.value = q(
123
- w,
124
- a,
125
- l.value.name
126
- ), n.value = 3, u.value--;
122
+ onSuccess: (t) => {
123
+ c.value = G(
124
+ U,
125
+ t,
126
+ n.value.name
127
+ ), l.value = 3, d.value--;
127
128
  },
128
129
  file: e[0]
129
130
  });
130
131
  return;
131
132
  }
132
133
  try {
133
- await _e(Q), W({
134
- file: l.value,
135
- dirName: H,
136
- oss: z,
137
- successCallBack(a) {
138
- i.value = q(
139
- w,
140
- a,
141
- l.value.name
142
- ), n.value = 3, u.value--;
134
+ const t = await (T ? M(T) : M()), u = await _e(async () => t);
135
+ O = u, J({
136
+ file: n.value,
137
+ dirName: K,
138
+ oss: u,
139
+ successCallBack(i) {
140
+ c.value = G(
141
+ U,
142
+ i,
143
+ n.value.name
144
+ ), l.value = 3, d.value--;
143
145
  },
144
- errorCallBack(a) {
145
- U && c.warning(a || s("ap.apUpload.networkAnomaly")), n.value = 1, l.value = null, u.value--;
146
+ errorCallBack(i) {
147
+ D && p.warning(i || s("ap.apUpload.networkAnomaly")), l.value = 1, n.value = null, d.value--;
146
148
  },
147
- progressCallBack(a) {
148
- d.value = a;
149
+ progressCallBack(i) {
150
+ f.value = i;
149
151
  },
150
- baseDirName: J
152
+ baseDirName: Q,
153
+ bucket: t?.bucket
151
154
  });
152
- } catch (a) {
153
- U && c.warning(
154
- typeof a?.message == "string" ? a.message : s("ap.apUpload.networkAnomaly")
155
- ), n.value = 1, l.value = null, u.value--;
155
+ } catch (t) {
156
+ D && p.warning(
157
+ typeof t?.message == "string" ? t.message : s("ap.apUpload.networkAnomaly")
158
+ ), l.value = 1, n.value = null, d.value--;
156
159
  }
157
160
  }
158
161
  }
159
162
  function le() {
160
- M && M?.(l.value), l.value && !i?.value && z.pauseUpload(), n.value = 1, l.value = null, i.value = void 0;
163
+ P && P?.(n.value), n.value && !c?.value && O?.pauseUpload?.(), l.value = 1, n.value = null, c.value = void 0;
161
164
  }
162
- return (e, a) => (h(), N("div", {
163
- class: ce({
164
- [t(x)()]: !0,
165
- [t(x)("un")]: n.value === 1,
166
- [t(G) ?? ""]: !0
165
+ return (e, t) => (k(), S("div", {
166
+ class: ue({
167
+ [a(z)()]: !0,
168
+ [a(z)("un")]: l.value === 1,
169
+ [a(H) ?? ""]: !0
167
170
  }),
168
- onClick: Z,
169
- onDragenter: O,
170
- onDragover: ee,
171
- onDragleave: O,
172
- onDrop: te
171
+ onClick: ee,
172
+ onDragenter: I,
173
+ onDragover: te,
174
+ onDragleave: I,
175
+ onDrop: oe
173
176
  }, [
174
177
  r("input", {
175
178
  ref_key: "fileRef",
176
- ref: v,
179
+ ref: m,
177
180
  style: { display: "none" },
178
181
  type: "file",
179
- accept: t(_),
180
- onChange: oe
182
+ accept: a(_),
183
+ onChange: ne
181
184
  }, null, 40, Fe),
182
- n.value === 1 ? (h(), N("div", Se, [
185
+ l.value === 1 ? (k(), S("div", Ne, [
183
186
  r("img", {
184
187
  class: "state-un-icon",
185
- src: t($)
186
- }, null, 8, Ne),
187
- r("div", Ee, b(t(K)), 1),
188
- r("div", be, b(typeof t(y) == "string" && t(y).length > 0 ? t(y) : `${t(s)("ap.apUpload.supportExtension")}:${t(we)(
189
- t(_)
190
- )},${t(s)("ap.apUpload.maxWarnUploadFileSize", {
191
- maxSize: t(k)
188
+ src: a(j)
189
+ }, null, 8, Se),
190
+ r("div", Ee, x(a(X)), 1),
191
+ r("div", xe, x(typeof a(w) == "string" && a(w).length > 0 ? a(w) : `${a(s)("ap.apUpload.supportExtension")}:${a(Ue)(
192
+ a(_)
193
+ )},${a(s)("ap.apUpload.maxWarnUploadFileSize", {
194
+ maxSize: a(y)
192
195
  })}`), 1)
193
196
  ])) : E("", !0),
194
- [2, 3].includes(n.value) ? (h(), N("div", xe, [
195
- r("div", ze, [
196
- r("img", { src: t($) }, null, 8, Ae)
197
+ [2, 3].includes(l.value) ? (k(), S("div", ze, [
198
+ r("div", Ae, [
199
+ r("img", { src: a(j) }, null, 8, Re)
197
200
  ]),
198
- r("div", Re, [
201
+ r("div", Be, [
199
202
  r("div", {
200
203
  class: "center-title",
201
- style: ue({
202
- color: T.value ? "#0070FF" : "#182948"
204
+ style: pe({
205
+ color: V.value ? "#0070FF" : "#182948"
203
206
  })
204
- }, b(l.value?.name), 5),
205
- r("div", Be, [
206
- T.value ? E("", !0) : (h(), pe(t(me), {
207
+ }, x(n.value?.name), 5),
208
+ r("div", Me, [
209
+ V.value ? E("", !0) : (k(), de(a(ge), {
207
210
  key: 0,
208
- percent: d.value,
211
+ percent: f.value,
209
212
  size: 4,
210
213
  "show-info": !1,
211
- "trail-color": t(A).borderColorBase,
212
- "stroke-color": t(A).colorPrimary
214
+ "trail-color": a(A).borderColorBase,
215
+ "stroke-color": a(A).colorPrimary
213
216
  }, null, 8, ["percent", "trail-color", "stroke-color"]))
214
217
  ])
215
218
  ]),
216
219
  r("div", {
217
220
  class: "right",
218
- onClick: de(le, ["stop"])
221
+ onClick: ve(le, ["stop"])
219
222
  }, [
220
- ve(t(fe))
223
+ fe(a(me))
221
224
  ])
222
225
  ])) : E("", !0)
223
226
  ], 34));
224
227
  }
225
228
  });
226
229
  export {
227
- Je as default
230
+ Ke as default
228
231
  };
@@ -4,7 +4,7 @@ import { Translator } from '../../../config-provider';
4
4
  export type { Oss } from '@aplus-frontend/oss';
5
5
  export type GetOssAccess = () => Promise<accessCreate>;
6
6
  export declare function injectLocaleToOss(tValue: Translator, langValue: Ref<string>): void;
7
- declare function put({ file, dirName, oss, successCallBack, errorCallBack, progressCallBack, baseDirName }: {
7
+ declare function put({ file, dirName, oss, successCallBack, errorCallBack, progressCallBack, baseDirName, bucket }: {
8
8
  file: File;
9
9
  dirName: string;
10
10
  oss: Oss;
@@ -12,6 +12,7 @@ declare function put({ file, dirName, oss, successCallBack, errorCallBack, progr
12
12
  errorCallBack: (msg: string) => void;
13
13
  progressCallBack: (p: number) => void;
14
14
  baseDirName?: string;
15
+ bucket?: string;
15
16
  }): Promise<void>;
16
17
  export declare function useOss(): {
17
18
  client: Oss;
@@ -1,82 +1,83 @@
1
- import { client as i, createOssInstance as w } from "@aplus-frontend/oss";
2
- let n, l;
3
- function U(e, s) {
4
- n = e, l = s;
1
+ import { client as l, createOssInstance as d } from "@aplus-frontend/oss";
2
+ let n, p;
3
+ function F(s, e) {
4
+ n = s, p = e;
5
5
  }
6
- const g = {
6
+ const O = {
7
7
  "zh-cn": "zh_CN",
8
8
  en: "en_US"
9
9
  };
10
- function p() {
11
- return g[l.value] ?? "zh_CN";
10
+ function c() {
11
+ return O[p.value] ?? "zh_CN";
12
12
  }
13
- async function d({
14
- file: e,
15
- dirName: s,
16
- oss: t,
17
- successCallBack: c,
18
- errorCallBack: o,
19
- progressCallBack: u,
20
- baseDirName: f = "Frontend-Upload"
13
+ async function U({
14
+ file: s,
15
+ dirName: e,
16
+ oss: o,
17
+ successCallBack: u,
18
+ errorCallBack: r,
19
+ progressCallBack: f,
20
+ baseDirName: m = "Frontend-Upload",
21
+ bucket: i
21
22
  }) {
22
- if (!s) {
23
- o("required dirName");
23
+ if (!e) {
24
+ r("required dirName");
24
25
  return;
25
26
  }
26
27
  try {
27
- const a = await t.put({
28
- fileName: e.name,
29
- dirName: s,
30
- data: e,
31
- progressCallBack: (r) => {
32
- u(r);
28
+ const a = await o.put({
29
+ fileName: s.name,
30
+ dirName: e,
31
+ data: s,
32
+ progressCallBack: (t) => {
33
+ f(t);
33
34
  },
34
- baseDirName: f
35
+ baseDirName: m
35
36
  });
36
37
  if (a.status === 204)
37
38
  return;
38
39
  if (a.status === 200) {
39
- const { saveUrl: r, previewUrl: m } = a;
40
- c(r, m);
40
+ const { saveUrl: t, previewUrl: w } = a, g = i && t ? `${i}:${t}` : t;
41
+ u(g, w);
41
42
  } else
42
- o(a?.message || n("ap.apUpload.networkAnomaly"));
43
+ r(a?.message || n("ap.apUpload.networkAnomaly"));
43
44
  } catch (a) {
44
- o(a);
45
+ r(a);
45
46
  }
46
47
  }
47
- function O() {
48
- return { client: i, put: d };
48
+ function y() {
49
+ return { client: l, put: U };
49
50
  }
50
- async function h(e) {
51
- if (!e)
51
+ async function T(s) {
52
+ if (!s)
52
53
  throw new Error(`${n("ap.apUpload.pleasePass")}getOssAccess`);
53
- return await i.initOssClient({
54
- getOssAccess: e,
55
- locale: p(),
56
- onFailure: (s) => {
54
+ return await l.initOssClient({
55
+ getOssAccess: s,
56
+ locale: c(),
57
+ onFailure: (e) => {
57
58
  throw new Error(
58
- typeof s?.message == "string" ? s.message : n("ap.apUpload.FailedToObtainOssTemporaryPermissions")
59
+ typeof e?.message == "string" ? e.message : n("ap.apUpload.FailedToObtainOssTemporaryPermissions")
59
60
  );
60
61
  }
61
- }), O();
62
+ }), y();
62
63
  }
63
- async function F(e) {
64
- if (!e)
64
+ async function v(s) {
65
+ if (!s)
65
66
  throw new Error(`${n("ap.apUpload.pleasePass")}getOssAccess`);
66
- const s = w();
67
- return await s.initOssClient({
68
- getOssAccess: e,
69
- locale: p(),
70
- onFailure: (t) => {
67
+ const e = d();
68
+ return await e.initOssClient({
69
+ getOssAccess: s,
70
+ locale: c(),
71
+ onFailure: (o) => {
71
72
  throw new Error(
72
- typeof t?.message == "string" ? t.message : n("ap.apUpload.FailedToObtainOssTemporaryPermissions")
73
+ typeof o?.message == "string" ? o.message : n("ap.apUpload.FailedToObtainOssTemporaryPermissions")
73
74
  );
74
75
  }
75
- }), s;
76
+ }), e;
76
77
  }
77
78
  export {
78
- F as getOssInstance,
79
- U as injectLocaleToOss,
80
- O as useOss,
81
- h as useOssInit
79
+ v as getOssInstance,
80
+ F as injectLocaleToOss,
81
+ y as useOss,
82
+ T as useOssInit
82
83
  };
@@ -1,5 +1,5 @@
1
- import { defineComponent as M, computed as y, createBlock as C, openBlock as u, unref as e, mergeProps as G, withCtx as i, renderSlot as H, normalizeProps as J, guardReactiveProps as K, createElementVNode as s, normalizeClass as l, createElementBlock as v, createVNode as n, createTextVNode as m, toDisplayString as p, resolveDynamicComponent as F, h as N, Fragment as L } from "vue";
2
- import { Form as Q, UploadDragger as W, TypographyParagraph as b, Progress as X, Tooltip as P } from "@aplus-frontend/antdv";
1
+ import { defineComponent as M, computed as b, createBlock as y, openBlock as u, unref as e, mergeProps as G, withCtx as i, renderSlot as H, normalizeProps as J, guardReactiveProps as K, createElementVNode as s, normalizeClass as l, createElementBlock as v, createVNode as n, createTextVNode as m, toDisplayString as p, resolveDynamicComponent as F, h as N, Fragment as L } from "vue";
2
+ import { Form as Q, UploadDragger as W, TypographyParagraph as C, Progress as X, Tooltip as P } from "@aplus-frontend/antdv";
3
3
  import { FormItemInputContext as Y } from "@aplus-frontend/antdv/es/form/FormItemContext";
4
4
  import { omit as Z } from "lodash-unified";
5
5
  import { useToken as ee } from "../../../config-provider/hooks/use-token.mjs";
@@ -26,19 +26,20 @@ const Se = /* @__PURE__ */ M({
26
26
  customRequest: {},
27
27
  maxSizeErrorMsg: {},
28
28
  acceptErrorMsg: {},
29
+ bucket: {},
29
30
  title: { type: [Object, String, Number, Boolean, null, Array] },
30
31
  subTitle: { type: [Object, String, Number, Boolean, null, Array] }
31
32
  },
32
33
  emits: ["update:fileList"],
33
34
  setup(w, { emit: A }) {
34
- const T = Y.useInject(), $ = y(() => T.status), d = w, q = A, B = Q.useInjectFormItemContext(), r = y({
35
+ const T = Y.useInject(), $ = b(() => T.status), d = w, q = A, B = Q.useInjectFormItemContext(), r = b({
35
36
  get() {
36
37
  return d.fileList || [];
37
38
  },
38
39
  set(c) {
39
40
  q("update:fileList", c), B?.onFieldChange();
40
41
  }
41
- }), o = y(() => r.value?.[0]), O = ne("apUpload"), { t: U, lang: j } = ae(), {
42
+ }), o = b(() => r.value?.[0]), O = ne("apUpload"), { t: U, lang: j } = ae(), {
42
43
  title: z,
43
44
  subTitle: R,
44
45
  beforeUpload: E,
@@ -60,7 +61,7 @@ const Se = /* @__PURE__ */ M({
60
61
  "subTitle"
61
62
  ]);
62
63
  }
63
- return (c, a) => (u(), C(e(W), G({
64
+ return (c, a) => (u(), y(e(W), G({
64
65
  ...c.$attrs,
65
66
  ..._(d)
66
67
  }, {
@@ -93,7 +94,7 @@ const Se = /* @__PURE__ */ M({
93
94
  s("div", {
94
95
  class: l([e(t)("content-file-name"), e(t)("content-ing-name")])
95
96
  }, [
96
- n(e(b), {
97
+ n(e(C), {
97
98
  ellipsis: { rows: 2 },
98
99
  tooltip: o.value.error
99
100
  }, {
@@ -133,7 +134,7 @@ const Se = /* @__PURE__ */ M({
133
134
  m(p(o.value?.error || "--"), 1)
134
135
  ]),
135
136
  default: i(() => [
136
- n(e(b), {
137
+ n(e(C), {
137
138
  ellipsis: { rows: 2 },
138
139
  tooltip: o.value.error
139
140
  }, {
@@ -169,7 +170,7 @@ const Se = /* @__PURE__ */ M({
169
170
  m(p(o.value?.name || "--"), 1)
170
171
  ]),
171
172
  default: i(() => [
172
- n(e(b), {
173
+ n(e(C), {
173
174
  ellipsis: { rows: 2 },
174
175
  tooltip: o.value.error
175
176
  }, {
@@ -200,12 +201,12 @@ const Se = /* @__PURE__ */ M({
200
201
  s("div", {
201
202
  class: l([e(t)("content-empty-title")])
202
203
  }, [
203
- (u(), C(F(N(L, [e(z)]))))
204
+ (u(), y(F(N(L, [e(z)]))))
204
205
  ], 2),
205
206
  s("div", {
206
207
  class: l([e(t)("content-empty-sub-title")])
207
208
  }, [
208
- (u(), C(F(N(L, [e(R)]))))
209
+ (u(), y(F(N(L, [e(R)]))))
209
210
  ], 2)
210
211
  ], 2))
211
212
  ], 2)
@@ -5,4 +5,9 @@ import { ApUploadGetOssAccess } from '../interface';
5
5
  export type { Oss } from '@aplus-frontend/oss';
6
6
  export type GetOssAccess = () => Promise<accessCreate>;
7
7
  export declare function injectHookOss(tValue: Translator, langValue: Ref<string>, getOssAccessValue?: ApUploadGetOssAccess): void;
8
- export declare function getOssInstance(): Promise< Oss>;
8
+ export declare function getOssInstance({ bucket }?: {
9
+ bucket?: string;
10
+ }): Promise<{
11
+ oss: Oss;
12
+ bucket: string;
13
+ }>;