@aplus-frontend/ui 0.2.26 → 0.2.28

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 (27) hide show
  1. package/es/src/ap-form/search-form/index.vue.mjs +77 -77
  2. package/es/src/ap-form/search-form/utils.d.ts +1 -0
  3. package/es/src/ap-form/search-form/utils.mjs +18 -11
  4. package/es/src/ap-upload/components/MultipleFile.vue2.mjs +12 -15
  5. package/es/src/ap-upload/components/Picture.vue2.mjs +10 -13
  6. package/es/src/ap-upload/components/SingleFile.vue2.mjs +15 -18
  7. package/es/src/business/ap-export-group/ApExportGroup.vue.d.ts +15 -1
  8. package/es/src/business/ap-export-group/ApExportGroup.vue2.mjs +57 -56
  9. package/es/src/business/ap-export-group/index.d.ts +57 -35
  10. package/es/src/business/ap-export-group/interface.d.ts +1 -0
  11. package/es/src/business/ap-summary/ap-summary.vue2.mjs +5 -5
  12. package/es/src/locale/lang/en.mjs +2 -1
  13. package/es/src/locale/lang/zh-cn.mjs +2 -1
  14. package/lib/src/ap-form/search-form/index.vue.js +1 -1
  15. package/lib/src/ap-form/search-form/utils.d.ts +1 -0
  16. package/lib/src/ap-form/search-form/utils.js +1 -1
  17. package/lib/src/ap-upload/components/MultipleFile.vue2.js +1 -1
  18. package/lib/src/ap-upload/components/Picture.vue2.js +1 -1
  19. package/lib/src/ap-upload/components/SingleFile.vue2.js +1 -1
  20. package/lib/src/business/ap-export-group/ApExportGroup.vue.d.ts +15 -1
  21. package/lib/src/business/ap-export-group/ApExportGroup.vue2.js +1 -1
  22. package/lib/src/business/ap-export-group/index.d.ts +57 -35
  23. package/lib/src/business/ap-export-group/interface.d.ts +1 -0
  24. package/lib/src/business/ap-summary/ap-summary.vue2.js +1 -1
  25. package/lib/src/locale/lang/en.js +1 -1
  26. package/lib/src/locale/lang/zh-cn.js +1 -1
  27. package/package.json +4 -4
@@ -1,24 +1,24 @@
1
- import { isVNode as ne, defineComponent as le, useSlots as re, ref as se, unref as o, shallowRef as V, computed as g, watch as j, cloneVNode as ie, createVNode as n, Fragment as _, openBlock as m, createBlock as y, mergeProps as ue, withCtx as S, resolveDynamicComponent as A, createElementBlock as ce, renderList as pe } from "vue";
2
- import { Col as B, Flex as M, Space as de, Button as E, Row as fe } from "@aplus-frontend/antdv";
1
+ import { isVNode as le, defineComponent as re, useSlots as se, ref as ie, unref as o, shallowRef as V, computed as g, watch as j, cloneVNode as ue, createVNode as a, Fragment as _, openBlock as m, createBlock as y, mergeProps as ce, withCtx as S, resolveDynamicComponent as A, createElementBlock as pe, renderList as de } from "vue";
2
+ import { Col as F, Flex as M, Space as fe, Button as E, Row as me } from "@aplus-frontend/antdv";
3
3
  import "../ap-form.vue.mjs";
4
4
  import "../item/index.vue2.mjs";
5
5
  import "../../hooks/index.mjs";
6
6
  import { genRealChildren as D } from "../item-group/helper.mjs";
7
- import { DoubleRightOutlined as me } from "@ant-design/icons-vue";
7
+ import { DoubleRightOutlined as he } from "@ant-design/icons-vue";
8
8
  import "../../config-provider/index.mjs";
9
- import { isArray as he, isBoolean as xe, omit as ye } from "lodash-unified";
9
+ import { isArray as xe, isBoolean as ye, omit as Ce } from "lodash-unified";
10
10
  import { isDef as $ } from "../../utils/index.mjs";
11
- import { diffFormItem as Ce } from "./utils.mjs";
12
- import { useControllableValue as ge } from "../../hooks/useControllableValue.mjs";
13
- import { useNamespace as _e } from "../../config-provider/hooks/use-namespace.mjs";
11
+ import { execFunc as L, diffFormItem as ge } from "./utils.mjs";
12
+ import { useControllableValue as _e } from "../../hooks/useControllableValue.mjs";
13
+ import { useNamespace as Fe } from "../../config-provider/hooks/use-namespace.mjs";
14
14
  import { useGlobalConfig as Be } from "../../config-provider/hooks/use-global-config.mjs";
15
- import { useLocale as Fe } from "../../config-provider/hooks/use-locale.mjs";
16
- import L from "../item/index.vue.mjs";
17
- import Re from "../ap-form.vue2.mjs";
18
- function Se(h) {
19
- return typeof h == "function" || Object.prototype.toString.call(h) === "[object Object]" && !ne(h);
15
+ import { useLocale as Re } from "../../config-provider/hooks/use-locale.mjs";
16
+ import U from "../item/index.vue.mjs";
17
+ import Se from "../ap-form.vue2.mjs";
18
+ function Ae(h) {
19
+ return typeof h == "function" || Object.prototype.toString.call(h) === "[object Object]" && !le(h);
20
20
  }
21
- const i = 24, We = /* @__PURE__ */ le({
21
+ const i = 24, qe = /* @__PURE__ */ re({
22
22
  name: "ApFormSearchForm",
23
23
  __name: "index",
24
24
  props: {
@@ -104,55 +104,55 @@ const i = 24, We = /* @__PURE__ */ le({
104
104
  },
105
105
  emits: ["update:collapse"],
106
106
  setup(h, {
107
- expose: U,
108
- emit: W
107
+ expose: W,
108
+ emit: q
109
109
  }) {
110
110
  var N;
111
- const s = re(), a = h, q = W, {
111
+ const s = se(), n = h, z = q, {
112
112
  value: u,
113
- updateValue: z
114
- } = ge(a, q, {
113
+ updateValue: H
114
+ } = _e(n, z, {
115
115
  valuePropName: "collapse",
116
116
  defaultValuePropName: "defaultCollapse"
117
117
  }), {
118
- b: H
119
- } = _e("ap-form-search-form"), G = Be("uiMode"), {
118
+ b: G
119
+ } = Fe("ap-form-search-form"), J = Be("uiMode"), {
120
120
  t: b
121
- } = Fe(), C = se();
122
- function J() {
123
- z(!o(u));
124
- }
121
+ } = Re(), C = ie();
125
122
  function K() {
126
- var e, t;
127
- (t = (e = C.value) == null ? void 0 : e.validateFields()) == null || t.then(a.onSubmit);
123
+ H(!o(u));
128
124
  }
129
125
  function Q() {
130
- var e, t, l;
131
- a.customReset || (t = (e = C.value) == null ? void 0 : e.resetFields) == null || t.call(e), (l = a.onReset) == null || l.call(a);
126
+ var e, t;
127
+ (t = (e = C.value) == null ? void 0 : e.validateFields()) == null || t.then((l) => L(n.onSubmit, l));
128
+ }
129
+ function X() {
130
+ var e, t;
131
+ n.customReset || (t = (e = C.value) == null ? void 0 : e.resetFields) == null || t.call(e), L(n.onReset);
132
132
  }
133
133
  let v = [];
134
- const F = V(D(s.default())), p = V((N = s.extra) == null ? void 0 : N.call(s)), w = g(() => Math.floor(i / a.countPerRow));
134
+ const B = V(D(s.default())), p = V((N = s.extra) == null ? void 0 : N.call(s)), w = g(() => Math.floor(i / n.countPerRow));
135
135
  j(() => s.default(), (e) => {
136
- v = F.value, F.value = Ce(v, D(e));
136
+ v = B.value, B.value = ge(v, D(e));
137
137
  }), j(() => {
138
138
  var e;
139
139
  return (e = s.extra) == null ? void 0 : e.call(s);
140
140
  }, (e) => {
141
141
  p.value = e;
142
142
  });
143
- const X = (e) => $(e) ? (he(e) ? e : [e]).join("") : Date.now(), R = g(() => {
144
- const e = F.value, t = [], l = [], r = o(w);
143
+ const Y = (e) => $(e) ? (xe(e) ? e : [e]).join("") : Date.now(), R = g(() => {
144
+ const e = B.value, t = [], l = [], r = o(w);
145
145
  let d = 0;
146
146
  e.forEach((c) => {
147
147
  const f = c.props;
148
- (xe(f.hidden) ? !!f.hidden : $(f.hidden)) ? t.push(c) : (d += f.span || r, l.push(c));
148
+ (ye(f.hidden) ? !!f.hidden : $(f.hidden)) ? t.push(c) : (d += f.span || r, l.push(c));
149
149
  });
150
- const k = i - (d + r) % i, Z = d % i < r, ee = k < r ? i : k, I = i - r * (o(p) && !a.extraInAction ? 2 : 1), te = !a.forceExpand && d > I;
150
+ const k = i - (d + r) % i, ee = d % i < r, te = k < r ? i : k, I = i - r * (o(p) && !n.extraInAction ? 2 : 1), oe = !n.forceExpand && d > I;
151
151
  let P = 0, T = 0;
152
- const oe = l.map((c, f) => {
152
+ const ae = l.map((c, f) => {
153
153
  const x = c.props, O = x.span || r;
154
- if (P += O, !a.forceExpand && o(u) && P > I) {
155
- t.push(ie(c, {
154
+ if (P += O, !n.forceExpand && o(u) && P > I) {
155
+ t.push(ue(c, {
156
156
  class: "ant-form-item-hidden",
157
157
  hidden: !0
158
158
  }));
@@ -161,82 +161,82 @@ const i = 24, We = /* @__PURE__ */ le({
161
161
  return T += O, {
162
162
  node: c,
163
163
  span: x.span || r,
164
- key: `ApFormSearchFormItem-${f}-${X(x.name)}-${x._signal}`
164
+ key: `ApFormSearchFormItem-${f}-${Y(x.name)}-${x._signal}`
165
165
  };
166
- }).filter(Boolean), ae = i - T - r;
166
+ }).filter(Boolean), ne = i - T - r;
167
167
  return {
168
- hideNode: n(_, null, [t]),
169
- nodes: oe,
170
- defaultExtraSpan: ee,
171
- actualExtraSpan: ae,
172
- showCollapse: te,
173
- lastRowOnlyIncludeActionAndExtra: Z
168
+ hideNode: a(_, null, [t]),
169
+ nodes: ae,
170
+ defaultExtraSpan: te,
171
+ actualExtraSpan: ne,
172
+ showCollapse: oe,
173
+ lastRowOnlyIncludeActionAndExtra: ee
174
174
  };
175
- }), Y = g(() => {
175
+ }), Z = g(() => {
176
176
  let e;
177
- const t = o(R), l = n(B, {
177
+ const t = o(R), l = a(F, {
178
178
  span: o(w),
179
179
  key: "actionWrapper"
180
180
  }, {
181
- default: () => [n(L, null, {
182
- default: () => [n(M, {
183
- justify: !o(u) && t.lastRowOnlyIncludeActionAndExtra && !(o(p) && a.extraInAction) ? "flex-end" : "space-between"
181
+ default: () => [a(U, null, {
182
+ default: () => [a(M, {
183
+ justify: !o(u) && t.lastRowOnlyIncludeActionAndExtra && !(o(p) && n.extraInAction) ? "flex-end" : "space-between"
184
184
  }, {
185
- default: () => [n(de, null, {
186
- default: () => [n(E, {
185
+ default: () => [a(fe, null, {
186
+ default: () => [a(E, {
187
187
  type: "primary",
188
- onClick: K,
189
- loading: a.submitLoading,
188
+ onClick: Q,
189
+ loading: n.submitLoading,
190
190
  htmlType: "submit"
191
191
  }, {
192
- default: () => [a.searchText || b("ap.apForm.search.search")]
193
- }), n(E, {
194
- onClick: Q
192
+ default: () => [n.searchText || b("ap.apForm.search.search")]
193
+ }), a(E, {
194
+ onClick: X
195
195
  }, {
196
- default: () => [a.resetText || b("ap.apForm.search.reset")]
197
- }), t.showCollapse ? n(E, {
198
- onClick: J,
199
- icon: n(me, {
200
- style: G.value === "aplus" ? "color:#B8C3D1" : "color:#BFBFBF",
196
+ default: () => [n.resetText || b("ap.apForm.search.reset")]
197
+ }), t.showCollapse ? a(E, {
198
+ onClick: K,
199
+ icon: a(he, {
200
+ style: J.value === "aplus" ? "color:#B8C3D1" : "color:#BFBFBF",
201
201
  rotate: o(u) ? 90 : -90
202
202
  }, null)
203
203
  }, null) : null]
204
- }), a.extraInAction ? o(p) : null]
204
+ }), n.extraInAction ? o(p) : null]
205
205
  })]
206
206
  })]
207
- }), r = !a.extraInAction && o(p) ? n(B, {
207
+ }), r = !n.extraInAction && o(p) ? a(F, {
208
208
  span: o(u) ? t.actualExtraSpan : t.defaultExtraSpan,
209
209
  key: "extraNode"
210
210
  }, {
211
- default: () => [n(L, null, {
212
- default: () => [n(M, {
211
+ default: () => [a(U, null, {
212
+ default: () => [a(M, {
213
213
  justify: !o(u) && (t.defaultExtraSpan === i || t.lastRowOnlyIncludeActionAndExtra) ? "start" : "flex-end"
214
- }, Se(e = o(p)) ? e : {
214
+ }, Ae(e = o(p)) ? e : {
215
215
  default: () => [e]
216
216
  })]
217
217
  })]
218
- }) : null, d = n(B, {
218
+ }) : null, d = a(F, {
219
219
  span: t.defaultExtraSpan
220
220
  }, null);
221
- return !o(u) && t.lastRowOnlyIncludeActionAndExtra ? n(_, null, [r || d, l]) : n(_, null, [l, r]);
221
+ return !o(u) && t.lastRowOnlyIncludeActionAndExtra ? a(_, null, [r || d, l]) : a(_, null, [l, r]);
222
222
  });
223
- return U({
223
+ return W({
224
224
  apForm: g(() => o(C))
225
- }), (e, t) => (m(), y(Re, ue({
226
- class: o(H)(),
225
+ }), (e, t) => (m(), y(Se, ce({
226
+ class: o(G)(),
227
227
  ref_key: "apForm",
228
228
  ref: C
229
- }, o(ye)(a, ["collapse", "defaultCollapse", "onUpdate:collapse", "searchText", "resetText", "onSubmit", "onReset", "extraInAction", "forceExpand", "countPerRow"])), {
230
- default: S(() => [(m(), y(A(R.value.hideNode))), n(o(fe), {
229
+ }, o(Ce)(n, ["collapse", "defaultCollapse", "onUpdate:collapse", "searchText", "resetText", "onSubmit", "onReset", "extraInAction", "forceExpand", "countPerRow"])), {
230
+ default: S(() => [(m(), y(A(R.value.hideNode))), a(o(me), {
231
231
  gutter: 16
232
232
  }, {
233
- default: S(() => [(m(!0), ce(_, null, pe(R.value.nodes, (l) => (m(), y(o(B), {
233
+ default: S(() => [(m(!0), pe(_, null, de(R.value.nodes, (l) => (m(), y(o(F), {
234
234
  key: l.key,
235
235
  span: l.span
236
236
  }, {
237
237
  default: S(() => [(m(), y(A(l.node)))]),
238
238
  _: 2
239
- }, 1032, ["span"]))), 128)), (m(), y(A(Y.value)))]),
239
+ }, 1032, ["span"]))), 128)), (m(), y(A(Z.value)))]),
240
240
  _: 1
241
241
  })]),
242
242
  _: 1
@@ -244,5 +244,5 @@ const i = 24, We = /* @__PURE__ */ le({
244
244
  }
245
245
  });
246
246
  export {
247
- We as default
247
+ qe as default
248
248
  };
@@ -2,3 +2,4 @@ import { VNode, RendererNode, RendererElement } from 'vue';
2
2
  export declare function diffFormItem(prevNodes: VNode[], current: VNode[]): VNode< RendererNode, RendererElement, {
3
3
  [key: string]: any;
4
4
  }>[];
5
+ export declare function execFunc(func: any, ...params: any): void;
@@ -1,22 +1,22 @@
1
- import { cloneVNode as g } from "vue";
2
- import { isArray as y } from "lodash-unified";
1
+ import { cloneVNode as l } from "vue";
2
+ import { isArray as a, isFunction as p } from "lodash-unified";
3
3
  function M(n, r) {
4
- const t = p(n), e = p(r);
4
+ const t = u(n), e = u(r);
5
5
  return r.map((o) => {
6
- const i = u(o.props.name), c = e.get(i), s = t.get(i);
6
+ const i = m(o.props.name), c = e.get(i), s = t.get(i);
7
7
  if (!t.get(i) || (c == null ? void 0 : c.index) !== (s == null ? void 0 : s.index))
8
8
  return o;
9
- const a = f(s.item), m = f(c.item);
10
- return JSON.stringify(a) !== JSON.stringify(m) ? o : g(o, { _signal: s.item._signal });
9
+ const g = f(s.item), y = f(c.item);
10
+ return JSON.stringify(g) !== JSON.stringify(y) ? o : l(o, { _signal: s.item._signal });
11
11
  });
12
12
  }
13
- function u(n) {
14
- return n ? (y(n) ? n : [n]).map((t) => "" + t).join("") : "";
13
+ function m(n) {
14
+ return n ? (a(n) ? n : [n]).map((t) => "" + t).join("") : "";
15
15
  }
16
- function p(n) {
16
+ function u(n) {
17
17
  const r = /* @__PURE__ */ new Map();
18
18
  return n.forEach((t, e) => {
19
- const o = t.props, i = u(o.name);
19
+ const o = t.props, i = m(o.name);
20
20
  r.set(i, { item: o, index: e });
21
21
  }), r;
22
22
  }
@@ -29,6 +29,13 @@ function f(n) {
29
29
  }
30
30
  return r;
31
31
  }
32
+ function N(n, ...r) {
33
+ if (a(n))
34
+ for (const t of n)
35
+ p(t) && t(...r);
36
+ else p(n) && n(...r);
37
+ }
32
38
  export {
33
- M as diffFormItem
39
+ M as diffFormItem,
40
+ N as execFunc
34
41
  };
@@ -68,21 +68,18 @@ const me = { class: "multiple-file-context" }, de = { key: 0 }, fe = { key: 1 },
68
68
  })
69
69
  );
70
70
  }), v(e), !1;
71
- if (typeof _ == "function") {
72
- if (await _(e) === !1)
73
- return v(e), !1;
74
- } else {
75
- if (e.size > E * 1024 * 1024)
76
- return m.warning(
77
- O || r("ap.apUpload.maxUploadFileSize", {
78
- maxSize: E
79
- })
80
- ), v(e), !1;
81
- if (!le(e, h))
82
- return m.warning(
83
- D || r("ap.apUpload.fileFormatNotSupported")
84
- ), v(e), !1;
85
- }
71
+ if (e.size > E * 1024 * 1024)
72
+ return m.warning(
73
+ O || r("ap.apUpload.maxUploadFileSize", {
74
+ maxSize: E
75
+ })
76
+ ), v(e), !1;
77
+ if (!le(e, h))
78
+ return m.warning(
79
+ D || r("ap.apUpload.fileFormatNotSupported")
80
+ ), v(e), !1;
81
+ if (typeof _ == "function" && await _(e) === !1)
82
+ return v(e), !1;
86
83
  i && i === 1 && (p = [], a.value = void 0), p.push(e);
87
84
  }
88
85
  async function j(e) {
@@ -83,19 +83,16 @@ const he = ["accept"], ve = { class: "picture-context" }, xe = { class: "picture
83
83
  q || u("ap.apUpload.maxUploadPicture", { maxCount: l })
84
84
  );
85
85
  }), !1;
86
- if (typeof E == "function") {
87
- if (await E(e) === !1)
88
- return !1;
89
- } else {
90
- if (e.size > w * 1024 * 1024)
91
- return m.warning(
92
- L || u("ap.apUpload.maxUploadFileSize", { maxSize: w })
93
- ), !1;
94
- if (!/image\/\w+/.test(e.type) || !le(e, _))
95
- return m.warning(
96
- V || u("ap.apUpload.pictureFormatNotSupported")
97
- ), !1;
98
- }
86
+ if (e.size > w * 1024 * 1024)
87
+ return m.warning(
88
+ L || u("ap.apUpload.maxUploadFileSize", { maxSize: w })
89
+ ), !1;
90
+ if (!/image\/\w+/.test(e.type) || !le(e, _))
91
+ return m.warning(
92
+ V || u("ap.apUpload.pictureFormatNotSupported")
93
+ ), !1;
94
+ if (typeof E == "function" && await E(e) === !1)
95
+ return !1;
99
96
  const a = new FileReader();
100
97
  a.readAsDataURL(e), a.onload = function() {
101
98
  const t = {
@@ -93,25 +93,22 @@ const ye = ["accept"], we = {
93
93
  }
94
94
  async function T(e) {
95
95
  if (e != null && e.length) {
96
- if (typeof B == "function") {
97
- if (await B(e[0]) === !1)
98
- return;
99
- } else {
100
- if (e[0].size > D * 1024 * 1024) {
101
- u.warning(
102
- K || r("ap.apUpload.maxUploadFileSize", {
103
- maxSize: D
104
- })
105
- );
106
- return;
107
- }
108
- if (!fe(e[0], w)) {
109
- u.warning(
110
- Q || r("ap.apUpload.fileFormatNotSupported")
111
- );
112
- return;
113
- }
96
+ if (e[0].size > D * 1024 * 1024) {
97
+ u.warning(
98
+ K || r("ap.apUpload.maxUploadFileSize", {
99
+ maxSize: D
100
+ })
101
+ );
102
+ return;
114
103
  }
104
+ if (!fe(e[0], w)) {
105
+ u.warning(
106
+ Q || r("ap.apUpload.fileFormatNotSupported")
107
+ );
108
+ return;
109
+ }
110
+ if (typeof B == "function" && await B(e[0]) === !1)
111
+ return;
115
112
  if (o.value = e[0], l.value = 2, f.value = 0, p.value++, typeof R == "function") {
116
113
  R({
117
114
  onProgress: (t) => {
@@ -1,7 +1,18 @@
1
1
  import { ApExportGroupProps } from './interface';
2
2
  import { DefineComponent, ComponentOptionsMixin, PublicProps, ExtractPropTypes, PropType } from 'vue';
3
- declare const _default: DefineComponent<__VLS_TypePropsToOption<ApExportGroupProps>, {}, unknown, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly< ExtractPropTypes<__VLS_TypePropsToOption<ApExportGroupProps>>>, {}, {}>;
3
+ declare const _default: DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToOption<ApExportGroupProps>, {
4
+ successMessage: boolean;
5
+ }>, {}, unknown, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly< ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToOption<ApExportGroupProps>, {
6
+ successMessage: boolean;
7
+ }>>>, {
8
+ successMessage: boolean | string;
9
+ }, {}>;
4
10
  export default _default;
11
+ type __VLS_WithDefaults<P, D> = {
12
+ [K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_PrettifyLocal<P[K] & {
13
+ default: D[K];
14
+ }> : P[K];
15
+ };
5
16
  type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
6
17
  type __VLS_TypePropsToOption<T> = {
7
18
  [K in keyof T]-?: {} extends Pick<T, K> ? {
@@ -11,3 +22,6 @@ type __VLS_TypePropsToOption<T> = {
11
22
  required: true;
12
23
  };
13
24
  };
25
+ type __VLS_PrettifyLocal<T> = {
26
+ [K in keyof T]: T[K];
27
+ } & {};
@@ -1,84 +1,85 @@
1
- import { defineComponent as G, computed as i, ref as M, openBlock as m, createBlock as f, unref as o, normalizeClass as D, withCtx as n, createVNode as y, createTextVNode as p, toDisplayString as x, mergeProps as K, createCommentVNode as R } from "vue";
2
- import { DownOutlined as B } from "@ant-design/icons-vue";
3
- import { Dropdown as N, Menu as T, MenuItem as g, Button as I } from "@aplus-frontend/antdv";
1
+ import { defineComponent as B, computed as l, ref as D, openBlock as m, createBlock as f, unref as a, normalizeClass as K, withCtx as s, createVNode as y, createTextVNode as g, toDisplayString as x, mergeProps as R, createCommentVNode as N } from "vue";
2
+ import { DownOutlined as T } from "@ant-design/icons-vue";
3
+ import { message as I, Dropdown as V, Menu as q, MenuItem as M, Button as F } from "@aplus-frontend/antdv";
4
4
  import "../../config-provider/index.mjs";
5
- import { ApExportGroupActionType as u } from "./interface.mjs";
6
- import { usePermission as V } from "@aplus-frontend/hooks";
7
- import { handleExportDownload as q } from "./handleExportDownload.mjs";
8
- import { useNamespace as z } from "../../config-provider/hooks/use-namespace.mjs";
9
- import { useLocale as O } from "../../config-provider/hooks/use-locale.mjs";
10
- import { useGlobalConfig as $ } from "../../config-provider/hooks/use-global-config.mjs";
11
- const te = /* @__PURE__ */ G({
5
+ import { ApExportGroupActionType as i } from "./interface.mjs";
6
+ import { usePermission as z } from "@aplus-frontend/hooks";
7
+ import { handleExportDownload as O } from "./handleExportDownload.mjs";
8
+ import { useNamespace as $ } from "../../config-provider/hooks/use-namespace.mjs";
9
+ import { useLocale as j } from "../../config-provider/hooks/use-locale.mjs";
10
+ import { useGlobalConfig as H } from "../../config-provider/hooks/use-global-config.mjs";
11
+ const oe = /* @__PURE__ */ B({
12
12
  __name: "ApExportGroup",
13
13
  props: {
14
14
  selectedRowKeys: {},
15
15
  disabled: { type: Boolean },
16
16
  auth: {},
17
- ifShow: { type: Function },
17
+ ifShow: {},
18
18
  text: {},
19
19
  idKey: {},
20
- request: { type: Function },
21
- getRequestParams: { type: Function },
22
- getInitialParams: { type: Function },
23
- beforeRequest: { type: Function }
20
+ request: {},
21
+ getRequestParams: {},
22
+ getInitialParams: {},
23
+ beforeRequest: {},
24
+ successMessage: { type: [Boolean, String], default: !1 }
24
25
  },
25
- setup(C) {
26
- const { hasPermission: E } = V(), e = C, { b: _ } = z("ap-export-group"), { t: c } = O(), L = $("uiMode"), S = i(() => {
26
+ setup(E) {
27
+ const { hasPermission: C } = z(), e = E, { b: S } = $("ap-export-group"), { t: n } = j(), _ = H("uiMode"), L = l(() => {
27
28
  const t = {
28
29
  aplus: "#0070FF",
29
30
  admin: "#34b77c"
30
31
  };
31
- return b.value ? "" : t[L.value] || t.aplus;
32
- }), b = i(() => !!(e != null && e.disabled)), A = {
32
+ return b.value ? "" : t[_.value] || t.aplus;
33
+ }), b = l(() => !!(e != null && e.disabled)), A = l(() => (e == null ? void 0 : e.successMessage) === !0 ? n("ap.apExportGroup.exportSuccess") : e != null && e.successMessage ? e.successMessage : ""), G = {
33
34
  textAlign: "center"
34
- }, s = M(!1), w = i(() => (e == null ? void 0 : e.selectedRowKeys) || []), F = i(() => {
35
+ }, c = D(!1), w = l(() => (e == null ? void 0 : e.selectedRowKeys) || []), P = l(() => {
35
36
  let t = e == null ? void 0 : e.ifShow;
36
- return !(e != null && e.ifShow) && (e != null && e.auth) && (t = () => E(e.auth)), (t == null ? void 0 : t()) ?? !0;
37
+ return !(e != null && e.ifShow) && (e != null && e.auth) && (t = () => C(e.auth)), (t == null ? void 0 : t()) ?? !0;
37
38
  });
38
- async function P({ key: t }) {
39
- var h, v;
40
- const { getRequestParams: l, request: a } = e || {};
39
+ async function k({ key: t }) {
40
+ var v, h;
41
+ const { getRequestParams: u, request: o } = e || {};
41
42
  let d = {};
42
- t === u.SELECT ? d = {
43
+ t === i.SELECT ? d = {
43
44
  [(e == null ? void 0 : e.idKey) || "ids"]: w.value
44
- } : t === u.ALL && (d = (l == null ? void 0 : l()) || {});
45
- const k = ((h = e == null ? void 0 : e.getInitialParams) == null ? void 0 : h.call(e)) || {};
45
+ } : t === i.ALL && (d = (u == null ? void 0 : u()) || {});
46
+ const p = ((v = e == null ? void 0 : e.getInitialParams) == null ? void 0 : v.call(e)) || {};
46
47
  try {
47
- s.value = !0;
48
+ c.value = !0;
48
49
  let r = {
49
50
  ...d,
50
- ...k
51
+ ...p
51
52
  };
52
- r = ((v = e == null ? void 0 : e.beforeRequest) == null ? void 0 : v.call(e, r)) || r, await q(async () => await (a == null ? void 0 : a(r)));
53
+ r = ((h = e == null ? void 0 : e.beforeRequest) == null ? void 0 : h.call(e, r)) || r, await O(async () => await (o == null ? void 0 : o(r))), e != null && e.successMessage && I.success(A.value);
53
54
  } finally {
54
- s.value = !1;
55
+ c.value = !1;
55
56
  }
56
57
  }
57
- return (t, l) => F.value ? (m(), f(o(N), {
58
+ return (t, u) => P.value ? (m(), f(a(V), {
58
59
  key: 0,
59
- class: D([o(_)()]),
60
- overlayStyle: A,
60
+ class: K([a(S)()]),
61
+ overlayStyle: G,
61
62
  disabled: b.value
62
63
  }, {
63
- overlay: n(() => [
64
- y(o(T), { onClick: P }, {
65
- default: n(() => {
66
- var a;
64
+ overlay: s(() => [
65
+ y(a(q), { onClick: k }, {
66
+ default: s(() => {
67
+ var o;
67
68
  return [
68
- (m(), f(o(g), {
69
- key: o(u).SELECT,
70
- disabled: ((a = w.value) == null ? void 0 : a.length) === 0
69
+ (m(), f(a(M), {
70
+ key: a(i).SELECT,
71
+ disabled: ((o = w.value) == null ? void 0 : o.length) === 0
71
72
  }, {
72
- default: n(() => [
73
- p(x(o(c)("ap.apExportGroup.exportSelected")), 1)
73
+ default: s(() => [
74
+ g(x(a(n)("ap.apExportGroup.exportSelected")), 1)
74
75
  ]),
75
76
  _: 1
76
77
  }, 8, ["disabled"])),
77
- (m(), f(o(g), {
78
- key: o(u).ALL
78
+ (m(), f(a(M), {
79
+ key: a(i).ALL
79
80
  }, {
80
- default: n(() => [
81
- p(x(o(c)("ap.apExportGroup.exportAll")), 1)
81
+ default: s(() => [
82
+ g(x(a(n)("ap.apExportGroup.exportAll")), 1)
82
83
  ]),
83
84
  _: 1
84
85
  }))
@@ -87,26 +88,26 @@ const te = /* @__PURE__ */ G({
87
88
  _: 1
88
89
  })
89
90
  ]),
90
- default: n(() => [
91
- y(o(I), K({
91
+ default: s(() => [
92
+ y(a(F), R({
92
93
  ...t.$attrs
93
94
  }, {
94
95
  style: {
95
- color: S.value
96
+ color: L.value
96
97
  },
97
- loading: s.value
98
+ loading: c.value
98
99
  }), {
99
- default: n(() => [
100
- p(x((e == null ? void 0 : e.text) ?? o(c)("ap.apExportGroup.export")) + " ", 1),
101
- y(o(B))
100
+ default: s(() => [
101
+ g(x((e == null ? void 0 : e.text) ?? a(n)("ap.apExportGroup.export")) + " ", 1),
102
+ y(a(T))
102
103
  ]),
103
104
  _: 1
104
105
  }, 16, ["style", "loading"])
105
106
  ]),
106
107
  _: 1
107
- }, 8, ["class", "disabled"])) : R("", !0);
108
+ }, 8, ["class", "disabled"])) : N("", !0);
108
109
  }
109
110
  });
110
111
  export {
111
- te as default
112
+ oe as default
112
113
  };