@aplus-frontend/ui 0.0.28 → 0.0.29

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 (69) 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-table/hooks/use-table-paging.mjs +23 -21
  10. package/es/src/ap-upload/apUpload.vue.d.ts +3 -11
  11. package/es/src/ap-upload/apUpload.vue.mjs +42 -36
  12. package/es/src/ap-upload/components/MultipleFile.vue2.mjs +115 -102
  13. package/es/src/ap-upload/components/Picture.vue2.mjs +121 -111
  14. package/es/src/ap-upload/components/SingleFile.vue2.mjs +120 -109
  15. package/es/src/ap-upload/hooks/useOss.d.ts +9 -4
  16. package/es/src/ap-upload/hooks/useOss.mjs +52 -34
  17. package/es/src/ap-upload/utils/accept.d.ts +3 -0
  18. package/es/src/ap-upload/utils/accept.mjs +35 -30
  19. package/es/src/business/ap-status/ApStatusGroup.vue.d.ts +7 -2
  20. package/es/src/business/ap-status/ApStatusGroup.vue2.mjs +7 -6
  21. package/es/src/business/ap-status/interface.d.ts +4 -1
  22. package/es/src/business/index.d.ts +41 -8
  23. package/es/src/config-provider/config-provider-props.d.ts +5 -1
  24. package/es/src/config-provider/config-provider-props.mjs +4 -0
  25. package/es/src/config-provider/config-provider.d.ts +10 -1
  26. package/es/src/config-provider/config-provider.mjs +9 -8
  27. package/es/src/config-provider/constants.d.ts +10 -0
  28. package/es/src/config-provider/hooks/use-global-config.d.ts +5 -1
  29. package/es/src/config-provider/index.d.ts +20 -1
  30. package/es/src/locale/lang/en.mjs +24 -0
  31. package/es/src/locale/lang/zh-cn.mjs +24 -0
  32. package/es/src/work-order-modal/createWorkOrder.d.ts +3 -1
  33. package/es/src/work-order-modal/interfaces.d.ts +3 -1
  34. package/es/src/work-order-modal/work-order-modal.vue.mjs +7 -7
  35. package/lib/src/ap-download/hooks/index.js +1 -1
  36. package/lib/src/ap-download/interface.d.ts +2 -2
  37. package/lib/src/ap-field/date/helper.js +1 -1
  38. package/lib/src/ap-field/date-range/index.vue.js +1 -1
  39. package/lib/src/ap-form/ap-form-list.vue.js +1 -1
  40. package/lib/src/ap-form/ap-form.vue2.js +1 -1
  41. package/lib/src/ap-form/interface.d.ts +4 -0
  42. package/lib/src/ap-form/search-form/index.vue.js +1 -1
  43. package/lib/src/ap-table/hooks/use-table-paging.js +1 -1
  44. package/lib/src/ap-upload/apUpload.vue.d.ts +3 -11
  45. package/lib/src/ap-upload/apUpload.vue.js +1 -1
  46. package/lib/src/ap-upload/components/MultipleFile.vue2.js +1 -1
  47. package/lib/src/ap-upload/components/Picture.vue2.js +1 -1
  48. package/lib/src/ap-upload/components/SingleFile.vue2.js +1 -1
  49. package/lib/src/ap-upload/hooks/useOss.d.ts +9 -4
  50. package/lib/src/ap-upload/hooks/useOss.js +1 -1
  51. package/lib/src/ap-upload/utils/accept.d.ts +3 -0
  52. package/lib/src/ap-upload/utils/accept.js +1 -1
  53. package/lib/src/business/ap-status/ApStatusGroup.vue.d.ts +7 -2
  54. package/lib/src/business/ap-status/ApStatusGroup.vue2.js +1 -1
  55. package/lib/src/business/ap-status/interface.d.ts +4 -1
  56. package/lib/src/business/index.d.ts +41 -8
  57. package/lib/src/config-provider/config-provider-props.d.ts +5 -1
  58. package/lib/src/config-provider/config-provider-props.js +1 -1
  59. package/lib/src/config-provider/config-provider.d.ts +10 -1
  60. package/lib/src/config-provider/config-provider.js +1 -1
  61. package/lib/src/config-provider/constants.d.ts +10 -0
  62. package/lib/src/config-provider/hooks/use-global-config.d.ts +5 -1
  63. package/lib/src/config-provider/index.d.ts +20 -1
  64. package/lib/src/locale/lang/en.js +1 -1
  65. package/lib/src/locale/lang/zh-cn.js +1 -1
  66. package/lib/src/work-order-modal/createWorkOrder.d.ts +3 -1
  67. package/lib/src/work-order-modal/interfaces.d.ts +3 -1
  68. package/lib/src/work-order-modal/work-order-modal.vue.js +1 -1
  69. package/package.json +1 -1
@@ -1,20 +1,21 @@
1
1
  import { client as t } from "@aplus-frontend/oss";
2
- function i() {
2
+ function o() {
3
3
  return { client: t };
4
4
  }
5
5
  async function e(n) {
6
6
  if (!n)
7
7
  throw new Error("请传入getOssAccess");
8
8
  return await t.initOssClient({
9
+ locale: "zh_CN",
9
10
  getOssAccess: n,
10
11
  onFailure: (s) => {
11
12
  throw new Error(
12
13
  typeof (s == null ? void 0 : s.message) == "string" ? s.message : "获取oss临时权限失败"
13
14
  );
14
15
  }
15
- }), i();
16
+ }), o();
16
17
  }
17
18
  export {
18
- i as useOss,
19
+ o as useOss,
19
20
  e as useOssInit
20
21
  };
@@ -1,4 +1,4 @@
1
- interface accessCreate {
1
+ interface AccessCreate {
2
2
  bucket: string;
3
3
  regionId: string;
4
4
  endpoint: string;
@@ -28,6 +28,6 @@ export interface ApDownLoadProps {
28
28
  */
29
29
  disabled?: boolean;
30
30
  fileName: string;
31
- getOssAccess: () => Promise<accessCreate>;
31
+ getOssAccess: () => Promise<AccessCreate>;
32
32
  }
33
33
  export {};
@@ -1,15 +1,15 @@
1
1
  import { getUtcTimestamp as m } from "@aplus-frontend/utils";
2
2
  import n from "dayjs";
3
- const i = (o, r, e = !0) => {
3
+ const i = (o, e, r = !0) => {
4
4
  if (!o)
5
5
  return null;
6
6
  let t = o.clone();
7
- return t = t.millisecond(0), r.indexOf("ss") === -1 && (t = t.second(e ? 0 : 59)), r.indexOf("mm") === -1 && (t = t.minute(e ? 0 : 59)), r.indexOf("HH") === -1 && (t = t.hour(e ? 0 : 23)), r.indexOf("DD") === -1 && (t = t.date(e ? 1 : 0), e || (t = t.month(t.month() + 1))), r.indexOf("MM") === -1 && (t = t.month(e ? 0 : 12)), t.valueOf();
7
+ return t = t.millisecond(0), e.indexOf("ss") === -1 && (t = t.second(r ? 0 : 59)), e.indexOf("mm") === -1 && (t = t.minute(r ? 0 : 59)), e.indexOf("HH") === -1 && (t = t.hour(r ? 0 : 23)), e.indexOf("DD") === -1 && (t = t.date(r ? 1 : 0), r || (t = t.month(t.month() + 1))), e.indexOf("MM") === -1 && (t = t.month(r ? 0 : 12)), t.valueOf();
8
8
  };
9
9
  function d(o) {
10
- return (r, e, t = !0) => {
11
- const f = o ? n(m(r, o)) : n(r);
12
- return i(f, e, t);
10
+ return (e, r, t = !0) => {
11
+ const f = i(e, r, t);
12
+ return o ? m(n(f), o) : f;
13
13
  };
14
14
  }
15
15
  const l = (o) => o && o.valueOf();
@@ -101,8 +101,8 @@ const fe = /* @__PURE__ */ x({
101
101
  const e = t(p);
102
102
  if (S(e) || !(e != null && e.length))
103
103
  return e;
104
- const n = o.timezone ? M(t(p)[0], o.timezone) : (l = t(p)) == null ? void 0 : l[0], a = o.timezone ? M(t(p)[1], o.timezone) : (d = t(p)) == null ? void 0 : d[1];
105
- return [u(n), u(a)];
104
+ const a = o.timezone ? M(t(p)[0], o.timezone) : (l = t(p)) == null ? void 0 : l[0], n = o.timezone ? M(t(p)[1], o.timezone) : (d = t(p)) == null ? void 0 : d[1];
105
+ return console.log("val", e, a, n), [u(a), u(n)];
106
106
  }), A = c(() => t(i) ? o.picker ?? Z[o.format] : o.picker), F = c(() => {
107
107
  const e = t(i) ? q[o.format] : {};
108
108
  return {
@@ -124,31 +124,31 @@ const fe = /* @__PURE__ */ x({
124
124
  h(e);
125
125
  return;
126
126
  }
127
- let n = f(e[0]) ? u(e[0]) : e[0], a = f(e[1]) ? u(e[1]) : e[1];
128
- t(i) ? h([
129
- m(n, t(r)),
130
- m(a, t(r), !1)
131
- ]) : h([D(n), D(a)]);
127
+ let a = f(e[0]) ? u(e[0]) : e[0], n = f(e[1]) ? u(e[1]) : e[1];
128
+ console.log(a, n), t(i) ? h([
129
+ m(a, t(r)),
130
+ m(n, t(r), !1)
131
+ ]) : h([D(a), D(n)]);
132
132
  }
133
133
  function E(e) {
134
134
  var s;
135
- const n = f(e[0]) ? u(e[0]) : e[0], a = f(e[1]) ? u(e[1]) : e[1], l = e[0] ? t(i) ? m(n, t(r)) : n.valueOf() : null, d = e[1] ? t(i) ? m(a, t(r), !1) : a.valueOf() : null;
135
+ const a = f(e[0]) ? u(e[0]) : e[0], n = f(e[1]) ? u(e[1]) : e[1], l = e[0] ? t(i) ? m(a, t(r)) : a.valueOf() : null, d = e[1] ? t(i) ? m(n, t(r), !1) : n.valueOf() : null;
136
136
  (s = o.onOk) == null || s.call(o, [l, d]);
137
137
  }
138
- function N(e, n) {
138
+ function N(e, a) {
139
139
  var y, P;
140
140
  if (S(e)) {
141
- (y = o.onChange) == null || y.call(o, e, n);
141
+ (y = o.onChange) == null || y.call(o, e, a);
142
142
  return;
143
143
  }
144
- const a = f(e[0]) ? u(e[0]) : e[0], l = f(e[1]) ? u(e[1]) : e[1], d = e[0] ? t(i) ? m(a, t(r)) : a.valueOf() : null, s = e[1] ? t(i) ? m(l, t(r), !1) : l.valueOf() : null;
145
- (P = o.onChange) == null || P.call(o, [d, s], n);
144
+ const n = f(e[0]) ? u(e[0]) : e[0], l = f(e[1]) ? u(e[1]) : e[1], d = e[0] ? t(i) ? m(n, t(r)) : n.valueOf() : null, s = e[1] ? t(i) ? m(l, t(r), !1) : l.valueOf() : null;
145
+ (P = o.onChange) == null || P.call(o, [d, s], a);
146
146
  }
147
- return (e, n) => {
148
- var a, l;
147
+ return (e, a) => {
148
+ var n, l;
149
149
  return e.mode === "read" ? (g(), k(B, { key: 0 }, [
150
150
  v.value ? (g(), k(B, { key: 0 }, [
151
- O(C((a = v.value[0]) == null ? void 0 : a.format(r.value)) + " ", 1),
151
+ O(C((n = v.value[0]) == null ? void 0 : n.format(r.value)) + " ", 1),
152
152
  T(e.$slots, "readModeSeparator", {}, () => [
153
153
  V(t(Q))
154
154
  ]),
@@ -1,38 +1,46 @@
1
- import { defineComponent as d, computed as f, unref as u, renderSlot as k } from "vue";
2
- import { useInjectForm as F } from "./context.mjs";
3
- import { isArray as h } from "lodash-unified";
4
- const w = /* @__PURE__ */ d({
1
+ import { defineComponent as F, onMounted as V, computed as f, unref as m, renderSlot as k } from "vue";
2
+ import { useInjectForm as h } from "./context.mjs";
3
+ import { isArray as A } from "lodash-unified";
4
+ const w = /* @__PURE__ */ F({
5
5
  name: "ApFormList",
6
6
  __name: "ap-form-list",
7
7
  props: {
8
- name: {}
8
+ name: {},
9
+ initialValue: {}
9
10
  },
10
- setup(l) {
11
+ setup(p) {
11
12
  let s = 1;
12
- const o = [], t = l, { model: a, updateModel: r } = F(), c = f(() => h(t.name) ? t.name.reduce((e, n) => e == null ? void 0 : e.value[n], a) : a == null ? void 0 : a.value[t.name]);
13
- function p(e = void 0) {
14
- const n = u(c) ? [...u(c), e] : [e];
13
+ const o = [], t = p, { model: i, updateModel: r, internalInstance: l } = h();
14
+ V(() => {
15
+ l == null || l.registerField({
16
+ name: t.name,
17
+ initialValue: t.initialValue
18
+ });
19
+ });
20
+ const a = f(() => A(t.name) ? t.name.reduce((e, n) => e == null ? void 0 : e.value[n], i) : i == null ? void 0 : i.value[t.name]);
21
+ function y(e = void 0) {
22
+ const n = m(a) ? [...m(a), e] : [e];
15
23
  o.push(s), s += 1, r == null || r(t.name, n);
16
24
  }
17
- function y(e) {
18
- let n = u(c) || [];
25
+ function _(e) {
26
+ let n = m(a) || [];
19
27
  n = [...n.slice(0, e), ...n.slice(e + 1)], o.splice(e, 1), r == null || r(t.name, n);
20
28
  }
21
- const _ = {
22
- add: p,
23
- remove: y
24
- }, v = f(() => (u(c) || []).map((n, m) => {
25
- let i = o[m];
26
- return typeof i > "u" && (o[m] = s, i = s, s += 1), {
27
- key: i,
28
- fieldName: m,
29
- name: [t.name, m],
29
+ const d = {
30
+ add: y,
31
+ remove: _
32
+ }, v = f(() => (m(a) || []).map((n, u) => {
33
+ let c = o[u];
34
+ return typeof c > "u" && (o[u] = s, c = s, s += 1), {
35
+ key: c,
36
+ fieldName: u,
37
+ name: [t.name, u],
30
38
  value: n
31
39
  };
32
40
  }));
33
41
  return (e, n) => k(e.$slots, "default", {
34
42
  fields: v.value,
35
- actions: _
43
+ actions: d
36
44
  });
37
45
  }
38
46
  });
@@ -1,10 +1,10 @@
1
- import { defineComponent as x, ref as A, reactive as E, nextTick as N, toRaw as m, computed as O, openBlock as w, createBlock as j, unref as y, mergeProps as S, withCtx as W, renderSlot as q } from "vue";
2
- import { Form as z } from "ant-design-vue";
3
- import { useProvideForm as D } from "./context.mjs";
4
- import { isArray as g, cloneDeep as L, omit as P } from "lodash-unified";
1
+ import { defineComponent as A, ref as E, reactive as N, nextTick as O, toRaw as m, computed as w, openBlock as j, createBlock as S, unref as C, mergeProps as W, withCtx as q, renderSlot as z } from "vue";
2
+ import { Form as L } from "ant-design-vue";
3
+ import { useProvideForm as P } from "./context.mjs";
4
+ import { isArray as g, omit as D } from "lodash-unified";
5
5
  import { INTERNAL_FORM_INSTANCE_MARK as K } from "./constant.mjs";
6
- import { isDef as $ } from "../utils/index.mjs";
7
- const Y = /* @__PURE__ */ x({
6
+ import { isDef as p } from "../utils/index.mjs";
7
+ const X = /* @__PURE__ */ A({
8
8
  __name: "ap-form",
9
9
  props: {
10
10
  layout: { default: "horizontal" },
@@ -32,112 +32,112 @@ const Y = /* @__PURE__ */ x({
32
32
  onValidate: {},
33
33
  initialValues: {}
34
34
  },
35
- setup(C, { expose: _ }) {
36
- const a = C;
37
- function p(e, t, l = !0) {
38
- var v;
35
+ setup(_, { expose: V }) {
36
+ const a = _;
37
+ function h(e, t, l = !0) {
38
+ var y;
39
39
  if (g(e)) {
40
- let f = o;
41
- for (let c = 0; c < e.length - 1; c++)
42
- f = f[e[c]];
43
- f[e[e.length - 1]] = t;
40
+ let n = o;
41
+ for (let u = 0; u < e.length - 1; u++)
42
+ e[u] in n || (n[e[u]] = {}), n = n[e[u]];
43
+ n[e[e.length - 1]] = t;
44
44
  } else
45
45
  o[e] = t;
46
- let i = g(e) ? e[0] : e;
47
- l && ((v = a.onValuesChange) == null || v.call(a, { [i]: o[i] }, o)), u();
46
+ let r = g(e) ? e[0] : e;
47
+ l && ((y = a.onValuesChange) == null || y.call(a, { [r]: o[r] }, o)), d();
48
48
  }
49
- const r = A();
50
- let s = a.initialValues || {};
51
- const o = E(a.initialValues || {});
52
- let n = [];
53
- const V = () => {
49
+ const i = E();
50
+ let f = a.initialValues || {};
51
+ const o = N(a.initialValues || {});
52
+ let s = [];
53
+ const R = () => {
54
54
  var e;
55
- (e = r.value) == null || e.resetFields(), N(() => {
56
- Object.keys(o).forEach((t) => delete o[t]), Object.assign(o, s), u();
55
+ (e = i.value) == null || e.resetFields(), O(() => {
56
+ Object.keys(o).forEach((t) => delete o[t]), Object.assign(o, f), d();
57
57
  });
58
- }, R = (e) => {
58
+ }, B = (e) => {
59
59
  var t;
60
- (t = r.value) == null || t.clearValidate(e);
61
- }, B = (e, t) => {
60
+ (t = i.value) == null || t.clearValidate(e);
61
+ }, I = (e, t) => {
62
62
  var l;
63
- return (l = r.value) == null ? void 0 : l.validateFields(e, t);
64
- }, I = (e) => {
63
+ return (l = i.value) == null ? void 0 : l.validateFields(e, t);
64
+ }, M = (e) => {
65
65
  var t;
66
- return (t = r.value) == null ? void 0 : t.getFieldsValue(e);
67
- }, M = (e, t) => {
66
+ return (t = i.value) == null ? void 0 : t.getFieldsValue(e);
67
+ }, T = (e, t) => {
68
68
  var l;
69
- return (l = r.value) == null ? void 0 : l.validate(e, t);
70
- }, T = (e, t = {}) => {
69
+ return (l = i.value) == null ? void 0 : l.validate(e, t);
70
+ }, b = (e, t = {}) => {
71
71
  var l;
72
- (l = r.value) == null || l.scrollToField(e, t);
73
- }, b = (e) => {
74
- Object.assign(o, e), u();
75
- }, h = (e, t) => {
76
- o[e] = t, u();
72
+ (l = i.value) == null || l.scrollToField(e, t);
73
+ }, k = (e) => {
74
+ Object.assign(o, e), d();
75
+ }, F = (e, t) => {
76
+ o[e] = t, d();
77
77
  };
78
- function d(e, t) {
79
- return t || e(m(o)), n.push(e), () => {
80
- n = n.filter((l) => l !== e);
78
+ function c(e, t) {
79
+ return t || e(m(o)), s.push(e), () => {
80
+ s = s.filter((l) => l !== e);
81
81
  };
82
82
  }
83
- function F({ initialValue: e, name: t }) {
84
- if ($(e))
85
- if (p(t, e, !1), g(t)) {
86
- let l = L(s);
87
- for (let i = 0; i < t.length - 1; i++)
88
- l[t[i]] && (l[t[i]] = {});
89
- l[t[t.length - 1]] = e, s = l;
83
+ function v({ initialValue: e, name: t }) {
84
+ if (p(e) && p(t))
85
+ if (h(t, e, !1), g(t)) {
86
+ let l = f;
87
+ for (let r = 0; r < t.length - 1; r++)
88
+ p(l[t[r]]) || (l[t[r]] = {}), l = l[t[r]];
89
+ l[t[t.length - 1]] = e;
90
90
  } else
91
- s[t] = e;
91
+ f[t] = e;
92
92
  }
93
- function k(e) {
93
+ function x(e) {
94
94
  if (e !== K) {
95
95
  console.warn("getInternalInstance should only used at internal");
96
96
  return;
97
97
  }
98
98
  return {
99
- registerField: F,
100
- registerWatch: d
99
+ registerField: v,
100
+ registerWatch: c
101
101
  };
102
102
  }
103
- function u() {
104
- if (n.length) {
103
+ function d() {
104
+ if (s.length) {
105
105
  const e = m(o);
106
- n.forEach((t) => {
106
+ s.forEach((t) => {
107
107
  t(e);
108
108
  });
109
109
  }
110
110
  }
111
- return D({
112
- model: O(() => o),
113
- updateModel: p,
111
+ return P({
112
+ model: w(() => o),
113
+ updateModel: h,
114
114
  internalInstance: {
115
- registerWatch: d,
116
- registerField: F,
117
- setFieldValue: h
115
+ registerWatch: c,
116
+ registerField: v,
117
+ setFieldValue: F
118
118
  }
119
- }), _({
120
- resetFields: V,
121
- clearValidate: R,
122
- validateFields: B,
123
- getFieldsValue: I,
124
- validate: M,
125
- scrollToField: T,
126
- setFieldsValue: b,
127
- setFieldValue: h,
128
- registerWatch: d,
129
- getInternalInstance: k
130
- }), (e, t) => (w(), j(y(z), S({
119
+ }), V({
120
+ resetFields: R,
121
+ clearValidate: B,
122
+ validateFields: I,
123
+ getFieldsValue: M,
124
+ validate: T,
125
+ scrollToField: b,
126
+ setFieldsValue: k,
127
+ setFieldValue: F,
128
+ registerWatch: c,
129
+ getInternalInstance: x
130
+ }), (e, t) => (j(), S(C(L), W({
131
131
  ref_key: "formRef",
132
- ref: r
133
- }, y(P)(a, ["initialValues"]), { model: o }), {
134
- default: W(() => [
135
- q(e.$slots, "default")
132
+ ref: i
133
+ }, C(D)(a, ["initialValues"]), { model: o }), {
134
+ default: q(() => [
135
+ z(e.$slots, "default")
136
136
  ]),
137
137
  _: 3
138
138
  }, 16, ["model"]));
139
139
  }
140
140
  });
141
141
  export {
142
- Y as default
142
+ X as default
143
143
  };
@@ -73,6 +73,10 @@ export type ApFormItemExpose = FormItemExpose & {
73
73
  };
74
74
  export type ApFormListProps = {
75
75
  name: FormItemProps['name'];
76
+ /**
77
+ * 设置FormList的默认值
78
+ */
79
+ initialValue?: any[];
76
80
  };
77
81
  export type ApFormSearchFormProps = ApFormProps & {
78
82
  collapse?: boolean;