@aplus-frontend/ui 6.26.5 → 6.27.0

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 (50) hide show
  1. package/es/src/ag-grid/hooks/use-columns-def.d.ts +2 -2
  2. package/es/src/ag-grid/hooks/use-columns-def.mjs +29 -29
  3. package/es/src/ag-grid/hooks/use-columns.d.ts +1 -1
  4. package/es/src/ag-grid/hooks/use-columns.mjs +8 -8
  5. package/es/src/ag-grid/hooks/use-pinned-row.d.ts +7 -0
  6. package/es/src/ag-grid/hooks/use-pinned-row.mjs +32 -0
  7. package/es/src/ag-grid/index.vue.mjs +251 -228
  8. package/es/src/ag-grid/interface.d.ts +4 -2
  9. package/es/src/ap-form/ap-form.vue.d.ts +2 -8
  10. package/es/src/ap-form/ap-form.vue2.mjs +3 -3
  11. package/es/src/ap-form/hooks/use-watch.mjs +25 -28
  12. package/es/src/ap-form/interface.d.ts +1 -1
  13. package/es/src/ap-upload/apUpload.vue.d.ts +9 -0
  14. package/es/src/ap-upload/apUpload.vue.mjs +38 -34
  15. package/es/src/ap-upload/components/MultipleFile.vue2.mjs +59 -59
  16. package/es/src/ap-upload/components/Picture.vue2.mjs +74 -74
  17. package/es/src/ap-upload/components/SingleFile.vue2.mjs +95 -95
  18. package/es/src/business/ap-value-select-card/index.vue2.mjs +120 -123
  19. package/es/src/business/hooks/usePageListAgGrid.d.ts +1 -1
  20. package/es/src/business/hooks/usePageListAgGrid.mjs +4 -4
  21. package/es/src/business/hooks/usePageListApGrid.mjs +14 -14
  22. package/es/src/version.d.ts +1 -1
  23. package/es/src/version.mjs +1 -1
  24. package/lib/src/ag-grid/hooks/use-columns-def.d.ts +2 -2
  25. package/lib/src/ag-grid/hooks/use-columns-def.js +1 -1
  26. package/lib/src/ag-grid/hooks/use-columns.d.ts +1 -1
  27. package/lib/src/ag-grid/hooks/use-columns.js +1 -1
  28. package/lib/src/ag-grid/hooks/use-pinned-row.d.ts +7 -0
  29. package/lib/src/ag-grid/hooks/use-pinned-row.js +1 -0
  30. package/lib/src/ag-grid/index.vue.js +1 -1
  31. package/lib/src/ag-grid/interface.d.ts +4 -2
  32. package/lib/src/ap-form/ap-form.vue.d.ts +2 -8
  33. package/lib/src/ap-form/ap-form.vue2.js +1 -1
  34. package/lib/src/ap-form/hooks/use-watch.js +1 -1
  35. package/lib/src/ap-form/interface.d.ts +1 -1
  36. package/lib/src/ap-upload/apUpload.vue.d.ts +9 -0
  37. package/lib/src/ap-upload/apUpload.vue.js +1 -1
  38. package/lib/src/ap-upload/components/MultipleFile.vue2.js +1 -1
  39. package/lib/src/ap-upload/components/Picture.vue2.js +1 -1
  40. package/lib/src/ap-upload/components/SingleFile.vue2.js +1 -1
  41. package/lib/src/business/ap-value-select-card/index.vue2.js +1 -1
  42. package/lib/src/business/hooks/usePageListAgGrid.d.ts +1 -1
  43. package/lib/src/business/hooks/usePageListAgGrid.js +1 -1
  44. package/lib/src/business/hooks/usePageListApGrid.js +1 -1
  45. package/lib/src/version.d.ts +1 -1
  46. package/lib/src/version.js +1 -1
  47. package/package.json +1 -1
  48. package/theme/ap-value-select-card/index.css +3 -4
  49. package/theme/ap-value-select-card/index.less +3 -4
  50. package/theme/index.css +3 -4
@@ -1,23 +1,23 @@
1
- import { defineComponent as Y, inject as r, ref as M, watch as Z, nextTick as F, createElementBlock as g, openBlock as v, normalizeClass as ee, unref as o, createElementVNode as d, renderSlot as te, createCommentVNode as $, Fragment as ae, renderList as ne, withDirectives as oe, createVNode as U, vShow as se, toDisplayString as k } from "vue";
1
+ import { defineComponent as Z, inject as r, ref as $, watch as F, nextTick as ee, createElementBlock as g, openBlock as h, normalizeClass as te, unref as o, createElementVNode as d, renderSlot as ae, createCommentVNode as I, Fragment as ne, renderList as oe, withDirectives as se, createVNode as k, vShow as ie, toDisplayString as C } from "vue";
2
2
  import "../../config-provider/index.mjs";
3
- import { getPath as ie, getName as re, getReturnData as I } from "../utils/returnData.mjs";
4
- import { CloseOutlined as ce, PlusOutlined as ue } from "@ant-design/icons-vue";
5
- import { useOss as le, getOssInstance as V } from "../hooks/useOss.mjs";
6
- import { fileMatchesAccept as pe, getAcceptText as de } from "../utils/accept.mjs";
7
- import { message as m, Progress as me } from "@aplus-frontend/antdv";
8
- import { omit as fe } from "lodash-unified";
9
- import { useLocale as ge } from "../../config-provider/hooks/use-locale.mjs";
3
+ import { getPath as re, getName as ce, getReturnData as V } from "../utils/returnData.mjs";
4
+ import { CloseOutlined as ue, PlusOutlined as le } from "@ant-design/icons-vue";
5
+ import { useOss as pe, getOssInstance as T } from "../hooks/useOss.mjs";
6
+ import { fileMatchesAccept as de, getAcceptText as me } from "../utils/accept.mjs";
7
+ import { message as m, Progress as fe } from "@aplus-frontend/antdv";
8
+ import { omit as ge } from "lodash-unified";
9
+ import { useLocale as he } from "../../config-provider/hooks/use-locale.mjs";
10
10
  import { useNamespace as ve } from "../../config-provider/hooks/use-namespace.mjs";
11
- const he = ["accept"], xe = { class: "picture-context" }, ye = { class: "picture-item-box" }, _e = ["src"], we = { class: "picture-item-shadow" }, Ue = ["onClick"], ke = {
11
+ const xe = ["accept"], we = { class: "picture-context" }, ye = { class: "picture-item-box" }, _e = ["src"], Ue = { class: "picture-item-shadow" }, ke = ["onClick"], Ce = {
12
12
  key: 0,
13
13
  class: "picture-item-uploading"
14
- }, Ce = { class: "picture-title" }, Re = { key: 0 }, Se = { key: 1 }, De = /* @__PURE__ */ Y({
14
+ }, Ee = { class: "picture-title" }, Re = { key: 0 }, Se = { key: 1 }, Le = /* @__PURE__ */ Z({
15
15
  __name: "Picture",
16
- setup(Ee, { expose: T }) {
17
- const { t: u } = ge(), { b: C } = ve("ap-upload-picture"), { put: D } = le(), L = r("theme"), O = r("dirName"), _ = r("accept") || "image/*", w = r("maxSize") ?? 5, R = r("title"), l = r("maxCount") ?? 10, h = r("uploadingCount"), S = r("beforeUpload"), E = r("customRequest"), b = r("getOssAccess"), B = r("maxSizeErrorMsg"), q = r("maxCountErrorMsg"), j = r("acceptErrorMsg"), x = M(null), c = r("value"), y = r("needName"), z = r("onRemove");
18
- let s = M([]);
16
+ setup(Me, { expose: D }) {
17
+ const { t: u } = he(), { b: E } = ve("ap-upload-picture"), { put: L } = pe(), O = r("theme"), B = r("dirName"), y = r("accept") || "image/*", _ = r("maxSize") ?? 5, R = r("title"), l = r("maxCount") ?? 10, v = r("uploadingCount"), S = r("beforeUpload"), M = r("customRequest"), b = r("getOssAccess"), q = r("maxSizeErrorMsg"), j = r("maxCountErrorMsg"), G = r("acceptErrorMsg"), x = $(null), c = r("value"), w = r("needName"), z = r("onRemove"), U = r("showUploadErrorMsg");
18
+ let s = $([]);
19
19
  const f = [];
20
- Z(
20
+ F(
21
21
  () => c?.value,
22
22
  async function(t) {
23
23
  !s?.value?.length && t && A(t);
@@ -29,19 +29,19 @@ const he = ["accept"], xe = { class: "picture-context" }, ye = { class: "picture
29
29
  c.value = void 0, f.splice(0, f.length), s.value = [];
30
30
  return;
31
31
  }
32
- F(async () => {
32
+ ee(async () => {
33
33
  const n = [];
34
34
  for (let e of t) {
35
- const a = ie(y, e), i = re(y, e), p = await V(b), W = await p.getSignatureUrl(a), X = {
35
+ const a = re(w, e), i = ce(w, e), p = await T(b), X = await p.getSignatureUrl(a), Y = {
36
36
  ...typeof e == "string" ? {} : e,
37
37
  ...new File([e], i, {}),
38
38
  uid: `${(/* @__PURE__ */ new Date()).getTime()}-${Math.random()}`,
39
- thumbUrl: W,
39
+ thumbUrl: X,
40
40
  status: "success",
41
41
  percent: 100,
42
42
  path: a
43
43
  };
44
- n.push(X), p.destroy();
44
+ n.push(Y), p.destroy();
45
45
  }
46
46
  if (l && n.length > l) {
47
47
  m.warning(
@@ -59,35 +59,35 @@ const he = ["accept"], xe = { class: "picture-context" }, ye = { class: "picture
59
59
  }), c.value = t;
60
60
  });
61
61
  }
62
- T({ setValue: A });
63
- function G() {
62
+ D({ setValue: A });
63
+ function H() {
64
64
  x.value?.click();
65
65
  }
66
- function H(t) {
66
+ function J(t) {
67
67
  const n = t.target;
68
- J(n?.files);
68
+ K(n?.files);
69
69
  }
70
- function J(t) {
70
+ function K(t) {
71
71
  if (t?.length)
72
72
  for (let n = 0; n < t.length; n++)
73
- K(t[n]);
73
+ Q(t[n]);
74
74
  x.value && (x.value.value = "");
75
75
  }
76
76
  let N;
77
- async function K(t) {
77
+ async function Q(t) {
78
78
  if (l && l > 1 && s.value.length >= l)
79
79
  return clearTimeout(N), N = setTimeout(() => {
80
80
  m.warning(
81
- q || u("ap.apUpload.maxUploadPicture", { maxCount: l })
81
+ j || u("ap.apUpload.maxUploadPicture", { maxCount: l })
82
82
  );
83
83
  }), !1;
84
- if (t.size > w * 1024 * 1024)
84
+ if (t.size > _ * 1024 * 1024)
85
85
  return m.warning(
86
- B || u("ap.apUpload.maxUploadFileSize", { maxSize: w })
86
+ q || u("ap.apUpload.maxUploadFileSize", { maxSize: _ })
87
87
  ), !1;
88
- if (!/image\/\w+/.test(t.type) || !pe(t, _))
88
+ if (!/image\/\w+/.test(t.type) || !de(t, y))
89
89
  return m.warning(
90
- j || u("ap.apUpload.pictureFormatNotSupported")
90
+ G || u("ap.apUpload.pictureFormatNotSupported")
91
91
  ), !1;
92
92
  if (typeof S == "function" && await S(t) === !1)
93
93
  return !1;
@@ -100,61 +100,61 @@ const he = ["accept"], xe = { class: "picture-context" }, ye = { class: "picture
100
100
  status: "uploading",
101
101
  percent: 0
102
102
  };
103
- Q(e, t);
103
+ W(e, t);
104
104
  }, n.onerror = function() {
105
105
  m.warning(u("ap.apUpload.imageParsingFailed"));
106
106
  };
107
107
  }
108
- async function Q(t, n) {
109
- if (h.value++, typeof E == "function") {
110
- E({
108
+ async function W(t, n) {
109
+ if (v.value++, typeof M == "function") {
110
+ M({
111
111
  onProgress: (e) => {
112
112
  const a = s.value.find((i) => i.uid === t.uid);
113
113
  a && (a.percent = e);
114
114
  },
115
115
  onError: (e) => {
116
- m.warning(e || u("ap.apUpload.networkAnomaly"));
116
+ U && m.warning(e || u("ap.apUpload.networkAnomaly"));
117
117
  const a = s.value.findIndex(
118
118
  (i) => i.uid === t.uid
119
119
  );
120
- a > -1 && s.value.splice(a, 1), h.value--;
120
+ a > -1 && s.value.splice(a, 1), v.value--;
121
121
  },
122
122
  onSuccess: (e) => {
123
123
  const a = s.value.find((i) => i.uid === t.uid);
124
124
  a && (a.status = "success", a.path = e), c.value = [
125
125
  ...c.value || [],
126
- I(y, e, n.name)
126
+ V(w, e, n.name)
127
127
  ], f.push({
128
128
  uid: t.uid,
129
129
  path: e
130
- }), h.value--;
130
+ }), v.value--;
131
131
  },
132
132
  file: n
133
133
  });
134
134
  return;
135
135
  }
136
136
  try {
137
- const e = await V(b);
138
- t.oss = e, s.value.push(t), D({
137
+ const e = await T(b);
138
+ t.oss = e, s.value.push(t), L({
139
139
  file: n,
140
- dirName: O,
140
+ dirName: B,
141
141
  oss: e,
142
142
  successCallBack(a) {
143
143
  const i = s.value.find((p) => p.uid === t.uid);
144
144
  i && (i.status = "success", i.path = a), c.value = [
145
145
  ...c.value || [],
146
- I(y, a, n.name)
146
+ V(w, a, n.name)
147
147
  ], f.push({
148
148
  uid: t.uid,
149
149
  path: a
150
- }), h.value--;
150
+ }), v.value--;
151
151
  },
152
152
  errorCallBack(a) {
153
- m.warning(a || u("ap.apUpload.networkAnomaly"));
153
+ U && m.warning(a || u("ap.apUpload.networkAnomaly"));
154
154
  const i = s.value.findIndex(
155
155
  (p) => p.uid === t.uid
156
156
  );
157
- i > -1 && s.value.splice(i, 1), h.value--;
157
+ i > -1 && s.value.splice(i, 1), v.value--;
158
158
  },
159
159
  progressCallBack(a) {
160
160
  const i = s.value.find((p) => p.uid === t.uid);
@@ -162,11 +162,11 @@ const he = ["accept"], xe = { class: "picture-context" }, ye = { class: "picture
162
162
  }
163
163
  });
164
164
  } catch (e) {
165
- m.warning(
165
+ U && m.warning(
166
166
  typeof e?.message == "string" ? e.message : u("ap.apUpload.networkAnomaly")
167
167
  );
168
168
  const a = s.value.findIndex((i) => i.uid === t.uid);
169
- a > -1 && s.value.splice(a, 1), h.value--;
169
+ a > -1 && s.value.splice(a, 1), v.value--;
170
170
  }
171
171
  }
172
172
  function P(t) {
@@ -188,10 +188,10 @@ const he = ["accept"], xe = { class: "picture-context" }, ye = { class: "picture
188
188
  );
189
189
  return s.value.splice(n, 1), Promise.resolve(!0);
190
190
  }
191
- return (t, n) => (v(), g("div", {
192
- class: ee({
193
- [o(C)()]: !0,
194
- [o(C)("admin")]: o(L) === "admin"
191
+ return (t, n) => (h(), g("div", {
192
+ class: te({
193
+ [o(E)()]: !0,
194
+ [o(E)("admin")]: o(O) === "admin"
195
195
  })
196
196
  }, [
197
197
  d("input", {
@@ -199,20 +199,20 @@ const he = ["accept"], xe = { class: "picture-context" }, ye = { class: "picture
199
199
  ref: x,
200
200
  style: { display: "none" },
201
201
  type: "file",
202
- accept: o(_),
203
- onChange: H
204
- }, null, 40, he),
205
- d("div", xe, [
206
- te(t.$slots, "pictureContext", {
202
+ accept: o(y),
203
+ onChange: J
204
+ }, null, 40, xe),
205
+ d("div", we, [
206
+ ae(t.$slots, "pictureContext", {
207
207
  fileList: o(s).map((e) => ({
208
- ...o(fe)(e, "oss"),
208
+ ...o(ge)(e, "oss"),
209
209
  oss: {
210
210
  pauseUpload: e?.oss?.pauseUpload
211
211
  }
212
212
  })),
213
213
  remove: P
214
214
  }, () => [
215
- (v(!0), g(ae, null, ne(o(s), (e) => (v(), g("div", {
215
+ (h(!0), g(ne, null, oe(o(s), (e) => (h(), g("div", {
216
216
  key: e.uid,
217
217
  class: "picture-item"
218
218
  }, [
@@ -221,46 +221,46 @@ const he = ["accept"], xe = { class: "picture-context" }, ye = { class: "picture
221
221
  src: e.thumbUrl,
222
222
  alt: ""
223
223
  }, null, 8, _e),
224
- oe(d("div", we, [
224
+ se(d("div", Ue, [
225
225
  d("div", {
226
226
  class: "picture-item-close",
227
227
  onClick: (a) => P(e)
228
228
  }, [
229
- U(o(ce))
230
- ], 8, Ue),
231
- e.status === "uploading" ? (v(), g("div", ke, [
232
- U(o(me), {
229
+ k(o(ue))
230
+ ], 8, ke),
231
+ e.status === "uploading" ? (h(), g("div", Ce, [
232
+ k(o(fe), {
233
233
  percent: e.percent,
234
234
  "stroke-color": "#ffffff",
235
235
  "trail-color": "rgba(255, 255, 255, 0.3)",
236
236
  size: 4,
237
237
  "show-info": !1
238
238
  }, null, 8, ["percent"])
239
- ])) : $("", !0)
239
+ ])) : I("", !0)
240
240
  ], 512), [
241
- [se, e.status === "uploading"]
241
+ [ie, e.status === "uploading"]
242
242
  ])
243
243
  ])
244
244
  ]))), 128))
245
245
  ]),
246
- o(l) === void 0 || o(s).length < o(l) ? (v(), g("div", {
246
+ o(l) === void 0 || o(s).length < o(l) ? (h(), g("div", {
247
247
  key: 0,
248
248
  class: "picture-upload",
249
- onClick: G
249
+ onClick: H
250
250
  }, [
251
- U(o(ue)),
252
- d("div", null, k(o(u)("ap.apUpload.update")), 1)
253
- ])) : $("", !0)
251
+ k(o(le)),
252
+ d("div", null, C(o(u)("ap.apUpload.update")), 1)
253
+ ])) : I("", !0)
254
254
  ]),
255
- d("div", Ce, [
256
- o(R) ? (v(), g("div", Re, k(o(R)), 1)) : (v(), g("div", Se, k(`${o(u)("ap.apUpload.supportExtension")}:${o(de)(o(_))},${o(u)(
255
+ d("div", Ee, [
256
+ o(R) ? (h(), g("div", Re, C(o(R)), 1)) : (h(), g("div", Se, C(`${o(u)("ap.apUpload.supportExtension")}:${o(me)(o(y))},${o(u)(
257
257
  "ap.apUpload.maxUploadPictureSize",
258
- { maxSize: o(w) }
258
+ { maxSize: o(_) }
259
259
  )}`), 1))
260
260
  ])
261
261
  ], 2));
262
262
  }
263
263
  });
264
264
  export {
265
- De as default
265
+ Le as default
266
266
  };
@@ -1,80 +1,80 @@
1
- import { defineComponent as ne, inject as n, ref as h, watch as le, computed as se, createElementBlock as x, openBlock as _, normalizeClass as re, unref as t, createElementVNode as r, createCommentVNode as z, toDisplayString as A, normalizeStyle as ie, createBlock as ce, withModifiers as ue, createVNode as pe } from "vue";
1
+ import { defineComponent as le, inject as o, ref as h, watch as se, computed as re, createElementBlock as z, openBlock as _, normalizeClass as ie, unref as t, createElementVNode as r, createCommentVNode as A, toDisplayString as b, normalizeStyle as ce, createBlock as ue, withModifiers as pe, createVNode as de } from "vue";
2
2
  import "../../config-provider/index.mjs";
3
- import { getName as de, getReturnData as q } from "../utils/returnData.mjs";
4
- import { useOss as ve, useOssInit as fe } from "../hooks/useOss.mjs";
5
- import { fileMatchesAccept as me, getAcceptText as ge } from "../utils/accept.mjs";
6
- import { message as c, Progress as he } from "@aplus-frontend/antdv";
7
- import { DeleteOutlined as _e } from "@ant-design/icons-vue";
8
- import I from "../assets/single-file-icon.png.mjs";
9
- import { useLocale as ke } from "../../config-provider/hooks/use-locale.mjs";
3
+ import { getName as ve, getReturnData as I } from "../utils/returnData.mjs";
4
+ import { useOss as fe, useOssInit as me } from "../hooks/useOss.mjs";
5
+ import { fileMatchesAccept as ge, getAcceptText as he } from "../utils/accept.mjs";
6
+ import { message as c, Progress as _e } from "@aplus-frontend/antdv";
7
+ import { DeleteOutlined as ke } from "@ant-design/icons-vue";
8
+ import j from "../assets/single-file-icon.png.mjs";
9
+ import { useLocale as we } from "../../config-provider/hooks/use-locale.mjs";
10
10
  import { useNamespace as ye } from "../../config-provider/hooks/use-namespace.mjs";
11
- const we = ["accept"], De = {
11
+ const De = ["accept"], Ue = {
12
12
  key: 0,
13
13
  class: "state-un"
14
- }, Ue = ["src"], Fe = { class: "state-un-title" }, Ce = { class: "state-un-subtitle" }, Ee = {
14
+ }, Fe = ["src"], Ce = { class: "state-un-title" }, Ee = { class: "state-un-subtitle" }, Se = {
15
15
  key: 1,
16
16
  class: "state-ing"
17
- }, Se = { class: "left" }, Ne = ["src"], xe = { class: "center" }, ze = { class: "center-progress" }, qe = /* @__PURE__ */ ne({
17
+ }, Ne = { class: "left" }, xe = ["src"], ze = { class: "center" }, Ae = { class: "center-progress" }, Ie = /* @__PURE__ */ le({
18
18
  __name: "SingleFile",
19
- setup(Ae, { expose: j }) {
20
- const { t: s } = ke(), { b: k } = ye("ap-upload-single-file"), { put: G, client: b } = ve(), y = n("theme"), W = n("dirName"), w = n("accept") || "*", D = n("maxSize") ?? 500, H = n("title") || s("ap.apUpload.clickOrDragUpload"), U = n("subTitle"), i = n("value"), F = n("needName"), u = n("uploadingCount"), R = n("beforeUpload"), B = n("customRequest"), J = n("getOssAccess"), K = n("maxSizeErrorMsg"), Q = n("acceptErrorMsg"), M = n("onRemove"), o = h(null);
21
- le(
19
+ setup(be, { expose: G }) {
20
+ const { t: s } = we(), { b: k } = ye("ap-upload-single-file"), { put: W, client: R } = fe(), w = o("theme"), H = o("dirName"), y = o("accept") || "*", D = o("maxSize") ?? 500, J = o("title") || s("ap.apUpload.clickOrDragUpload"), U = o("subTitle"), i = o("value"), F = o("needName"), u = o("uploadingCount"), B = o("beforeUpload"), M = o("customRequest"), K = o("getOssAccess"), Q = o("maxSizeErrorMsg"), X = o("acceptErrorMsg"), O = o("onRemove"), C = o("showUploadErrorMsg"), n = h(null);
21
+ se(
22
22
  () => i?.value,
23
23
  function(e) {
24
- o.value === null && e && O(e);
24
+ n.value === null && e && P(e);
25
25
  },
26
26
  { immediate: !0 }
27
27
  );
28
- function O(e) {
28
+ function P(e) {
29
29
  e ? setTimeout(() => {
30
- const a = de(F, e);
31
- l.value = 3, o.value = new File([e], a, {}), i.value = e;
32
- }) : (l.value = 1, o.value = null, i.value = void 0);
30
+ const a = ve(F, e);
31
+ l.value = 3, n.value = new File([e], a, {}), i.value = e;
32
+ }) : (l.value = 1, n.value = null, i.value = void 0);
33
33
  }
34
- j({ setValue: O });
35
- const l = h(1), v = h(0), f = h(null), P = se(() => o.value && i?.value);
36
- function X() {
34
+ G({ setValue: P });
35
+ const l = h(1), v = h(0), f = h(null), T = re(() => n.value && i?.value);
36
+ function Y() {
37
37
  l.value === 1 && f.value?.click();
38
38
  }
39
- function T(e) {
39
+ function L(e) {
40
40
  e.preventDefault(), e.stopPropagation();
41
41
  }
42
- function Y(e) {
43
- e.dataTransfer.dropEffect = "copy", e.preventDefault(), e.stopPropagation();
44
- }
45
42
  function Z(e) {
46
- L(e);
43
+ e.dataTransfer.dropEffect = "copy", e.preventDefault(), e.stopPropagation();
47
44
  }
48
45
  function ee(e) {
46
+ V(e);
47
+ }
48
+ function ae(e) {
49
49
  if (e.preventDefault(), e.stopPropagation(), l.value !== 1)
50
50
  return;
51
- var a = e.dataTransfer, m = [], V = 0, $ = a.files.length;
51
+ var a = e.dataTransfer, m = [], $ = 0, q = a.files.length;
52
52
  function p() {
53
- V === $ - 1 && Z(m), V++;
53
+ $ === q - 1 && ee(m), $++;
54
54
  }
55
55
  if (a.items !== void 0)
56
- for (var C = 0; C < a.items.length; C++) {
57
- var E = a.items[C];
58
- if (E.kind === "file" && E.webkitGetAsEntry().isFile) {
59
- var oe = E.getAsFile();
60
- m.push(oe), p();
56
+ for (var E = 0; E < a.items.length; E++) {
57
+ var S = a.items[E];
58
+ if (S.kind === "file" && S.webkitGetAsEntry().isFile) {
59
+ var ne = S.getAsFile();
60
+ m.push(ne), p();
61
61
  }
62
62
  }
63
63
  else
64
- for (let N = 0; N < $; N++) {
65
- var g = a.files[N];
64
+ for (let x = 0; x < q; x++) {
65
+ var g = a.files[x];
66
66
  if (g.type)
67
67
  m.push(g), p();
68
68
  else
69
69
  try {
70
- var S = new FileReader();
71
- S.readAsDataURL(g.slice(0, 3)), S.addEventListener(
70
+ var N = new FileReader();
71
+ N.readAsDataURL(g.slice(0, 3)), N.addEventListener(
72
72
  "load",
73
73
  function(d) {
74
74
  console.warn(d, "load"), m.push(g), p();
75
75
  },
76
76
  !1
77
- ), S.addEventListener(
77
+ ), N.addEventListener(
78
78
  "error",
79
79
  function(d) {
80
80
  console.warn(d, "error"), c.warning(s("ap.apUpload.foldersNotSupported")), p();
@@ -86,41 +86,41 @@ const we = ["accept"], De = {
86
86
  }
87
87
  }
88
88
  }
89
- async function ae(e) {
89
+ async function te(e) {
90
90
  const a = e.target;
91
- await L(a?.files), f.value && (f.value.value = "");
91
+ await V(a?.files), f.value && (f.value.value = "");
92
92
  }
93
- async function L(e) {
93
+ async function V(e) {
94
94
  if (e?.length) {
95
95
  if (e[0].size > D * 1024 * 1024) {
96
96
  c.warning(
97
- K || s("ap.apUpload.maxUploadFileSize", {
97
+ Q || s("ap.apUpload.maxUploadFileSize", {
98
98
  maxSize: D
99
99
  })
100
100
  );
101
101
  return;
102
102
  }
103
- if (!me(e[0], w)) {
103
+ if (!ge(e[0], y)) {
104
104
  c.warning(
105
- Q || s("ap.apUpload.fileFormatNotSupported")
105
+ X || s("ap.apUpload.fileFormatNotSupported")
106
106
  );
107
107
  return;
108
108
  }
109
- if (typeof R == "function" && await R(e[0]) === !1)
109
+ if (typeof B == "function" && await B(e[0]) === !1)
110
110
  return;
111
- if (o.value = e[0], l.value = 2, v.value = 0, u.value++, typeof B == "function") {
112
- B({
111
+ if (n.value = e[0], l.value = 2, v.value = 0, u.value++, typeof M == "function") {
112
+ M({
113
113
  onProgress: (a) => {
114
114
  v.value = a;
115
115
  },
116
116
  onError: (a) => {
117
- c.warning(a || s("ap.apUpload.networkAnomaly")), l.value = 1, o.value = null, u.value--;
117
+ C && c.warning(a || s("ap.apUpload.networkAnomaly")), l.value = 1, n.value = null, u.value--;
118
118
  },
119
119
  onSuccess: (a) => {
120
- i.value = q(
120
+ i.value = I(
121
121
  F,
122
122
  a,
123
- o.value.name
123
+ n.value.name
124
124
  ), l.value = 3, u.value--;
125
125
  },
126
126
  file: e[0]
@@ -128,98 +128,98 @@ const we = ["accept"], De = {
128
128
  return;
129
129
  }
130
130
  try {
131
- await fe(J), G({
132
- file: o.value,
133
- dirName: W,
134
- oss: b,
131
+ await me(K), W({
132
+ file: n.value,
133
+ dirName: H,
134
+ oss: R,
135
135
  successCallBack(a) {
136
- i.value = q(
136
+ i.value = I(
137
137
  F,
138
138
  a,
139
- o.value.name
139
+ n.value.name
140
140
  ), l.value = 3, u.value--;
141
141
  },
142
142
  errorCallBack(a) {
143
- c.warning(a || s("ap.apUpload.networkAnomaly")), l.value = 1, o.value = null, u.value--;
143
+ C && c.warning(a || s("ap.apUpload.networkAnomaly")), l.value = 1, n.value = null, u.value--;
144
144
  },
145
145
  progressCallBack(a) {
146
146
  v.value = a;
147
147
  }
148
148
  });
149
149
  } catch (a) {
150
- c.warning(
150
+ C && c.warning(
151
151
  typeof a?.message == "string" ? a.message : s("ap.apUpload.networkAnomaly")
152
- ), l.value = 1, o.value = null, u.value--;
152
+ ), l.value = 1, n.value = null, u.value--;
153
153
  }
154
154
  }
155
155
  }
156
- function te() {
157
- M && M?.(o.value), o.value && !i?.value && b.pauseUpload(), l.value = 1, o.value = null, i.value = void 0;
156
+ function oe() {
157
+ O && O?.(n.value), n.value && !i?.value && R.pauseUpload(), l.value = 1, n.value = null, i.value = void 0;
158
158
  }
159
- return (e, a) => (_(), x("div", {
160
- class: re({
159
+ return (e, a) => (_(), z("div", {
160
+ class: ie({
161
161
  [t(k)()]: !0,
162
- [t(k)("admin")]: t(y) === "admin",
162
+ [t(k)("admin")]: t(w) === "admin",
163
163
  [t(k)("un")]: l.value === 1
164
164
  }),
165
- onClick: X,
166
- onDragenter: T,
167
- onDragover: Y,
168
- onDragleave: T,
169
- onDrop: ee
165
+ onClick: Y,
166
+ onDragenter: L,
167
+ onDragover: Z,
168
+ onDragleave: L,
169
+ onDrop: ae
170
170
  }, [
171
171
  r("input", {
172
172
  ref_key: "fileRef",
173
173
  ref: f,
174
174
  style: { display: "none" },
175
175
  type: "file",
176
- accept: t(w),
177
- onChange: ae
178
- }, null, 40, we),
179
- l.value === 1 ? (_(), x("div", De, [
176
+ accept: t(y),
177
+ onChange: te
178
+ }, null, 40, De),
179
+ l.value === 1 ? (_(), z("div", Ue, [
180
180
  r("img", {
181
181
  class: "state-un-icon",
182
- src: t(I)
183
- }, null, 8, Ue),
184
- r("div", Fe, A(t(H)), 1),
185
- r("div", Ce, A(typeof t(U) == "string" && t(U).length > 0 ? t(U) : `${t(s)("ap.apUpload.supportExtension")}:${t(ge)(
186
- t(w)
182
+ src: t(j)
183
+ }, null, 8, Fe),
184
+ r("div", Ce, b(t(J)), 1),
185
+ r("div", Ee, b(typeof t(U) == "string" && t(U).length > 0 ? t(U) : `${t(s)("ap.apUpload.supportExtension")}:${t(he)(
186
+ t(y)
187
187
  )},${t(s)("ap.apUpload.maxWarnUploadFileSize", {
188
188
  maxSize: t(D)
189
189
  })}`), 1)
190
- ])) : z("", !0),
191
- [2, 3].includes(l.value) ? (_(), x("div", Ee, [
192
- r("div", Se, [
193
- r("img", { src: t(I) }, null, 8, Ne)
190
+ ])) : A("", !0),
191
+ [2, 3].includes(l.value) ? (_(), z("div", Se, [
192
+ r("div", Ne, [
193
+ r("img", { src: t(j) }, null, 8, xe)
194
194
  ]),
195
- r("div", xe, [
195
+ r("div", ze, [
196
196
  r("div", {
197
197
  class: "center-title",
198
- style: ie({
199
- color: P.value ? "#0070FF" : "#182948"
198
+ style: ce({
199
+ color: T.value ? "#0070FF" : "#182948"
200
200
  })
201
- }, A(o.value?.name), 5),
202
- r("div", ze, [
203
- P.value ? z("", !0) : (_(), ce(t(he), {
201
+ }, b(n.value?.name), 5),
202
+ r("div", Ae, [
203
+ T.value ? A("", !0) : (_(), ue(t(_e), {
204
204
  key: 0,
205
205
  percent: v.value,
206
206
  size: 4,
207
207
  "show-info": !1,
208
- "trail-color": t(y) === "admin" ? "#D9D9D9" : "#DEE4ED",
209
- "stroke-color": t(y) === "admin" ? "#34B77C" : "#0070FF"
208
+ "trail-color": t(w) === "admin" ? "#D9D9D9" : "#DEE4ED",
209
+ "stroke-color": t(w) === "admin" ? "#34B77C" : "#0070FF"
210
210
  }, null, 8, ["percent", "trail-color", "stroke-color"]))
211
211
  ])
212
212
  ]),
213
213
  r("div", {
214
214
  class: "right",
215
- onClick: ue(te, ["stop"])
215
+ onClick: pe(oe, ["stop"])
216
216
  }, [
217
- pe(t(_e))
217
+ de(t(ke))
218
218
  ])
219
- ])) : z("", !0)
219
+ ])) : A("", !0)
220
220
  ], 34));
221
221
  }
222
222
  });
223
223
  export {
224
- qe as default
224
+ Ie as default
225
225
  };