@yidun/antd-super-table 0.0.7 → 0.0.9

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/dist/typings.d.ts DELETED
@@ -1,233 +0,0 @@
1
- import type { SelectProps, TableProps, PaginationProps } from 'ant-design-vue';
2
- import type { Component, Reactive, Ref } from 'vue';
3
- /** 表格列对应的type类型 */
4
- export type SuperTableColumnType = 'text' | 'link' | 'button' | 'tag' | 'image' | 'component' | 'sort';
5
- /** 查询表单项对应的type类型 */
6
- export type SuperTableFormItemType = 'input' | 'inputGroup' | 'inputNumber' | 'inputNumberRange' | 'select' | 'treeSelect' | 'cascader' | 'datePicker' | 'rangePicker' | 'component';
7
- export interface SuperTableFormItem {
8
- /** 查询详类型 */
9
- type: SuperTableFormItemType;
10
- /** 查询项对应的字段名称 */
11
- name: string;
12
- /** 绑定数据时v-model对应的name,默认value */
13
- modelPropName?: string;
14
- /** 查询项label */
15
- label: string;
16
- /** 传递给查询详的props */
17
- props?: Record<string, any>;
18
- /** 选项值 */
19
- value?: any;
20
- /** 自定义组件 */
21
- component?: Component;
22
- /** 查询项宽度系数 */
23
- span?: number;
24
- /** 是否显示 */
25
- visible?: boolean;
26
- /** 带select前缀的组合输入框配置 */
27
- addonBeforeProps?: SelectProps;
28
- /** 改变时保持静默,不要触发搜索*/
29
- quiet?: boolean;
30
- /** 是否展示label,默认展示 */
31
- showLabel?: boolean;
32
- /** 固定选项,不允许删除,高级搜索时一定会默认展示 */
33
- fixed?: boolean;
34
- /**
35
- * 默认选中,开启后表现为
36
- * 1. 高级搜索弹窗打开时会默认选中对应的搜索项
37
- * 2. 没有配置默认场景时,会根据选中的项目生成一个默认场景 */
38
- selected?: boolean;
39
- /** 默认值 */
40
- _defaultValue?: any;
41
- /** 排序 */
42
- _order?: number;
43
- /** 是否选中 */
44
- _selected?: boolean;
45
- /** 在选中场景中的排序 */
46
- _orderInScene?: number;
47
- [key: string]: any;
48
- }
49
- /** 表格单条数据 */
50
- export type TableDataItem = Record<string, any>;
51
- /** 表格列吸附方式 */
52
- export type TableColumnFixedType = 'left' | 'right';
53
- /** 排序方式 */
54
- export type SortOrders = 'ascending' | 'descending' | null;
55
- /** 表格表头配置 */
56
- export interface SuperTableColumn {
57
- /** 列对应key */
58
- key: string;
59
- /** 展示类型 text: 文本 button: 按钮 link: 链接 tag: 标签 component:自定义组件 */
60
- type?: SuperTableColumnType | ((row: TableDataItem, index: number) => SuperTableColumnType);
61
- /** 标题 */
62
- title: string;
63
- /** 标题对应的提示信息 */
64
- titleTooltip?: string | ((row: TableDataItem, index: number) => string);
65
- /** 表格内容 */
66
- content?: string | ((row: TableDataItem, index: number) => any);
67
- /** 表格内容对应的提示信息 */
68
- tooltip?: string | boolean | ((row: TableDataItem, index: number) => string);
69
- /** 表格内容解析自定义组件 */
70
- component?: Component;
71
- /** 表格内容解析用到的组件组件对应的props */
72
- props?: Record<string, any> | ((row: TableDataItem, index: number) => Record<string, any>);
73
- /** 是否可复制 */
74
- copyable?: boolean;
75
- /** 是否超出显示省略号 */
76
- ellipsis?: boolean;
77
- /** 是否可见 */
78
- visible?: boolean;
79
- /** 宽度 */
80
- width?: number;
81
- [key: string]: any;
82
- }
83
- /**
84
- * 查询场景 https://docs.popo.netease.com/lingxi/1f2fdcb62291477f8056457f63fa3fcd?appVersion=4.15.0&deviceType=4&popo_hidenativebar=1&popo_noindicator=1&disposable_login_token=1
85
- * */
86
- export interface SuperTableQueryScene {
87
- /** 场景唯一标识 */
88
- code: string;
89
- /** 场景名称 */
90
- name: string;
91
- /** 配置类型 */
92
- type?: string;
93
- /** 配置详情 */
94
- value?: string;
95
- /** 查询项列表 */
96
- items: SuperTableQuerySceneItem[];
97
- /** 是否是私有配置 */
98
- asPrivate?: boolean;
99
- /** 是否是自定义场景 */
100
- isCustom?: boolean;
101
- }
102
- /** 场景中保存的查询条件配置 */
103
- export interface SuperTableQuerySceneItem {
104
- /** 字段名称 */
105
- name: string;
106
- /** 字段类型 */
107
- type: string;
108
- /** 字段值 */
109
- value: any;
110
- }
111
- /** 默认场景配置 */
112
- export interface DefaultSceneConfig {
113
- /** 场景名称 */
114
- name?: string;
115
- /** 场景唯一表示,多个自定义场景时必填 */
116
- code?: string;
117
- /** 查询项列表 */
118
- items: {
119
- /** 字段名称 */
120
- name: string;
121
- /** 字段值 */
122
- value: any;
123
- }[];
124
- }
125
- /** 场景状态 */
126
- export interface SuperTableSceneState {
127
- /** 查询场景列表 */
128
- list: SuperTableQueryScene[];
129
- /** 是否正在加载场景 */
130
- loading: boolean;
131
- /** 是否正在保存场景 */
132
- submiting: boolean;
133
- /** 是否已经加载过场景 */
134
- loaded: boolean;
135
- }
136
- /** 提供给弹窗使用的表格全局状态 */
137
- export interface SuperTableContext {
138
- /** 场景类型 */
139
- sceneType: string;
140
- /** 场景状态 */
141
- sceneState: Reactive<SuperTableSceneState>;
142
- /** 查询场景 */
143
- queryScene(): void;
144
- /** 新增/更新场景 */
145
- updateScene(scene: SuperTableQueryScene | SuperTableQueryScene[]): void;
146
- /** 删除场景 */
147
- deleteScene(sceneCode: string): void;
148
- /** 当前生效中的查询参数 */
149
- selectedFormItems: SuperTableQuerySceneItem[];
150
- /** 禁用添加场景功能 */
151
- allowCreateScene: Ref<boolean>;
152
- }
153
- /** 数据请求方法 */
154
- export type PropTableRequestFunction = (options: {
155
- /** 查询参数 */
156
- params: Record<string, any>;
157
- /** 分页大小 */
158
- pageSize?: number;
159
- /** 当前页码 */
160
- pageNum?: number;
161
- [key: string]: any;
162
- }) => Promise<{
163
- total: number;
164
- data: Record<string, any>[];
165
- }>;
166
- export interface AntdTableProps extends TableProps {
167
- pagination: PaginationProps;
168
- columns: SuperTableColumn[];
169
- dataSource: Record<string, any>[];
170
- }
171
- /** 表单操作方法接口 */
172
- export interface FormOperations {
173
- /**
174
- * 获取表单项配置
175
- * @param {string} name - 表单项名称
176
- * @returns {SuperTableFormItem | undefined} 表单项配置
177
- */
178
- getFormItem(name: string): SuperTableFormItem | undefined;
179
- /**
180
- * 设置表单项配置
181
- * @param {string} name - 表单项名称
182
- * @param {string} keyPath - 配置路径
183
- * @param {any} newConfig - 新的配置值
184
- * @returns {void}
185
- */
186
- setFormItem(name: string, keyPath: string, newConfig: any): void;
187
- /**
188
- * 获取表单值
189
- * @param {string | string[]} [name] - 表单项名称或名称数组,不传则获取所有值
190
- * @returns {Record<string, any>} 表单值对象
191
- */
192
- getFormValues(name?: string | string[]): Record<string, any>;
193
- /**
194
- * 设置表单值
195
- * @param {Record<string, any>} values - 要设置的表单值对象
196
- * @returns {void}
197
- */
198
- setFormValues(values: Record<string, any>): void;
199
- /**
200
- * 获取单个表单项值
201
- * @param {string} name - 表单项名称
202
- * @returns {any} 表单项值
203
- */
204
- getFormValue(name: string): any;
205
- /**
206
- * 设置单个表单项值
207
- * @param {string} name - 表单项名称
208
- * @param {any} value - 要设置的值
209
- * @returns {void}
210
- */
211
- setFormValue(name: string, value: any): void;
212
- }
213
- /** 表格操作方法接口 */
214
- export interface TableOperations {
215
- /**
216
- * 获取表格数据
217
- * @returns {any[]} 表格数据数组
218
- */
219
- getTableData(): any[];
220
- /**
221
- * 设置表格数据
222
- * @param {any[]} data - 要设置的表格数据
223
- * @returns {void}
224
- */
225
- setTableData(data: any[]): void;
226
- /**
227
- * 设置表格数据项
228
- * @param {number} index - 数据项索引
229
- * @param {Record<string, any>} data - 要设置的数据项
230
- * @returns {void}
231
- */
232
- setTableDataItem(index: number, data: Record<string, any>): void;
233
- }
File without changes
File without changes
File without changes
File without changes
File without changes