@aplus-frontend/ui 0.0.28 → 0.0.30

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 (81) hide show
  1. package/es/src/ap-download/hooks/index.mjs +4 -3
  2. package/es/src/ap-download/interface.d.ts +2 -2
  3. package/es/src/ap-field/date/helper.mjs +5 -5
  4. package/es/src/ap-field/date-range/index.vue.mjs +15 -15
  5. package/es/src/ap-form/ap-form-list.vue.mjs +29 -21
  6. package/es/src/ap-form/ap-form.vue2.mjs +77 -77
  7. package/es/src/ap-form/interface.d.ts +4 -0
  8. package/es/src/ap-form/search-form/index.vue.mjs +123 -99
  9. package/es/src/ap-form/style/search-form.css +6 -0
  10. package/es/src/ap-table/hooks/use-table-paging.mjs +23 -21
  11. package/es/src/ap-upload/apUpload.vue.d.ts +3 -11
  12. package/es/src/ap-upload/apUpload.vue.mjs +42 -36
  13. package/es/src/ap-upload/components/MultipleFile.vue2.mjs +115 -102
  14. package/es/src/ap-upload/components/Picture.vue2.mjs +121 -111
  15. package/es/src/ap-upload/components/SingleFile.vue2.mjs +120 -109
  16. package/es/src/ap-upload/hooks/useOss.d.ts +9 -4
  17. package/es/src/ap-upload/hooks/useOss.mjs +52 -34
  18. package/es/src/ap-upload/styles/multiple-file.css +1 -1
  19. package/es/src/ap-upload/utils/accept.d.ts +3 -0
  20. package/es/src/ap-upload/utils/accept.mjs +35 -30
  21. package/es/src/business/ap-status/ApStatusGroup.vue.d.ts +7 -2
  22. package/es/src/business/ap-status/ApStatusGroup.vue2.mjs +7 -6
  23. package/es/src/business/ap-status/interface.d.ts +4 -1
  24. package/es/src/business/index.d.ts +41 -8
  25. package/es/src/config-provider/config-provider-props.d.ts +5 -1
  26. package/es/src/config-provider/config-provider-props.mjs +4 -0
  27. package/es/src/config-provider/config-provider.d.ts +10 -1
  28. package/es/src/config-provider/config-provider.mjs +9 -8
  29. package/es/src/config-provider/constants.d.ts +10 -0
  30. package/es/src/config-provider/hooks/use-global-config.d.ts +5 -1
  31. package/es/src/config-provider/index.d.ts +20 -1
  32. package/es/src/editable-table/style/index.css +3 -0
  33. package/es/src/locale/lang/en.mjs +24 -0
  34. package/es/src/locale/lang/zh-cn.mjs +24 -0
  35. package/es/src/theme/ap-form/search-form.css +6 -0
  36. package/es/src/theme/ap-upload/multiple-file.css +1 -1
  37. package/es/src/theme/editable-table/index.css +3 -0
  38. package/es/src/work-order-modal/createWorkOrder.d.ts +3 -1
  39. package/es/src/work-order-modal/interfaces.d.ts +3 -1
  40. package/es/src/work-order-modal/work-order-modal.vue.mjs +7 -7
  41. package/lib/src/ap-download/hooks/index.js +1 -1
  42. package/lib/src/ap-download/interface.d.ts +2 -2
  43. package/lib/src/ap-field/date/helper.js +1 -1
  44. package/lib/src/ap-field/date-range/index.vue.js +1 -1
  45. package/lib/src/ap-form/ap-form-list.vue.js +1 -1
  46. package/lib/src/ap-form/ap-form.vue2.js +1 -1
  47. package/lib/src/ap-form/interface.d.ts +4 -0
  48. package/lib/src/ap-form/search-form/index.vue.js +1 -1
  49. package/lib/src/ap-form/style/search-form.css +6 -0
  50. package/lib/src/ap-table/hooks/use-table-paging.js +1 -1
  51. package/lib/src/ap-upload/apUpload.vue.d.ts +3 -11
  52. package/lib/src/ap-upload/apUpload.vue.js +1 -1
  53. package/lib/src/ap-upload/components/MultipleFile.vue2.js +1 -1
  54. package/lib/src/ap-upload/components/Picture.vue2.js +1 -1
  55. package/lib/src/ap-upload/components/SingleFile.vue2.js +1 -1
  56. package/lib/src/ap-upload/hooks/useOss.d.ts +9 -4
  57. package/lib/src/ap-upload/hooks/useOss.js +1 -1
  58. package/lib/src/ap-upload/styles/multiple-file.css +1 -1
  59. package/lib/src/ap-upload/utils/accept.d.ts +3 -0
  60. package/lib/src/ap-upload/utils/accept.js +1 -1
  61. package/lib/src/business/ap-status/ApStatusGroup.vue.d.ts +7 -2
  62. package/lib/src/business/ap-status/ApStatusGroup.vue2.js +1 -1
  63. package/lib/src/business/ap-status/interface.d.ts +4 -1
  64. package/lib/src/business/index.d.ts +41 -8
  65. package/lib/src/config-provider/config-provider-props.d.ts +5 -1
  66. package/lib/src/config-provider/config-provider-props.js +1 -1
  67. package/lib/src/config-provider/config-provider.d.ts +10 -1
  68. package/lib/src/config-provider/config-provider.js +1 -1
  69. package/lib/src/config-provider/constants.d.ts +10 -0
  70. package/lib/src/config-provider/hooks/use-global-config.d.ts +5 -1
  71. package/lib/src/config-provider/index.d.ts +20 -1
  72. package/lib/src/editable-table/style/index.css +3 -0
  73. package/lib/src/locale/lang/en.js +1 -1
  74. package/lib/src/locale/lang/zh-cn.js +1 -1
  75. package/lib/src/theme/ap-form/search-form.css +6 -0
  76. package/lib/src/theme/ap-upload/multiple-file.css +1 -1
  77. package/lib/src/theme/editable-table/index.css +3 -0
  78. package/lib/src/work-order-modal/createWorkOrder.d.ts +3 -1
  79. package/lib/src/work-order-modal/interfaces.d.ts +3 -1
  80. package/lib/src/work-order-modal/work-order-modal.vue.js +1 -1
  81. package/package.json +1 -1
@@ -1,71 +1,82 @@
1
- import { defineComponent as $, inject as a, ref as q, watch as D, nextTick as j, openBlock as h, createElementBlock as _, normalizeClass as W, unref as n, createVNode as w, withCtx as F, createElementVNode as R, createTextVNode as G, toDisplayString as A, withModifiers as H, createBlock as J, resolveDynamicComponent as K, createCommentVNode as Q } from "vue";
1
+ import { defineComponent as D, inject as n, ref as M, watch as $, nextTick as j, openBlock as v, createElementBlock as C, normalizeClass as W, unref as s, createVNode as _, withCtx as E, createElementVNode as b, createTextVNode as G, toDisplayString as L, withModifiers as H, createBlock as J, resolveDynamicComponent as K, createCommentVNode as Q } from "vue";
2
2
  import "../../config-provider/index.mjs";
3
- import { getPath as U, getName as V, getReturnData as v } from "../utils/returnData.mjs";
4
- import { useOss as X, getOssInstance as Y } from "../hooks/useOss.mjs";
5
- import { message as u, Upload as Z, Button as ee } from "ant-design-vue";
6
- import { UploadOutlined as te } from "@ant-design/icons-vue";
7
- import { fileMatchesAccept as se, getAcceptText as oe } from "../utils/accept.mjs";
3
+ import { getPath as V, getName as X, getReturnData as x } from "../utils/returnData.mjs";
4
+ import { useOss as Y, getOssInstance as Z } from "../hooks/useOss.mjs";
5
+ import { message as p, Upload as ee, Button as te } from "ant-design-vue";
6
+ import { UploadOutlined as oe } from "@ant-design/icons-vue";
7
+ import { fileMatchesAccept as ae, getAcceptText as se } from "../utils/accept.mjs";
8
8
  import "../styles/multiple-file.css";
9
- import { useNamespace as ne } from "../../config-provider/hooks/use-namespace.mjs";
10
- const ae = { class: "multiple-file-context" }, ie = { key: 0 }, re = { key: 1 }, xe = /* @__PURE__ */ $({
9
+ import { useLocale as ne } from "../../config-provider/hooks/use-locale.mjs";
10
+ import { useNamespace as ie } from "../../config-provider/hooks/use-namespace.mjs";
11
+ const le = { class: "multiple-file-context" }, re = { key: 0 }, pe = { key: 1 }, ke = /* @__PURE__ */ D({
11
12
  __name: "MultipleFile",
12
13
  setup(ue) {
13
- const { b: k } = ne("ap-upload-multiple-file"), { put: E } = X(), L = a("theme"), P = a("dirName"), x = a("accept") || "*", T = a("maxSize") || 500, I = a("title") || "上传文件", f = a("subTitle"), i = a("maxCount"), c = a("uploadingCount"), N = a("beforeUpload"), b = a("customRequest"), S = a("getOssAccess"), o = a("value"), p = [], l = a("needName"), d = q(null);
14
- D(
15
- () => o == null ? void 0 : o.value,
14
+ const { t: i } = ne(), { b: U } = ie("ap-upload-multiple-file"), { put: R } = Y(), S = n("theme"), B = n("dirName"), y = n("accept") || "*", A = n("maxSize") ?? 500, I = n("title") || i("ap.apUpload.uploadFile"), g = n("subTitle"), l = n("maxCount") ?? 10, u = n("uploadingCount"), F = n("beforeUpload"), N = n("customRequest"), P = n("getOssAccess"), a = n("value"), d = [], c = n("needName"), f = M(null);
15
+ $(
16
+ () => a == null ? void 0 : a.value,
16
17
  function(e) {
17
- !d.value.fileList.length && e && j(() => {
18
- const t = e.map((s) => {
19
- const r = U(l, s), C = V(l, s), y = new File(
20
- [s],
21
- C,
18
+ !f.value.fileList.length && e && j(() => {
19
+ const t = e.map((o) => {
20
+ const r = V(c, o), w = X(c, o), k = new File(
21
+ [o],
22
+ w,
22
23
  {}
23
24
  );
24
- return y.response = r, y.uid = r, y;
25
+ return k.response = r, k.uid = r, k;
25
26
  });
26
- if (i && t.length > i) {
27
- u.warning(
28
- `文件初始化个数超过${i}个,后续上传的文件会与数据不同步`
27
+ if (l && t.length > l) {
28
+ p.warning(
29
+ i("ap.apUpload.fileInitializationException", {
30
+ maxCount: l
31
+ })
29
32
  );
30
33
  return;
31
34
  }
32
- t.forEach((s) => {
33
- m.push(s), p.push({
34
- uid: s.uid,
35
- path: s.response
35
+ t.forEach((o) => {
36
+ m.push(o), d.push({
37
+ uid: o.uid,
38
+ path: o.response
36
39
  });
37
- }), d.value.fileList = t;
40
+ }), f.value.fileList = t;
38
41
  });
39
42
  }
40
43
  );
41
- let m = [], B;
42
- function g(e) {
44
+ let m = [], T;
45
+ function h(e) {
43
46
  setTimeout(() => {
44
- const t = d.value.fileList.findIndex(
45
- (s) => s.uid === e.uid
47
+ const t = f.value.fileList.findIndex(
48
+ (o) => o.uid === e.uid
46
49
  );
47
- t >= 0 && d.value.fileList.splice(t, 1);
50
+ t >= 0 && f.value.fileList.splice(t, 1);
48
51
  });
49
52
  }
50
- function O(e) {
51
- if (i && i > 1 && m.length >= i)
52
- return clearTimeout(B), B = setTimeout(() => {
53
- u.warning(`最多上传${i}个文件`);
54
- }), g(e), !1;
55
- if (typeof N == "function") {
56
- if (N(e) === !1)
57
- return g(e), !1;
53
+ function z(e) {
54
+ if (l && l > 1 && m.length >= l)
55
+ return clearTimeout(T), T = setTimeout(() => {
56
+ p.warning(
57
+ i("ap.apUpload.maxUploadFiles", {
58
+ maxCount: l
59
+ })
60
+ );
61
+ }), h(e), !1;
62
+ if (typeof F == "function") {
63
+ if (F(e) === !1)
64
+ return h(e), !1;
58
65
  } else {
59
- if (e.size > T * 1024 * 1024)
60
- return u.warning(`文件大小不超过${T}MB`), g(e), !1;
61
- if (!se(e, x))
62
- return u.warning("不支持该格式的文件"), g(e), !1;
66
+ if (e.size > A * 1024 * 1024)
67
+ return p.warning(
68
+ i("ap.apUpload.maxUploadFileSize", {
69
+ maxSize: A
70
+ })
71
+ ), h(e), !1;
72
+ if (!ae(e, y))
73
+ return p.warning(i("ap.apUpload.fileFormatNotSupported")), h(e), !1;
63
74
  }
64
- i && i === 1 && (m = [], o.value = void 0), m.push(e);
75
+ l && l === 1 && (m = [], a.value = void 0), m.push(e);
65
76
  }
66
- async function z(e) {
67
- if (c.value++, typeof b == "function") {
68
- b({
77
+ async function O(e) {
78
+ if (u.value++, typeof N == "function") {
79
+ N({
69
80
  onProgress: (t) => {
70
81
  setTimeout(() => {
71
82
  e.onProgress({
@@ -74,115 +85,117 @@ const ae = { class: "multiple-file-context" }, ie = { key: 0 }, re = { key: 1 },
74
85
  });
75
86
  },
76
87
  onError: (t) => {
77
- u.warning(t || "网络异常"), setTimeout(() => {
88
+ p.warning(t || i("ap.apUpload.networkAnomaly")), setTimeout(() => {
78
89
  e.onError({
79
90
  name: t,
80
91
  message: t
81
92
  });
82
- }), c.value--;
93
+ }), u.value--;
83
94
  },
84
95
  onSuccess: (t) => {
85
96
  setTimeout(() => {
86
97
  e.onSuccess(t);
87
- }), o.value ? o.value.push(
88
- v(l, t, e.file.name)
89
- ) : o.value = [
90
- v(l, t, e.file.name)
91
- ], p.push({
98
+ }), a.value ? a.value.push(
99
+ x(c, t, e.file.name)
100
+ ) : a.value = [
101
+ x(c, t, e.file.name)
102
+ ], d.push({
92
103
  uid: e.file.uid,
93
104
  path: t
94
- }), c.value--;
105
+ }), u.value--;
95
106
  },
96
107
  file: e.file
97
108
  });
98
109
  return;
99
110
  }
100
111
  try {
101
- const t = await Y(S);
102
- e.file.oss = t, E({
112
+ const t = await Z(P);
113
+ e.file.oss = t, R({
103
114
  file: e.file,
104
- dirName: P,
115
+ dirName: B,
105
116
  oss: t,
106
- successCallBack(s) {
107
- e.onSuccess(s), o.value ? o.value.push(
108
- v(l, s, e.file.name)
109
- ) : o.value = [
110
- v(l, s, e.file.name)
111
- ], p.push({
117
+ successCallBack(o) {
118
+ e.onSuccess(o), a.value ? a.value.push(
119
+ x(c, o, e.file.name)
120
+ ) : a.value = [
121
+ x(c, o, e.file.name)
122
+ ], d.push({
112
123
  uid: e.file.uid,
113
- path: s
114
- }), c.value--;
124
+ path: o
125
+ }), u.value--;
115
126
  },
116
- errorCallBack(s) {
117
- u.warning(s || "网络异常"), e.onError({
118
- name: s,
119
- message: s
120
- }), c.value--;
127
+ errorCallBack(o) {
128
+ p.warning(o || i("ap.apUpload.networkAnomaly")), e.onError({
129
+ name: o,
130
+ message: o
131
+ }), u.value--;
121
132
  },
122
- progressCallBack(s) {
133
+ progressCallBack(o) {
123
134
  e.onProgress({
124
- percent: s
135
+ percent: o
125
136
  });
126
137
  }
127
138
  });
128
139
  } catch (t) {
129
- u.warning(typeof (t == null ? void 0 : t.message) == "string" ? t.message : "网络异常"), e.onError({
130
- name: (t == null ? void 0 : t.message) || "网络异常",
131
- message: (t == null ? void 0 : t.message) || "网络异常"
132
- }), c.value--;
140
+ p.warning(
141
+ typeof (t == null ? void 0 : t.message) == "string" ? t.message : i("ap.apUpload.networkAnomaly")
142
+ ), e.onError({
143
+ name: (t == null ? void 0 : t.message) || i("ap.apUpload.networkAnomaly"),
144
+ message: (t == null ? void 0 : t.message) || i("ap.apUpload.networkAnomaly")
145
+ }), u.value--;
133
146
  }
134
147
  }
135
- function M(e) {
136
- var s;
148
+ function q(e) {
149
+ var o;
137
150
  if (e.response) {
138
- if (Array.isArray(o.value)) {
139
- const r = p.findIndex((C) => C.uid === e.uid);
140
- r >= 0 && (o == null || o.value.splice(r, 1), p.splice(r, 1)), o.value.length === 0 && (o.value = void 0);
151
+ if (Array.isArray(a.value)) {
152
+ const r = d.findIndex((w) => w.uid === e.uid);
153
+ r >= 0 && (a == null || a.value.splice(r, 1), d.splice(r, 1)), a.value.length === 0 && (a.value = void 0);
141
154
  }
142
155
  } else
143
- (s = e == null ? void 0 : e.oss) == null || s.pauseUpload();
156
+ (o = e == null ? void 0 : e.oss) == null || o.pauseUpload();
144
157
  const t = m.findIndex(
145
158
  (r) => r.uid === e.uid
146
159
  );
147
160
  return m.splice(t, 1), Promise.resolve(!0);
148
161
  }
149
- return (e, t) => (h(), _("div", {
162
+ return (e, t) => (v(), C("div", {
150
163
  class: W({
151
- [n(k)()]: !0,
152
- [n(k)("admin")]: n(L) === "admin"
164
+ [s(U)()]: !0,
165
+ [s(U)("admin")]: s(S) === "admin"
153
166
  })
154
167
  }, [
155
- w(n(Z), {
168
+ _(s(ee), {
156
169
  ref_key: "uploadRef",
157
- ref: d,
158
- accept: n(x),
170
+ ref: f,
171
+ accept: s(y),
159
172
  multiple: "",
160
- maxCount: n(i),
173
+ maxCount: s(l),
161
174
  progress: {
162
175
  strokeWidth: 3,
163
176
  showInfo: !1,
164
177
  strokeColor: "#0070FF"
165
178
  },
166
- beforeUpload: O,
167
- customRequest: z,
168
- onRemove: M
179
+ beforeUpload: z,
180
+ customRequest: O,
181
+ onRemove: q
169
182
  }, {
170
- default: F(() => [
171
- R("div", ae, [
172
- w(n(ee), { class: "file-btn" }, {
173
- default: F(() => [
174
- w(n(te)),
175
- G(" " + A(n(I)), 1)
183
+ default: E(() => [
184
+ b("div", le, [
185
+ _(s(te), { class: "file-btn" }, {
186
+ default: E(() => [
187
+ _(s(oe)),
188
+ G(" " + L(s(I)), 1)
176
189
  ]),
177
190
  _: 1
178
191
  }),
179
- R("div", {
192
+ b("div", {
180
193
  class: "sub-title",
181
194
  onClick: t[0] || (t[0] = H(() => {
182
195
  }, ["stop"]))
183
196
  }, [
184
- typeof n(f) == "string" ? (h(), _("div", ie, A(n(f) || `支持扩展名:${n(oe)(n(x))}`), 1)) : n(f) ? (h(), _("div", re, [
185
- (h(), J(K(n(f))))
197
+ typeof s(g) == "string" ? (v(), C("div", re, L(s(g) || `${s(i)("ap.apUpload.supportExtension")}:${s(se)(s(y))}`), 1)) : s(g) ? (v(), C("div", pe, [
198
+ (v(), J(K(s(g))))
186
199
  ])) : Q("", !0)
187
200
  ])
188
201
  ])
@@ -193,5 +206,5 @@ const ae = { class: "multiple-file-context" }, ie = { key: 0 }, re = { key: 1 },
193
206
  }
194
207
  });
195
208
  export {
196
- xe as default
209
+ ke as default
197
210
  };