@jetlinks-web/components 2.0.1 → 2.0.2-2
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/package.json +3 -3
- package/src/ConfigProvider/context.ts +17 -17
- package/src/ConfigProvider/index.tsx +40 -42
- package/src/ProLayout/Basic/BasicLayout.tsx +395 -392
- package/src/ProLayout/Basic/Header.tsx +115 -115
- package/src/ProLayout/PageContainer/index.tsx +441 -441
- package/src/ProLayout/SiderMenu/BaseMenu.tsx +296 -296
- package/src/ProLayout/SiderMenu/SiderMenu.tsx +320 -320
- package/src/ProLayout/SiderMenu/typings.ts +49 -49
- package/src/ProLayout/TopHeader/index.tsx +210 -210
- package/src/ProLayout/typings.ts +87 -87
- package/src/ProTable/index.tsx +551 -551
- package/src/ProTable/proTableTypes.ts +70 -70
- package/src/ProTable/style/index.less +92 -92
- package/src/Search/typing.ts +76 -76
- package/src/style/variable.less +4 -4
|
@@ -1,70 +1,70 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* 公共类型数据
|
|
3
|
-
*/
|
|
4
|
-
import type { TableProps, ColumnProps } from 'ant-design-vue/
|
|
5
|
-
import type { TooltipProps } from 'ant-design-vue/
|
|
6
|
-
import type { PopconfirmProps } from 'ant-design-vue/
|
|
7
|
-
import { CSSProperties } from 'vue';
|
|
8
|
-
|
|
9
|
-
export enum TypeEnum {
|
|
10
|
-
TREE = 'TREE',
|
|
11
|
-
PAGE = 'PAGE',
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
export enum ModelEnum {
|
|
15
|
-
TABLE = 'TABLE',
|
|
16
|
-
CARD = 'CARD',
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
export type ModelType = keyof typeof ModelEnum;
|
|
20
|
-
|
|
21
|
-
export type RequestData =
|
|
22
|
-
| {
|
|
23
|
-
code: string;
|
|
24
|
-
result: {
|
|
25
|
-
data: Record<string, any>[] | undefined;
|
|
26
|
-
pageIndex: number;
|
|
27
|
-
pageSize: number;
|
|
28
|
-
total: number;
|
|
29
|
-
};
|
|
30
|
-
status: number;
|
|
31
|
-
}
|
|
32
|
-
| Record<string, any>;
|
|
33
|
-
|
|
34
|
-
export type ActionsType = {
|
|
35
|
-
key: string;
|
|
36
|
-
text?: string;
|
|
37
|
-
disabled?: boolean;
|
|
38
|
-
permission?: boolean;
|
|
39
|
-
onClick?: (data: any) => void;
|
|
40
|
-
style?: CSSProperties;
|
|
41
|
-
tooltip?: TooltipProps;
|
|
42
|
-
popConfirm?: PopconfirmProps;
|
|
43
|
-
icon?: string;
|
|
44
|
-
};
|
|
45
|
-
|
|
46
|
-
export interface JColumnProps extends ColumnProps {
|
|
47
|
-
scopedSlots?: boolean; // 是否为插槽 true: 是 false: 否
|
|
48
|
-
hideInTable?: boolean; //
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
export interface CommonProps extends TableProps {
|
|
52
|
-
cardBodyClass?: string;
|
|
53
|
-
columns: JColumnProps[];
|
|
54
|
-
model?: ModelType; // 显示table还是card
|
|
55
|
-
noPagination?: boolean;
|
|
56
|
-
rowSelection?: TableProps['rowSelection'];
|
|
57
|
-
// cardProps?: Record<string, any>;
|
|
58
|
-
dataSource?: Record<string, any>[];
|
|
59
|
-
gridColumn?: number;
|
|
60
|
-
/**
|
|
61
|
-
* 用于不同分辨率
|
|
62
|
-
* gridColumns[0] 1366 ~ 1440 分辨率;
|
|
63
|
-
* gridColumns[1] 1440 ~ 1600 分辨率;
|
|
64
|
-
* gridColumns[2] > 1600 分辨率;
|
|
65
|
-
*/
|
|
66
|
-
gridColumns?: number[];
|
|
67
|
-
alertRender?: boolean; // 选择提示框
|
|
68
|
-
type?: keyof typeof TypeEnum; // 判断表格类型:SCROLL:滑动表格; TREE:树表格; PAGE:分页表格
|
|
69
|
-
bodyStyle?: Record<string, any>;
|
|
70
|
-
}
|
|
1
|
+
/**
|
|
2
|
+
* 公共类型数据
|
|
3
|
+
*/
|
|
4
|
+
import type { TableProps, ColumnProps } from 'ant-design-vue/es/table';
|
|
5
|
+
import type { TooltipProps } from 'ant-design-vue/es/tooltip';
|
|
6
|
+
import type { PopconfirmProps } from 'ant-design-vue/es/popconfirm';
|
|
7
|
+
import { CSSProperties } from 'vue';
|
|
8
|
+
|
|
9
|
+
export enum TypeEnum {
|
|
10
|
+
TREE = 'TREE',
|
|
11
|
+
PAGE = 'PAGE',
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export enum ModelEnum {
|
|
15
|
+
TABLE = 'TABLE',
|
|
16
|
+
CARD = 'CARD',
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export type ModelType = keyof typeof ModelEnum;
|
|
20
|
+
|
|
21
|
+
export type RequestData =
|
|
22
|
+
| {
|
|
23
|
+
code: string;
|
|
24
|
+
result: {
|
|
25
|
+
data: Record<string, any>[] | undefined;
|
|
26
|
+
pageIndex: number;
|
|
27
|
+
pageSize: number;
|
|
28
|
+
total: number;
|
|
29
|
+
};
|
|
30
|
+
status: number;
|
|
31
|
+
}
|
|
32
|
+
| Record<string, any>;
|
|
33
|
+
|
|
34
|
+
export type ActionsType = {
|
|
35
|
+
key: string;
|
|
36
|
+
text?: string;
|
|
37
|
+
disabled?: boolean;
|
|
38
|
+
permission?: boolean;
|
|
39
|
+
onClick?: (data: any) => void;
|
|
40
|
+
style?: CSSProperties;
|
|
41
|
+
tooltip?: TooltipProps;
|
|
42
|
+
popConfirm?: PopconfirmProps;
|
|
43
|
+
icon?: string;
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
export interface JColumnProps extends ColumnProps {
|
|
47
|
+
scopedSlots?: boolean; // 是否为插槽 true: 是 false: 否
|
|
48
|
+
hideInTable?: boolean; //
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
export interface CommonProps extends TableProps {
|
|
52
|
+
cardBodyClass?: string;
|
|
53
|
+
columns: JColumnProps[];
|
|
54
|
+
model?: ModelType; // 显示table还是card
|
|
55
|
+
noPagination?: boolean;
|
|
56
|
+
rowSelection?: TableProps['rowSelection'];
|
|
57
|
+
// cardProps?: Record<string, any>;
|
|
58
|
+
dataSource?: Record<string, any>[];
|
|
59
|
+
gridColumn?: number;
|
|
60
|
+
/**
|
|
61
|
+
* 用于不同分辨率
|
|
62
|
+
* gridColumns[0] 1366 ~ 1440 分辨率;
|
|
63
|
+
* gridColumns[1] 1440 ~ 1600 分辨率;
|
|
64
|
+
* gridColumns[2] > 1600 分辨率;
|
|
65
|
+
*/
|
|
66
|
+
gridColumns?: number[];
|
|
67
|
+
alertRender?: boolean; // 选择提示框
|
|
68
|
+
type?: keyof typeof TypeEnum; // 判断表格类型:SCROLL:滑动表格; TREE:树表格; PAGE:分页表格
|
|
69
|
+
bodyStyle?: Record<string, any>;
|
|
70
|
+
}
|
|
@@ -1,92 +1,92 @@
|
|
|
1
|
-
@import '../../style/variable.less';
|
|
2
|
-
//@import 'ant-design-vue/
|
|
3
|
-
|
|
4
|
-
.jtable-body-spin {
|
|
5
|
-
min-height: 100%;
|
|
6
|
-
width: 100%;
|
|
7
|
-
padding: 16px 24px 24px;
|
|
8
|
-
background-color: #fff;
|
|
9
|
-
|
|
10
|
-
.ant-spin-nested-loading {
|
|
11
|
-
height: 100%;
|
|
12
|
-
.ant-spin-container {
|
|
13
|
-
height: 100%;
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
.jtable-body {
|
|
18
|
-
width: 100%;
|
|
19
|
-
box-sizing: border-box;
|
|
20
|
-
height: 100%;
|
|
21
|
-
display: flex;
|
|
22
|
-
flex-direction: column;
|
|
23
|
-
|
|
24
|
-
.jtable-body-header {
|
|
25
|
-
display: flex;
|
|
26
|
-
justify-content: space-between;
|
|
27
|
-
align-items: center;
|
|
28
|
-
|
|
29
|
-
.jtable-body-header-right {
|
|
30
|
-
display: flex;
|
|
31
|
-
gap: 8px;
|
|
32
|
-
align-items: center;
|
|
33
|
-
|
|
34
|
-
.jtable-body-header-right-button {
|
|
35
|
-
.right-button-icon {
|
|
36
|
-
font-size: 16px;
|
|
37
|
-
color: #d9d9d9;
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
.ant-radio-button-wrapper {
|
|
41
|
-
padding: 0 8px;
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
.ant-radio-button-wrapper-checked {
|
|
45
|
-
.right-button-icon {
|
|
46
|
-
color: @primary-color;
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
.jtable-content {
|
|
54
|
-
flex: 1;
|
|
55
|
-
padding: 16px 0;
|
|
56
|
-
|
|
57
|
-
.jtable-alert {
|
|
58
|
-
margin-bottom: 16px;
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
.jtable-card {
|
|
62
|
-
.jtable-card-items {
|
|
63
|
-
display: grid;
|
|
64
|
-
grid-gap: 26px;
|
|
65
|
-
|
|
66
|
-
.jtable-card-item {
|
|
67
|
-
display: flex;
|
|
68
|
-
min-width: 0;
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
.jtable-pagination {
|
|
75
|
-
// position: absolute;
|
|
76
|
-
// background-color: white;
|
|
77
|
-
// padding: 10px 0;
|
|
78
|
-
// right: 0;
|
|
79
|
-
// bottom: 0;
|
|
80
|
-
width: 100%;
|
|
81
|
-
display: flex;
|
|
82
|
-
justify-content: flex-end;
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
.j-table-empty {
|
|
86
|
-
display: flex;
|
|
87
|
-
justify-content: center;
|
|
88
|
-
align-items: center;
|
|
89
|
-
margin: 10% 0;
|
|
90
|
-
}
|
|
91
|
-
}
|
|
92
|
-
}
|
|
1
|
+
@import '../../style/variable.less';
|
|
2
|
+
//@import 'ant-design-vue/es/style/themes/variable.less';
|
|
3
|
+
|
|
4
|
+
.jtable-body-spin {
|
|
5
|
+
min-height: 100%;
|
|
6
|
+
width: 100%;
|
|
7
|
+
padding: 16px 24px 24px;
|
|
8
|
+
background-color: #fff;
|
|
9
|
+
|
|
10
|
+
.ant-spin-nested-loading {
|
|
11
|
+
height: 100%;
|
|
12
|
+
.ant-spin-container {
|
|
13
|
+
height: 100%;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
.jtable-body {
|
|
18
|
+
width: 100%;
|
|
19
|
+
box-sizing: border-box;
|
|
20
|
+
height: 100%;
|
|
21
|
+
display: flex;
|
|
22
|
+
flex-direction: column;
|
|
23
|
+
|
|
24
|
+
.jtable-body-header {
|
|
25
|
+
display: flex;
|
|
26
|
+
justify-content: space-between;
|
|
27
|
+
align-items: center;
|
|
28
|
+
|
|
29
|
+
.jtable-body-header-right {
|
|
30
|
+
display: flex;
|
|
31
|
+
gap: 8px;
|
|
32
|
+
align-items: center;
|
|
33
|
+
|
|
34
|
+
.jtable-body-header-right-button {
|
|
35
|
+
.right-button-icon {
|
|
36
|
+
font-size: 16px;
|
|
37
|
+
color: #d9d9d9;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
.ant-radio-button-wrapper {
|
|
41
|
+
padding: 0 8px;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
.ant-radio-button-wrapper-checked {
|
|
45
|
+
.right-button-icon {
|
|
46
|
+
color: @primary-color;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
.jtable-content {
|
|
54
|
+
flex: 1;
|
|
55
|
+
padding: 16px 0;
|
|
56
|
+
|
|
57
|
+
.jtable-alert {
|
|
58
|
+
margin-bottom: 16px;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
.jtable-card {
|
|
62
|
+
.jtable-card-items {
|
|
63
|
+
display: grid;
|
|
64
|
+
grid-gap: 26px;
|
|
65
|
+
|
|
66
|
+
.jtable-card-item {
|
|
67
|
+
display: flex;
|
|
68
|
+
min-width: 0;
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
.jtable-pagination {
|
|
75
|
+
// position: absolute;
|
|
76
|
+
// background-color: white;
|
|
77
|
+
// padding: 10px 0;
|
|
78
|
+
// right: 0;
|
|
79
|
+
// bottom: 0;
|
|
80
|
+
width: 100%;
|
|
81
|
+
display: flex;
|
|
82
|
+
justify-content: flex-end;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
.j-table-empty {
|
|
86
|
+
display: flex;
|
|
87
|
+
justify-content: center;
|
|
88
|
+
align-items: center;
|
|
89
|
+
margin: 10% 0;
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
}
|
package/src/Search/typing.ts
CHANGED
|
@@ -1,76 +1,76 @@
|
|
|
1
|
-
import type { ColumnType } from 'ant-design-vue/
|
|
2
|
-
|
|
3
|
-
export interface SearchBaseProps {
|
|
4
|
-
rename?: string;
|
|
5
|
-
type?:
|
|
6
|
-
| 'select'
|
|
7
|
-
| 'number'
|
|
8
|
-
| 'string'
|
|
9
|
-
| 'treeSelect'
|
|
10
|
-
| 'date'
|
|
11
|
-
| 'time'
|
|
12
|
-
| 'rangePicker'
|
|
13
|
-
| 'component'
|
|
14
|
-
| 'timeRange';
|
|
15
|
-
format?: string;
|
|
16
|
-
options?: any[] | Function;
|
|
17
|
-
first?: boolean;
|
|
18
|
-
defaultTermType?: string; // 默认 eq
|
|
19
|
-
defaultValue?: any; // 默认值
|
|
20
|
-
defaultOnceValue?: any; // 会被重置掉的默认值
|
|
21
|
-
title?: ColumnType['title'];
|
|
22
|
-
sortIndex?: number;
|
|
23
|
-
|
|
24
|
-
span?: number;
|
|
25
|
-
componentProps?: any;
|
|
26
|
-
|
|
27
|
-
termFilter?: string[];
|
|
28
|
-
|
|
29
|
-
termOptions?: Array<{ label: string; value: string }>;
|
|
30
|
-
|
|
31
|
-
handleValue?: (value: SearchItemData) => any;
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
export interface SearchItemProps {
|
|
35
|
-
rename?: SearchBaseProps['rename'];
|
|
36
|
-
title: string;
|
|
37
|
-
column: string | number | ColumnType['dataIndex'];
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
export interface SearchItemData {
|
|
41
|
-
column: string | number | ColumnType['dataIndex'];
|
|
42
|
-
value: any;
|
|
43
|
-
termType: string;
|
|
44
|
-
type?: string;
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
export interface TermsItem {
|
|
48
|
-
terms: SearchItemData[];
|
|
49
|
-
type?: string;
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
export interface Terms {
|
|
53
|
-
terms: TermsItem[];
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
export interface SortItem {
|
|
57
|
-
name: string;
|
|
58
|
-
order?: 'desc' | 'asc';
|
|
59
|
-
value?: any;
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
export interface SearchHistoryList {
|
|
63
|
-
content?: string;
|
|
64
|
-
name: string;
|
|
65
|
-
id: string;
|
|
66
|
-
key: string;
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
export interface SearchProps
|
|
70
|
-
extends Omit<SearchBaseProps, 'title'>,
|
|
71
|
-
SearchItemProps {}
|
|
72
|
-
|
|
73
|
-
export interface JColumnsProps extends ColumnType {
|
|
74
|
-
scopedSlots?: boolean;
|
|
75
|
-
search: SearchProps;
|
|
76
|
-
}
|
|
1
|
+
import type { ColumnType } from 'ant-design-vue/es/table';
|
|
2
|
+
|
|
3
|
+
export interface SearchBaseProps {
|
|
4
|
+
rename?: string;
|
|
5
|
+
type?:
|
|
6
|
+
| 'select'
|
|
7
|
+
| 'number'
|
|
8
|
+
| 'string'
|
|
9
|
+
| 'treeSelect'
|
|
10
|
+
| 'date'
|
|
11
|
+
| 'time'
|
|
12
|
+
| 'rangePicker'
|
|
13
|
+
| 'component'
|
|
14
|
+
| 'timeRange';
|
|
15
|
+
format?: string;
|
|
16
|
+
options?: any[] | Function;
|
|
17
|
+
first?: boolean;
|
|
18
|
+
defaultTermType?: string; // 默认 eq
|
|
19
|
+
defaultValue?: any; // 默认值
|
|
20
|
+
defaultOnceValue?: any; // 会被重置掉的默认值
|
|
21
|
+
title?: ColumnType['title'];
|
|
22
|
+
sortIndex?: number;
|
|
23
|
+
|
|
24
|
+
span?: number;
|
|
25
|
+
componentProps?: any;
|
|
26
|
+
|
|
27
|
+
termFilter?: string[];
|
|
28
|
+
|
|
29
|
+
termOptions?: Array<{ label: string; value: string }>;
|
|
30
|
+
|
|
31
|
+
handleValue?: (value: SearchItemData) => any;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export interface SearchItemProps {
|
|
35
|
+
rename?: SearchBaseProps['rename'];
|
|
36
|
+
title: string;
|
|
37
|
+
column: string | number | ColumnType['dataIndex'];
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
export interface SearchItemData {
|
|
41
|
+
column: string | number | ColumnType['dataIndex'];
|
|
42
|
+
value: any;
|
|
43
|
+
termType: string;
|
|
44
|
+
type?: string;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
export interface TermsItem {
|
|
48
|
+
terms: SearchItemData[];
|
|
49
|
+
type?: string;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
export interface Terms {
|
|
53
|
+
terms: TermsItem[];
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
export interface SortItem {
|
|
57
|
+
name: string;
|
|
58
|
+
order?: 'desc' | 'asc';
|
|
59
|
+
value?: any;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
export interface SearchHistoryList {
|
|
63
|
+
content?: string;
|
|
64
|
+
name: string;
|
|
65
|
+
id: string;
|
|
66
|
+
key: string;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
export interface SearchProps
|
|
70
|
+
extends Omit<SearchBaseProps, 'title'>,
|
|
71
|
+
SearchItemProps {}
|
|
72
|
+
|
|
73
|
+
export interface JColumnsProps extends ColumnType {
|
|
74
|
+
scopedSlots?: boolean;
|
|
75
|
+
search: SearchProps;
|
|
76
|
+
}
|
package/src/style/variable.less
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
@import 'ant-design-vue/
|
|
2
|
-
|
|
3
|
-
@text-color-title: #000;
|
|
4
|
-
@text-color-subtitle: #263237;
|
|
1
|
+
@import 'ant-design-vue/es/style/themes/index.less';
|
|
2
|
+
|
|
3
|
+
@text-color-title: #000;
|
|
4
|
+
@text-color-subtitle: #263237;
|