@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,45 +1,48 @@
1
- import { createElementVNode as f, defineComponent as G, inject as u, ref as I, watch as H, openBlock as p, createElementBlock as m, normalizeClass as J, unref as o, Fragment as K, renderList as Q, withDirectives as W, createVNode as C, createCommentVNode as P, vShow as X, toDisplayString as B } from "vue";
1
+ import { defineComponent as H, inject as u, ref as I, watch as J, openBlock as f, createElementBlock as h, normalizeClass as K, unref as o, createElementVNode as d, Fragment as Q, renderList as W, withDirectives as X, createVNode as C, createCommentVNode as R, vShow as Y, toDisplayString as U } from "vue";
2
2
  import "../../config-provider/index.mjs";
3
- import { getPath as Y, getName as Z, getReturnData as w } from "../utils/returnData.mjs";
4
- import { CloseOutlined as F, PlusOutlined as ee } from "@ant-design/icons-vue";
5
- import { useOss as te, getOssInstance as D } from "../hooks/useOss.mjs";
6
- import { fileMatchesAccept as ne, getAcceptText as se } from "../utils/accept.mjs";
7
- import { message as d, Progress as ie } from "ant-design-vue";
3
+ import { getPath as Z, getName as F, getReturnData as w } from "../utils/returnData.mjs";
4
+ import { CloseOutlined as ee, PlusOutlined as te } from "@ant-design/icons-vue";
5
+ import { useOss as ne, getOssInstance as $ } from "../hooks/useOss.mjs";
6
+ import { fileMatchesAccept as ae, getAcceptText as se } from "../utils/accept.mjs";
7
+ import { message as m, Progress as oe } from "ant-design-vue";
8
8
  import "../styles/picture.css";
9
- import { useNamespace as ae } from "../../config-provider/hooks/use-namespace.mjs";
10
- const oe = ["accept"], ce = { class: "picture-context" }, ue = { class: "picture-item-box" }, re = ["src"], le = { class: "picture-item-shadow" }, de = ["onClick"], fe = {
9
+ import { useLocale as ie } from "../../config-provider/hooks/use-locale.mjs";
10
+ import { useNamespace as ce } from "../../config-provider/hooks/use-namespace.mjs";
11
+ const ue = ["accept"], re = { class: "picture-context" }, le = { class: "picture-item-box" }, pe = ["src"], de = { class: "picture-item-shadow" }, me = ["onClick"], fe = {
11
12
  key: 0,
12
13
  class: "picture-item-uploading"
13
- }, pe = /* @__PURE__ */ f("div", null, "上传", -1), me = { class: "picture-title" }, he = { key: 0 }, ge = { key: 1 }, Re = /* @__PURE__ */ G({
14
+ }, he = { class: "picture-title" }, ge = { key: 0 }, ve = { key: 1 }, be = /* @__PURE__ */ H({
14
15
  __name: "Picture",
15
- setup(ve) {
16
- const { b: k } = ae("ap-upload-picture"), { put: O } = te(), S = u("theme"), T = u("dirName"), y = u("accept") || "image/*", x = u("maxSize") || 5, N = u("title"), r = u("maxCount"), h = u("uploadingCount"), $ = u("beforeUpload"), b = u("customRequest"), R = u("getOssAccess"), _ = I(null), c = u("value"), g = u("needName");
17
- let a = I([]);
18
- const v = [];
19
- H(
16
+ setup(_e) {
17
+ const { t: r } = ie(), { b: A } = ce("ap-upload-picture"), { put: D } = ne(), E = u("theme"), O = u("dirName"), y = u("accept") || "image/*", k = u("maxSize") ?? 5, N = u("title"), l = u("maxCount") ?? 10, g = u("uploadingCount"), P = u("beforeUpload"), S = u("customRequest"), b = u("getOssAccess"), x = I(null), c = u("value"), v = u("needName");
18
+ let i = I([]);
19
+ const _ = [];
20
+ J(
20
21
  () => c == null ? void 0 : c.value,
21
22
  async function(e) {
22
- if (!a.value.length && e) {
23
- const s = [];
23
+ if (!i.value.length && e) {
24
+ const a = [];
24
25
  for (let t of e) {
25
- const n = Y(g, t), i = Z(g, t), l = await D(R), V = await l.getSignatureUrl(n), j = {
26
- ...new File([t], i, {}),
26
+ const n = Z(v, t), s = F(v, t), p = await $(b), j = await p.getSignatureUrl(n), G = {
27
+ ...new File([t], s, {}),
27
28
  uid: `${(/* @__PURE__ */ new Date()).getTime()}-${Math.random()}`,
28
- thumbUrl: V,
29
+ thumbUrl: j,
29
30
  status: "success",
30
31
  percent: 100,
31
32
  path: n
32
33
  };
33
- s.push(j), l.destroy();
34
+ a.push(G), p.destroy();
34
35
  }
35
- if (r && s.length > r) {
36
- d.warning(
37
- `文件初始化个数超过${r}个,后续上传的文件会与数据不同步`
36
+ if (l && a.length > l) {
37
+ m.warning(
38
+ r("ap.apUpload.fileInitializationException", {
39
+ maxCount: l
40
+ })
38
41
  );
39
42
  return;
40
43
  }
41
- s.forEach((t) => {
42
- a.value.push(t), v.push({
44
+ a.forEach((t) => {
45
+ i.value.push(t), _.push({
43
46
  uid: t.uid,
44
47
  path: t.path
45
48
  });
@@ -47,37 +50,39 @@ const oe = ["accept"], ce = { class: "picture-context" }, ue = { class: "picture
47
50
  }
48
51
  }
49
52
  );
50
- function z() {
53
+ function T() {
51
54
  var e;
52
- (e = _.value) == null || e.click();
55
+ (e = x.value) == null || e.click();
53
56
  }
54
- function M(e) {
55
- const s = e.target;
56
- E(s == null ? void 0 : s.files);
57
+ function B(e) {
58
+ const a = e.target;
59
+ L(a == null ? void 0 : a.files);
57
60
  }
58
- function E(e) {
61
+ function L(e) {
59
62
  if (e != null && e.length)
60
- for (let s = 0; s < e.length; s++)
61
- L(e[s]);
62
- _.value && (_.value.value = "");
63
+ for (let a = 0; a < e.length; a++)
64
+ q(e[a]);
65
+ x.value && (x.value.value = "");
63
66
  }
64
- let A;
65
- function L(e) {
66
- if (r && r > 1 && a.value.length >= r)
67
- return clearTimeout(A), A = setTimeout(() => {
68
- d.warning(`最多上传${r}个图片`);
67
+ let z;
68
+ function q(e) {
69
+ if (l && l > 1 && i.value.length >= l)
70
+ return clearTimeout(z), z = setTimeout(() => {
71
+ m.warning(
72
+ r("ap.apUpload.maxUploadPicture", { maxCount: l })
73
+ );
69
74
  }), !1;
70
- if (typeof $ == "function") {
71
- if ($(e) === !1)
75
+ if (typeof P == "function") {
76
+ if (P(e) === !1)
72
77
  return !1;
73
78
  } else {
74
- if (e.size > x * 1024 * 1024)
75
- return d.warning(`文件大小不超过${x}MB`), !1;
76
- if (!/image\/\w+/.test(e.type) || !ne(e, y))
77
- return d.warning("不支持该格式的图片"), !1;
79
+ if (e.size > k * 1024 * 1024)
80
+ return m.warning(r("ap.apUpload.maxUploadFileSize", { maxSize: k })), !1;
81
+ if (!/image\/\w+/.test(e.type) || !ae(e, y))
82
+ return m.warning(r("ap.apUpload.pictureFormatNotSupported")), !1;
78
83
  }
79
- const s = new FileReader();
80
- s.readAsDataURL(e), s.onload = function() {
84
+ const a = new FileReader();
85
+ a.readAsDataURL(e), a.onload = function() {
81
86
  const t = {
82
87
  ...e,
83
88
  uid: `${(/* @__PURE__ */ new Date()).getTime()}-${Math.random()}`,
@@ -85,135 +90,140 @@ const oe = ["accept"], ce = { class: "picture-context" }, ue = { class: "picture
85
90
  status: "uploading",
86
91
  percent: 0
87
92
  };
88
- q(t, e);
89
- }, s.onerror = function() {
90
- d.warning("图片解析失败");
93
+ M(t, e);
94
+ }, a.onerror = function() {
95
+ m.warning(r("ap.apUpload.imageParsingFailed"));
91
96
  };
92
97
  }
93
- async function q(e, s) {
94
- if (h.value++, typeof b == "function") {
95
- b({
98
+ async function M(e, a) {
99
+ if (g.value++, typeof S == "function") {
100
+ S({
96
101
  onProgress: (t) => {
97
- const n = a.value.find((i) => i.uid === e.uid);
102
+ const n = i.value.find((s) => s.uid === e.uid);
98
103
  n && (n.percent = t);
99
104
  },
100
105
  onError: (t) => {
101
- d.warning(t || "网络异常");
102
- const n = a.value.findIndex((i) => i.uid === e.uid);
103
- n > -1 && a.value.splice(n, 1), h.value--;
106
+ m.warning(t || r("ap.apUpload.networkAnomaly"));
107
+ const n = i.value.findIndex((s) => s.uid === e.uid);
108
+ n > -1 && i.value.splice(n, 1), g.value--;
104
109
  },
105
110
  onSuccess: (t) => {
106
- const n = a.value.find((i) => i.uid === e.uid);
107
- n && (n.status = "success", n.path = t), c.value ? c.value.push(w(g, t, s.name)) : c.value = [w(g, t, s.name)], v.push({
111
+ const n = i.value.find((s) => s.uid === e.uid);
112
+ n && (n.status = "success", n.path = t), c.value ? c.value.push(w(v, t, a.name)) : c.value = [w(v, t, a.name)], _.push({
108
113
  uid: e.uid,
109
114
  path: t
110
- }), h.value--;
115
+ }), g.value--;
111
116
  },
112
- file: s
117
+ file: a
113
118
  });
114
119
  return;
115
120
  }
116
121
  try {
117
- const t = await D(R);
118
- e.oss = t, a.value.push(e), O({
119
- file: s,
120
- dirName: T,
122
+ const t = await $(b);
123
+ e.oss = t, i.value.push(e), D({
124
+ file: a,
125
+ dirName: O,
121
126
  oss: t,
122
127
  successCallBack(n) {
123
- const i = a.value.find((l) => l.uid === e.uid);
124
- i && (i.status = "success", i.path = n), c.value ? c.value.push(w(g, n, s.name)) : c.value = [w(g, n, s.name)], v.push({
128
+ const s = i.value.find((p) => p.uid === e.uid);
129
+ s && (s.status = "success", s.path = n), c.value ? c.value.push(w(v, n, a.name)) : c.value = [w(v, n, a.name)], _.push({
125
130
  uid: e.uid,
126
131
  path: n
127
- }), h.value--;
132
+ }), g.value--;
128
133
  },
129
134
  errorCallBack(n) {
130
- d.warning(n || "网络异常");
131
- const i = a.value.findIndex((l) => l.uid === e.uid);
132
- i > -1 && a.value.splice(i, 1), h.value--;
135
+ m.warning(n || r("ap.apUpload.networkAnomaly"));
136
+ const s = i.value.findIndex((p) => p.uid === e.uid);
137
+ s > -1 && i.value.splice(s, 1), g.value--;
133
138
  },
134
139
  progressCallBack(n) {
135
- const i = a.value.find((l) => l.uid === e.uid);
136
- i && (i.percent = n);
140
+ const s = i.value.find((p) => p.uid === e.uid);
141
+ s && (s.percent = n);
137
142
  }
138
143
  });
139
144
  } catch (t) {
140
- d.warning(typeof (t == null ? void 0 : t.message) == "string" ? t.message : "网络异常");
141
- const n = a.value.findIndex((i) => i.uid === e.uid);
142
- n > -1 && a.value.splice(n, 1), h.value--;
145
+ m.warning(
146
+ typeof (t == null ? void 0 : t.message) == "string" ? t.message : r("ap.apUpload.networkAnomaly")
147
+ );
148
+ const n = i.value.findIndex((s) => s.uid === e.uid);
149
+ n > -1 && i.value.splice(n, 1), g.value--;
143
150
  }
144
151
  }
145
- function U(e) {
152
+ function V(e) {
146
153
  var t;
147
154
  if (e.path) {
148
155
  if (Array.isArray(c.value)) {
149
- const n = v.findIndex((i) => i.uid === e.uid);
150
- n >= 0 && (c == null || c.value.splice(n, 1), v.splice(n, 1)), c.value.length === 0 && (c.value = void 0);
156
+ const n = _.findIndex((s) => s.uid === e.uid);
157
+ n >= 0 && (c == null || c.value.splice(n, 1), _.splice(n, 1)), c.value.length === 0 && (c.value = void 0);
151
158
  }
152
159
  } else
153
160
  (t = e == null ? void 0 : e.oss) == null || t.pauseUpload();
154
- const s = a.value.findIndex((n) => n.uid === e.uid);
155
- return a.value.splice(s, 1), Promise.resolve(!0);
161
+ const a = i.value.findIndex((n) => n.uid === e.uid);
162
+ return i.value.splice(a, 1), Promise.resolve(!0);
156
163
  }
157
- return (e, s) => (p(), m("div", {
158
- class: J({
159
- [o(k)()]: !0,
160
- [o(k)("admin")]: o(S) === "admin"
164
+ return (e, a) => (f(), h("div", {
165
+ class: K({
166
+ [o(A)()]: !0,
167
+ [o(A)("admin")]: o(E) === "admin"
161
168
  })
162
169
  }, [
163
- f("input", {
170
+ d("input", {
164
171
  style: { display: "none" },
165
172
  type: "file",
166
173
  ref_key: "fileRef",
167
- ref: _,
174
+ ref: x,
168
175
  accept: o(y),
169
- onChange: M
170
- }, null, 40, oe),
171
- f("div", ce, [
172
- (p(!0), m(K, null, Q(o(a), (t) => (p(), m("div", {
176
+ onChange: B
177
+ }, null, 40, ue),
178
+ d("div", re, [
179
+ (f(!0), h(Q, null, W(o(i), (t) => (f(), h("div", {
173
180
  class: "picture-item",
174
181
  key: t.uid
175
182
  }, [
176
- f("div", ue, [
177
- f("img", {
183
+ d("div", le, [
184
+ d("img", {
178
185
  src: t.thumbUrl,
179
186
  alt: ""
180
- }, null, 8, re),
181
- W(f("div", le, [
182
- f("div", {
187
+ }, null, 8, pe),
188
+ X(d("div", de, [
189
+ d("div", {
183
190
  class: "picture-item-close",
184
- onClick: (n) => U(t)
191
+ onClick: (n) => V(t)
185
192
  }, [
186
- C(o(F))
187
- ], 8, de),
188
- t.status === "uploading" ? (p(), m("div", fe, [
189
- C(o(ie), {
193
+ C(o(ee))
194
+ ], 8, me),
195
+ t.status === "uploading" ? (f(), h("div", fe, [
196
+ C(o(oe), {
190
197
  percent: t.percent,
191
198
  strokeColor: "#ffffff",
192
199
  trailColor: "rgba(255, 255, 255, 0.3)",
193
200
  size: 4,
194
201
  showInfo: !1
195
202
  }, null, 8, ["percent"])
196
- ])) : P("", !0)
203
+ ])) : R("", !0)
197
204
  ], 512), [
198
- [X, t.status === "uploading"]
205
+ [Y, t.status === "uploading"]
199
206
  ])
200
207
  ])
201
208
  ]))), 128)),
202
- o(r) === void 0 || o(a).length < o(r) ? (p(), m("div", {
209
+ o(l) === void 0 || o(i).length < o(l) ? (f(), h("div", {
203
210
  key: 0,
204
211
  class: "picture-upload",
205
- onClick: z
212
+ onClick: T
206
213
  }, [
207
- C(o(ee)),
208
- pe
209
- ])) : P("", !0)
214
+ C(o(te)),
215
+ d("div", null, U(o(r)("ap.apUpload.update")), 1)
216
+ ])) : R("", !0)
210
217
  ]),
211
- f("div", me, [
212
- o(N) ? (p(), m("div", he, B(o(N)), 1)) : (p(), m("div", ge, B(`支持扩展名:${o(se)(o(y))},图片大小小于${o(x)}MB`), 1))
218
+ d("div", he, [
219
+ o(N) ? (f(), h("div", ge, U(o(N)), 1)) : (f(), h("div", ve, U(`${o(r)("ap.apUpload.supportExtension")}:${o(se)(o(y))},${o(r)(
220
+ "ap.apUpload.maxUploadPictureSize",
221
+ { maxSize: o(k) }
222
+ )}`), 1))
213
223
  ])
214
224
  ], 2));
215
225
  }
216
226
  });
217
227
  export {
218
- Re as default
228
+ be as default
219
229
  };