@bscjc/webui 1.2.4 → 1.4.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/README.md +5 -2
- package/dist/components/JcCascader/index.d.ts +150 -50
- package/dist/components/JcColumnConfig/constants.d.ts +9 -0
- package/dist/components/JcColumnConfig/index.d.ts +190 -0
- package/dist/components/JcColumnConfig/index.vue.d.ts +95 -0
- package/dist/components/JcColumnConfig/storage.d.ts +28 -0
- package/dist/components/JcColumnConfig/types.d.ts +99 -0
- package/dist/components/JcColumnConfig/useColumnConfig.d.ts +88 -0
- package/dist/components/JcDatePicker/index.d.ts +98 -33
- package/dist/components/JcImportButton/index.d.ts +62 -0
- package/dist/components/JcImportButton/index.vue.d.ts +29 -0
- package/dist/components/JcImportDialog/index.d.ts +101 -0
- package/dist/components/JcImportDialog/index.vue.d.ts +53 -0
- package/dist/components/JcInputComplex/index.d.ts +86 -28
- package/dist/components/JcInputSwitch/index.d.ts +86 -28
- package/dist/components/JcListLayout/index.d.ts +2 -4
- package/dist/components/JcMoreQueryContain/index.d.ts +2 -4
- package/dist/components/JcSelectQuery/index.d.ts +2 -4
- package/dist/components/JcTagQuery/index.d.ts +29 -10
- package/dist/components/index.d.ts +3 -0
- package/dist/es/index.mjs +2311 -2506
- package/dist/index.css +2 -2
- package/dist/lib/index.cjs +8 -8
- package/dist/tsconfig.app.tsbuildinfo +1 -1
- package/dist/types/components/JcCascader/index.d.ts +152 -52
- package/dist/types/components/JcColumnConfig/constants.d.ts +9 -0
- package/dist/types/components/JcColumnConfig/index.d.ts +190 -0
- package/dist/types/components/JcColumnConfig/index.vue.d.ts +95 -0
- package/dist/types/components/JcColumnConfig/storage.d.ts +25 -0
- package/dist/types/components/JcColumnConfig/types.d.ts +96 -0
- package/dist/types/components/JcColumnConfig/useColumnConfig.d.ts +85 -0
- package/dist/types/components/JcDatePicker/index.d.ts +100 -35
- package/dist/types/components/JcImportButton/index.d.ts +64 -0
- package/dist/types/components/JcImportButton/index.vue.d.ts +31 -0
- package/dist/types/components/JcImportDialog/index.d.ts +103 -0
- package/dist/types/components/JcImportDialog/index.vue.d.ts +55 -0
- package/dist/types/components/JcInputComplex/index.d.ts +1213 -1155
- package/dist/types/components/JcInputSwitch/index.d.ts +423 -365
- package/dist/types/components/JcListLayout/index.d.ts +2 -4
- package/dist/types/components/JcMoreQueryContain/index.d.ts +2 -4
- package/dist/types/components/JcSelectQuery/index.d.ts +2 -4
- package/dist/types/components/JcTagQuery/index.d.ts +29 -10
- package/dist/types/components/index.d.ts +3 -0
- package/dist/types/components.d.ts +3 -0
- package/dist/types/utils/install.d.ts +4 -0
- package/dist/utils/install.d.ts +4 -0
- package/package.json +7 -4
package/README.md
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
# @bscjc/webui
|
|
2
|
+
|
|
2
3
|
一个 Vue3 组件库,使用 Vite,Element Plus 和 TypeScript 构建的组件库
|
|
3
4
|
|
|
4
5
|
## 组件目录介绍
|
|
@@ -14,13 +15,15 @@
|
|
|
14
15
|
| JcInputComplex | 复杂输入切换组件,支持单行和多行文本输入 |
|
|
15
16
|
| JcTagQuery | 标签查询组件,用于展示和管理查询标签 |
|
|
16
17
|
| JcMoreQueryContain | 查询容器,用于包裹更多查询条件 |
|
|
18
|
+
| JcImportDialog | 导入弹窗组件,支持导入操作和下载模版 |
|
|
19
|
+
| JcImportButton | 导入按钮组件,支持导入操作 |
|
|
17
20
|
|
|
18
21
|
## 安装使用说明
|
|
19
22
|
|
|
20
23
|
### 安装
|
|
21
24
|
|
|
22
25
|
```shell
|
|
23
|
-
npm i @bscjc/webui
|
|
26
|
+
npm i @bscjc/webui
|
|
24
27
|
// 或者
|
|
25
28
|
pnpm add @bscjc/webui
|
|
26
29
|
```
|
|
@@ -55,4 +58,4 @@ app.mount("#app");
|
|
|
55
58
|
<script setup>
|
|
56
59
|
import { JcSelectQuery } from "@bscjc/webui";
|
|
57
60
|
</script>
|
|
58
|
-
```
|
|
61
|
+
```
|
|
@@ -1,58 +1,156 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
1
|
+
export declare const JcCascader: {
|
|
2
|
+
new (...args: any[]): import("vue").CreateComponentPublicInstanceWithMixins<Readonly<import("vue").ExtractPropTypes<{
|
|
3
|
+
field: {
|
|
4
|
+
type: StringConstructor;
|
|
5
|
+
required: true;
|
|
6
|
+
default: string;
|
|
7
|
+
};
|
|
8
|
+
options: {
|
|
9
|
+
type: import("vue").PropType<Array<{
|
|
10
|
+
label: string;
|
|
11
|
+
value: string;
|
|
12
|
+
children?: Array<{
|
|
13
|
+
label: string;
|
|
14
|
+
value: string;
|
|
15
|
+
}>;
|
|
16
|
+
}>> | never[];
|
|
17
|
+
default: () => never[];
|
|
18
|
+
};
|
|
19
|
+
keyField: {
|
|
20
|
+
type: any;
|
|
21
|
+
default: () => string[];
|
|
22
|
+
};
|
|
23
|
+
width: {
|
|
24
|
+
type: StringConstructor;
|
|
25
|
+
default: string;
|
|
26
|
+
};
|
|
27
|
+
size: {
|
|
28
|
+
type: import("vue").PropType<"small" | "default" | "large">;
|
|
29
|
+
default: string;
|
|
30
|
+
validator: (value: string) => boolean;
|
|
31
|
+
};
|
|
32
|
+
footerBtnName: {
|
|
33
|
+
type: StringConstructor;
|
|
34
|
+
default: string;
|
|
35
|
+
};
|
|
36
|
+
isNeedFooter: {
|
|
37
|
+
type: BooleanConstructor;
|
|
38
|
+
default: boolean;
|
|
39
|
+
};
|
|
40
|
+
isNeedHeader: {
|
|
41
|
+
type: BooleanConstructor;
|
|
42
|
+
default: boolean;
|
|
43
|
+
};
|
|
44
|
+
isNeedOnlySelect: {
|
|
45
|
+
type: BooleanConstructor;
|
|
46
|
+
default: boolean;
|
|
47
|
+
};
|
|
48
|
+
injectionKey: {
|
|
49
|
+
type: StringConstructor;
|
|
50
|
+
default: string;
|
|
51
|
+
};
|
|
52
|
+
}>> & Readonly<{}>, {
|
|
53
|
+
[x: string]: any;
|
|
54
|
+
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, import("vue").PublicProps, {
|
|
55
|
+
size: "small" | "default" | "large";
|
|
56
|
+
injectionKey: string;
|
|
57
|
+
field: string;
|
|
58
|
+
options: {
|
|
11
59
|
label: string;
|
|
12
60
|
value: string;
|
|
13
61
|
children?: Array<{
|
|
14
62
|
label: string;
|
|
15
63
|
value: string;
|
|
16
64
|
}>;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
}
|
|
65
|
+
}[];
|
|
66
|
+
keyField: any;
|
|
67
|
+
width: string;
|
|
68
|
+
footerBtnName: string;
|
|
69
|
+
isNeedFooter: boolean;
|
|
70
|
+
isNeedOnlySelect: boolean;
|
|
71
|
+
isNeedHeader: boolean;
|
|
72
|
+
}, true, {}, {}, import("vue").GlobalComponents, import("vue").GlobalDirectives, string, {}, any, import("vue").ComponentProvideOptions, {
|
|
73
|
+
P: {};
|
|
74
|
+
B: {};
|
|
75
|
+
D: {};
|
|
76
|
+
C: {};
|
|
77
|
+
M: {};
|
|
78
|
+
Defaults: {};
|
|
79
|
+
}, Readonly<import("vue").ExtractPropTypes<{
|
|
80
|
+
field: {
|
|
81
|
+
type: StringConstructor;
|
|
82
|
+
required: true;
|
|
83
|
+
default: string;
|
|
84
|
+
};
|
|
85
|
+
options: {
|
|
86
|
+
type: import("vue").PropType<Array<{
|
|
87
|
+
label: string;
|
|
88
|
+
value: string;
|
|
89
|
+
children?: Array<{
|
|
90
|
+
label: string;
|
|
91
|
+
value: string;
|
|
92
|
+
}>;
|
|
93
|
+
}>> | never[];
|
|
94
|
+
default: () => never[];
|
|
95
|
+
};
|
|
96
|
+
keyField: {
|
|
97
|
+
type: any;
|
|
98
|
+
default: () => string[];
|
|
99
|
+
};
|
|
100
|
+
width: {
|
|
101
|
+
type: StringConstructor;
|
|
102
|
+
default: string;
|
|
103
|
+
};
|
|
104
|
+
size: {
|
|
105
|
+
type: import("vue").PropType<"small" | "default" | "large">;
|
|
106
|
+
default: string;
|
|
107
|
+
validator: (value: string) => boolean;
|
|
108
|
+
};
|
|
109
|
+
footerBtnName: {
|
|
110
|
+
type: StringConstructor;
|
|
111
|
+
default: string;
|
|
112
|
+
};
|
|
113
|
+
isNeedFooter: {
|
|
114
|
+
type: BooleanConstructor;
|
|
115
|
+
default: boolean;
|
|
116
|
+
};
|
|
117
|
+
isNeedHeader: {
|
|
118
|
+
type: BooleanConstructor;
|
|
119
|
+
default: boolean;
|
|
120
|
+
};
|
|
121
|
+
isNeedOnlySelect: {
|
|
122
|
+
type: BooleanConstructor;
|
|
123
|
+
default: boolean;
|
|
124
|
+
};
|
|
125
|
+
injectionKey: {
|
|
126
|
+
type: StringConstructor;
|
|
127
|
+
default: string;
|
|
128
|
+
};
|
|
129
|
+
}>> & Readonly<{}>, {
|
|
130
|
+
[x: string]: any;
|
|
131
|
+
}, {}, {}, {}, {
|
|
132
|
+
size: "small" | "default" | "large";
|
|
133
|
+
injectionKey: string;
|
|
134
|
+
field: string;
|
|
135
|
+
options: {
|
|
136
|
+
label: string;
|
|
137
|
+
value: string;
|
|
138
|
+
children?: Array<{
|
|
139
|
+
label: string;
|
|
140
|
+
value: string;
|
|
141
|
+
}>;
|
|
142
|
+
}[];
|
|
143
|
+
keyField: any;
|
|
144
|
+
width: string;
|
|
145
|
+
footerBtnName: string;
|
|
146
|
+
isNeedFooter: boolean;
|
|
147
|
+
isNeedOnlySelect: boolean;
|
|
148
|
+
isNeedHeader: boolean;
|
|
149
|
+
}>;
|
|
150
|
+
__isFragment?: never;
|
|
151
|
+
__isTeleport?: never;
|
|
152
|
+
__isSuspense?: never;
|
|
153
|
+
} & import("vue").ComponentOptionsBase<Readonly<import("vue").ExtractPropTypes<{
|
|
56
154
|
field: {
|
|
57
155
|
type: StringConstructor;
|
|
58
156
|
required: true;
|
|
@@ -103,6 +201,8 @@ export declare const JcCascader: SFCWithInstall<import("vue").DefineComponent<im
|
|
|
103
201
|
default: string;
|
|
104
202
|
};
|
|
105
203
|
}>> & Readonly<{}>, {
|
|
204
|
+
[x: string]: any;
|
|
205
|
+
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, {
|
|
106
206
|
size: "small" | "default" | "large";
|
|
107
207
|
injectionKey: string;
|
|
108
208
|
field: string;
|
|
@@ -120,5 +220,5 @@ export declare const JcCascader: SFCWithInstall<import("vue").DefineComponent<im
|
|
|
120
220
|
isNeedFooter: boolean;
|
|
121
221
|
isNeedOnlySelect: boolean;
|
|
122
222
|
isNeedHeader: boolean;
|
|
123
|
-
}, {},
|
|
223
|
+
}, {}, string, {}, import("vue").GlobalComponents, import("vue").GlobalDirectives, string, import("vue").ComponentProvideOptions> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps & import("vue").Plugin;
|
|
124
224
|
export default JcCascader;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ToolbarColumnConfigV2 常量定义
|
|
3
|
+
*/
|
|
4
|
+
/** 存储键前缀 */
|
|
5
|
+
export declare const STORAGE_PREFIX = "VXE_TABLE_CUSTOM_COLUMN_";
|
|
6
|
+
/** 存储版本号 */
|
|
7
|
+
export declare const STORAGE_VERSION = 1;
|
|
8
|
+
/** 特殊列类型(不参与配置) */
|
|
9
|
+
export declare const SPECIAL_COLUMN_TYPES: readonly ["checkbox", "seq", "radio", "expand"];
|
|
@@ -0,0 +1,190 @@
|
|
|
1
|
+
export declare const JcColumnConfig: {
|
|
2
|
+
new (...args: any[]): import("vue").CreateComponentPublicInstanceWithMixins<Readonly<import("vue").ExtractPropTypes<{
|
|
3
|
+
table: {
|
|
4
|
+
type: import("vue").PropType<import("vxe-table").VxeTableInstance>;
|
|
5
|
+
default: null;
|
|
6
|
+
};
|
|
7
|
+
itemWidth: {
|
|
8
|
+
type: NumberConstructor;
|
|
9
|
+
default: number;
|
|
10
|
+
};
|
|
11
|
+
drawerWidth: {
|
|
12
|
+
type: StringConstructor;
|
|
13
|
+
default: string;
|
|
14
|
+
};
|
|
15
|
+
maxFixedCount: {
|
|
16
|
+
type: NumberConstructor;
|
|
17
|
+
default: number;
|
|
18
|
+
};
|
|
19
|
+
lockFieldList: {
|
|
20
|
+
type: import("vue").PropType<string[]>;
|
|
21
|
+
default: () => never[];
|
|
22
|
+
};
|
|
23
|
+
storagePrefix: {
|
|
24
|
+
type: StringConstructor;
|
|
25
|
+
default: string;
|
|
26
|
+
};
|
|
27
|
+
columnGroups: {
|
|
28
|
+
type: import("vue").PropType<import("./types").ColumnGroupConfig[]>;
|
|
29
|
+
default: () => never[];
|
|
30
|
+
};
|
|
31
|
+
}>> & Readonly<{
|
|
32
|
+
onChange?: ((config: import("./types").ColumnConfig[]) => any) | undefined;
|
|
33
|
+
onReset?: (() => any) | undefined;
|
|
34
|
+
onSaved?: ((config: import("./types").ColumnConfig[]) => any) | undefined;
|
|
35
|
+
"onWidth-change"?: ((params: {
|
|
36
|
+
field: string;
|
|
37
|
+
width: number;
|
|
38
|
+
}) => any) | undefined;
|
|
39
|
+
}>, {
|
|
40
|
+
openDrawer: () => void;
|
|
41
|
+
closeDrawer: () => void;
|
|
42
|
+
loadStoredConfig: () => Promise<void>;
|
|
43
|
+
resetToDefault: () => Promise<void>;
|
|
44
|
+
saveAndApply: () => Promise<void>;
|
|
45
|
+
onResizableChange: (params: import("vxe-table").VxeTableDefines.ResizableChangeEventParams) => void;
|
|
46
|
+
hasStoredConfig: () => boolean;
|
|
47
|
+
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
|
|
48
|
+
change: (config: import("./types").ColumnConfig[]) => any;
|
|
49
|
+
reset: () => any;
|
|
50
|
+
saved: (config: import("./types").ColumnConfig[]) => any;
|
|
51
|
+
"width-change": (params: {
|
|
52
|
+
field: string;
|
|
53
|
+
width: number;
|
|
54
|
+
}) => any;
|
|
55
|
+
}, import("vue").PublicProps, {
|
|
56
|
+
table: import("vxe-table").VxeTableInstance;
|
|
57
|
+
lockFieldList: string[];
|
|
58
|
+
maxFixedCount: number;
|
|
59
|
+
storagePrefix: string;
|
|
60
|
+
itemWidth: number;
|
|
61
|
+
drawerWidth: string;
|
|
62
|
+
columnGroups: import("./types").ColumnGroupConfig[];
|
|
63
|
+
}, true, {}, {}, import("vue").GlobalComponents, import("vue").GlobalDirectives, string, {}, any, import("vue").ComponentProvideOptions, {
|
|
64
|
+
P: {};
|
|
65
|
+
B: {};
|
|
66
|
+
D: {};
|
|
67
|
+
C: {};
|
|
68
|
+
M: {};
|
|
69
|
+
Defaults: {};
|
|
70
|
+
}, Readonly<import("vue").ExtractPropTypes<{
|
|
71
|
+
table: {
|
|
72
|
+
type: import("vue").PropType<import("vxe-table").VxeTableInstance>;
|
|
73
|
+
default: null;
|
|
74
|
+
};
|
|
75
|
+
itemWidth: {
|
|
76
|
+
type: NumberConstructor;
|
|
77
|
+
default: number;
|
|
78
|
+
};
|
|
79
|
+
drawerWidth: {
|
|
80
|
+
type: StringConstructor;
|
|
81
|
+
default: string;
|
|
82
|
+
};
|
|
83
|
+
maxFixedCount: {
|
|
84
|
+
type: NumberConstructor;
|
|
85
|
+
default: number;
|
|
86
|
+
};
|
|
87
|
+
lockFieldList: {
|
|
88
|
+
type: import("vue").PropType<string[]>;
|
|
89
|
+
default: () => never[];
|
|
90
|
+
};
|
|
91
|
+
storagePrefix: {
|
|
92
|
+
type: StringConstructor;
|
|
93
|
+
default: string;
|
|
94
|
+
};
|
|
95
|
+
columnGroups: {
|
|
96
|
+
type: import("vue").PropType<import("./types").ColumnGroupConfig[]>;
|
|
97
|
+
default: () => never[];
|
|
98
|
+
};
|
|
99
|
+
}>> & Readonly<{
|
|
100
|
+
onChange?: ((config: import("./types").ColumnConfig[]) => any) | undefined;
|
|
101
|
+
onReset?: (() => any) | undefined;
|
|
102
|
+
onSaved?: ((config: import("./types").ColumnConfig[]) => any) | undefined;
|
|
103
|
+
"onWidth-change"?: ((params: {
|
|
104
|
+
field: string;
|
|
105
|
+
width: number;
|
|
106
|
+
}) => any) | undefined;
|
|
107
|
+
}>, {
|
|
108
|
+
openDrawer: () => void;
|
|
109
|
+
closeDrawer: () => void;
|
|
110
|
+
loadStoredConfig: () => Promise<void>;
|
|
111
|
+
resetToDefault: () => Promise<void>;
|
|
112
|
+
saveAndApply: () => Promise<void>;
|
|
113
|
+
onResizableChange: (params: import("vxe-table").VxeTableDefines.ResizableChangeEventParams) => void;
|
|
114
|
+
hasStoredConfig: () => boolean;
|
|
115
|
+
}, {}, {}, {}, {
|
|
116
|
+
table: import("vxe-table").VxeTableInstance;
|
|
117
|
+
lockFieldList: string[];
|
|
118
|
+
maxFixedCount: number;
|
|
119
|
+
storagePrefix: string;
|
|
120
|
+
itemWidth: number;
|
|
121
|
+
drawerWidth: string;
|
|
122
|
+
columnGroups: import("./types").ColumnGroupConfig[];
|
|
123
|
+
}>;
|
|
124
|
+
__isFragment?: never;
|
|
125
|
+
__isTeleport?: never;
|
|
126
|
+
__isSuspense?: never;
|
|
127
|
+
} & import("vue").ComponentOptionsBase<Readonly<import("vue").ExtractPropTypes<{
|
|
128
|
+
table: {
|
|
129
|
+
type: import("vue").PropType<import("vxe-table").VxeTableInstance>;
|
|
130
|
+
default: null;
|
|
131
|
+
};
|
|
132
|
+
itemWidth: {
|
|
133
|
+
type: NumberConstructor;
|
|
134
|
+
default: number;
|
|
135
|
+
};
|
|
136
|
+
drawerWidth: {
|
|
137
|
+
type: StringConstructor;
|
|
138
|
+
default: string;
|
|
139
|
+
};
|
|
140
|
+
maxFixedCount: {
|
|
141
|
+
type: NumberConstructor;
|
|
142
|
+
default: number;
|
|
143
|
+
};
|
|
144
|
+
lockFieldList: {
|
|
145
|
+
type: import("vue").PropType<string[]>;
|
|
146
|
+
default: () => never[];
|
|
147
|
+
};
|
|
148
|
+
storagePrefix: {
|
|
149
|
+
type: StringConstructor;
|
|
150
|
+
default: string;
|
|
151
|
+
};
|
|
152
|
+
columnGroups: {
|
|
153
|
+
type: import("vue").PropType<import("./types").ColumnGroupConfig[]>;
|
|
154
|
+
default: () => never[];
|
|
155
|
+
};
|
|
156
|
+
}>> & Readonly<{
|
|
157
|
+
onChange?: ((config: import("./types").ColumnConfig[]) => any) | undefined;
|
|
158
|
+
onReset?: (() => any) | undefined;
|
|
159
|
+
onSaved?: ((config: import("./types").ColumnConfig[]) => any) | undefined;
|
|
160
|
+
"onWidth-change"?: ((params: {
|
|
161
|
+
field: string;
|
|
162
|
+
width: number;
|
|
163
|
+
}) => any) | undefined;
|
|
164
|
+
}>, {
|
|
165
|
+
openDrawer: () => void;
|
|
166
|
+
closeDrawer: () => void;
|
|
167
|
+
loadStoredConfig: () => Promise<void>;
|
|
168
|
+
resetToDefault: () => Promise<void>;
|
|
169
|
+
saveAndApply: () => Promise<void>;
|
|
170
|
+
onResizableChange: (params: import("vxe-table").VxeTableDefines.ResizableChangeEventParams) => void;
|
|
171
|
+
hasStoredConfig: () => boolean;
|
|
172
|
+
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
|
|
173
|
+
change: (config: import("./types").ColumnConfig[]) => any;
|
|
174
|
+
reset: () => any;
|
|
175
|
+
saved: (config: import("./types").ColumnConfig[]) => any;
|
|
176
|
+
"width-change": (params: {
|
|
177
|
+
field: string;
|
|
178
|
+
width: number;
|
|
179
|
+
}) => any;
|
|
180
|
+
}, string, {
|
|
181
|
+
table: import("vxe-table").VxeTableInstance;
|
|
182
|
+
lockFieldList: string[];
|
|
183
|
+
maxFixedCount: number;
|
|
184
|
+
storagePrefix: string;
|
|
185
|
+
itemWidth: number;
|
|
186
|
+
drawerWidth: string;
|
|
187
|
+
columnGroups: import("./types").ColumnGroupConfig[];
|
|
188
|
+
}, {}, string, {}, import("vue").GlobalComponents, import("vue").GlobalDirectives, string, import("vue").ComponentProvideOptions> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps & import("vue").Plugin;
|
|
189
|
+
export default JcColumnConfig;
|
|
190
|
+
export type { ColumnGroupConfig } from "./types";
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import { type PropType } from "vue";
|
|
2
|
+
import type { VxeTableInstance, VxeTableDefines } from "vxe-table";
|
|
3
|
+
import type { ColumnConfig, ColumnGroupConfig } from "./types";
|
|
4
|
+
declare const _default: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
5
|
+
table: {
|
|
6
|
+
type: PropType<VxeTableInstance>;
|
|
7
|
+
default: null;
|
|
8
|
+
};
|
|
9
|
+
itemWidth: {
|
|
10
|
+
type: NumberConstructor;
|
|
11
|
+
default: number;
|
|
12
|
+
};
|
|
13
|
+
drawerWidth: {
|
|
14
|
+
type: StringConstructor;
|
|
15
|
+
default: string;
|
|
16
|
+
};
|
|
17
|
+
maxFixedCount: {
|
|
18
|
+
type: NumberConstructor;
|
|
19
|
+
default: number;
|
|
20
|
+
};
|
|
21
|
+
lockFieldList: {
|
|
22
|
+
type: PropType<string[]>;
|
|
23
|
+
default: () => never[];
|
|
24
|
+
};
|
|
25
|
+
storagePrefix: {
|
|
26
|
+
type: StringConstructor;
|
|
27
|
+
default: string;
|
|
28
|
+
};
|
|
29
|
+
columnGroups: {
|
|
30
|
+
type: PropType<ColumnGroupConfig[]>;
|
|
31
|
+
default: () => never[];
|
|
32
|
+
};
|
|
33
|
+
}>, {
|
|
34
|
+
openDrawer: () => void;
|
|
35
|
+
closeDrawer: () => void;
|
|
36
|
+
loadStoredConfig: () => Promise<void>;
|
|
37
|
+
resetToDefault: () => Promise<void>;
|
|
38
|
+
saveAndApply: () => Promise<void>;
|
|
39
|
+
onResizableChange: (params: VxeTableDefines.ResizableChangeEventParams) => void;
|
|
40
|
+
hasStoredConfig: () => boolean;
|
|
41
|
+
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
|
|
42
|
+
change: (config: ColumnConfig[]) => any;
|
|
43
|
+
reset: () => any;
|
|
44
|
+
saved: (config: ColumnConfig[]) => any;
|
|
45
|
+
"width-change": (params: {
|
|
46
|
+
field: string;
|
|
47
|
+
width: number;
|
|
48
|
+
}) => any;
|
|
49
|
+
}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
50
|
+
table: {
|
|
51
|
+
type: PropType<VxeTableInstance>;
|
|
52
|
+
default: null;
|
|
53
|
+
};
|
|
54
|
+
itemWidth: {
|
|
55
|
+
type: NumberConstructor;
|
|
56
|
+
default: number;
|
|
57
|
+
};
|
|
58
|
+
drawerWidth: {
|
|
59
|
+
type: StringConstructor;
|
|
60
|
+
default: string;
|
|
61
|
+
};
|
|
62
|
+
maxFixedCount: {
|
|
63
|
+
type: NumberConstructor;
|
|
64
|
+
default: number;
|
|
65
|
+
};
|
|
66
|
+
lockFieldList: {
|
|
67
|
+
type: PropType<string[]>;
|
|
68
|
+
default: () => never[];
|
|
69
|
+
};
|
|
70
|
+
storagePrefix: {
|
|
71
|
+
type: StringConstructor;
|
|
72
|
+
default: string;
|
|
73
|
+
};
|
|
74
|
+
columnGroups: {
|
|
75
|
+
type: PropType<ColumnGroupConfig[]>;
|
|
76
|
+
default: () => never[];
|
|
77
|
+
};
|
|
78
|
+
}>> & Readonly<{
|
|
79
|
+
onChange?: ((config: ColumnConfig[]) => any) | undefined;
|
|
80
|
+
onReset?: (() => any) | undefined;
|
|
81
|
+
onSaved?: ((config: ColumnConfig[]) => any) | undefined;
|
|
82
|
+
"onWidth-change"?: ((params: {
|
|
83
|
+
field: string;
|
|
84
|
+
width: number;
|
|
85
|
+
}) => any) | undefined;
|
|
86
|
+
}>, {
|
|
87
|
+
table: VxeTableInstance;
|
|
88
|
+
lockFieldList: string[];
|
|
89
|
+
maxFixedCount: number;
|
|
90
|
+
storagePrefix: string;
|
|
91
|
+
itemWidth: number;
|
|
92
|
+
drawerWidth: string;
|
|
93
|
+
columnGroups: ColumnGroupConfig[];
|
|
94
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
95
|
+
export default _default;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ToolbarColumnConfigV2 存储工具函数
|
|
3
|
+
*/
|
|
4
|
+
import type { StoredColumnConfig, TableColumnStorage } from './types';
|
|
5
|
+
/**
|
|
6
|
+
* 获取存储键
|
|
7
|
+
*/
|
|
8
|
+
export declare const getStorageKey: (tableId: string, prefix: string) => string;
|
|
9
|
+
/**
|
|
10
|
+
* 读取存储
|
|
11
|
+
*/
|
|
12
|
+
export declare const getStorage: (tableId: string, prefix: string) => TableColumnStorage | null;
|
|
13
|
+
/**
|
|
14
|
+
* 保存存储
|
|
15
|
+
*/
|
|
16
|
+
export declare const setStorage: (tableId: string, prefix: string, columns: StoredColumnConfig[]) => void;
|
|
17
|
+
/**
|
|
18
|
+
* 删除存储
|
|
19
|
+
*/
|
|
20
|
+
export declare const removeStorage: (tableId: string, prefix: string) => void;
|
|
21
|
+
/**
|
|
22
|
+
* 更新单列宽度(增量更新)
|
|
23
|
+
*/
|
|
24
|
+
export declare const updateColumnWidth: (tableId: string, prefix: string, field: string, width: number, allColumnsForFallback?: StoredColumnConfig[]) => void;
|
|
25
|
+
/**
|
|
26
|
+
* 检查是否有存储配置
|
|
27
|
+
*/
|
|
28
|
+
export declare const hasStorage: (tableId: string, prefix: string) => boolean;
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ToolbarColumnConfigV2 类型定义
|
|
3
|
+
*/
|
|
4
|
+
import type { VxeTableInstance, VxeTableDefines } from 'vxe-table';
|
|
5
|
+
/**
|
|
6
|
+
* 外部传入的列分组配置(简化版)
|
|
7
|
+
*/
|
|
8
|
+
export interface ColumnGroupConfig {
|
|
9
|
+
/** 分组标题 */
|
|
10
|
+
title: string;
|
|
11
|
+
/** 分组下的字段列表 */
|
|
12
|
+
fields: string[];
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* 内部使用的列分组(带 id)
|
|
16
|
+
*/
|
|
17
|
+
export interface ColumnGroup extends ColumnGroupConfig {
|
|
18
|
+
/** 分组唯一标识(自动生成) */
|
|
19
|
+
id: string;
|
|
20
|
+
/** 是否为默认分组([基础信息]) */
|
|
21
|
+
isDefault?: boolean;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* 存储的列配置(持久化到 localStorage)
|
|
25
|
+
*/
|
|
26
|
+
export interface StoredColumnConfig {
|
|
27
|
+
/** 列字段名(唯一标识) */
|
|
28
|
+
field: string;
|
|
29
|
+
/** 是否可见 */
|
|
30
|
+
visible: boolean;
|
|
31
|
+
/** 固定方向 */
|
|
32
|
+
fixed?: 'left' | 'right';
|
|
33
|
+
/** 列宽(像素) */
|
|
34
|
+
width?: number;
|
|
35
|
+
/** 排序序号 */
|
|
36
|
+
sortNumber: number;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* 完整存储结构
|
|
40
|
+
*/
|
|
41
|
+
export interface TableColumnStorage {
|
|
42
|
+
/** 存储版本(用于兼容性升级) */
|
|
43
|
+
version: number;
|
|
44
|
+
/** 最后更新时间戳 */
|
|
45
|
+
timestamp: number;
|
|
46
|
+
/** 列配置数组 */
|
|
47
|
+
columns: StoredColumnConfig[];
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* 组件内部使用的列配置(扩展自 StoredColumnConfig)
|
|
51
|
+
*/
|
|
52
|
+
export interface ColumnConfig extends StoredColumnConfig {
|
|
53
|
+
/** 列标题 */
|
|
54
|
+
title: string;
|
|
55
|
+
/** 是否锁定可见性(由 lockFieldList 决定) */
|
|
56
|
+
visibleLocked: boolean;
|
|
57
|
+
/** 原始索引(用于判断顺序是否变化) */
|
|
58
|
+
originalIndex: number;
|
|
59
|
+
/** 所属分组ID */
|
|
60
|
+
groupId?: string;
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* 组件 Props 类型
|
|
64
|
+
*/
|
|
65
|
+
export interface ToolbarColumnConfigV2Props {
|
|
66
|
+
/** 表格实例(必需) */
|
|
67
|
+
table: VxeTableInstance | null;
|
|
68
|
+
/** 锁定不能隐藏的字段列表 */
|
|
69
|
+
lockFieldList?: string[];
|
|
70
|
+
/** 最大固定列数(左右合计) */
|
|
71
|
+
maxFixedCount?: number;
|
|
72
|
+
/** 每个字段项的宽度 */
|
|
73
|
+
itemWidth?: number;
|
|
74
|
+
/** 抽屉宽度 */
|
|
75
|
+
drawerWidth?: string;
|
|
76
|
+
/** 存储键前缀 */
|
|
77
|
+
storagePrefix?: string;
|
|
78
|
+
/** 列分组配置(可选) */
|
|
79
|
+
columnGroups?: ColumnGroupConfig[];
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* 组件暴露的方法
|
|
83
|
+
*/
|
|
84
|
+
export interface ToolbarColumnConfigV2Expose {
|
|
85
|
+
/** 加载存储配置并应用到表格 */
|
|
86
|
+
loadStoredConfig: () => Promise<void>;
|
|
87
|
+
/** 恢复默认配置 */
|
|
88
|
+
resetToDefault: () => Promise<void>;
|
|
89
|
+
/** 保存并应用配置 */
|
|
90
|
+
saveAndApply: () => Promise<void>;
|
|
91
|
+
/** 打开配置抽屉 */
|
|
92
|
+
openDrawer: () => void;
|
|
93
|
+
/** 关闭配置抽屉 */
|
|
94
|
+
closeDrawer: () => void;
|
|
95
|
+
/** 处理列宽变化事件 */
|
|
96
|
+
onResizableChange: (params: VxeTableDefines.ResizableChangeEventParams) => void;
|
|
97
|
+
/** 检查是否有存储配置 */
|
|
98
|
+
hasStoredConfig: () => boolean;
|
|
99
|
+
}
|