@aplus-frontend/ui 0.0.1-beta.39 → 0.0.1-beta.40
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/index.mjs +104 -98
- package/es/src/ap-action/item-popconfirm/index.vue.d.ts +343 -0
- package/es/src/ap-custom-column/column-select.vue.mjs +19 -19
- package/es/src/ap-field/select/index.vue.d.ts +235 -0
- package/es/src/ap-form/interface.d.ts +1 -0
- package/es/src/ap-form/items/checkbox/index.vue.d.ts +47 -0
- package/es/src/ap-form/items/checkbox/index.vue.mjs +61 -0
- package/es/src/ap-form/items/checkbox/index.vue2.mjs +4 -0
- package/es/src/ap-form/items/index.d.ts +2 -1
- package/es/src/ap-form/items/index.mjs +1 -0
- package/es/src/ap-form/items/interface.d.ts +5 -1
- package/es/src/ap-form/modal-form/index.vue.d.ts +378 -0
- package/es/src/ap-form/search-form/index.vue.mjs +48 -44
- package/es/src/ap-table/ap-table.vue.d.ts +184 -0
- package/es/src/ap-table/ap-table.vue.mjs +258 -0
- package/es/src/ap-table/ap-table.vue2.mjs +4 -0
- package/es/src/ap-table/components/index/index.vue.d.ts +28 -0
- package/es/src/ap-table/components/index/index.vue.mjs +4 -0
- package/es/src/ap-table/components/index/index.vue2.mjs +21 -0
- package/es/src/ap-table/components/interface.d.ts +10 -0
- package/es/src/ap-table/components/style/index.css +12 -0
- package/es/src/ap-table/constants.d.ts +11075 -0
- package/es/src/ap-table/constants.mjs +55 -0
- package/es/src/ap-table/hooks/use-table-paging.d.ts +5 -1
- package/es/src/ap-table/hooks/use-table-paging.mjs +142 -0
- package/es/src/ap-table/index.d.ts +5 -0
- package/es/src/ap-table/index.mjs +6 -0
- package/es/src/ap-table/interface.d.ts +41 -14
- package/es/src/ap-table/interface.mjs +1 -0
- package/es/src/ap-table/style/ap-table.css +26 -0
- package/es/src/ap-table/utils.mjs +35 -0
- package/es/src/config-provider/config-provider-props.d.ts +152 -0
- package/es/src/config-provider/config-provider.d.ts +323 -0
- package/es/src/config-provider/config-provider.mjs +26 -34
- package/es/src/config-provider/hooks/use-global-config.d.ts +154 -0
- package/es/src/config-provider/index.d.ts +691 -0
- package/es/src/index.d.ts +1 -0
- package/es/src/index.mjs +206 -199
- package/es/src/modal/basic.vue.d.ts +464 -0
- package/es/src/modal/components/modal-footer.vue.d.ts +457 -0
- package/es/src/modal/components/modal.d.ts +443 -0
- package/es/src/modal/index.d.ts +963 -0
- package/es/src/modal/props.d.ts +283 -0
- package/es/src/pro-form/hooks/use-label-width.d.ts +312 -0
- package/es/src/pro-table/components/editable/editable-cell.vue.d.ts +82 -2
- package/es/src/theme/ap-table/ap-table-index.css +12 -0
- package/es/src/theme/ap-table/ap-table.css +26 -0
- package/es/src/theme/work-order-modal/index.css +2 -2
- package/es/src/work-order-modal/style/index.css +2 -2
- package/es/src/work-order-modal/work-order-modal.vue.mjs +35 -25
- package/lib/index.js +1 -1
- package/lib/src/ap-action/item-popconfirm/index.vue.d.ts +343 -0
- package/lib/src/ap-custom-column/column-select.vue.js +1 -1
- package/lib/src/ap-field/select/index.vue.d.ts +235 -0
- package/lib/src/ap-form/interface.d.ts +1 -0
- package/lib/src/ap-form/items/checkbox/index.vue.d.ts +47 -0
- package/lib/src/ap-form/items/checkbox/index.vue.js +1 -0
- package/lib/src/ap-form/items/checkbox/index.vue2.js +1 -0
- package/lib/src/ap-form/items/index.d.ts +2 -1
- package/lib/src/ap-form/items/index.js +1 -1
- package/lib/src/ap-form/items/interface.d.ts +5 -1
- package/lib/src/ap-form/modal-form/index.vue.d.ts +378 -0
- package/lib/src/ap-form/search-form/index.vue.js +1 -1
- package/lib/src/ap-table/ap-table.vue.d.ts +184 -0
- package/lib/src/ap-table/ap-table.vue.js +1 -0
- package/lib/src/ap-table/ap-table.vue2.js +1 -0
- package/lib/src/ap-table/components/index/index.vue.d.ts +28 -0
- package/lib/src/ap-table/components/index/index.vue.js +1 -0
- package/lib/src/ap-table/components/index/index.vue2.js +1 -0
- package/lib/src/ap-table/components/interface.d.ts +10 -0
- package/lib/src/ap-table/components/style/index.css +12 -0
- package/lib/src/ap-table/constants.d.ts +11075 -0
- package/lib/src/ap-table/constants.js +1 -0
- package/lib/src/ap-table/hooks/use-table-paging.d.ts +5 -1
- package/lib/src/ap-table/hooks/use-table-paging.js +1 -0
- package/lib/src/ap-table/index.d.ts +5 -0
- package/lib/src/ap-table/index.js +1 -0
- package/lib/src/ap-table/interface.d.ts +41 -14
- package/lib/src/ap-table/interface.js +1 -0
- package/lib/src/ap-table/style/ap-table.css +26 -0
- package/lib/src/ap-table/utils.js +1 -0
- package/lib/src/config-provider/config-provider-props.d.ts +152 -0
- package/lib/src/config-provider/config-provider.d.ts +323 -0
- package/lib/src/config-provider/config-provider.js +1 -1
- package/lib/src/config-provider/hooks/use-global-config.d.ts +154 -0
- package/lib/src/config-provider/index.d.ts +691 -0
- package/lib/src/index.d.ts +1 -0
- package/lib/src/index.js +1 -1
- package/lib/src/modal/basic.vue.d.ts +464 -0
- package/lib/src/modal/components/modal-footer.vue.d.ts +457 -0
- package/lib/src/modal/components/modal.d.ts +443 -0
- package/lib/src/modal/index.d.ts +963 -0
- package/lib/src/modal/props.d.ts +283 -0
- package/lib/src/pro-form/hooks/use-label-width.d.ts +312 -0
- package/lib/src/pro-table/components/editable/editable-cell.vue.d.ts +82 -2
- package/lib/src/theme/ap-table/ap-table-index.css +12 -0
- package/lib/src/theme/ap-table/ap-table.css +26 -0
- package/lib/src/theme/work-order-modal/index.css +2 -2
- package/lib/src/work-order-modal/style/index.css +2 -2
- package/lib/src/work-order-modal/work-order-modal.vue.js +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import "../ap-action/index.mjs";
|
|
2
|
+
import "../ap-field/index.mjs";
|
|
3
|
+
import "../ap-form/index.mjs";
|
|
4
|
+
import "./components/index/index.vue.mjs";
|
|
5
|
+
import m from "../ap-form/items/date/index.vue.mjs";
|
|
6
|
+
import o from "../ap-form/items/date-range/index.vue.mjs";
|
|
7
|
+
import r from "../ap-form/items/number/index.vue.mjs";
|
|
8
|
+
import i from "../ap-form/items/radio/index.vue.mjs";
|
|
9
|
+
import t from "../ap-form/items/select/index.vue.mjs";
|
|
10
|
+
import f from "../ap-form/items/switch/index.vue.mjs";
|
|
11
|
+
import a from "../ap-form/items/text/index.vue.mjs";
|
|
12
|
+
import _ from "../ap-form/items/text-area/index.vue.mjs";
|
|
13
|
+
import c from "../ap-form/items/checkbox/index.vue.mjs";
|
|
14
|
+
import e from "../ap-field/date/index.vue.mjs";
|
|
15
|
+
import n from "../ap-field/date-range/index.vue.mjs";
|
|
16
|
+
import p from "../ap-field/number/index.vue.mjs";
|
|
17
|
+
import s from "../ap-field/radio/index.vue.mjs";
|
|
18
|
+
import $ from "../ap-field/select/index.vue.mjs";
|
|
19
|
+
import d from "../ap-field/switch/index.vue.mjs";
|
|
20
|
+
import x from "../ap-field/text/index.vue.mjs";
|
|
21
|
+
import b from "../ap-field/text-area/index.vue.mjs";
|
|
22
|
+
import h from "../ap-field/checkbox/index.vue.mjs";
|
|
23
|
+
import l from "../ap-action/group/index.vue.mjs";
|
|
24
|
+
import R from "./components/index/index.vue2.mjs";
|
|
25
|
+
const N = {
|
|
26
|
+
date: m,
|
|
27
|
+
dateRange: o,
|
|
28
|
+
number: r,
|
|
29
|
+
radio: i,
|
|
30
|
+
select: t,
|
|
31
|
+
switch: f,
|
|
32
|
+
text: a,
|
|
33
|
+
textArea: _,
|
|
34
|
+
checkbox: c
|
|
35
|
+
}, O = {
|
|
36
|
+
date: e,
|
|
37
|
+
dateRange: n,
|
|
38
|
+
number: p,
|
|
39
|
+
radio: s,
|
|
40
|
+
select: $,
|
|
41
|
+
switch: d,
|
|
42
|
+
text: x,
|
|
43
|
+
textArea: b,
|
|
44
|
+
checkbox: h,
|
|
45
|
+
action: l,
|
|
46
|
+
index: R
|
|
47
|
+
}, P = [
|
|
48
|
+
"action",
|
|
49
|
+
"index"
|
|
50
|
+
];
|
|
51
|
+
export {
|
|
52
|
+
N as apTableFormItemMap,
|
|
53
|
+
O as apTableRenderItemMap,
|
|
54
|
+
P as noRenderAsFormItemValueList
|
|
55
|
+
};
|
|
@@ -25,6 +25,10 @@ export type UseTablePagingParams<DataType, ParamsType> = {
|
|
|
25
25
|
* 额外的默认请求参数,这个参数变更不会触发网络请求
|
|
26
26
|
*/
|
|
27
27
|
defaultParams?: ParamsType;
|
|
28
|
+
/**
|
|
29
|
+
* 默认的数据源
|
|
30
|
+
*/
|
|
31
|
+
defaultData?: DataType[];
|
|
28
32
|
/**
|
|
29
33
|
* 数据请求前格式化请求参数
|
|
30
34
|
* @param values
|
|
@@ -48,7 +52,7 @@ export type UseTablePagingParams<DataType, ParamsType> = {
|
|
|
48
52
|
*/
|
|
49
53
|
sortFields?: string[];
|
|
50
54
|
};
|
|
51
|
-
export declare const useTablePaging: <DataType = any, ParamsType = Record<string, any>>({ manual, defaultCurrent, defaultPageSize, request, defaultParams, formatParams, paramsValueTypeMap, resetFieldsIgnores, filterFields, sortFields }: UseTablePagingParams<DataType, ParamsType>) => {
|
|
55
|
+
export declare const useTablePaging: <DataType = any, ParamsType = Record<string, any>>({ manual, defaultCurrent, defaultPageSize, request, defaultParams, defaultData, formatParams, paramsValueTypeMap, resetFieldsIgnores, filterFields, sortFields }: UseTablePagingParams<DataType, ParamsType>) => {
|
|
52
56
|
formRef: Ref<ApFormSearchFormExpose | undefined>;
|
|
53
57
|
submit: () => void;
|
|
54
58
|
reset: () => void;
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
import { ref as v, unref as r, onMounted as N, computed as j } from "vue";
|
|
2
|
+
import { parseFieldValue as U, dataIndexToStr as W } from "../utils.mjs";
|
|
3
|
+
import { isArray as X } from "lodash-unified";
|
|
4
|
+
import "../../config-provider/index.mjs";
|
|
5
|
+
import { useLocale as Y } from "../../config-provider/hooks/use-locale.mjs";
|
|
6
|
+
const ae = ({
|
|
7
|
+
manual: x = !1,
|
|
8
|
+
defaultCurrent: y = 1,
|
|
9
|
+
defaultPageSize: S = 10,
|
|
10
|
+
request: D,
|
|
11
|
+
defaultParams: R = {},
|
|
12
|
+
defaultData: A = [],
|
|
13
|
+
formatParams: T,
|
|
14
|
+
paramsValueTypeMap: z,
|
|
15
|
+
resetFieldsIgnores: P,
|
|
16
|
+
filterFields: B = [],
|
|
17
|
+
sortFields: E = []
|
|
18
|
+
}) => {
|
|
19
|
+
let F = 0, f = {};
|
|
20
|
+
const L = (e) => T ? T(e) : e, c = v(), l = v(y), g = v(S), { t: C } = Y(), n = v({
|
|
21
|
+
total: 0,
|
|
22
|
+
records: A,
|
|
23
|
+
loading: !1
|
|
24
|
+
}), V = async (e) => {
|
|
25
|
+
var o;
|
|
26
|
+
const a = L(e), t = Date.now();
|
|
27
|
+
F = t, n.value.loading = !0;
|
|
28
|
+
try {
|
|
29
|
+
const s = await D({
|
|
30
|
+
...R,
|
|
31
|
+
...a
|
|
32
|
+
});
|
|
33
|
+
F === t && (n.value.total = s.total || ((o = s.data) == null ? void 0 : o.length) || 0, n.value.records = [...s.data || []]);
|
|
34
|
+
} catch {
|
|
35
|
+
F === t && (n.value.records = [], n.value.total = 0);
|
|
36
|
+
} finally {
|
|
37
|
+
n.value.loading = !1;
|
|
38
|
+
}
|
|
39
|
+
}, b = (e) => {
|
|
40
|
+
const a = {};
|
|
41
|
+
return Object.entries(e).forEach(([t, o]) => {
|
|
42
|
+
if (a[t] = o, z && o) {
|
|
43
|
+
const s = z[t];
|
|
44
|
+
s && (a[t] = U(s, o));
|
|
45
|
+
}
|
|
46
|
+
}), a;
|
|
47
|
+
}, M = (e) => {
|
|
48
|
+
var o, s, d, p, m, u, i;
|
|
49
|
+
const a = ((s = (o = c.value) == null ? void 0 : o.apForm) == null ? void 0 : s.getFieldsValue()) || {}, t = {};
|
|
50
|
+
Object.entries(a).forEach(([$, K]) => {
|
|
51
|
+
P && P.indexOf($) > -1 && (t[$] = K);
|
|
52
|
+
}), (p = (d = c.value) == null ? void 0 : d.apForm) == null || p.resetFields(), (i = (u = (m = c.value) == null ? void 0 : m.apForm) == null ? void 0 : u.setFieldsValue) == null || i.call(u, t), e == null || e();
|
|
53
|
+
}, h = (e) => {
|
|
54
|
+
f = e;
|
|
55
|
+
const a = b(e);
|
|
56
|
+
V(a);
|
|
57
|
+
}, q = (e) => {
|
|
58
|
+
h({
|
|
59
|
+
...f,
|
|
60
|
+
...e
|
|
61
|
+
});
|
|
62
|
+
}, w = () => {
|
|
63
|
+
var a, t;
|
|
64
|
+
const e = ((t = (a = c.value) == null ? void 0 : a.apForm) == null ? void 0 : t.getFieldsValue(!0)) || {};
|
|
65
|
+
h({
|
|
66
|
+
...e,
|
|
67
|
+
pageCurrent: 1,
|
|
68
|
+
pageSize: f.pageSize || S
|
|
69
|
+
});
|
|
70
|
+
}, J = () => {
|
|
71
|
+
M(w);
|
|
72
|
+
}, Q = () => {
|
|
73
|
+
h(f);
|
|
74
|
+
}, G = (e) => {
|
|
75
|
+
const a = r(n).total - e, t = Math.ceil(a / r(g)), o = r(l) > t ? t : r(l);
|
|
76
|
+
q({
|
|
77
|
+
current: o > 0 ? o : 1
|
|
78
|
+
});
|
|
79
|
+
}, O = (e, a, t) => {
|
|
80
|
+
var m, u;
|
|
81
|
+
const o = ((u = (m = c.value) == null ? void 0 : m.apForm) == null ? void 0 : u.getFieldsValue(!0)) || {};
|
|
82
|
+
l.value = e.current, g.value = e.pageSize;
|
|
83
|
+
const s = X(t) ? [...t] : [t], d = {};
|
|
84
|
+
for (const i of s)
|
|
85
|
+
E.includes(i.field) && (d[W(i.field)] = i.order);
|
|
86
|
+
const p = {};
|
|
87
|
+
for (const i of Object.keys(a))
|
|
88
|
+
B.includes(i) && (p[i] = a[i]);
|
|
89
|
+
h({
|
|
90
|
+
...o,
|
|
91
|
+
filter: p,
|
|
92
|
+
sort: d,
|
|
93
|
+
current: e.current,
|
|
94
|
+
pageSize: e.pageSize
|
|
95
|
+
});
|
|
96
|
+
};
|
|
97
|
+
N(() => {
|
|
98
|
+
var a, t;
|
|
99
|
+
const e = ((t = (a = c.value) == null ? void 0 : a.apForm) == null ? void 0 : t.getFieldsValue(!0)) || {};
|
|
100
|
+
if (f = {
|
|
101
|
+
current: r(l),
|
|
102
|
+
pageSize: r(g),
|
|
103
|
+
...e
|
|
104
|
+
}, !x) {
|
|
105
|
+
const o = b(f);
|
|
106
|
+
V(o);
|
|
107
|
+
}
|
|
108
|
+
});
|
|
109
|
+
const H = j(() => r(n).total === 0 ? "-" : `${r(l.value)}/${Math.ceil(
|
|
110
|
+
r(n).total / r(g)
|
|
111
|
+
)}`), I = j(() => ({
|
|
112
|
+
loading: r(n).loading,
|
|
113
|
+
pagination: {
|
|
114
|
+
current: r(l),
|
|
115
|
+
pageSize: r(g),
|
|
116
|
+
total: r(n).total,
|
|
117
|
+
showSizeChanger: !0,
|
|
118
|
+
showQuickJumper: !0,
|
|
119
|
+
showTotal: (e) => `${C("ap.apTable.pagination.totalLeft", { total: e })} ${C(
|
|
120
|
+
"ap.apTable.pagination.totalRight",
|
|
121
|
+
{ page: r(H) }
|
|
122
|
+
)}`
|
|
123
|
+
},
|
|
124
|
+
onChange: O,
|
|
125
|
+
dataSource: r(n).records
|
|
126
|
+
}));
|
|
127
|
+
return {
|
|
128
|
+
formRef: c,
|
|
129
|
+
submit: w,
|
|
130
|
+
reset: J,
|
|
131
|
+
refresh: Q,
|
|
132
|
+
refreshByDelete: G,
|
|
133
|
+
data: n,
|
|
134
|
+
current: l,
|
|
135
|
+
pageSize: g,
|
|
136
|
+
handleTableChange: O,
|
|
137
|
+
tableProps: I
|
|
138
|
+
};
|
|
139
|
+
};
|
|
140
|
+
export {
|
|
141
|
+
ae as useTablePaging
|
|
142
|
+
};
|
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
import { ColumnType, TableProps } from 'ant-design-vue/es/table';
|
|
2
|
-
import { CompareFn } from 'ant-design-vue/es/table/interface';
|
|
2
|
+
import { CompareFn, SortOrder } from 'ant-design-vue/es/table/interface';
|
|
3
3
|
import { ApFormSearchFormProps } from '../ap-form';
|
|
4
|
-
import { ApFormItemDateProps, ApFormItemDateRangeProps, ApFormItemNumberProps, ApFormItemRadioProps, ApFormItemSelectProps, ApFormItemSwitchProps, ApFormItemTextAreaProps, ApFormItemTextProps } from 'src/ap-form/items/interface';
|
|
4
|
+
import { ApFormItemCheckboxProps, ApFormItemDateProps, ApFormItemDateRangeProps, ApFormItemNumberProps, ApFormItemRadioProps, ApFormItemSelectProps, ApFormItemSwitchProps, ApFormItemTextAreaProps, ApFormItemTextProps } from 'src/ap-form/items/interface';
|
|
5
|
+
import { Recordable } from '../type';
|
|
5
6
|
import { CSSProperties } from 'vue';
|
|
7
|
+
import { ApActionGroupProps } from '../ap-action';
|
|
8
|
+
import { ApTableIndexProps } from './components/interface';
|
|
6
9
|
|
|
7
10
|
type ValueEnmuTyType = {
|
|
8
11
|
text: string;
|
|
@@ -13,7 +16,7 @@ type ValueEnmuTyType = {
|
|
|
13
16
|
/**
|
|
14
17
|
* ApTable默认支持的值类型(将会用于表单生成和默认值格式化)
|
|
15
18
|
*/
|
|
16
|
-
export type
|
|
19
|
+
export type ApTableValueFields = {
|
|
17
20
|
/** 日期选择器 */
|
|
18
21
|
date: ApFormItemDateProps;
|
|
19
22
|
/** 日期范围选择器 */
|
|
@@ -30,8 +33,18 @@ export type ApTableFormFields = {
|
|
|
30
33
|
text: ApFormItemTextProps;
|
|
31
34
|
/** 多行文本输入 */
|
|
32
35
|
textArea: ApFormItemTextAreaProps;
|
|
36
|
+
/** 多选 */
|
|
37
|
+
checkbox: ApFormItemCheckboxProps;
|
|
38
|
+
/**
|
|
39
|
+
* 操作列
|
|
40
|
+
*/
|
|
41
|
+
action: ApActionGroupProps;
|
|
42
|
+
/**
|
|
43
|
+
* 索引列
|
|
44
|
+
*/
|
|
45
|
+
index: ApTableIndexProps;
|
|
33
46
|
};
|
|
34
|
-
type ValueEnum = Record<string, ValueEnmuTyType>;
|
|
47
|
+
export type ValueEnum = Record<string, ValueEnmuTyType>;
|
|
35
48
|
export type ExtraProColumnType<T> = Omit<ColumnType<T>, 'children'> & {
|
|
36
49
|
sorter?: string | boolean | CompareFn<T> | {
|
|
37
50
|
compare?: CompareFn<T>;
|
|
@@ -39,7 +52,7 @@ export type ExtraProColumnType<T> = Omit<ColumnType<T>, 'children'> & {
|
|
|
39
52
|
multiple?: number;
|
|
40
53
|
};
|
|
41
54
|
};
|
|
42
|
-
export type ApColumnType<ValueType extends keyof
|
|
55
|
+
export type ApColumnType<ValueType extends keyof ApTableValueFields = 'text'> = ExtraProColumnType<any> & {
|
|
43
56
|
children?: ApColumnType[];
|
|
44
57
|
/**
|
|
45
58
|
* 表单项所占据的格子数(1-24格)
|
|
@@ -63,36 +76,37 @@ export type ApColumnType<ValueType extends keyof ApTableFormFields = 'text'> = E
|
|
|
63
76
|
hideInTable?: boolean;
|
|
64
77
|
/**
|
|
65
78
|
* 值的枚举,会自动转化把值当成 key 来取出要显示的内容(也会作为select的选项)
|
|
79
|
+
* @deprecated 未实现请使用`fieldProps.options`
|
|
66
80
|
*/
|
|
67
81
|
valueEnum?: ValueEnum;
|
|
68
82
|
/**
|
|
69
83
|
* 自定义查询表单渲染
|
|
70
84
|
*/
|
|
71
|
-
customRenderFormItem?: () => any;
|
|
85
|
+
customRenderFormItem?: (config: ApColumnType) => any;
|
|
72
86
|
/**
|
|
73
87
|
* 指定值类型(将会用于默认渲染和查询表单生成)
|
|
74
88
|
*/
|
|
75
|
-
valueType?: keyof
|
|
89
|
+
valueType?: keyof ApTableValueFields;
|
|
76
90
|
/**
|
|
77
91
|
* 值类型额外配置的参数(用于查询表单渲染)
|
|
78
92
|
*/
|
|
79
|
-
fieldProps?:
|
|
93
|
+
fieldProps?: ApTableValueFields[ValueType];
|
|
80
94
|
};
|
|
81
95
|
export type RequestData<T> = {
|
|
82
96
|
data: T[] | undefined;
|
|
83
97
|
total: number;
|
|
84
98
|
} & Record<string, any>;
|
|
85
|
-
export type ApTableProps<RecordType = any, ParamsType = any, ValueType extends keyof
|
|
99
|
+
export type ApTableProps<RecordType = any, ParamsType = any, ValueType extends keyof ApTableValueFields = 'text'> = Omit<TableProps<RecordType>, 'columns' | 'pagination' | 'dataSource' | 'size'> & {
|
|
86
100
|
/**
|
|
87
101
|
* 列配置
|
|
88
102
|
*/
|
|
89
|
-
columns?: ApColumnType<
|
|
103
|
+
columns?: ApColumnType<any>[];
|
|
90
104
|
/**
|
|
91
105
|
* 是否启用卡片样式
|
|
92
106
|
*/
|
|
93
107
|
card?: boolean;
|
|
94
108
|
/**
|
|
95
|
-
* request
|
|
109
|
+
* request额外请求的参数,这些参数在变更时将不会自动发起网络请求
|
|
96
110
|
*/
|
|
97
111
|
params?: ParamsType;
|
|
98
112
|
/**
|
|
@@ -110,6 +124,8 @@ export type ApTableProps<RecordType = any, ParamsType = any, ValueType extends k
|
|
|
110
124
|
request?: (params: ParamsType & {
|
|
111
125
|
pageSize?: number;
|
|
112
126
|
current?: number;
|
|
127
|
+
sort?: Record<string, SortOrder>;
|
|
128
|
+
filter?: Recordable<any>;
|
|
113
129
|
}) => Promise<Partial<RequestData<RecordType>>>;
|
|
114
130
|
/**
|
|
115
131
|
* 数据加载完成后触发
|
|
@@ -118,7 +134,7 @@ export type ApTableProps<RecordType = any, ParamsType = any, ValueType extends k
|
|
|
118
134
|
*/
|
|
119
135
|
onLoad?: (data: RecordType[]) => void;
|
|
120
136
|
/**
|
|
121
|
-
*
|
|
137
|
+
* 表格的默认数据源,这些数据源将会在第一次请求后被替换
|
|
122
138
|
*/
|
|
123
139
|
defaultData?: RecordType[];
|
|
124
140
|
/**
|
|
@@ -138,9 +154,12 @@ export type ApTableProps<RecordType = any, ParamsType = any, ValueType extends k
|
|
|
138
154
|
*/
|
|
139
155
|
beforeSearchSubmit?: (params: Partial<ParamsType>) => any;
|
|
140
156
|
/**
|
|
141
|
-
*
|
|
157
|
+
* 是否显示分页器(特定的分页器)或者指定默认的当前页和pageSize
|
|
142
158
|
*/
|
|
143
|
-
pagination?:
|
|
159
|
+
pagination?: false | {
|
|
160
|
+
defaultCurrent?: number;
|
|
161
|
+
defaultPageSize?: number;
|
|
162
|
+
};
|
|
144
163
|
/**
|
|
145
164
|
* 自定义查询表单容器样式
|
|
146
165
|
*/
|
|
@@ -149,5 +168,13 @@ export type ApTableProps<RecordType = any, ParamsType = any, ValueType extends k
|
|
|
149
168
|
* 自定义表格样式
|
|
150
169
|
*/
|
|
151
170
|
tableWrapperStyle?: CSSProperties;
|
|
171
|
+
/**
|
|
172
|
+
* 是否手动发起第一次网络请求
|
|
173
|
+
*/
|
|
174
|
+
manual?: boolean;
|
|
175
|
+
/**
|
|
176
|
+
* 表格尺寸(只支持中等大小和小尺寸)
|
|
177
|
+
*/
|
|
178
|
+
size?: 'middle' | 'small';
|
|
152
179
|
};
|
|
153
180
|
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -18,3 +18,29 @@
|
|
|
18
18
|
.aplus-ap-table-table .ant-pagination .ant-pagination-total-text {
|
|
19
19
|
flex: 1;
|
|
20
20
|
}
|
|
21
|
+
.aplus-ap-table-table tr > th.ant-table-cell {
|
|
22
|
+
background-color: #F2F6F9;
|
|
23
|
+
border-bottom-color: #E9EDF3;
|
|
24
|
+
}
|
|
25
|
+
.aplus-ap-table-table tr > th.ant-table-cell::before {
|
|
26
|
+
display: none;
|
|
27
|
+
}
|
|
28
|
+
.aplus-ap-table-table tr > td.ant-table-cell {
|
|
29
|
+
border-top-color: #E9EDF3;
|
|
30
|
+
}
|
|
31
|
+
.aplus-ap-table-table-admin .ant-pagination {
|
|
32
|
+
margin-bottom: 0 !important;
|
|
33
|
+
}
|
|
34
|
+
.aplus-ap-table-table-admin .ant-pagination .ant-pagination-total-text {
|
|
35
|
+
flex: 1;
|
|
36
|
+
}
|
|
37
|
+
.aplus-ap-table-table-admin tr > th.ant-table-cell {
|
|
38
|
+
background-color: #FAFAFA;
|
|
39
|
+
border-bottom-color: #E9E9E9;
|
|
40
|
+
}
|
|
41
|
+
.aplus-ap-table-table-admin tr > th.ant-table-cell::before {
|
|
42
|
+
display: none;
|
|
43
|
+
}
|
|
44
|
+
.aplus-ap-table-table-admin tr > td.ant-table-cell {
|
|
45
|
+
border-top-color: #E9E9E9;
|
|
46
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { isObject as t, isArray as c } from "lodash-unified";
|
|
2
|
+
const f = (e, r, s) => {
|
|
3
|
+
let a = {};
|
|
4
|
+
return t(e) ? Object.keys(e).forEach((n) => {
|
|
5
|
+
t(e[n]) ? a[n] = f(e[n], r[n], s) : a[n] = s(e[n], r);
|
|
6
|
+
}) : a = s(e, r), a;
|
|
7
|
+
}, u = (e, r) => {
|
|
8
|
+
switch (e) {
|
|
9
|
+
case "dayjs":
|
|
10
|
+
return r.valueOf();
|
|
11
|
+
case "dayjsRange":
|
|
12
|
+
return r.map((s) => s.valueOf());
|
|
13
|
+
case "dayjsDayRange": {
|
|
14
|
+
const [s, a] = r;
|
|
15
|
+
return [s.startOf("day").valueOf(), a.endOf("day").valueOf()];
|
|
16
|
+
}
|
|
17
|
+
case "multiple":
|
|
18
|
+
case "multipleNumber":
|
|
19
|
+
return c(r) ? r : [r];
|
|
20
|
+
case "boolean":
|
|
21
|
+
return r;
|
|
22
|
+
case "object":
|
|
23
|
+
return r;
|
|
24
|
+
default:
|
|
25
|
+
return r;
|
|
26
|
+
}
|
|
27
|
+
};
|
|
28
|
+
function O(e) {
|
|
29
|
+
return c(e) ? e.join(".") : e;
|
|
30
|
+
}
|
|
31
|
+
export {
|
|
32
|
+
O as dataIndexToStr,
|
|
33
|
+
f as formatParamsValueType,
|
|
34
|
+
u as parseFieldValue
|
|
35
|
+
};
|
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
import { ExtractPropTypes, PropType } from 'vue';
|
|
2
|
+
import { LocaleType } from '../locale/interface';
|
|
3
|
+
import { ApiType, ScrollbarGlobalConfig, TableDefaultConfig } from './constants';
|
|
4
|
+
import { default as __DTS_DEFAULT_0__ } from 'ant-design-vue/es/config-provider/renderEmpty';
|
|
5
|
+
import { TransformCellTextProps } from 'ant-design-vue/es/table/interface';
|
|
6
|
+
import { CSPConfig, SizeType, ThemeConfig } from 'ant-design-vue/es/config-provider/context';
|
|
7
|
+
import { Locale } from 'ant-design-vue/es/locale';
|
|
8
|
+
import { ValidateMessages } from 'ant-design-vue/es/form/interface';
|
|
9
|
+
import { RequiredMark } from 'ant-design-vue/es/form/Form';
|
|
10
|
+
|
|
11
|
+
export declare const configProviderProps: () => {
|
|
12
|
+
iconPrefixCls: StringConstructor;
|
|
13
|
+
getTargetContainer: {
|
|
14
|
+
type: PropType<() => HTMLElement | Window>;
|
|
15
|
+
};
|
|
16
|
+
getPopupContainer: {
|
|
17
|
+
type: PropType<(triggerNode?: HTMLElement | undefined) => HTMLElement>;
|
|
18
|
+
};
|
|
19
|
+
prefixCls: StringConstructor;
|
|
20
|
+
getPrefixCls: {
|
|
21
|
+
type: PropType<(suffixCls?: string | undefined, customizePrefixCls?: string | undefined) => string>;
|
|
22
|
+
};
|
|
23
|
+
renderEmpty: {
|
|
24
|
+
type: PropType< __DTS_DEFAULT_0__>;
|
|
25
|
+
};
|
|
26
|
+
transformCellText: {
|
|
27
|
+
type: PropType<(tableProps: TransformCellTextProps) => any>;
|
|
28
|
+
};
|
|
29
|
+
csp: {
|
|
30
|
+
type: PropType< CSPConfig>;
|
|
31
|
+
default: CSPConfig;
|
|
32
|
+
};
|
|
33
|
+
input: {
|
|
34
|
+
type: PropType<{
|
|
35
|
+
autocomplete?: string | undefined;
|
|
36
|
+
}>;
|
|
37
|
+
default: {
|
|
38
|
+
autocomplete?: string | undefined;
|
|
39
|
+
};
|
|
40
|
+
};
|
|
41
|
+
autoInsertSpaceInButton: {
|
|
42
|
+
type: BooleanConstructor;
|
|
43
|
+
default: any;
|
|
44
|
+
};
|
|
45
|
+
locale: {
|
|
46
|
+
type: PropType< Locale>;
|
|
47
|
+
default: Locale;
|
|
48
|
+
};
|
|
49
|
+
pageHeader: {
|
|
50
|
+
type: PropType<{
|
|
51
|
+
ghost?: boolean | undefined;
|
|
52
|
+
}>;
|
|
53
|
+
default: {
|
|
54
|
+
ghost?: boolean | undefined;
|
|
55
|
+
};
|
|
56
|
+
};
|
|
57
|
+
componentSize: {
|
|
58
|
+
type: PropType< SizeType>;
|
|
59
|
+
};
|
|
60
|
+
componentDisabled: {
|
|
61
|
+
type: BooleanConstructor;
|
|
62
|
+
default: any;
|
|
63
|
+
};
|
|
64
|
+
direction: {
|
|
65
|
+
type: PropType<"ltr" | "rtl">;
|
|
66
|
+
default: string;
|
|
67
|
+
};
|
|
68
|
+
space: {
|
|
69
|
+
type: PropType<{
|
|
70
|
+
size?: number | SizeType;
|
|
71
|
+
}>;
|
|
72
|
+
default: {
|
|
73
|
+
size?: number | SizeType;
|
|
74
|
+
};
|
|
75
|
+
};
|
|
76
|
+
virtual: {
|
|
77
|
+
type: BooleanConstructor;
|
|
78
|
+
default: any;
|
|
79
|
+
};
|
|
80
|
+
dropdownMatchSelectWidth: {
|
|
81
|
+
type: (BooleanConstructor | NumberConstructor)[];
|
|
82
|
+
default: boolean;
|
|
83
|
+
};
|
|
84
|
+
form: {
|
|
85
|
+
type: PropType<{
|
|
86
|
+
validateMessages?: ValidateMessages | undefined;
|
|
87
|
+
requiredMark?: RequiredMark | undefined;
|
|
88
|
+
colon?: boolean | undefined;
|
|
89
|
+
}>;
|
|
90
|
+
default: {
|
|
91
|
+
validateMessages?: ValidateMessages | undefined;
|
|
92
|
+
requiredMark?: RequiredMark | undefined;
|
|
93
|
+
colon?: boolean | undefined;
|
|
94
|
+
};
|
|
95
|
+
};
|
|
96
|
+
pagination: {
|
|
97
|
+
type: PropType<{
|
|
98
|
+
showSizeChanger?: boolean | undefined;
|
|
99
|
+
}>;
|
|
100
|
+
default: {
|
|
101
|
+
showSizeChanger?: boolean | undefined;
|
|
102
|
+
};
|
|
103
|
+
};
|
|
104
|
+
theme: {
|
|
105
|
+
type: PropType< ThemeConfig>;
|
|
106
|
+
default: ThemeConfig;
|
|
107
|
+
};
|
|
108
|
+
select: {
|
|
109
|
+
type: PropType<{
|
|
110
|
+
showSearch?: boolean | undefined;
|
|
111
|
+
}>;
|
|
112
|
+
default: {
|
|
113
|
+
showSearch?: boolean | undefined;
|
|
114
|
+
};
|
|
115
|
+
};
|
|
116
|
+
wave: {
|
|
117
|
+
type: PropType<{
|
|
118
|
+
disabled?: boolean | undefined;
|
|
119
|
+
}>;
|
|
120
|
+
default: {
|
|
121
|
+
disabled?: boolean | undefined;
|
|
122
|
+
};
|
|
123
|
+
};
|
|
124
|
+
/**
|
|
125
|
+
* @description aplus-ui的locale
|
|
126
|
+
*/
|
|
127
|
+
aplusLocale: {
|
|
128
|
+
type: PropType<LocaleType>;
|
|
129
|
+
};
|
|
130
|
+
namespace: {
|
|
131
|
+
type: StringConstructor;
|
|
132
|
+
default: string;
|
|
133
|
+
};
|
|
134
|
+
api: {
|
|
135
|
+
type: PropType<ApiType>;
|
|
136
|
+
default: () => {};
|
|
137
|
+
};
|
|
138
|
+
table: {
|
|
139
|
+
type: PropType<TableDefaultConfig>;
|
|
140
|
+
};
|
|
141
|
+
scrollbar: {
|
|
142
|
+
type: PropType<ScrollbarGlobalConfig>;
|
|
143
|
+
default: () => {
|
|
144
|
+
native: boolean;
|
|
145
|
+
};
|
|
146
|
+
};
|
|
147
|
+
uiMode: {
|
|
148
|
+
type: PropType<"aplus" | "admin">;
|
|
149
|
+
default: string;
|
|
150
|
+
};
|
|
151
|
+
};
|
|
152
|
+
export type ConfigProviderProps = Partial<ExtractPropTypes<ReturnType<typeof configProviderProps>>>;
|