@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.
- package/es/src/ap-grid/utils/table.mjs +8 -8
- package/es/src/ap-list/hooks/use-offline-list.d.ts +3 -0
- package/es/src/ap-list/hooks/use-offline-list.mjs +25 -19
- package/es/src/ap-list/interface.d.ts +3 -5
- package/es/src/business/ap-batch-action/ApBatchAction.vue.d.ts +3 -1
- package/es/src/business/ap-batch-action/ApBatchAction.vue2.mjs +35 -31
- package/es/src/business/ap-batch-action/index.d.ts +9 -3
- package/es/src/business/ap-batch-action/interface.d.ts +4 -0
- package/es/src/business/ap-export-group/ApExportGroup.vue.d.ts +1 -1
- package/es/src/business/ap-export-group/ApExportGroup.vue2.mjs +153 -116
- package/es/src/business/ap-export-group/index.d.ts +3 -3
- package/es/src/business/ap-export-group/interface.d.ts +14 -2
- package/es/src/business/ap-table-modal/interface.d.ts +3 -1
- package/es/src/business/ap-table-modal/table-layout/index.vue2.mjs +32 -30
- package/es/src/design-token/index.mjs +1 -1
- package/es/src/editable-table/hooks/use-get-columns.mjs +18 -18
- package/es/src/text/index.vue.d.ts +1 -1
- package/es/src/text/index.vue.mjs +49 -43
- package/es/src/version.d.ts +1 -1
- package/es/src/version.mjs +1 -1
- package/es/test/setup.d.ts +1 -5
- package/lib/src/ap-grid/utils/table.js +1 -1
- package/lib/src/ap-list/hooks/use-offline-list.d.ts +3 -0
- package/lib/src/ap-list/hooks/use-offline-list.js +1 -1
- package/lib/src/ap-list/interface.d.ts +3 -5
- package/lib/src/business/ap-batch-action/ApBatchAction.vue.d.ts +3 -1
- package/lib/src/business/ap-batch-action/ApBatchAction.vue2.js +1 -1
- package/lib/src/business/ap-batch-action/index.d.ts +9 -3
- package/lib/src/business/ap-batch-action/interface.d.ts +4 -0
- package/lib/src/business/ap-export-group/ApExportGroup.vue.d.ts +1 -1
- package/lib/src/business/ap-export-group/ApExportGroup.vue2.js +1 -1
- package/lib/src/business/ap-export-group/index.d.ts +3 -3
- package/lib/src/business/ap-export-group/interface.d.ts +14 -2
- package/lib/src/business/ap-table-modal/interface.d.ts +3 -1
- package/lib/src/business/ap-table-modal/table-layout/index.vue2.js +1 -1
- package/lib/src/design-token/index.js +1 -1
- package/lib/src/editable-table/hooks/use-get-columns.js +1 -1
- package/lib/src/text/index.vue.d.ts +1 -1
- package/lib/src/text/index.vue.js +1 -1
- package/lib/src/version.d.ts +1 -1
- package/lib/src/version.js +1 -1
- package/lib/test/setup.d.ts +1 -5
- package/package.json +1 -1
- package/theme/ap-grid/index.css +11 -4
- package/theme/ap-grid/index.less +11 -2
- package/theme/ap-table-modal/index.css +3 -2
- package/theme/ap-table-modal/index.less +3 -2
- package/theme/index.css +17 -6
- package/theme/text/index.css +3 -0
- package/theme/text/index.less +3 -0
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { omit as
|
|
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
|
|
4
|
+
function v(e) {
|
|
5
5
|
var n;
|
|
6
6
|
const t = {
|
|
7
|
-
...
|
|
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 =
|
|
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,
|
|
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
|
-
}
|
|
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,
|
|
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
|
-
|
|
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
|
|
2
|
-
|
|
3
|
-
|
|
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
|
-
),
|
|
7
|
+
), o = g(
|
|
6
8
|
e.pagination && e.pagination.defaultPageSize || 10
|
|
7
9
|
);
|
|
8
|
-
function
|
|
9
|
-
|
|
10
|
+
function d(t, a) {
|
|
11
|
+
i.value = t, o.value = a;
|
|
10
12
|
}
|
|
11
|
-
const
|
|
12
|
-
(
|
|
13
|
-
|
|
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:
|
|
17
|
-
var
|
|
18
|
+
pagination: f(() => {
|
|
19
|
+
var c;
|
|
20
|
+
const { showLessItems: t, showSizeChanger: a, showQuickJumper: r, pageSizeOptions: u } = e.pagination || {};
|
|
18
21
|
return {
|
|
19
|
-
current:
|
|
20
|
-
pageSize:
|
|
21
|
-
total: ((
|
|
22
|
-
showSizeChanger: !
|
|
23
|
-
showQuickJumper: !
|
|
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:
|
|
27
|
-
onChange:
|
|
32
|
+
dataSource: p,
|
|
33
|
+
onChange: d
|
|
28
34
|
};
|
|
29
35
|
};
|
|
30
36
|
export {
|
|
31
|
-
|
|
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<{}>, {
|
|
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
|
|
2
|
-
import { Button as
|
|
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
|
|
5
|
-
import { useLocale as
|
|
6
|
-
const
|
|
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: {
|
|
13
|
+
clearAll: {},
|
|
14
|
+
showSelected: { type: Boolean, default: !0 }
|
|
11
15
|
},
|
|
12
|
-
setup(
|
|
13
|
-
const { b:
|
|
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 =
|
|
16
|
-
}),
|
|
17
|
-
return
|
|
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, _,
|
|
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" ?
|
|
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 &&
|
|
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) => (
|
|
33
|
-
class: f([t(
|
|
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(
|
|
42
|
+
class: f(t(r)("header"))
|
|
39
43
|
}, [
|
|
40
44
|
m(e.$slots, "header")
|
|
41
45
|
], 2), [
|
|
42
|
-
[z,
|
|
46
|
+
[z, i.value]
|
|
43
47
|
]),
|
|
44
48
|
c("div", {
|
|
45
|
-
class: f(t(
|
|
49
|
+
class: f(t(r)("body"))
|
|
46
50
|
}, [
|
|
47
51
|
m(e.$slots, "prefix"),
|
|
48
|
-
|
|
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
|
-
|
|
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) =>
|
|
61
|
+
onClick: l[0] || (l[0] = (h) => o.clearAll && o.clearAll())
|
|
58
62
|
}, {
|
|
59
|
-
default:
|
|
60
|
-
v(
|
|
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
|
-
|
|
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, {
|
|
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, {
|
|
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;
|
|
@@ -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
|
|
2
|
-
import { DownOutlined as
|
|
3
|
-
import { message as
|
|
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
|
|
6
|
-
import { usePermission as
|
|
7
|
-
import { handleExportDownload as
|
|
8
|
-
import { useInjectApTable as
|
|
9
|
-
import { convertExportField as
|
|
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 {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import
|
|
15
|
-
|
|
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(
|
|
33
|
-
const { hasPermission:
|
|
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
|
|
36
|
-
return !!(e != null && e.disabled) || (
|
|
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
|
-
|
|
40
|
-
() =>
|
|
42
|
+
U(
|
|
43
|
+
() => f.value,
|
|
41
44
|
() => {
|
|
42
|
-
|
|
45
|
+
f.value && (w.value = !1);
|
|
43
46
|
},
|
|
44
47
|
{
|
|
45
48
|
immediate: !0
|
|
46
49
|
}
|
|
47
50
|
);
|
|
48
|
-
const
|
|
49
|
-
const
|
|
50
|
-
return
|
|
51
|
-
key:
|
|
52
|
-
} : typeof
|
|
53
|
-
...
|
|
54
|
-
key:
|
|
55
|
-
} :
|
|
56
|
-
}
|
|
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
|
-
},
|
|
59
|
-
let
|
|
60
|
-
return !(e != null && e.ifShow) && (e != null && e.auth) && (
|
|
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
|
|
63
|
-
|
|
65
|
+
async function O() {
|
|
66
|
+
x.value.length > 0 ? p({ key: s.SELECT }) : p({ key: s.ALL });
|
|
64
67
|
}
|
|
65
|
-
async function
|
|
66
|
-
var
|
|
67
|
-
const { getRequestParams:
|
|
68
|
-
let
|
|
69
|
-
|
|
70
|
-
[(
|
|
71
|
-
} :
|
|
72
|
-
const
|
|
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
|
-
|
|
75
|
-
let
|
|
77
|
+
d.value = !0;
|
|
78
|
+
let k = Object.assign(
|
|
76
79
|
{
|
|
77
|
-
...
|
|
78
|
-
...
|
|
80
|
+
...C,
|
|
81
|
+
...q
|
|
79
82
|
},
|
|
80
|
-
|
|
81
|
-
[
|
|
82
|
-
|
|
83
|
-
|
|
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
|
-
|
|
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
|
-
|
|
92
|
+
d.value = !1;
|
|
90
93
|
}
|
|
91
94
|
}
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
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
|
-
|
|
195
|
+
Ee as default
|
|
159
196
|
};
|