@aplus-frontend/ui 0.1.25 → 0.1.27
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-download/ap-download.vue.d.ts +7 -3
- package/es/src/ap-download/ap-download.vue.mjs +50 -35
- package/es/src/ap-download/interface.d.ts +3 -11
- package/es/src/ap-download/style/ap-download.css +3 -0
- package/es/src/ap-form/ap-form-item.vue.mjs +26 -26
- package/es/src/ap-table/ap-table.vue.mjs +231 -183
- package/es/src/ap-table/components/interface.d.ts +33 -1
- package/es/src/ap-table/components/setting/images/icon_carst_down.svg.mjs +4 -0
- package/es/src/ap-table/components/setting/images/icon_fill_right.svg.mjs +4 -0
- package/es/src/ap-table/components/setting/modal/index.vue.d.ts +28 -0
- package/es/src/ap-table/components/setting/modal/index.vue.mjs +4 -0
- package/es/src/ap-table/components/setting/modal/index.vue2.mjs +152 -0
- package/es/src/ap-table/components/setting/select-group/index.vue.d.ts +13 -0
- package/es/src/ap-table/components/setting/select-group/index.vue.mjs +4 -0
- package/es/src/ap-table/components/setting/select-group/index.vue2.mjs +96 -0
- package/es/src/ap-table/components/setting/sortable/index.vue.d.ts +13 -0
- package/es/src/ap-table/components/setting/sortable/index.vue.mjs +4 -0
- package/es/src/ap-table/components/setting/sortable/index.vue2.mjs +51 -0
- package/es/src/ap-table/components/setting/sortable/item.vue.d.ts +20 -0
- package/es/src/ap-table/components/setting/sortable/item.vue.mjs +4 -0
- package/es/src/ap-table/components/setting/sortable/item.vue2.mjs +140 -0
- package/es/src/ap-table/components/setting/sorter/context.d.ts +11 -0
- package/es/src/ap-table/components/setting/sorter/context.mjs +20 -0
- package/es/src/ap-table/components/setting/sorter/index.vue.d.ts +18 -0
- package/es/src/ap-table/components/setting/sorter/index.vue.mjs +4 -0
- package/es/src/ap-table/components/setting/sorter/index.vue2.mjs +199 -0
- package/es/src/ap-table/components/setting/tree-select/index.vue.d.ts +13 -0
- package/es/src/ap-table/components/setting/tree-select/index.vue.mjs +4 -0
- package/es/src/ap-table/components/setting/tree-select/index.vue2.mjs +75 -0
- package/es/src/ap-table/components/setting/utils.d.ts +17 -0
- package/es/src/ap-table/components/setting/utils.mjs +48 -0
- package/es/src/ap-table/components/style/setting/modal.css +39 -0
- package/es/src/ap-table/components/style/setting/select-group.css +7 -0
- package/es/src/ap-table/components/style/setting/sortable-item-meta.css +50 -0
- package/es/src/ap-table/components/style/setting/sortable-item.css +3 -0
- package/es/src/ap-table/components/style/setting/sorter.css +26 -0
- package/es/src/ap-table/constants.d.ts +31 -8
- package/es/src/ap-table/constants.mjs +41 -53
- package/es/src/ap-table/context.d.ts +31 -0
- package/es/src/ap-table/context.mjs +20 -0
- package/es/src/ap-table/hooks/use-table-column-state.d.ts +18 -0
- package/es/src/ap-table/hooks/use-table-column-state.mjs +46 -0
- package/es/src/ap-table/hooks/use-table-content-height.mjs +19 -19
- package/es/src/ap-table/hooks/use-table-paging.d.ts +1 -0
- package/es/src/ap-table/hooks/use-table-paging.mjs +87 -82
- package/es/src/ap-table/interface.d.ts +51 -1
- package/es/src/ap-table/style/ap-table.css +29 -1
- package/es/src/ap-table/utils.d.ts +1 -1
- package/es/src/ap-table/utils.mjs +82 -82
- package/es/src/ap-upload/components/MultipleFile.vue2.mjs +91 -89
- package/es/src/ap-upload/components/Picture.vue2.mjs +114 -112
- package/es/src/ap-upload/components/SingleFile.vue2.mjs +10 -7
- package/es/src/business/ap-attachment/ApAttachment.d.ts +1 -1
- package/es/src/business/ap-attachment/ApAttachment.mjs +45 -42
- package/es/src/business/ap-attachment/style.css +2 -0
- package/es/src/business/ap-ladder/ApLadder.vue2.mjs +114 -84
- package/es/src/business/ap-ladder/interface.d.ts +42 -0
- package/es/src/business/ap-ladder/interface.mjs +10 -0
- package/es/src/business/hooks/usePageListApTable.d.ts +8 -3
- package/es/src/business/hooks/usePageListApTable.mjs +27 -17
- package/es/src/business/hooks/useTableRefresh.d.ts +3 -4
- package/es/src/business/hooks/useTableRefresh.mjs +9 -9
- package/es/src/business/index.d.ts +4 -4
- package/es/src/editable-table/interface.d.ts +1 -1
- package/es/src/locale/lang/en.mjs +14 -0
- package/es/src/locale/lang/zh-cn.mjs +14 -0
- package/es/src/theme/ap-attachment/ap-attachment.css +2 -0
- package/es/src/theme/ap-download/ap-download.css +3 -0
- package/es/src/theme/ap-table/ap-table.css +29 -1
- package/es/src/theme/ap-table/setting/modal.css +39 -0
- package/es/src/theme/ap-table/setting/select-group.css +7 -0
- package/es/src/theme/ap-table/setting/sortable-item-meta.css +50 -0
- package/es/src/theme/ap-table/setting/sortable-item.css +3 -0
- package/es/src/theme/ap-table/setting/sorter.css +26 -0
- package/es/src/theme/css-var/index.mjs +22 -12
- package/lib/src/ap-download/ap-download.vue.d.ts +7 -3
- package/lib/src/ap-download/ap-download.vue.js +1 -1
- package/lib/src/ap-download/interface.d.ts +3 -11
- package/lib/src/ap-download/style/ap-download.css +3 -0
- package/lib/src/ap-form/ap-form-item.vue.js +1 -1
- package/lib/src/ap-table/ap-table.vue.js +1 -1
- package/lib/src/ap-table/components/interface.d.ts +33 -1
- package/lib/src/ap-table/components/setting/images/icon_carst_down.svg.js +1 -0
- package/lib/src/ap-table/components/setting/images/icon_fill_right.svg.js +1 -0
- package/lib/src/ap-table/components/setting/modal/index.vue.d.ts +28 -0
- package/lib/src/ap-table/components/setting/modal/index.vue.js +1 -0
- package/lib/src/ap-table/components/setting/modal/index.vue2.js +1 -0
- package/lib/src/ap-table/components/setting/select-group/index.vue.d.ts +13 -0
- package/lib/src/ap-table/components/setting/select-group/index.vue.js +1 -0
- package/lib/src/ap-table/components/setting/select-group/index.vue2.js +1 -0
- package/lib/src/ap-table/components/setting/sortable/index.vue.d.ts +13 -0
- package/lib/src/ap-table/components/setting/sortable/index.vue.js +1 -0
- package/lib/src/ap-table/components/setting/sortable/index.vue2.js +1 -0
- package/lib/src/ap-table/components/setting/sortable/item.vue.d.ts +20 -0
- package/lib/src/ap-table/components/setting/sortable/item.vue.js +1 -0
- package/lib/src/ap-table/components/setting/sortable/item.vue2.js +1 -0
- package/lib/src/ap-table/components/setting/sorter/context.d.ts +11 -0
- package/lib/src/ap-table/components/setting/sorter/context.js +1 -0
- package/lib/src/ap-table/components/setting/sorter/index.vue.d.ts +18 -0
- package/lib/src/ap-table/components/setting/sorter/index.vue.js +1 -0
- package/lib/src/ap-table/components/setting/sorter/index.vue2.js +1 -0
- package/lib/src/ap-table/components/setting/tree-select/index.vue.d.ts +13 -0
- package/lib/src/ap-table/components/setting/tree-select/index.vue.js +1 -0
- package/lib/src/ap-table/components/setting/tree-select/index.vue2.js +1 -0
- package/lib/src/ap-table/components/setting/utils.d.ts +17 -0
- package/lib/src/ap-table/components/setting/utils.js +1 -0
- package/lib/src/ap-table/components/style/setting/modal.css +39 -0
- package/lib/src/ap-table/components/style/setting/select-group.css +7 -0
- package/lib/src/ap-table/components/style/setting/sortable-item-meta.css +50 -0
- package/lib/src/ap-table/components/style/setting/sortable-item.css +3 -0
- package/lib/src/ap-table/components/style/setting/sorter.css +26 -0
- package/lib/src/ap-table/constants.d.ts +31 -8
- package/lib/src/ap-table/constants.js +1 -1
- package/lib/src/ap-table/context.d.ts +31 -0
- package/lib/src/ap-table/context.js +1 -0
- package/lib/src/ap-table/hooks/use-table-column-state.d.ts +18 -0
- package/lib/src/ap-table/hooks/use-table-column-state.js +1 -0
- package/lib/src/ap-table/hooks/use-table-content-height.js +1 -1
- package/lib/src/ap-table/hooks/use-table-paging.d.ts +1 -0
- package/lib/src/ap-table/hooks/use-table-paging.js +1 -1
- package/lib/src/ap-table/interface.d.ts +51 -1
- package/lib/src/ap-table/style/ap-table.css +29 -1
- package/lib/src/ap-table/utils.d.ts +1 -1
- package/lib/src/ap-table/utils.js +1 -1
- package/lib/src/ap-upload/components/MultipleFile.vue2.js +1 -1
- package/lib/src/ap-upload/components/Picture.vue2.js +1 -1
- package/lib/src/ap-upload/components/SingleFile.vue2.js +1 -1
- package/lib/src/business/ap-attachment/ApAttachment.d.ts +1 -1
- package/lib/src/business/ap-attachment/ApAttachment.js +1 -1
- package/lib/src/business/ap-attachment/style.css +2 -0
- package/lib/src/business/ap-ladder/ApLadder.vue2.js +1 -1
- package/lib/src/business/ap-ladder/interface.d.ts +42 -0
- package/lib/src/business/ap-ladder/interface.js +1 -0
- package/lib/src/business/hooks/usePageListApTable.d.ts +8 -3
- package/lib/src/business/hooks/usePageListApTable.js +1 -1
- package/lib/src/business/hooks/useTableRefresh.d.ts +3 -4
- package/lib/src/business/hooks/useTableRefresh.js +1 -1
- package/lib/src/business/index.d.ts +4 -4
- package/lib/src/editable-table/interface.d.ts +1 -1
- package/lib/src/locale/lang/en.js +1 -1
- package/lib/src/locale/lang/zh-cn.js +1 -1
- package/lib/src/theme/ap-attachment/ap-attachment.css +2 -0
- package/lib/src/theme/ap-download/ap-download.css +3 -0
- package/lib/src/theme/ap-table/ap-table.css +29 -1
- package/lib/src/theme/ap-table/setting/modal.css +39 -0
- package/lib/src/theme/ap-table/setting/select-group.css +7 -0
- package/lib/src/theme/ap-table/setting/sortable-item-meta.css +50 -0
- package/lib/src/theme/ap-table/setting/sortable-item.css +3 -0
- package/lib/src/theme/ap-table/setting/sorter.css +26 -0
- package/lib/src/theme/css-var/index.js +1 -1
- package/package.json +3 -2
|
@@ -3,71 +3,59 @@ import "../ap-field/index.mjs";
|
|
|
3
3
|
import "../ap-form/index.mjs";
|
|
4
4
|
import "./components/index/index.vue.mjs";
|
|
5
5
|
import "./components/status/index.vue.mjs";
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
6
|
+
import o from "../ap-form/items/date/index.vue.mjs";
|
|
7
|
+
import r from "../ap-form/items/date-range/index.vue.mjs";
|
|
8
|
+
import i from "../ap-form/items/number/index.vue.mjs";
|
|
9
9
|
import t from "../ap-form/items/radio/index.vue.mjs";
|
|
10
|
-
import
|
|
11
|
-
import
|
|
10
|
+
import a from "../ap-form/items/select/index.vue.mjs";
|
|
11
|
+
import f from "../ap-form/items/switch/index.vue.mjs";
|
|
12
12
|
import { ApFormItemText as m } from "../ap-form/items/text/index.mjs";
|
|
13
|
-
import
|
|
14
|
-
import
|
|
15
|
-
import
|
|
13
|
+
import _ from "../ap-form/items/text-area/index.vue.mjs";
|
|
14
|
+
import e from "../ap-form/items/checkbox/index.vue.mjs";
|
|
15
|
+
import s from "../ap-field/date/index.vue.mjs";
|
|
16
16
|
import p from "../ap-field/date-range/index.vue.mjs";
|
|
17
|
-
import
|
|
18
|
-
import
|
|
19
|
-
import
|
|
17
|
+
import c from "../ap-field/number/index.vue.mjs";
|
|
18
|
+
import n from "../ap-field/radio/index.vue.mjs";
|
|
19
|
+
import $ from "../ap-field/select/index.vue.mjs";
|
|
20
20
|
import d from "../ap-field/switch/index.vue.mjs";
|
|
21
|
-
import { ApFieldText as
|
|
22
|
-
import
|
|
23
|
-
import
|
|
24
|
-
import
|
|
25
|
-
import
|
|
26
|
-
import
|
|
27
|
-
import
|
|
28
|
-
const
|
|
29
|
-
date:
|
|
30
|
-
dateRange:
|
|
31
|
-
number:
|
|
21
|
+
import { ApFieldText as x } from "../ap-field/text/index.mjs";
|
|
22
|
+
import b from "../ap-field/text-area/index.vue.mjs";
|
|
23
|
+
import l from "../ap-field/checkbox/index.vue.mjs";
|
|
24
|
+
import h from "../ap-action/group/index.vue.mjs";
|
|
25
|
+
import w from "./components/index/index.vue2.mjs";
|
|
26
|
+
import A from "./components/status/index.vue2.mjs";
|
|
27
|
+
import u from "../ap-field/text/password.vue.mjs";
|
|
28
|
+
const U = {
|
|
29
|
+
date: o,
|
|
30
|
+
dateRange: r,
|
|
31
|
+
number: i,
|
|
32
32
|
radio: t,
|
|
33
|
-
select:
|
|
34
|
-
switch:
|
|
33
|
+
select: a,
|
|
34
|
+
switch: f,
|
|
35
35
|
text: m,
|
|
36
|
-
textArea:
|
|
37
|
-
checkbox:
|
|
36
|
+
textArea: _,
|
|
37
|
+
checkbox: e,
|
|
38
38
|
password: m.Password
|
|
39
|
-
},
|
|
40
|
-
date:
|
|
39
|
+
}, W = {
|
|
40
|
+
date: s,
|
|
41
41
|
dateRange: p,
|
|
42
|
-
number:
|
|
43
|
-
radio:
|
|
44
|
-
select:
|
|
42
|
+
number: c,
|
|
43
|
+
radio: n,
|
|
44
|
+
select: $,
|
|
45
45
|
switch: d,
|
|
46
|
-
text:
|
|
47
|
-
textArea:
|
|
48
|
-
checkbox:
|
|
49
|
-
action:
|
|
50
|
-
index:
|
|
51
|
-
status:
|
|
52
|
-
password:
|
|
46
|
+
text: x,
|
|
47
|
+
textArea: b,
|
|
48
|
+
checkbox: l,
|
|
49
|
+
action: h,
|
|
50
|
+
index: w,
|
|
51
|
+
status: A,
|
|
52
|
+
password: u
|
|
53
53
|
}, X = [
|
|
54
54
|
"action",
|
|
55
55
|
"index"
|
|
56
|
-
]
|
|
57
|
-
display: "-webkit-inline-box",
|
|
58
|
-
"-webkit-line-clamp": 2,
|
|
59
|
-
"-webkit-box-orient": "vertical",
|
|
60
|
-
overflow: "hidden",
|
|
61
|
-
textOverflow: "ellipsis",
|
|
62
|
-
whiteSpace: "normal",
|
|
63
|
-
maxWidth: "100%",
|
|
64
|
-
verticalAlign: "middle",
|
|
65
|
-
wordBreak: "break-all",
|
|
66
|
-
flex: 1
|
|
67
|
-
};
|
|
56
|
+
];
|
|
68
57
|
export {
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
Y as ellipsisTitleStyle,
|
|
58
|
+
U as apTableFormItemMap,
|
|
59
|
+
W as apTableRenderItemMap,
|
|
72
60
|
X as noRenderAsFormItemValueList
|
|
73
61
|
};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { ColumnType } from 'ant-design-vue/es/table';
|
|
2
|
+
import { ComputedRef, InjectionKey } from 'vue';
|
|
3
|
+
import { ApTableProps } from './interface';
|
|
4
|
+
type TableSize = ApTableProps['size'];
|
|
5
|
+
type ApTableContextProps<RecordType> = {
|
|
6
|
+
/**
|
|
7
|
+
* 表格列配置
|
|
8
|
+
*/
|
|
9
|
+
columns?: ComputedRef<ColumnType<RecordType>[]>;
|
|
10
|
+
/**
|
|
11
|
+
* 表格列配置备份(只有在props变更后才会变更)
|
|
12
|
+
*/
|
|
13
|
+
columnsBackup?: ComputedRef<ColumnType<RecordType>[]>;
|
|
14
|
+
/**
|
|
15
|
+
* 更新数据源的方法
|
|
16
|
+
* @param name
|
|
17
|
+
* @param value
|
|
18
|
+
* @param triggerChange 是否触发外部的`onValuesChange`函数
|
|
19
|
+
* @returns
|
|
20
|
+
*/
|
|
21
|
+
updateColumns?: (nextColumns: ColumnType<RecordType>[]) => void;
|
|
22
|
+
/**
|
|
23
|
+
* ApForm内部实例
|
|
24
|
+
*/
|
|
25
|
+
size?: ComputedRef<TableSize>;
|
|
26
|
+
updateSize?: (nextSize: TableSize) => void;
|
|
27
|
+
};
|
|
28
|
+
export declare const ApTableContextKey: InjectionKey<ApTableContextProps<any>>;
|
|
29
|
+
export declare function useProvideApTable<ModelType>(state: ApTableContextProps<ModelType>): void;
|
|
30
|
+
export declare function useInjectApTable(): ApTableContextProps<any>;
|
|
31
|
+
export {};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { provide as n, inject as p, computed as e } from "vue";
|
|
2
|
+
const t = Symbol("apTableContextKey");
|
|
3
|
+
function i(o) {
|
|
4
|
+
n(t, o);
|
|
5
|
+
}
|
|
6
|
+
function l() {
|
|
7
|
+
return p(t, {
|
|
8
|
+
columns: e(() => []),
|
|
9
|
+
updateColumns: () => {
|
|
10
|
+
},
|
|
11
|
+
size: e(() => "middle"),
|
|
12
|
+
updateSize: () => {
|
|
13
|
+
}
|
|
14
|
+
});
|
|
15
|
+
}
|
|
16
|
+
export {
|
|
17
|
+
t as ApTableContextKey,
|
|
18
|
+
l as useInjectApTable,
|
|
19
|
+
i as useProvideApTable
|
|
20
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { ApColumnState } from '../interface';
|
|
2
|
+
import { Ref, ComputedRef } from 'vue';
|
|
3
|
+
export declare const useTableColumnState: (initialColumnState: ApColumnState[]) => {
|
|
4
|
+
columnState: Ref<{
|
|
5
|
+
key: string | number;
|
|
6
|
+
show?: boolean | undefined;
|
|
7
|
+
fixed?: ("left" | "right") | undefined;
|
|
8
|
+
disabled?: boolean | undefined;
|
|
9
|
+
label?: any;
|
|
10
|
+
children?: any[] | undefined;
|
|
11
|
+
}[]>;
|
|
12
|
+
selectAll: () => void;
|
|
13
|
+
unSelectAll: () => void;
|
|
14
|
+
toggleSelect: (key: string, show?: boolean) => void;
|
|
15
|
+
setColumnState: (nextColumnState: ApColumnState[]) => void;
|
|
16
|
+
isAllSelected: ComputedRef<boolean>;
|
|
17
|
+
toggleSelectAll: () => void;
|
|
18
|
+
};
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { ref as d, computed as h, unref as r } from "vue";
|
|
2
|
+
import { isDef as w } from "../../utils/index.mjs";
|
|
3
|
+
function s(c, e) {
|
|
4
|
+
c.forEach((n) => {
|
|
5
|
+
var o;
|
|
6
|
+
e(n), (o = n.children) != null && o.length && s(n.children, e);
|
|
7
|
+
});
|
|
8
|
+
}
|
|
9
|
+
const p = (c) => {
|
|
10
|
+
const e = d(c), n = h(() => r(e).every((t) => t.show));
|
|
11
|
+
function o() {
|
|
12
|
+
const t = r(e);
|
|
13
|
+
s(t, (l) => {
|
|
14
|
+
!l.disabled && (l.show = !0);
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
function u() {
|
|
18
|
+
const t = r(e);
|
|
19
|
+
s(t, (l) => {
|
|
20
|
+
!l.disabled && (l.show = !1);
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
function i() {
|
|
24
|
+
r(n) ? u() : o();
|
|
25
|
+
}
|
|
26
|
+
function a(t, l) {
|
|
27
|
+
s(r(e), (f) => {
|
|
28
|
+
f.key === t && (f.show = w(l) ? l : !f.show);
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
function S(t) {
|
|
32
|
+
e.value = t;
|
|
33
|
+
}
|
|
34
|
+
return {
|
|
35
|
+
columnState: e,
|
|
36
|
+
selectAll: o,
|
|
37
|
+
unSelectAll: u,
|
|
38
|
+
toggleSelect: a,
|
|
39
|
+
setColumnState: S,
|
|
40
|
+
isAllSelected: n,
|
|
41
|
+
toggleSelectAll: i
|
|
42
|
+
};
|
|
43
|
+
};
|
|
44
|
+
export {
|
|
45
|
+
p as useTableColumnState
|
|
46
|
+
};
|
|
@@ -1,39 +1,39 @@
|
|
|
1
|
-
import { useElementSize as
|
|
2
|
-
import { ref as
|
|
3
|
-
function
|
|
1
|
+
import { useElementSize as b } from "@vueuse/core";
|
|
2
|
+
import { ref as s, computed as y, unref as f, onUpdated as v } from "vue";
|
|
3
|
+
function p(t) {
|
|
4
4
|
if (!t)
|
|
5
5
|
return 0;
|
|
6
6
|
const e = parseFloat(t);
|
|
7
7
|
return Number.isNaN(e) ? 0 : e;
|
|
8
8
|
}
|
|
9
|
-
function
|
|
9
|
+
function m(t) {
|
|
10
10
|
if (!t)
|
|
11
11
|
return 0;
|
|
12
12
|
const e = getComputedStyle(t);
|
|
13
|
-
return t.clientHeight +
|
|
13
|
+
return t.clientHeight + p(e.marginTop) + p(e.marginBottom);
|
|
14
14
|
}
|
|
15
|
-
const
|
|
16
|
-
const e =
|
|
15
|
+
const T = (t) => {
|
|
16
|
+
const e = s(), { height: d } = b(e), a = s();
|
|
17
17
|
let i = !1;
|
|
18
|
-
const
|
|
19
|
-
var
|
|
20
|
-
const
|
|
21
|
-
return
|
|
22
|
-
|
|
18
|
+
const H = y(() => {
|
|
19
|
+
var u, c, l, g, h;
|
|
20
|
+
const n = ((c = (u = e.value) == null ? void 0 : u.querySelector(".aplus-ap-table-header-wrapper")) == null ? void 0 : c.clientHeight) || 0, r = ((g = (l = e.value) == null ? void 0 : l.querySelector(".ant-table-header")) == null ? void 0 : g.clientHeight) || 47, o = (h = e.value) == null ? void 0 : h.querySelector(".ant-pagination"), S = o ? m(o) : f(a);
|
|
21
|
+
return o && (i = !0), Math.ceil(
|
|
22
|
+
f(d) - r - n - (S || 0) - ((t == null ? void 0 : t.offset) || 0)
|
|
23
23
|
);
|
|
24
24
|
});
|
|
25
|
-
return
|
|
26
|
-
var
|
|
25
|
+
return v(() => {
|
|
26
|
+
var r;
|
|
27
27
|
if (i)
|
|
28
28
|
return;
|
|
29
|
-
const
|
|
30
|
-
if (!
|
|
29
|
+
const n = (r = e.value) == null ? void 0 : r.querySelector(".ant-pagination");
|
|
30
|
+
if (!n) {
|
|
31
31
|
a.value = 0;
|
|
32
32
|
return;
|
|
33
33
|
}
|
|
34
|
-
a.value =
|
|
35
|
-
}), { contentRef: e, height:
|
|
34
|
+
a.value = m(n), i = !0;
|
|
35
|
+
}), { contentRef: e, height: H };
|
|
36
36
|
};
|
|
37
37
|
export {
|
|
38
|
-
|
|
38
|
+
T as default
|
|
39
39
|
};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { ref as
|
|
2
|
-
import { parseFieldValue as
|
|
3
|
-
import { isArray as
|
|
1
|
+
import { ref as P, nextTick as _, unref as n, onMounted as I, computed as V, createVNode as b } from "vue";
|
|
2
|
+
import { parseFieldValue as k, dataIndexToStr as ee } from "../utils.mjs";
|
|
3
|
+
import { isArray as te } from "lodash-unified";
|
|
4
4
|
import "../../config-provider/index.mjs";
|
|
5
|
-
import { useLocale as
|
|
6
|
-
import { useNamespace as
|
|
7
|
-
const
|
|
5
|
+
import { useLocale as ae } from "../../config-provider/hooks/use-locale.mjs";
|
|
6
|
+
import { useNamespace as ne } from "../../config-provider/hooks/use-namespace.mjs";
|
|
7
|
+
const ue = ({
|
|
8
8
|
manual: B = !1,
|
|
9
9
|
defaultCurrent: E = 1,
|
|
10
10
|
defaultPageSize: w = 10,
|
|
@@ -13,145 +13,150 @@ const le = ({
|
|
|
13
13
|
defaultData: $ = [],
|
|
14
14
|
formatParams: C,
|
|
15
15
|
paramsValueTypeMap: y,
|
|
16
|
-
resetFieldsIgnores:
|
|
16
|
+
resetFieldsIgnores: D,
|
|
17
17
|
filterFields: q,
|
|
18
18
|
sortFields: J,
|
|
19
|
-
showLessItems:
|
|
19
|
+
showLessItems: z = !1,
|
|
20
20
|
showTotal: L = !0
|
|
21
21
|
}) => {
|
|
22
|
-
let
|
|
23
|
-
const Q = (e) => C ? C(e) : e,
|
|
24
|
-
t:
|
|
25
|
-
} =
|
|
26
|
-
b:
|
|
27
|
-
} =
|
|
22
|
+
let S = 0, f = {};
|
|
23
|
+
const Q = (e) => C ? C(e) : e, c = P(), l = P(E), p = P(w), {
|
|
24
|
+
t: F
|
|
25
|
+
} = ae(), {
|
|
26
|
+
b: T
|
|
27
|
+
} = ne("ap-table"), o = P({
|
|
28
28
|
total: 0,
|
|
29
29
|
records: $,
|
|
30
30
|
loading: !1
|
|
31
|
-
}),
|
|
32
|
-
var
|
|
31
|
+
}), O = async (e) => {
|
|
32
|
+
var r;
|
|
33
33
|
const a = Q(e), t = Date.now();
|
|
34
|
-
|
|
34
|
+
S = t, o.value.loading = !0;
|
|
35
35
|
try {
|
|
36
36
|
const s = await M({
|
|
37
37
|
...N,
|
|
38
38
|
...a
|
|
39
39
|
});
|
|
40
|
-
|
|
40
|
+
S === t && (o.value.total = s.total || ((r = s.data) == null ? void 0 : r.length) || 0, o.value.records = [...s.data || []]);
|
|
41
41
|
} catch {
|
|
42
|
-
|
|
42
|
+
S === t && (o.value.records = [], o.value.total = 0);
|
|
43
43
|
} finally {
|
|
44
|
-
|
|
44
|
+
o.value.loading = !1;
|
|
45
45
|
}
|
|
46
|
-
},
|
|
46
|
+
}, R = (e) => {
|
|
47
47
|
const a = {};
|
|
48
|
-
return Object.entries(e).forEach(([t,
|
|
49
|
-
if (a[t] =
|
|
48
|
+
return Object.entries(e).forEach(([t, r]) => {
|
|
49
|
+
if (a[t] = r, y && r) {
|
|
50
50
|
const s = y[t];
|
|
51
|
-
s && (a[t] =
|
|
51
|
+
s && (a[t] = k(s, r));
|
|
52
52
|
}
|
|
53
53
|
}), a;
|
|
54
54
|
}, G = async (e) => {
|
|
55
|
-
var
|
|
56
|
-
const a = ((s = (
|
|
55
|
+
var r, s, g, d, m, u, h;
|
|
56
|
+
const a = ((s = (r = c.value) == null ? void 0 : r.apForm) == null ? void 0 : s.getFieldsValue()) || {}, t = {};
|
|
57
57
|
Object.entries(a).forEach(([v, i]) => {
|
|
58
|
-
|
|
59
|
-
}), await ((d = (g =
|
|
58
|
+
D && D.indexOf(v) > -1 && (t[v] = i);
|
|
59
|
+
}), await ((d = (g = c.value) == null ? void 0 : g.apForm) == null ? void 0 : d.resetFields()), (h = (u = (m = c.value) == null ? void 0 : m.apForm) == null ? void 0 : u.setFieldsValue) == null || h.call(u, t), _(() => {
|
|
60
60
|
e == null || e();
|
|
61
61
|
});
|
|
62
|
-
},
|
|
63
|
-
|
|
64
|
-
const a =
|
|
65
|
-
|
|
62
|
+
}, x = (e) => {
|
|
63
|
+
f = e;
|
|
64
|
+
const a = R(e);
|
|
65
|
+
O(a);
|
|
66
66
|
}, H = (e) => {
|
|
67
|
-
|
|
68
|
-
...
|
|
67
|
+
x({
|
|
68
|
+
...f,
|
|
69
69
|
...e
|
|
70
70
|
});
|
|
71
|
-
},
|
|
71
|
+
}, j = () => {
|
|
72
72
|
var a, t;
|
|
73
|
-
const e = ((t = (a =
|
|
74
|
-
|
|
73
|
+
const e = ((t = (a = c.value) == null ? void 0 : a.apForm) == null ? void 0 : t.getFieldsValue(!0)) || {};
|
|
74
|
+
l.value = 1, x({
|
|
75
75
|
...e,
|
|
76
76
|
current: 1,
|
|
77
|
-
pageSize:
|
|
77
|
+
pageSize: f.pageSize || w
|
|
78
78
|
});
|
|
79
79
|
}, K = () => {
|
|
80
|
-
G(
|
|
80
|
+
G(j);
|
|
81
81
|
}, U = () => {
|
|
82
|
-
|
|
82
|
+
x(f);
|
|
83
83
|
}, W = (e) => {
|
|
84
|
-
const a = o
|
|
84
|
+
const a = n(o).total - e, t = Math.ceil(a / n(p)), r = n(l) > t ? t : n(l);
|
|
85
85
|
H({
|
|
86
|
-
current:
|
|
86
|
+
current: r > 0 ? r : 1
|
|
87
87
|
});
|
|
88
88
|
}, A = (e, a, t) => {
|
|
89
89
|
var m, u, h, v;
|
|
90
|
-
const
|
|
91
|
-
|
|
92
|
-
const s =
|
|
90
|
+
const r = ((u = (m = c.value) == null ? void 0 : m.apForm) == null ? void 0 : u.getFieldsValue(!0)) || {};
|
|
91
|
+
l.value = e.current, p.value = e.pageSize;
|
|
92
|
+
const s = te(t) ? [...t] : [t], g = {};
|
|
93
93
|
for (const i of s)
|
|
94
|
-
(h =
|
|
94
|
+
(h = n(J)) != null && h.includes(i.field) && (g[ee(i.field)] = i.order);
|
|
95
95
|
const d = {};
|
|
96
96
|
for (const i of Object.keys(a))
|
|
97
|
-
(v =
|
|
98
|
-
|
|
99
|
-
...
|
|
97
|
+
(v = n(q)) != null && v.includes(i) && (d[i] = a[i]);
|
|
98
|
+
x({
|
|
99
|
+
...r,
|
|
100
100
|
filter: d,
|
|
101
101
|
sort: g,
|
|
102
102
|
current: e.current,
|
|
103
103
|
pageSize: e.pageSize
|
|
104
104
|
});
|
|
105
105
|
};
|
|
106
|
-
|
|
106
|
+
I(() => {
|
|
107
107
|
var a, t;
|
|
108
|
-
const e = ((t = (a =
|
|
109
|
-
if (
|
|
110
|
-
current:
|
|
111
|
-
pageSize:
|
|
108
|
+
const e = ((t = (a = c.value) == null ? void 0 : a.apForm) == null ? void 0 : t.getFieldsValue(!0)) || {};
|
|
109
|
+
if (f = {
|
|
110
|
+
current: n(l),
|
|
111
|
+
pageSize: n(p),
|
|
112
112
|
...e
|
|
113
113
|
}, !B) {
|
|
114
|
-
const
|
|
115
|
-
|
|
114
|
+
const r = R(f);
|
|
115
|
+
O(r);
|
|
116
116
|
}
|
|
117
117
|
});
|
|
118
|
-
const X = V(() => o
|
|
119
|
-
|
|
118
|
+
const X = V(() => n(o).total === 0 ? "-" : `${n(l.value)}/${Math.ceil(n(o).total / n(p))}`);
|
|
119
|
+
function Y(e) {
|
|
120
|
+
e != null && e.length && (o.value.records = e, o.value.total = e.length);
|
|
121
|
+
}
|
|
122
|
+
const Z = V(() => ({
|
|
123
|
+
loading: n(o).loading,
|
|
120
124
|
pagination: {
|
|
121
|
-
current:
|
|
122
|
-
pageSize:
|
|
123
|
-
total: o
|
|
124
|
-
showSizeChanger: !
|
|
125
|
-
showQuickJumper: !
|
|
126
|
-
showLessItems:
|
|
125
|
+
current: n(l),
|
|
126
|
+
pageSize: n(p),
|
|
127
|
+
total: n(o).total,
|
|
128
|
+
showSizeChanger: !z,
|
|
129
|
+
showQuickJumper: !z,
|
|
130
|
+
showLessItems: z,
|
|
127
131
|
size: "default",
|
|
128
|
-
showTotal: L ? (e) =>
|
|
129
|
-
class:
|
|
130
|
-
}, [
|
|
131
|
-
class:
|
|
132
|
-
}, [e]), " ",
|
|
133
|
-
class:
|
|
134
|
-
}, [
|
|
135
|
-
class:
|
|
136
|
-
}, [
|
|
132
|
+
showTotal: L ? (e) => b("span", {
|
|
133
|
+
class: T("pagination-total-wrapper")
|
|
134
|
+
}, [F("ap.apTable.pagination.totalLeftPrefix"), " ", b("span", {
|
|
135
|
+
class: T("pagination-count-text")
|
|
136
|
+
}, [e]), " ", F("ap.apTable.pagination.totalLeftSuffix"), b("span", {
|
|
137
|
+
class: T("pagination--total-right")
|
|
138
|
+
}, [F("ap.apTable.pagination.totalRightPrefix"), " ", b("span", {
|
|
139
|
+
class: T("pagination-count-text")
|
|
140
|
+
}, [n(X)]), " ", F("ap.apTable.pagination.totalRightSuffix")])]) : void 0
|
|
137
141
|
},
|
|
138
142
|
onChange: A,
|
|
139
|
-
dataSource: o
|
|
143
|
+
dataSource: n(o).records
|
|
140
144
|
}));
|
|
141
145
|
return {
|
|
142
|
-
formRef:
|
|
143
|
-
submit:
|
|
146
|
+
formRef: c,
|
|
147
|
+
submit: j,
|
|
144
148
|
reset: K,
|
|
145
149
|
refresh: U,
|
|
146
150
|
refreshByDelete: W,
|
|
147
|
-
data:
|
|
148
|
-
current:
|
|
149
|
-
pageSize:
|
|
151
|
+
data: o,
|
|
152
|
+
current: l,
|
|
153
|
+
pageSize: p,
|
|
150
154
|
handleTableChange: A,
|
|
151
|
-
tableProps:
|
|
152
|
-
dataSource: V(() => o
|
|
155
|
+
tableProps: Z,
|
|
156
|
+
dataSource: V(() => n(o).records),
|
|
157
|
+
setDataSource: Y
|
|
153
158
|
};
|
|
154
159
|
};
|
|
155
160
|
export {
|
|
156
|
-
|
|
161
|
+
ue as useTablePaging
|
|
157
162
|
};
|
|
@@ -72,6 +72,52 @@ export type CommonFieldReturnType = ApFormItemProps & {
|
|
|
72
72
|
placeholder?: string;
|
|
73
73
|
disabled?: boolean;
|
|
74
74
|
};
|
|
75
|
+
export type ApTableSettingType = {
|
|
76
|
+
/**
|
|
77
|
+
* 用于持久化缓存的key
|
|
78
|
+
*/
|
|
79
|
+
persistenceKey?: string;
|
|
80
|
+
/**
|
|
81
|
+
* 持久化类型
|
|
82
|
+
*/
|
|
83
|
+
persistenceType?: 'localStorage' | 'sessionStorage';
|
|
84
|
+
/**
|
|
85
|
+
* 列的默认状态
|
|
86
|
+
*/
|
|
87
|
+
defaultValue?: Recordable<Omit<ApColumnState, 'children' | 'key'>>;
|
|
88
|
+
/**
|
|
89
|
+
* 列状态变更时的回调(注意,返回的是全量状态)
|
|
90
|
+
* @param val
|
|
91
|
+
* @returns
|
|
92
|
+
*/
|
|
93
|
+
onChange?: (val: ApColumnState[]) => void;
|
|
94
|
+
};
|
|
95
|
+
export type ApColumnState = {
|
|
96
|
+
/**
|
|
97
|
+
* 列的唯一标识
|
|
98
|
+
*/
|
|
99
|
+
key: string | number;
|
|
100
|
+
/**
|
|
101
|
+
* 列是否显示
|
|
102
|
+
*/
|
|
103
|
+
show?: boolean;
|
|
104
|
+
/**
|
|
105
|
+
* 列的固定状态
|
|
106
|
+
*/
|
|
107
|
+
fixed?: 'left' | 'right';
|
|
108
|
+
/**
|
|
109
|
+
* 是否可以修改列状态
|
|
110
|
+
*/
|
|
111
|
+
disabled?: boolean;
|
|
112
|
+
/**
|
|
113
|
+
* 列对应显示的文本
|
|
114
|
+
*/
|
|
115
|
+
label?: any;
|
|
116
|
+
/**
|
|
117
|
+
* 子节点状态
|
|
118
|
+
*/
|
|
119
|
+
children?: ApColumnState[];
|
|
120
|
+
};
|
|
75
121
|
export type FieldPropsType<ReturnType, RecordType, ExtraValueType, ValueType extends ApTableValueTypes, MergedValueType extends ExtraValueType | ValueType> = ReturnType | ((opt: Partial<{
|
|
76
122
|
value: any;
|
|
77
123
|
text: any;
|
|
@@ -81,7 +127,7 @@ export type FieldPropsType<ReturnType, RecordType, ExtraValueType, ValueType ext
|
|
|
81
127
|
column: ApColumnType<RecordType, ExtraValueType, ValueType, MergedValueType>;
|
|
82
128
|
}>) => ReturnType);
|
|
83
129
|
export type ApColumnType<RecordType = any, ExtraValueType = 'text', ValueType extends ApTableValueTypes = ApTableValueTypes, MergedValueType extends ExtraValueType | ValueType = ExtraValueType | ValueType> = MergedValueType extends ExtraValueType | ValueType ? ExtraProColumnType<RecordType> & {
|
|
84
|
-
children?: ApColumnType<RecordType, ExtraValueType, ValueType, MergedValueType>[];
|
|
130
|
+
children?: Omit<ApColumnType<RecordType, ExtraValueType, ValueType, MergedValueType>, 'fixed'>[];
|
|
85
131
|
/**
|
|
86
132
|
* 表单项所占据的格子数(1-24格)
|
|
87
133
|
*/
|
|
@@ -267,6 +313,10 @@ export type ApTableProps<RecordType = any, ParamsType = any> = Omit<TableProps<R
|
|
|
267
313
|
* 设置表格列是否可以resize
|
|
268
314
|
*/
|
|
269
315
|
columnResizable?: ColumnType['resizable'];
|
|
316
|
+
/**
|
|
317
|
+
* 是否开启表格设置
|
|
318
|
+
*/
|
|
319
|
+
settings?: true | ApTableSettingType;
|
|
270
320
|
};
|
|
271
321
|
export type ApTableExpose<SearchParamsType = Recordable, RecordType = any> = {
|
|
272
322
|
/**
|
|
@@ -7,7 +7,9 @@
|
|
|
7
7
|
display: flex;
|
|
8
8
|
flex-direction: column;
|
|
9
9
|
}
|
|
10
|
-
.aplus-ap-table-adaptive .ant-table-wrapper
|
|
10
|
+
.aplus-ap-table-adaptive .ant-table-wrapper {
|
|
11
|
+
flex: 1;
|
|
12
|
+
}
|
|
11
13
|
.aplus-ap-table-adaptive .ant-spin-nested-loading,
|
|
12
14
|
.aplus-ap-table-adaptive .ant-spin-container {
|
|
13
15
|
height: 100%;
|
|
@@ -35,6 +37,8 @@
|
|
|
35
37
|
.aplus-ap-table__table-wrapper {
|
|
36
38
|
flex: 1;
|
|
37
39
|
max-height: 100%;
|
|
40
|
+
display: flex;
|
|
41
|
+
flex-direction: column;
|
|
38
42
|
}
|
|
39
43
|
.aplus-ap-table__table-wrapper-card {
|
|
40
44
|
padding: 16px;
|
|
@@ -98,3 +102,27 @@
|
|
|
98
102
|
.aplus-ap-table-pagination-total-wrapper {
|
|
99
103
|
color: var(--ap-table-pagination-total-color, #526A90);
|
|
100
104
|
}
|
|
105
|
+
.aplus-ap-table-header {
|
|
106
|
+
padding-bottom: 16px;
|
|
107
|
+
display: flex;
|
|
108
|
+
justify-content: space-between;
|
|
109
|
+
align-items: center;
|
|
110
|
+
flex-wrap: nowrap;
|
|
111
|
+
}
|
|
112
|
+
.aplus-ap-table-header__title {
|
|
113
|
+
flex: 1;
|
|
114
|
+
flex-shrink: 1;
|
|
115
|
+
min-width: 0;
|
|
116
|
+
}
|
|
117
|
+
.aplus-ap-table-table-header__title {
|
|
118
|
+
display: -webkit-inline-box;
|
|
119
|
+
-webkit-line-clamp: 2;
|
|
120
|
+
-webkit-box-orient: vertical;
|
|
121
|
+
overflow: hidden;
|
|
122
|
+
text-overflow: ellipsis;
|
|
123
|
+
white-space: normal;
|
|
124
|
+
max-width: 100%;
|
|
125
|
+
vertical-align: middle;
|
|
126
|
+
word-break: break-all;
|
|
127
|
+
flex: 1;
|
|
128
|
+
}
|