@aplus-frontend/ui 6.14.0 → 6.16.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/ap-grid/utils/table.mjs +8 -8
  2. package/es/src/ap-list/hooks/use-offline-list.d.ts +3 -0
  3. package/es/src/ap-list/hooks/use-offline-list.mjs +25 -19
  4. package/es/src/ap-list/interface.d.ts +3 -5
  5. package/es/src/business/ap-batch-action/ApBatchAction.vue.d.ts +3 -1
  6. package/es/src/business/ap-batch-action/ApBatchAction.vue2.mjs +35 -31
  7. package/es/src/business/ap-batch-action/index.d.ts +9 -3
  8. package/es/src/business/ap-batch-action/interface.d.ts +4 -0
  9. package/es/src/business/ap-export-group/ApExportGroup.vue.d.ts +1 -1
  10. package/es/src/business/ap-export-group/ApExportGroup.vue2.mjs +153 -116
  11. package/es/src/business/ap-export-group/index.d.ts +3 -3
  12. package/es/src/business/ap-export-group/interface.d.ts +14 -2
  13. package/es/src/business/ap-table-modal/interface.d.ts +3 -1
  14. package/es/src/business/ap-table-modal/table-layout/index.vue2.mjs +32 -30
  15. package/es/src/design-token/index.mjs +1 -1
  16. package/es/src/editable-table/hooks/use-get-columns.mjs +18 -18
  17. package/es/src/text/index.vue.d.ts +1 -1
  18. package/es/src/text/index.vue.mjs +49 -43
  19. package/es/src/version.d.ts +1 -1
  20. package/es/src/version.mjs +1 -1
  21. package/es/test/setup.d.ts +1 -5
  22. package/lib/src/ap-grid/utils/table.js +1 -1
  23. package/lib/src/ap-list/hooks/use-offline-list.d.ts +3 -0
  24. package/lib/src/ap-list/hooks/use-offline-list.js +1 -1
  25. package/lib/src/ap-list/interface.d.ts +3 -5
  26. package/lib/src/business/ap-batch-action/ApBatchAction.vue.d.ts +3 -1
  27. package/lib/src/business/ap-batch-action/ApBatchAction.vue2.js +1 -1
  28. package/lib/src/business/ap-batch-action/index.d.ts +9 -3
  29. package/lib/src/business/ap-batch-action/interface.d.ts +4 -0
  30. package/lib/src/business/ap-export-group/ApExportGroup.vue.d.ts +1 -1
  31. package/lib/src/business/ap-export-group/ApExportGroup.vue2.js +1 -1
  32. package/lib/src/business/ap-export-group/index.d.ts +3 -3
  33. package/lib/src/business/ap-export-group/interface.d.ts +14 -2
  34. package/lib/src/business/ap-table-modal/interface.d.ts +3 -1
  35. package/lib/src/business/ap-table-modal/table-layout/index.vue2.js +1 -1
  36. package/lib/src/design-token/index.js +1 -1
  37. package/lib/src/editable-table/hooks/use-get-columns.js +1 -1
  38. package/lib/src/text/index.vue.d.ts +1 -1
  39. package/lib/src/text/index.vue.js +1 -1
  40. package/lib/src/version.d.ts +1 -1
  41. package/lib/src/version.js +1 -1
  42. package/lib/test/setup.d.ts +1 -5
  43. package/package.json +1 -1
  44. package/theme/ap-grid/index.css +11 -4
  45. package/theme/ap-grid/index.less +11 -2
  46. package/theme/ap-table-modal/index.css +3 -2
  47. package/theme/ap-table-modal/index.less +3 -2
  48. package/theme/index.css +17 -6
  49. package/theme/text/index.css +3 -0
  50. package/theme/text/index.less +3 -0
@@ -1,10 +1,10 @@
1
- import { omit as d, isUndefined as s, isFunction as c, isNumber as C } from "lodash-unified";
1
+ import { omit as u, isUndefined as s, isFunction as c, isNumber as C } from "lodash-unified";
2
2
  import { isDef as m } from "../../utils/index.mjs";
3
3
  const g = 20, w = 50, b = (e) => e.some((t) => !!t.html);
4
- function R(e) {
4
+ function v(e) {
5
5
  var n;
6
6
  const t = {
7
- ...d(e, [
7
+ ...u(e, [
8
8
  "columns",
9
9
  "request",
10
10
  "searchForm",
@@ -42,7 +42,7 @@ function R(e) {
42
42
  range: o.range || !1
43
43
  };
44
44
  }
45
- return t.border = e.bordered === !1 ? "inner" : !0, e.expandable && (t.expandConfig = d(e.expandable, [
45
+ return t.border = e.bordered === !1 ? "inner" : !0, e.expandable && (t.expandConfig = u(e.expandable, [
46
46
  "renderContent",
47
47
  "width",
48
48
  "title"
@@ -50,10 +50,10 @@ function R(e) {
50
50
  enabled: !1
51
51
  }, t.virtualYConfig = {
52
52
  enabled: !1
53
- }) : (f(t, "X", e.virtual), f(t, "Y", e.virtual)), t.round = m(e.round) ? e.round : !e.card, e.virtual !== !1 && (t.headerCellConfig = {
53
+ }) : (f(t, "X", e.virtual), f(t, "Y", e.virtual)), t.round = m(e.round) ? e.round : !e.card, t.headerCellConfig = {
54
54
  height: 36,
55
55
  ...t.headerCellConfig || {}
56
- }), t.treeConfig && (t.treeConfig = {
56
+ }, t.treeConfig && (t.treeConfig = {
57
57
  ...t.treeConfig || {},
58
58
  /**
59
59
  * 使用非树层级列表,配合transform
@@ -62,7 +62,7 @@ function R(e) {
62
62
  }), t;
63
63
  }
64
64
  function f(e, t, i) {
65
- const n = t === "X", o = n ? "x" : "y", r = n ? "virtualXConfig" : "virtualYConfig", l = i == null ? void 0 : i[o], a = l !== !1, u = n ? g : w, h = C(l) && l >= 0 ? l : u;
65
+ const n = t === "X", o = n ? "x" : "y", r = n ? "virtualXConfig" : "virtualYConfig", l = i == null ? void 0 : i[o], a = l !== !1, d = n ? g : w, h = C(l) && l >= 0 ? l : d;
66
66
  e[r] = {
67
67
  enabled: a,
68
68
  gt: h,
@@ -94,5 +94,5 @@ function k(e) {
94
94
  export {
95
95
  k as getRowExpandProps,
96
96
  K as getRowSelectionProps,
97
- R as toVxeProps
97
+ v as toVxeProps
98
98
  };
@@ -14,6 +14,9 @@ export declare const useOfflineList: <DataType = Recordable>(params: ApListProps
14
14
  total: number;
15
15
  showSizeChanger: boolean;
16
16
  showQuickJumper: boolean;
17
+ showLessItems: boolean | undefined;
18
+ size: "default" | "small";
19
+ pageSizeOptions: (string | number)[];
17
20
  }>;
18
21
  dataSource: ComputedRef<DataType[]>;
19
22
  onChange: (page: number, size: number) => void;
@@ -1,32 +1,38 @@
1
- import { ref as o, computed as r, unref as t } from "vue";
2
- const l = (e) => {
3
- const n = o(
1
+ import { ref as g, computed as f, unref as n } from "vue";
2
+ import { isDef as s } from "../../utils/index.mjs";
3
+ import { isUndefined as S } from "lodash-unified";
4
+ const C = (e) => {
5
+ const i = g(
4
6
  e.pagination && e.pagination.defaultCurrent || 1
5
- ), u = o(
7
+ ), o = g(
6
8
  e.pagination && e.pagination.defaultPageSize || 10
7
9
  );
8
- function a(i, g) {
9
- n.value = i, u.value = g;
10
+ function d(t, a) {
11
+ i.value = t, o.value = a;
10
12
  }
11
- const c = r(() => e.dataSource ? e.pagination === !1 ? [...e.dataSource] : e.dataSource.slice(
12
- (t(n) - 1) * t(u),
13
- t(n) * t(u)
13
+ const p = f(() => e.dataSource ? e.pagination === !1 ? [...e.dataSource] : e.dataSource.slice(
14
+ (n(i) - 1) * n(o),
15
+ n(i) * n(o)
14
16
  ) : []);
15
17
  return {
16
- pagination: r(() => {
17
- var i;
18
+ pagination: f(() => {
19
+ var c;
20
+ const { showLessItems: t, showSizeChanger: a, showQuickJumper: r, pageSizeOptions: u } = e.pagination || {};
18
21
  return {
19
- current: t(n),
20
- pageSize: t(u),
21
- total: ((i = e.dataSource) == null ? void 0 : i.length) || 0,
22
- showSizeChanger: !0,
23
- showQuickJumper: !0
22
+ current: n(i),
23
+ pageSize: n(o),
24
+ total: ((c = e.dataSource) == null ? void 0 : c.length) || 0,
25
+ showSizeChanger: s(a) ? a : !t,
26
+ showQuickJumper: s(r) ? r : !t,
27
+ showLessItems: t,
28
+ size: "default",
29
+ pageSizeOptions: S(u) ? ["10", "20", "50", "100"] : u
24
30
  };
25
31
  }),
26
- dataSource: c,
27
- onChange: a
32
+ dataSource: p,
33
+ onChange: d
28
34
  };
29
35
  };
30
36
  export {
31
- l as useOfflineList
37
+ C as useOfflineList
32
38
  };
@@ -1,5 +1,5 @@
1
1
  import { StyleValue } from 'vue';
2
- import { RequestData } from '../ap-table';
2
+ import { ApTablePaginationConfig, RequestData } from '../ap-table';
3
3
  import { Recordable } from '../type';
4
4
  import { InternalPagingType } from '../ap-table/hooks/use-table-paging-ng';
5
5
  export type ApListProps<RecordType = any, ParamsType = Recordable> = {
@@ -49,14 +49,12 @@ export type ApListProps<RecordType = any, ParamsType = Recordable> = {
49
49
  /**
50
50
  * 是否显示分页器(特定的分页器)或者指定默认的当前页和pageSize
51
51
  */
52
- pagination?: false | {
53
- defaultCurrent?: number;
54
- defaultPageSize?: number;
52
+ pagination?: false | (Omit<ApTablePaginationConfig, 'showTotal'> & {
55
53
  /**
56
54
  * 只有一页时隐藏分页
57
55
  */
58
56
  hideOnSinglePage?: boolean;
59
- };
57
+ });
60
58
  /**
61
59
  * 是否手动发起第一次网络请求
62
60
  */
@@ -17,7 +17,9 @@ declare function __VLS_template(): {
17
17
  rootEl: HTMLDivElement;
18
18
  };
19
19
  type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
20
- declare const __VLS_component: DefineComponent<ApBatchActionProps, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<ApBatchActionProps> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {
20
+ declare const __VLS_component: DefineComponent<ApBatchActionProps, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<ApBatchActionProps> & Readonly<{}>, {
21
+ showSelected: boolean;
22
+ }, {}, {}, {}, string, ComponentProvideOptions, false, {
21
23
  headerRef: HTMLDivElement;
22
24
  }, HTMLDivElement>;
23
25
  declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
@@ -1,73 +1,77 @@
1
- import { defineComponent as b, useSlots as x, computed as D, ref as N, watch as V, createElementBlock as E, openBlock as K, normalizeClass as f, unref as t, withDirectives as T, createElementVNode as c, renderSlot as m, vShow as z, createTextVNode as v, toDisplayString as a, createVNode as F, withCtx as O } from "vue";
2
- import { Button as j } from "@aplus-frontend/antdv";
1
+ import { defineComponent as x, useSlots as D, computed as E, ref as N, watch as K, createElementBlock as R, openBlock as V, normalizeClass as f, unref as t, withDirectives as T, createElementVNode as c, renderSlot as m, vShow as z, createCommentVNode as O, createTextVNode as v, toDisplayString as n, createVNode as j, withCtx as q } from "vue";
2
+ import { Button as F } from "@aplus-frontend/antdv";
3
3
  import "../../config-provider/index.mjs";
4
- import { useNamespace as q } from "../../config-provider/hooks/use-namespace.mjs";
5
- import { useLocale as G } from "../../config-provider/hooks/use-locale.mjs";
6
- const I = { class: "selected-desc" }, J = { class: "selected-desc-conut" }, M = { class: "selected-desc-clean" }, Y = /* @__PURE__ */ b({
4
+ import { useNamespace as G } from "../../config-provider/hooks/use-namespace.mjs";
5
+ import { useLocale as I } from "../../config-provider/hooks/use-locale.mjs";
6
+ const J = {
7
+ key: 0,
8
+ class: "selected-desc"
9
+ }, M = { class: "selected-desc-conut" }, P = { class: "selected-desc-clean" }, Z = /* @__PURE__ */ x({
7
10
  __name: "ApBatchAction",
8
11
  props: {
9
12
  selectedRowKeys: {},
10
- clearAll: { type: Function }
13
+ clearAll: {},
14
+ showSelected: { type: Boolean, default: !0 }
11
15
  },
12
- setup(R) {
13
- const { b: n } = q("ap-batch-action"), { t: r } = G(), i = R, s = x(), $ = D(() => {
16
+ setup($) {
17
+ const { b: r } = G("ap-batch-action"), { t: d } = I(), o = $, s = D(), b = E(() => {
14
18
  var e;
15
- return ((e = i.selectedRowKeys) == null ? void 0 : e.length) || 0;
16
- }), d = N(!1), p = N();
17
- return V(
19
+ return ((e = o.selectedRowKeys) == null ? void 0 : e.length) || 0;
20
+ }), i = N(!1), p = N();
21
+ return K(
18
22
  () => s.header,
19
23
  () => {
20
24
  setTimeout(() => {
21
- var l, h, y, A, _, B, o, g, w, S, k;
25
+ var l, h, y, A, _, w, a, B, S, g, k;
22
26
  const e = (l = s.header) == null ? void 0 : l.call(s);
23
- (e == null ? void 0 : e.length) === 1 && ((y = (h = e == null ? void 0 : e[0]) == null ? void 0 : h.type) == null ? void 0 : y.name) === "ASpace" ? d.value = !!((w = (g = (o = Array.prototype.slice.call((B = (_ = (A = p.value) == null ? void 0 : A.children) == null ? void 0 : _[0]) == null ? void 0 : B.children)) == null ? void 0 : o.filter) == null ? void 0 : g.call(o, (u) => {
27
+ (e == null ? void 0 : e.length) === 1 && ((y = (h = e == null ? void 0 : e[0]) == null ? void 0 : h.type) == null ? void 0 : y.name) === "ASpace" ? i.value = !!((S = (B = (a = Array.prototype.slice.call((w = (_ = (A = p.value) == null ? void 0 : A.children) == null ? void 0 : _[0]) == null ? void 0 : w.children)) == null ? void 0 : a.filter) == null ? void 0 : B.call(a, (u) => {
24
28
  var C;
25
29
  return (C = u == null ? void 0 : u.children) == null ? void 0 : C.length;
26
- })) != null && w.length) : d.value = !!((k = (S = p.value) == null ? void 0 : S.children) != null && k.length);
30
+ })) != null && S.length) : i.value = !!((k = (g = p.value) == null ? void 0 : g.children) != null && k.length);
27
31
  });
28
32
  },
29
33
  {
30
34
  immediate: !0
31
35
  }
32
- ), (e, l) => (K(), E("div", {
33
- class: f([t(n)()])
36
+ ), (e, l) => (V(), R("div", {
37
+ class: f([t(r)()])
34
38
  }, [
35
39
  T(c("div", {
36
40
  ref_key: "headerRef",
37
41
  ref: p,
38
- class: f(t(n)("header"))
42
+ class: f(t(r)("header"))
39
43
  }, [
40
44
  m(e.$slots, "header")
41
45
  ], 2), [
42
- [z, d.value]
46
+ [z, i.value]
43
47
  ]),
44
48
  c("div", {
45
- class: f(t(n)("body"))
49
+ class: f(t(r)("body"))
46
50
  }, [
47
51
  m(e.$slots, "prefix"),
48
- c("div", I, [
49
- c("div", J, [
50
- v(a(t(r)("ap.apBatchAction.selected")) + " ", 1),
51
- c("span", null, a($.value), 1),
52
- v(" " + a(t(r)("ap.apBatchAction.piecesOfData")), 1)
53
- ]),
52
+ o.showSelected ? (V(), R("div", J, [
54
53
  c("div", M, [
55
- F(t(j), {
54
+ v(n(t(d)("ap.apBatchAction.selected")) + " ", 1),
55
+ c("span", null, n(b.value), 1),
56
+ v(" " + n(t(d)("ap.apBatchAction.piecesOfData")), 1)
57
+ ]),
58
+ c("div", P, [
59
+ j(t(F), {
56
60
  type: "link",
57
- onClick: l[0] || (l[0] = (h) => i.clearAll && i.clearAll())
61
+ onClick: l[0] || (l[0] = (h) => o.clearAll && o.clearAll())
58
62
  }, {
59
- default: O(() => [
60
- v(a(t(r)("ap.apBatchAction.empty")), 1)
63
+ default: q(() => [
64
+ v(n(t(d)("ap.apBatchAction.empty")), 1)
61
65
  ]),
62
66
  _: 1
63
67
  })
64
68
  ])
65
- ]),
69
+ ])) : O("", !0),
66
70
  m(e.$slots, "suffix")
67
71
  ], 2)
68
72
  ], 2));
69
73
  }
70
74
  });
71
75
  export {
72
- Y as default
76
+ Z as default
73
77
  };
@@ -2,7 +2,9 @@ import { CreateComponentPublicInstanceWithMixins, ComponentOptionsMixin, PublicP
2
2
  import { ApBatchActionProps } from './interface';
3
3
  export * from './interface';
4
4
  declare const ApBatchAction: {
5
- new (...args: any[]): CreateComponentPublicInstanceWithMixins<Readonly< ApBatchActionProps> & Readonly<{}>, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, PublicProps, {}, false, {}, {}, GlobalComponents, GlobalDirectives, string, {
5
+ new (...args: any[]): CreateComponentPublicInstanceWithMixins<Readonly< ApBatchActionProps> & Readonly<{}>, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, PublicProps, {
6
+ showSelected: boolean;
7
+ }, false, {}, {}, GlobalComponents, GlobalDirectives, string, {
6
8
  headerRef: HTMLDivElement;
7
9
  }, HTMLDivElement, ComponentProvideOptions, {
8
10
  P: {};
@@ -11,11 +13,15 @@ declare const ApBatchAction: {
11
13
  C: {};
12
14
  M: {};
13
15
  Defaults: {};
14
- }, Readonly< ApBatchActionProps> & Readonly<{}>, {}, {}, {}, {}, {}>;
16
+ }, Readonly< ApBatchActionProps> & Readonly<{}>, {}, {}, {}, {}, {
17
+ showSelected: boolean;
18
+ }>;
15
19
  __isFragment?: never;
16
20
  __isTeleport?: never;
17
21
  __isSuspense?: never;
18
- } & ComponentOptionsBase<Readonly< ApBatchActionProps> & Readonly<{}>, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, {}, {}, string, {}, GlobalComponents, GlobalDirectives, string, ComponentProvideOptions> & VNodeProps & AllowedComponentProps & ComponentCustomProps & (new () => {
22
+ } & ComponentOptionsBase<Readonly< ApBatchActionProps> & Readonly<{}>, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, {
23
+ showSelected: boolean;
24
+ }, {}, string, {}, GlobalComponents, GlobalDirectives, string, ComponentProvideOptions> & VNodeProps & AllowedComponentProps & ComponentCustomProps & (new () => {
19
25
  $slots: Readonly<{
20
26
  header: () => any[];
21
27
  prefix: () => void;
@@ -7,4 +7,8 @@ export interface ApBatchActionProps {
7
7
  * 清空
8
8
  */
9
9
  clearAll?: () => void;
10
+ /**
11
+ * 是否显示主体
12
+ */
13
+ showSelected?: boolean;
10
14
  }
@@ -1,7 +1,7 @@
1
1
  import { ApExportGroupProps } from './interface';
2
2
  import { DefineComponent, ComponentOptionsMixin, PublicProps, ComponentProvideOptions } from 'vue';
3
3
  declare const _default: DefineComponent<ApExportGroupProps, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<ApExportGroupProps> & Readonly<{}>, {
4
- type: "button" | "dropdown";
4
+ type: "button" | "dropdown" | "group";
5
5
  exportField: boolean | {
6
6
  key?: string;
7
7
  convertField?: {
@@ -1,22 +1,25 @@
1
- import { defineComponent as O, ref as A, computed as s, watch as V, createElementBlock as $, openBlock as d, Fragment as q, createBlock as y, createCommentVNode as M, unref as a, mergeProps as B, withCtx as n, createTextVNode as x, toDisplayString as g, normalizeClass as z, createVNode as h } from "vue";
2
- import { DownOutlined as U } from "@ant-design/icons-vue";
3
- import { message as H, Dropdown as J, Menu as Q, MenuItem as G } from "@aplus-frontend/antdv";
1
+ import { defineComponent as z, ref as M, computed as v, watch as U, createElementBlock as H, openBlock as c, Fragment as J, createBlock as m, createCommentVNode as S, unref as o, mergeProps as A, withCtx as u, createTextVNode as h, toDisplayString as E, normalizeClass as Q, createVNode as F } from "vue";
2
+ import { DownOutlined as W } from "@ant-design/icons-vue";
3
+ import { message as X, Dropdown as Y, Menu as Z, MenuItem as T } from "@aplus-frontend/antdv";
4
4
  import "../../config-provider/index.mjs";
5
- import { ApExportGroupActionType as i } from "./interface.mjs";
6
- import { usePermission as W } from "@aplus-frontend/hooks";
7
- import { handleExportDownload as X } from "./handleExportDownload.mjs";
8
- import { useInjectApTable as Y } from "../../ap-table/context.mjs";
9
- import { convertExportField as Z } from "./convertExportField.mjs";
5
+ import { ApExportGroupActionType as s } from "./interface.mjs";
6
+ import { usePermission as _ } from "@aplus-frontend/hooks";
7
+ import { handleExportDownload as ee } from "./handleExportDownload.mjs";
8
+ import { useInjectApTable as te } from "../../ap-table/context.mjs";
9
+ import { convertExportField as ae } from "./convertExportField.mjs";
10
10
  import "../../ap-button/index.mjs";
11
- import { useNamespace as ee } from "../../config-provider/hooks/use-namespace.mjs";
12
- import { useLocale as te } from "../../config-provider/hooks/use-locale.mjs";
13
- import { useGlobalConfig as ae } from "../../config-provider/hooks/use-global-config.mjs";
14
- import P from "../../ap-button/ap-button.vue.mjs";
15
- const ge = /* @__PURE__ */ O({
11
+ import { ApBatchActionGroup as le } from "../ap-batch-action-group/index.mjs";
12
+ import { useNamespace as oe } from "../../config-provider/hooks/use-namespace.mjs";
13
+ import { useLocale as re } from "../../config-provider/hooks/use-locale.mjs";
14
+ import { useGlobalConfig as se } from "../../config-provider/hooks/use-global-config.mjs";
15
+ import K from "../../ap-button/ap-button.vue.mjs";
16
+ const Ee = /* @__PURE__ */ z({
16
17
  __name: "ApExportGroup",
17
18
  props: {
18
19
  type: { default: "button" },
19
20
  selectedRowKeys: {},
21
+ groupList: {},
22
+ buttonProps: {},
20
23
  disabled: { type: Boolean },
21
24
  auth: {},
22
25
  ifShow: {},
@@ -29,131 +32,165 @@ const ge = /* @__PURE__ */ O({
29
32
  successMessage: { type: [Boolean, String], default: !1 },
30
33
  exportField: { type: [Boolean, Object], default: void 0 }
31
34
  },
32
- setup(K) {
33
- const { hasPermission: T } = W(), e = K, { columns: c, dataSource: f } = Y(), { b: D } = ee("ap-export-group"), { t: r } = te(), C = ae("exportField"), u = A(!1), p = A(!1), m = s(
35
+ setup(D) {
36
+ const { hasPermission: R } = _(), e = D, { columns: g, dataSource: b } = te(), { b: j } = oe("ap-export-group"), { t: n } = re(), P = se("exportField"), d = M(!1), w = M(!1), f = v(
34
37
  () => {
35
- var t;
36
- return !!(e != null && e.disabled) || (f !== void 0 ? !((t = f == null ? void 0 : f.value) != null && t.length) : !1) || u.value;
38
+ var l;
39
+ return !!(e != null && e.disabled) || (b !== void 0 ? !((l = b == null ? void 0 : b.value) != null && l.length) : !1) || d.value;
37
40
  }
38
41
  );
39
- V(
40
- () => m.value,
42
+ U(
43
+ () => f.value,
41
44
  () => {
42
- m.value && (p.value = !1);
45
+ f.value && (w.value = !1);
43
46
  },
44
47
  {
45
48
  immediate: !0
46
49
  }
47
50
  );
48
- const R = s(() => (e == null ? void 0 : e.successMessage) === !0 ? r("ap.apExportGroup.exportSuccess") : e != null && e.successMessage ? e.successMessage : ""), b = s(() => {
49
- const t = "exportFieldList", l = (e == null ? void 0 : e.exportField) ?? (C.value === "" ? !0 : C.value) ?? !1;
50
- return l === !0 ? {
51
- key: t
52
- } : typeof l == "object" ? {
53
- ...l,
54
- key: l.key ?? t
55
- } : l;
56
- }), j = {
51
+ const I = v(() => (e == null ? void 0 : e.successMessage) === !0 ? n("ap.apExportGroup.exportSuccess") : e != null && e.successMessage ? e.successMessage : ""), N = (l = e == null ? void 0 : e.exportField) => {
52
+ const a = "exportFieldList", t = l ?? (P.value === "" ? !0 : P.value) ?? !1;
53
+ return t === !0 ? {
54
+ key: a
55
+ } : typeof t == "object" ? {
56
+ ...t,
57
+ key: t.key ?? a
58
+ } : t;
59
+ }, $ = {
57
60
  textAlign: "center"
58
- }, k = s(() => (e == null ? void 0 : e.selectedRowKeys) || []), L = s(() => {
59
- let t = e == null ? void 0 : e.ifShow;
60
- return !(e != null && e.ifShow) && (e != null && e.auth) && (t = () => T(e.auth)), (t == null ? void 0 : t()) ?? !0;
61
+ }, x = v(() => (e == null ? void 0 : e.selectedRowKeys) || []), L = v(() => {
62
+ let l = e == null ? void 0 : e.ifShow;
63
+ return !(e != null && e.ifShow) && (e != null && e.auth) && (l = () => R(e.auth)), (l == null ? void 0 : l()) ?? !0;
61
64
  });
62
- async function I() {
63
- k.value.length > 0 ? w({ key: i.SELECT }) : w({ key: i.ALL });
65
+ async function O() {
66
+ x.value.length > 0 ? p({ key: s.SELECT }) : p({ key: s.ALL });
64
67
  }
65
- async function w({ key: t }) {
66
- var F, S, _;
67
- const { getRequestParams: l, request: o } = e || {};
68
- let E = {};
69
- t === i.SELECT ? E = {
70
- [(e == null ? void 0 : e.idKey) || "ids"]: k.value
71
- } : t === i.ALL && (E = (l == null ? void 0 : l()) || {});
72
- const N = ((F = e == null ? void 0 : e.getInitialParams) == null ? void 0 : F.call(e)) || {};
68
+ async function p({ key: l, option: a }) {
69
+ var G, B;
70
+ const t = a || e, { getRequestParams: i, request: r } = t || {}, y = N(t == null ? void 0 : t.exportField);
71
+ let C = {};
72
+ l === s.SELECT ? C = {
73
+ [(t == null ? void 0 : t.idKey) || "ids"]: x.value
74
+ } : l === s.ALL && (C = (i == null ? void 0 : i()) || {});
75
+ const q = ((G = t == null ? void 0 : t.getInitialParams) == null ? void 0 : G.call(t)) || {};
73
76
  try {
74
- u.value = !0;
75
- let v = Object.assign(
77
+ d.value = !0;
78
+ let k = Object.assign(
76
79
  {
77
- ...E,
78
- ...N
80
+ ...C,
81
+ ...q
79
82
  },
80
- b.value && (c != null && c.value) ? {
81
- [b.value.key]: Z(
82
- c.value,
83
- (S = b.value) == null ? void 0 : S.convertField
83
+ y && (g != null && g.value) ? {
84
+ [y.key]: ae(
85
+ g.value,
86
+ y == null ? void 0 : y.convertField
84
87
  )
85
88
  } : {}
86
89
  );
87
- v = ((_ = e == null ? void 0 : e.beforeRequest) == null ? void 0 : _.call(e, v)) || v, await X(async () => await (o == null ? void 0 : o(v))), e != null && e.successMessage && H.success(R.value);
90
+ k = ((B = t == null ? void 0 : t.beforeRequest) == null ? void 0 : B.call(t, k)) || k, await ee(async () => await (r == null ? void 0 : r(k))), t != null && t.successMessage && X.success(I.value);
88
91
  } finally {
89
- u.value = !1;
92
+ d.value = !1;
90
93
  }
91
94
  }
92
- return (t, l) => (d(), $(q, null, [
93
- L.value && e.type === "button" ? (d(), y(a(P), B({ key: 0 }, {
94
- ...t.$attrs
95
- }, {
96
- disabled: m.value,
97
- loading: u.value,
98
- "min-width": "",
99
- onClick: I
100
- }), {
101
- default: n(() => [
102
- x(g((e == null ? void 0 : e.text) ?? a(r)("ap.apExportGroup.export")), 1)
103
- ]),
104
- _: 1
105
- }, 16, ["disabled", "loading"])) : M("", !0),
106
- L.value && e.type === "dropdown" ? (d(), y(a(J), {
107
- key: 1,
108
- open: p.value,
109
- "onUpdate:open": l[0] || (l[0] = (o) => p.value = o),
110
- class: z([a(D)()]),
111
- "overlay-style": j,
112
- disabled: m.value
113
- }, {
114
- overlay: n(() => [
115
- h(a(Q), { onClick: w }, {
116
- default: n(() => {
117
- var o;
118
- return [
119
- (d(), y(a(G), {
120
- key: a(i).SELECT,
121
- disabled: ((o = k.value) == null ? void 0 : o.length) === 0
122
- }, {
123
- default: n(() => [
124
- x(g(a(r)("ap.apExportGroup.exportSelected")), 1)
125
- ]),
126
- _: 1
127
- }, 8, ["disabled"])),
128
- (d(), y(a(G), {
129
- key: a(i).ALL
130
- }, {
131
- default: n(() => [
132
- x(g(a(r)("ap.apExportGroup.exportAll")), 1)
133
- ]),
134
- _: 1
135
- }))
136
- ];
137
- }),
138
- _: 1
139
- })
140
- ]),
141
- default: n(() => [
142
- h(a(P), B({
143
- ...t.$attrs
144
- }, { loading: u.value }), {
145
- default: n(() => [
146
- x(g((e == null ? void 0 : e.text) ?? a(r)("ap.apExportGroup.export")) + " ", 1),
147
- h(a(U))
148
- ]),
149
- _: 1
150
- }, 16, ["loading"])
151
- ]),
152
- _: 1
153
- }, 8, ["open", "class", "disabled"])) : M("", !0)
154
- ], 64));
95
+ const V = v(() => {
96
+ var l;
97
+ return ((l = e == null ? void 0 : e.groupList) == null ? void 0 : l.map((a, t) => ({
98
+ key: t,
99
+ content: a == null ? void 0 : a.text,
100
+ auth: a == null ? void 0 : a.auth,
101
+ ifShow: a == null ? void 0 : a.ifShow,
102
+ disabled: a == null ? void 0 : a.disabled,
103
+ onClick: () => {
104
+ x.value.length > 0 ? p({
105
+ key: s.SELECT,
106
+ option: a
107
+ }) : p({
108
+ key: s.ALL,
109
+ option: a
110
+ });
111
+ }
112
+ }))) || [];
113
+ });
114
+ return (l, a) => {
115
+ var t, i;
116
+ return c(), H(J, null, [
117
+ L.value && e.type === "button" ? (c(), m(o(K), A({ key: 0 }, {
118
+ ...l.$attrs
119
+ }, {
120
+ disabled: f.value,
121
+ loading: d.value,
122
+ "min-width": "",
123
+ onClick: O
124
+ }), {
125
+ default: u(() => [
126
+ h(E((e == null ? void 0 : e.text) ?? o(n)("ap.apExportGroup.export")), 1)
127
+ ]),
128
+ _: 1
129
+ }, 16, ["disabled", "loading"])) : S("", !0),
130
+ L.value && e.type === "dropdown" ? (c(), m(o(Y), {
131
+ key: 1,
132
+ open: w.value,
133
+ "onUpdate:open": a[0] || (a[0] = (r) => w.value = r),
134
+ class: Q([o(j)()]),
135
+ "overlay-style": $,
136
+ disabled: f.value
137
+ }, {
138
+ overlay: u(() => [
139
+ F(o(Z), { onClick: p }, {
140
+ default: u(() => {
141
+ var r;
142
+ return [
143
+ (c(), m(o(T), {
144
+ key: o(s).SELECT,
145
+ disabled: ((r = x.value) == null ? void 0 : r.length) === 0
146
+ }, {
147
+ default: u(() => [
148
+ h(E(o(n)("ap.apExportGroup.exportSelected")), 1)
149
+ ]),
150
+ _: 1
151
+ }, 8, ["disabled"])),
152
+ (c(), m(o(T), {
153
+ key: o(s).ALL
154
+ }, {
155
+ default: u(() => [
156
+ h(E(o(n)("ap.apExportGroup.exportAll")), 1)
157
+ ]),
158
+ _: 1
159
+ }))
160
+ ];
161
+ }),
162
+ _: 1
163
+ })
164
+ ]),
165
+ default: u(() => [
166
+ F(o(K), A({
167
+ ...l.$attrs
168
+ }, { loading: d.value }), {
169
+ default: u(() => [
170
+ h(E((e == null ? void 0 : e.text) ?? o(n)("ap.apExportGroup.export")) + " ", 1),
171
+ F(o(W))
172
+ ]),
173
+ _: 1
174
+ }, 16, ["loading"])
175
+ ]),
176
+ _: 1
177
+ }, 8, ["open", "class", "disabled"])) : S("", !0),
178
+ L.value && e.type === "group" ? (c(), m(o(le), A({ key: 2 }, {
179
+ ...l.$attrs
180
+ }, {
181
+ disabled: f.value,
182
+ loading: d.value,
183
+ "button-props": {
184
+ ...e.buttonProps,
185
+ content: ((t = e == null ? void 0 : e.buttonProps) == null ? void 0 : t.content) ?? o(n)("ap.apExportGroup.export"),
186
+ type: ((i = e == null ? void 0 : e.buttonProps) == null ? void 0 : i.type) ?? "default"
187
+ },
188
+ "menu-list": V.value
189
+ }), null, 16, ["disabled", "loading", "button-props", "menu-list"])) : S("", !0)
190
+ ], 64);
191
+ };
155
192
  }
156
193
  });
157
194
  export {
158
- ge as default
195
+ Ee as default
159
196
  };