@yidun/antd-super-table 0.0.1
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 +605 -0
- package/dist/antd-super-table.css +1 -0
- package/dist/antd-super-table.es.js +12523 -0
- package/dist/components/VNodes.d.ts +12 -0
- package/dist/config.d.ts +37 -0
- package/dist/index.d.ts +8 -0
- package/dist/typings.d.ts +253 -0
- package/dist/utils/dialogManager.d.ts +17 -0
- package/dist/utils/index.d.ts +113 -0
- package/dist/utils/service.d.ts +63 -0
- package/dist/utils/useDialog.d.ts +15 -0
- package/package.json +60 -0
package/README.md
ADDED
|
@@ -0,0 +1,605 @@
|
|
|
1
|
+
# Antd Super Table 组件
|
|
2
|
+
|
|
3
|
+
## 介绍
|
|
4
|
+
|
|
5
|
+
Antd Super Table 是一个基于 Ant Design Vue 的高级表格组件,提供了丰富的功能特性:
|
|
6
|
+
|
|
7
|
+
- 🔍 灵活的查询条件配置
|
|
8
|
+
- 📊 强大的表格列配置
|
|
9
|
+
- 🎯 场景管理功能
|
|
10
|
+
- ⚡️ 高性能渲染
|
|
11
|
+
- 🛠 可定制的表格配置
|
|
12
|
+
|
|
13
|
+
## 安装
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
npm install @yidun/antd-super-table
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
## 基础用法
|
|
20
|
+
|
|
21
|
+
```vue
|
|
22
|
+
<template>
|
|
23
|
+
<SuperTable
|
|
24
|
+
:form-items="formItems"
|
|
25
|
+
:columns="columns"
|
|
26
|
+
:request="onRequest"
|
|
27
|
+
/>
|
|
28
|
+
</template>
|
|
29
|
+
|
|
30
|
+
<script setup lang="ts">
|
|
31
|
+
import SuperTable from 'antd-super-table'
|
|
32
|
+
import type { SuperTableFormItem, SuperTableColumn } from 'antd-super-table'
|
|
33
|
+
|
|
34
|
+
// 定义查询条件
|
|
35
|
+
const formItems: SuperTableFormItem[] = [
|
|
36
|
+
{
|
|
37
|
+
type: 'input',
|
|
38
|
+
key: 'name',
|
|
39
|
+
label: '姓名',
|
|
40
|
+
},
|
|
41
|
+
]
|
|
42
|
+
|
|
43
|
+
// 定义表格列
|
|
44
|
+
const columns: SuperTableColumn[] = [
|
|
45
|
+
{
|
|
46
|
+
type: 'text',
|
|
47
|
+
key: 'name',
|
|
48
|
+
title: '姓名',
|
|
49
|
+
},
|
|
50
|
+
]
|
|
51
|
+
|
|
52
|
+
// 定义请求函数
|
|
53
|
+
const onRequest = async (params: Record<string, any>) => {
|
|
54
|
+
const res = await api.getList(params)
|
|
55
|
+
return {
|
|
56
|
+
list: res.data,
|
|
57
|
+
total: res.total,
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
</script>
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
## 查询场景配置
|
|
64
|
+
|
|
65
|
+
默认启用场景,场景相关的配置存储在localStorage中
|
|
66
|
+
|
|
67
|
+
| 属性名 | 类型 | 默认值 | 说明 |
|
|
68
|
+
| ---------------- | ------- | ------- | ----------------------------------- |
|
|
69
|
+
| sceneType | string | '' | 场景对应的标识 |
|
|
70
|
+
| enableScene | boolean | `true` | 是否启用场景管理 |
|
|
71
|
+
| sceneStorageType | string | `local` | 场景存储位置,可选 `local` 或 `api` |
|
|
72
|
+
| sceneRequestUrl | string | `''` | 场景存储的api地址 |
|
|
73
|
+
| defaultScene | array | | 默认场景配置 |
|
|
74
|
+
|
|
75
|
+
## 查询条件配置
|
|
76
|
+
|
|
77
|
+
### 支持的输入类型
|
|
78
|
+
|
|
79
|
+
- 文本输入框 (input)
|
|
80
|
+
- 组合输入框 (inputGroup)
|
|
81
|
+
- 数字输入框 (inputNumber)
|
|
82
|
+
- 数字范围输入框 (inputNumberRange)
|
|
83
|
+
- 选择器 (select)
|
|
84
|
+
- 日期选择器 (datePicker)
|
|
85
|
+
- 日期范围选择器 (rangePicker)
|
|
86
|
+
- 级联选择 (cascader)
|
|
87
|
+
- 树形选择 (treeSelect)
|
|
88
|
+
- 自定义组件 (custom)
|
|
89
|
+
|
|
90
|
+
### 完整示例
|
|
91
|
+
|
|
92
|
+
```typescript
|
|
93
|
+
import dayjs from 'dayjs'
|
|
94
|
+
import { Switch } from 'ant-design-vue'
|
|
95
|
+
|
|
96
|
+
export const createFormItems = () => {
|
|
97
|
+
return [
|
|
98
|
+
{
|
|
99
|
+
key: 'input', // 唯一标识
|
|
100
|
+
type: 'input', // 类型
|
|
101
|
+
label: '输入框',
|
|
102
|
+
name: 'input', // 字段名称
|
|
103
|
+
fixed: true,
|
|
104
|
+
},
|
|
105
|
+
{
|
|
106
|
+
key: 'inputGroup',
|
|
107
|
+
type: 'inputGroup',
|
|
108
|
+
label: '输入框组',
|
|
109
|
+
name: 'inputGroup',
|
|
110
|
+
fixed: true,
|
|
111
|
+
addonBeforeProps: {
|
|
112
|
+
style: {
|
|
113
|
+
width: '40%',
|
|
114
|
+
},
|
|
115
|
+
options: [
|
|
116
|
+
{
|
|
117
|
+
label: '大于',
|
|
118
|
+
value: '>',
|
|
119
|
+
},
|
|
120
|
+
{
|
|
121
|
+
label: '小于',
|
|
122
|
+
value: '<',
|
|
123
|
+
},
|
|
124
|
+
{
|
|
125
|
+
label: '大于等于',
|
|
126
|
+
value: '>=',
|
|
127
|
+
},
|
|
128
|
+
{
|
|
129
|
+
label: '小于等于',
|
|
130
|
+
value: '<=',
|
|
131
|
+
},
|
|
132
|
+
],
|
|
133
|
+
},
|
|
134
|
+
value: {
|
|
135
|
+
select: '<=',
|
|
136
|
+
value: 999,
|
|
137
|
+
},
|
|
138
|
+
},
|
|
139
|
+
{
|
|
140
|
+
key: 'inputNumber',
|
|
141
|
+
type: 'inputNumber',
|
|
142
|
+
label: '数字输入框',
|
|
143
|
+
name: 'inputNumber',
|
|
144
|
+
fixed: true,
|
|
145
|
+
},
|
|
146
|
+
{
|
|
147
|
+
key: 'inputNumberRange',
|
|
148
|
+
type: 'inputNumberRange',
|
|
149
|
+
label: '数字范围输入',
|
|
150
|
+
name: 'inputNumberRange',
|
|
151
|
+
fixed: true,
|
|
152
|
+
props: {
|
|
153
|
+
min: 0,
|
|
154
|
+
max: 100,
|
|
155
|
+
placeholder: ['最小值', '最大值'],
|
|
156
|
+
},
|
|
157
|
+
},
|
|
158
|
+
{
|
|
159
|
+
key: 'select',
|
|
160
|
+
type: 'select',
|
|
161
|
+
label: '单选',
|
|
162
|
+
name: 'select',
|
|
163
|
+
fixed: true,
|
|
164
|
+
props: {
|
|
165
|
+
options: Array.from({ length: 3 }).map((_, index) => ({
|
|
166
|
+
label: `选项-${index + 1}`,
|
|
167
|
+
value: index,
|
|
168
|
+
})),
|
|
169
|
+
},
|
|
170
|
+
},
|
|
171
|
+
{
|
|
172
|
+
key: 'multipleSelect',
|
|
173
|
+
type: 'select',
|
|
174
|
+
label: '多选',
|
|
175
|
+
name: 'multipleSelect',
|
|
176
|
+
props: {
|
|
177
|
+
mode: 'multiple',
|
|
178
|
+
options: Array.from({ length: 10 }).map((_, index) => ({
|
|
179
|
+
label: `选项-${index + 1}`,
|
|
180
|
+
value: index,
|
|
181
|
+
})),
|
|
182
|
+
},
|
|
183
|
+
},
|
|
184
|
+
{
|
|
185
|
+
key: 'date',
|
|
186
|
+
type: 'datePicker',
|
|
187
|
+
label: '日期',
|
|
188
|
+
name: 'date',
|
|
189
|
+
props: {
|
|
190
|
+
showTime: true,
|
|
191
|
+
format: 'YYYY-MM-DD HH:mm',
|
|
192
|
+
presets: [
|
|
193
|
+
{ label: 'Yesterday', value: dayjs().add(-1, 'd') },
|
|
194
|
+
{ label: 'Last Week', value: dayjs().add(-7, 'd') },
|
|
195
|
+
{ label: 'Last Month', value: dayjs().add(-1, 'month') },
|
|
196
|
+
],
|
|
197
|
+
},
|
|
198
|
+
},
|
|
199
|
+
{
|
|
200
|
+
key: 'rangePicker',
|
|
201
|
+
type: 'rangePicker',
|
|
202
|
+
label: '时间范围',
|
|
203
|
+
name: 'rangePicker',
|
|
204
|
+
props: {
|
|
205
|
+
showTime: true,
|
|
206
|
+
format: 'YYYY-MM-DD HH:mm',
|
|
207
|
+
presets: [
|
|
208
|
+
{ label: 'Last 7 Days', value: [dayjs().add(-7, 'd'), dayjs()] },
|
|
209
|
+
{ label: 'Last 14 Days', value: [dayjs().add(-14, 'd'), dayjs()] },
|
|
210
|
+
{ label: 'Last 30 Days', value: [dayjs().add(-30, 'd'), dayjs()] },
|
|
211
|
+
{ label: 'Last 90 Days', value: [dayjs().add(-90, 'd'), dayjs()] },
|
|
212
|
+
],
|
|
213
|
+
},
|
|
214
|
+
},
|
|
215
|
+
{
|
|
216
|
+
key: 'component',
|
|
217
|
+
type: 'component',
|
|
218
|
+
label: '自定义组件',
|
|
219
|
+
name: 'component',
|
|
220
|
+
component: Switch,
|
|
221
|
+
modelPropName: 'checked', // 默认通过v-model:value绑定数据,可通过modelPropName自定义修改,最终效果为v-model:[modelPropName]
|
|
222
|
+
showLabel: false, // 是否显示label,默认为true
|
|
223
|
+
},
|
|
224
|
+
]
|
|
225
|
+
}
|
|
226
|
+
```
|
|
227
|
+
|
|
228
|
+
## 表格列配置
|
|
229
|
+
|
|
230
|
+
### 支持的列类型
|
|
231
|
+
|
|
232
|
+
- 文本 (text)
|
|
233
|
+
- 图片 (image)
|
|
234
|
+
- 标签 (tag)
|
|
235
|
+
- 按钮 (button)
|
|
236
|
+
- 链接 (link)
|
|
237
|
+
- 自定义 (component)
|
|
238
|
+
- 排序 (sort)
|
|
239
|
+
|
|
240
|
+
内置解析类型,均支持在一个单元格内展示多个节点,超出最大个数后会展示更多按钮,点击更多按钮可展开查看所有数据,所以可以扩展出文本列表、图片列表、按钮列表、标签列表等展示形式
|
|
241
|
+
|
|
242
|
+
### 完整示例
|
|
243
|
+
|
|
244
|
+
```typescript
|
|
245
|
+
import { Input } from 'ant-design-vue'
|
|
246
|
+
|
|
247
|
+
/**
|
|
248
|
+
* @description 初始化表单配置,操作类方法可通过参数传递进来
|
|
249
|
+
* @param { object } options 一些提供给表格内置组件使用的扩展
|
|
250
|
+
*
|
|
251
|
+
* */
|
|
252
|
+
export const createTableColumns = (options: {
|
|
253
|
+
onDelete: (record: Record<string, any>) => void
|
|
254
|
+
}) => {
|
|
255
|
+
return [
|
|
256
|
+
{
|
|
257
|
+
key: 'text',
|
|
258
|
+
title: '文本',
|
|
259
|
+
type: 'text', // 默认类型为text,可不填
|
|
260
|
+
content: 'text',
|
|
261
|
+
width: 150,
|
|
262
|
+
},
|
|
263
|
+
{
|
|
264
|
+
key: 'textList',
|
|
265
|
+
title: '文本列表',
|
|
266
|
+
content: 'textList',
|
|
267
|
+
width: 150,
|
|
268
|
+
},
|
|
269
|
+
{
|
|
270
|
+
key: 'image',
|
|
271
|
+
type: 'image',
|
|
272
|
+
title: '图片',
|
|
273
|
+
content: 'imageSrc',
|
|
274
|
+
},
|
|
275
|
+
{
|
|
276
|
+
key: 'tag',
|
|
277
|
+
type: 'tag',
|
|
278
|
+
title: '标签',
|
|
279
|
+
width: 120,
|
|
280
|
+
content() {
|
|
281
|
+
return {
|
|
282
|
+
label: '标签',
|
|
283
|
+
color: 'blue',
|
|
284
|
+
}
|
|
285
|
+
},
|
|
286
|
+
},
|
|
287
|
+
{
|
|
288
|
+
key: 'tagList',
|
|
289
|
+
type: 'tag',
|
|
290
|
+
title: '标签列表',
|
|
291
|
+
width: 200,
|
|
292
|
+
content() {
|
|
293
|
+
return [
|
|
294
|
+
{
|
|
295
|
+
label: '色情',
|
|
296
|
+
color: 'red',
|
|
297
|
+
},
|
|
298
|
+
{
|
|
299
|
+
label: '违禁',
|
|
300
|
+
color: 'blue',
|
|
301
|
+
},
|
|
302
|
+
{
|
|
303
|
+
label: '暴恐',
|
|
304
|
+
color: '#f00',
|
|
305
|
+
},
|
|
306
|
+
{
|
|
307
|
+
label: '涉政',
|
|
308
|
+
color: 'pink',
|
|
309
|
+
},
|
|
310
|
+
]
|
|
311
|
+
},
|
|
312
|
+
},
|
|
313
|
+
{
|
|
314
|
+
key: 'button',
|
|
315
|
+
type: 'button',
|
|
316
|
+
title: '按钮',
|
|
317
|
+
content() {
|
|
318
|
+
return {
|
|
319
|
+
label: '查看配置',
|
|
320
|
+
onClick() {
|
|
321
|
+
window.open(location.href)
|
|
322
|
+
},
|
|
323
|
+
}
|
|
324
|
+
},
|
|
325
|
+
},
|
|
326
|
+
{
|
|
327
|
+
key: 'link',
|
|
328
|
+
type: 'link',
|
|
329
|
+
title: '链接',
|
|
330
|
+
content() {
|
|
331
|
+
return {
|
|
332
|
+
label: '查看详情',
|
|
333
|
+
to: location.href,
|
|
334
|
+
}
|
|
335
|
+
},
|
|
336
|
+
},
|
|
337
|
+
{
|
|
338
|
+
key: 'custom',
|
|
339
|
+
title: '自定义组件',
|
|
340
|
+
type: 'component',
|
|
341
|
+
component: Input,
|
|
342
|
+
width: 200,
|
|
343
|
+
props: {
|
|
344
|
+
placeholder: '请输入',
|
|
345
|
+
style: {
|
|
346
|
+
width: '120px',
|
|
347
|
+
},
|
|
348
|
+
onChange() {
|
|
349
|
+
console.log('change')
|
|
350
|
+
},
|
|
351
|
+
},
|
|
352
|
+
},
|
|
353
|
+
{
|
|
354
|
+
key: 'actions',
|
|
355
|
+
type: 'button',
|
|
356
|
+
title: '操作',
|
|
357
|
+
fixed: 'right',
|
|
358
|
+
width: 200,
|
|
359
|
+
content() {
|
|
360
|
+
return [
|
|
361
|
+
{
|
|
362
|
+
label: '编辑',
|
|
363
|
+
},
|
|
364
|
+
{
|
|
365
|
+
label: '删除',
|
|
366
|
+
onClick: options.onDelete,
|
|
367
|
+
},
|
|
368
|
+
|
|
369
|
+
{
|
|
370
|
+
label: '详情',
|
|
371
|
+
onClick() {
|
|
372
|
+
window.open(location.href)
|
|
373
|
+
},
|
|
374
|
+
},
|
|
375
|
+
{
|
|
376
|
+
label: '上线',
|
|
377
|
+
},
|
|
378
|
+
{
|
|
379
|
+
label: '下线',
|
|
380
|
+
},
|
|
381
|
+
]
|
|
382
|
+
},
|
|
383
|
+
},
|
|
384
|
+
]
|
|
385
|
+
}
|
|
386
|
+
```
|
|
387
|
+
|
|
388
|
+
###
|
|
389
|
+
|
|
390
|
+
## 对外提供的方法
|
|
391
|
+
|
|
392
|
+
## API
|
|
393
|
+
|
|
394
|
+
### Props
|
|
395
|
+
|
|
396
|
+
| 参数 | 说明 | 类型 | 默认值 |
|
|
397
|
+
| ------------ | ------------ | -------------------------------------------------------------------------- | -------------------------- |
|
|
398
|
+
| formItems | 查询条件配置 | `SuperTableFormItem[]` | `[]` |
|
|
399
|
+
| columns | 表格列配置 | `SuperTableColumn[]` | `[]` |
|
|
400
|
+
| request | 数据请求函数 | `(params: Record<string, any>) => Promise<{ list: any[], total: number }>` | - |
|
|
401
|
+
| sceneType | 场景类型 | `string` | - |
|
|
402
|
+
| loading | 加载状态 | `boolean` | `false` |
|
|
403
|
+
| pagination | 分页配置 | `boolean | TablePaginationConfig` |
|
|
404
|
+
| rowKey | 行数据的 key | `string | ((record: any) => string)` |
|
|
405
|
+
| rowSelection | 行选择配置 | `TableRowSelection` | - |
|
|
406
|
+
|
|
407
|
+
### Events
|
|
408
|
+
|
|
409
|
+
| 事件名 | 说明 | 回调参数 |
|
|
410
|
+
| ---------------- | -------------- | ---------------------------------------------------------- |
|
|
411
|
+
| search | 搜索事件 | `(params: Record<string, any>) => void` |
|
|
412
|
+
| reset | 重置事件 | `() => void` |
|
|
413
|
+
| change | 表格变化事件 | `(pagination, filters, sorter) => void` |
|
|
414
|
+
| selection-change | 选择项变化事件 | `(selectedRowKeys: string[], selectedRows: any[]) => void` |
|
|
415
|
+
|
|
416
|
+
### Methods
|
|
417
|
+
|
|
418
|
+
| 方法名 | 说明 | 参数 |
|
|
419
|
+
| -------------- | ------------ | ------------------------------- |
|
|
420
|
+
| reload | 重新加载数据 | `(resetPage?: boolean) => void` |
|
|
421
|
+
| reset | 重置查询条件 | `() => void` |
|
|
422
|
+
| clearSelection | 清空选择项 | `() => void` |
|
|
423
|
+
|
|
424
|
+
## Interface
|
|
425
|
+
|
|
426
|
+
### 表格列类型
|
|
427
|
+
|
|
428
|
+
```typescript
|
|
429
|
+
/** 表格列对应的type类型 */
|
|
430
|
+
export type SuperTableColumnType =
|
|
431
|
+
| 'text'
|
|
432
|
+
| 'link'
|
|
433
|
+
| 'button'
|
|
434
|
+
| 'tag'
|
|
435
|
+
| 'image'
|
|
436
|
+
| 'component'
|
|
437
|
+
| 'sort'
|
|
438
|
+
|
|
439
|
+
/** 表格列配置 */
|
|
440
|
+
export interface SuperTableColumn {
|
|
441
|
+
/** 列对应key */
|
|
442
|
+
key: string
|
|
443
|
+
|
|
444
|
+
/** 展示类型 text: 文本 button: 按钮 link: 链接 tag: 标签 component:自定义组件 */
|
|
445
|
+
type?: SuperTableColumnType | ((row: TableDataItem, index: number) => SuperTableColumnType)
|
|
446
|
+
|
|
447
|
+
/** 标题 */
|
|
448
|
+
title: string
|
|
449
|
+
|
|
450
|
+
/** 标题对应的提示信息 */
|
|
451
|
+
titleTooltip?: string | ((row: TableDataItem, index: number) => string)
|
|
452
|
+
|
|
453
|
+
/** 表格内容 */
|
|
454
|
+
content?: string | ((row: TableDataItem, index: number) => any)
|
|
455
|
+
|
|
456
|
+
/** 表格内容对应的提示信息 */
|
|
457
|
+
tooltip?: string | boolean | ((row: TableDataItem, index: number) => string)
|
|
458
|
+
|
|
459
|
+
/** 表格内容解析自定义组件 */
|
|
460
|
+
component?: Component
|
|
461
|
+
|
|
462
|
+
/** 表格内容解析用到的组件组件对应的props */
|
|
463
|
+
props?: Record<string, any> | ((row: TableDataItem, index: number) => Record<string, any>)
|
|
464
|
+
|
|
465
|
+
/** 是否可复制 */
|
|
466
|
+
copyable?: boolean
|
|
467
|
+
|
|
468
|
+
/** 是否超出显示省略号 */
|
|
469
|
+
ellipsis?: boolean
|
|
470
|
+
|
|
471
|
+
/** 是否可见 */
|
|
472
|
+
visible?: boolean
|
|
473
|
+
|
|
474
|
+
/** 宽度 */
|
|
475
|
+
width?: number
|
|
476
|
+
}
|
|
477
|
+
```
|
|
478
|
+
|
|
479
|
+
### 查询条件类型
|
|
480
|
+
|
|
481
|
+
```typescript
|
|
482
|
+
/** 查询表单项对应的type类型 */
|
|
483
|
+
export type SuperTableFormItemType =
|
|
484
|
+
| 'input'
|
|
485
|
+
| 'inputGroup'
|
|
486
|
+
| 'inputNumber'
|
|
487
|
+
| 'inputNumberRange'
|
|
488
|
+
| 'select'
|
|
489
|
+
| 'treeSelect'
|
|
490
|
+
| 'cascader'
|
|
491
|
+
| 'datePicker'
|
|
492
|
+
| 'rangePicker'
|
|
493
|
+
| 'component'
|
|
494
|
+
|
|
495
|
+
/** 查询条件配置 */
|
|
496
|
+
export interface SuperTableFormItem {
|
|
497
|
+
/** 查询详类型 */
|
|
498
|
+
type: SuperTableFormItemType
|
|
499
|
+
|
|
500
|
+
/** 查询项对应的字段名称 */
|
|
501
|
+
name: string
|
|
502
|
+
|
|
503
|
+
/** 绑定数据时v-model对应的name,默认value */
|
|
504
|
+
modelPropName?: string
|
|
505
|
+
|
|
506
|
+
/** 查询项label */
|
|
507
|
+
label: string
|
|
508
|
+
|
|
509
|
+
/** 传递给查询详的props */
|
|
510
|
+
props?: Record<string, any>
|
|
511
|
+
|
|
512
|
+
/** 选项值 */
|
|
513
|
+
value?: any
|
|
514
|
+
|
|
515
|
+
/** 自定义组件 */
|
|
516
|
+
component?: Component
|
|
517
|
+
|
|
518
|
+
/** 查询项宽度系数 */
|
|
519
|
+
span?: number
|
|
520
|
+
|
|
521
|
+
/** 是否显示 */
|
|
522
|
+
visible?: boolean
|
|
523
|
+
|
|
524
|
+
/** 带select前缀的组合输入框配置 */
|
|
525
|
+
addonBeforeProps?: SelectProps
|
|
526
|
+
|
|
527
|
+
/** 改变时保持静默,不要触发搜索*/
|
|
528
|
+
quiet?: boolean
|
|
529
|
+
|
|
530
|
+
/** 是否展示label,默认展示 */
|
|
531
|
+
showLabel?: boolean
|
|
532
|
+
|
|
533
|
+
/** 固定选项,不允许删除,高级搜索时一定会默认展示 */
|
|
534
|
+
fixed?: boolean
|
|
535
|
+
|
|
536
|
+
/** 默认选中,开启后表现为
|
|
537
|
+
* 1. 高级搜索弹窗打开时会默认选中对应的搜索项
|
|
538
|
+
* 2. 没有配置默认场景时,会根据选中的项目生成一个默认场景 */
|
|
539
|
+
selected?: boolean
|
|
540
|
+
}
|
|
541
|
+
```
|
|
542
|
+
|
|
543
|
+
### 场景管理类型
|
|
544
|
+
|
|
545
|
+
```typescript
|
|
546
|
+
/** 查询场景 */
|
|
547
|
+
export interface SuperTableQueryScene {
|
|
548
|
+
/** 场景唯一标识 */
|
|
549
|
+
code: string
|
|
550
|
+
|
|
551
|
+
/** 场景名称 */
|
|
552
|
+
name: string
|
|
553
|
+
|
|
554
|
+
/** 配置类型 */
|
|
555
|
+
type?: string
|
|
556
|
+
|
|
557
|
+
/** 配置详情 */
|
|
558
|
+
value?: string
|
|
559
|
+
|
|
560
|
+
/** 查询项列表 */
|
|
561
|
+
items: SuperTableQuerySceneItem[]
|
|
562
|
+
|
|
563
|
+
/** 是否是私有配置 */
|
|
564
|
+
asPrivate?: boolean
|
|
565
|
+
|
|
566
|
+
/** 是否是自定义场景 */
|
|
567
|
+
isCustom?: boolean
|
|
568
|
+
}
|
|
569
|
+
|
|
570
|
+
/** 场景中保存的查询条件配置 */
|
|
571
|
+
export interface SuperTableQuerySceneItem {
|
|
572
|
+
/** 字段名称 */
|
|
573
|
+
name: string
|
|
574
|
+
|
|
575
|
+
/** 字段类型 */
|
|
576
|
+
type: string
|
|
577
|
+
|
|
578
|
+
/** 字段值 */
|
|
579
|
+
value: any
|
|
580
|
+
}
|
|
581
|
+
|
|
582
|
+
/** 默认场景配置 */
|
|
583
|
+
export interface DefaultSceneConfig {
|
|
584
|
+
/** 场景名称 */
|
|
585
|
+
name?: string
|
|
586
|
+
|
|
587
|
+
/** 场景唯一表示,多个自定义场景时必填 */
|
|
588
|
+
code?: string
|
|
589
|
+
|
|
590
|
+
/** 查询项列表 */
|
|
591
|
+
items: {
|
|
592
|
+
/** 字段名称 */
|
|
593
|
+
name: string
|
|
594
|
+
/** 字段值 */
|
|
595
|
+
value: any
|
|
596
|
+
}[]
|
|
597
|
+
}
|
|
598
|
+
```
|
|
599
|
+
|
|
600
|
+
## 注意事项
|
|
601
|
+
|
|
602
|
+
1. 组件依赖于 Ant Design Vue,请确保项目中已安装相关依赖
|
|
603
|
+
2. TypeScript 项目需要在 `tsconfig.json` 中配置类型声明文件路径
|
|
604
|
+
3. 自定义组件需要通过 `component` 属性传入,并确保组件已全局注册或局部引入
|
|
605
|
+
4. 场景管理功能需要配置 `sceneType` 属性,并实现相关的存储接口
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
._ellipsisElement_6fog1_1{width:100%;overflow:hidden;display:flex}._ellipsisElement_6fog1_1 ._elementItem_6fog1_6{min-width:0}._ellipsisElementHasGap_6fog1_10{gap:8px}._flexWrap_6fog1_14{flex-wrap:wrap}._ellipsisTag_6fog1_18{cursor:pointer}._imageEllipsisTag_6fog1_22{line-height:30px;min-width:32px;padding:0;text-align:center}._ellipsisList_6fog1_29{max-width:500px;display:flex;gap:8px;flex-wrap:wrap}._tableCellContent_1chn7_1 ._antTypographyEllipsis_1chn7_1{width:100%}._tableCellContent_1chn7_1 ._draggableIcon_1chn7_4{cursor:grab}._textListItem_1chn7_8{width:100%;margin-bottom:4px}._configBtn_1rypj_1{position:absolute;z-index:999;right:0;top:12px}._tableConfig_1rypj_8{width:260px}._tableConfig_1rypj_8 ._tableConfigHead_1rypj_11{padding:8px 16px}._tableConfig_1rypj_8 ._tableConfigContent_1rypj_14{padding:8px 0;height:300px;overflow:auto}._tableConfig_1rypj_8 ._tableConfigContent_1rypj_14 ._columnList_1rypj_19 ._columnItem_1rypj_19{display:flex;align-items:center;gap:8px;min-height:32px;padding:0 16px}._tableConfig_1rypj_8 ._tableConfigContent_1rypj_14 ._columnList_1rypj_19 ._columnItem_1rypj_19 ._columnItemContent_1rypj_26{flex:1;cursor:pointer}._tableConfig_1rypj_8 ._tableConfigContent_1rypj_14 ._columnList_1rypj_19 ._columnItem_1rypj_19 ._dragIcon_1rypj_30{cursor:grab}._tableConfig_1rypj_8 ._tableConfigContent_1rypj_14 ._columnList_1rypj_19 ._columnItem_1rypj_19 ._dragIconDisabled_1rypj_33{cursor:not-allowed}._tableConfig_1rypj_8 ._tableConfigContent_1rypj_14 ._columnList_1rypj_19 ._columnItem_1rypj_19 ._dragHandle_1rypj_36{cursor:grab}._tableConfig_1rypj_8 ._tableConfigContent_1rypj_14 ._emptyText_1rypj_39{line-height:200px;text-align:center}._tableConfig_1rypj_8 ._tableConfigFoot_1rypj_43{display:flex;align-items:center;justify-content:flex-end;border-top:1px solid #d9d9d9;padding:8px 16px}.pro-table-config-popover .ant-popover-inner-content{padding:0}._dynamicList_1woe5_1{list-style:none;padding:0;margin:0}._dynamicList_1woe5_1 ._dynamicListItem_1woe5_6{display:flex;align-items:center;gap:16px;padding:8px;background-color:#fff}._dynamicList_1woe5_1 ._dynamicListItem_1woe5_6 ._dynamicListItemContent_1woe5_13{flex:1;min-width:0}._dynamicList_1woe5_1 ._dynamicListItem_1woe5_6 ._actionsIcons_1woe5_17{display:flex;align-items:center}._dynamicList_1woe5_1 ._dynamicListItem_1woe5_6 ._actionsIcons_1woe5_17 ._dragIcon_1woe5_21{cursor:grab}._dynamicList_1woe5_1 ._dynamicListItem_1woe5_6:last-child{border-bottom:none;margin-bottom:16px}._inputGroup_eukv3_1,._inputNumberGroup_149g6_1{width:100%}._inputNumberGroup_149g6_1 ._inputNumberGroupContent_149g6_4{width:100%;display:flex;align-items:center}._inputNumberGroup_149g6_1 ._inputNumber_149g6_1{width:unset!important;flex:1}._inputNumberGroup_149g6_1 ._startInputNumber_149g6_13{border-top-right-radius:0;border-bottom-right-radius:0;border-right-color:transparent}._inputNumberGroup_149g6_1 ._startInputNumber_149g6_13:focus,._inputNumberGroup_149g6_1 ._startInputNumber_149g6_13:hover{border-right-color:#1677ff}._inputNumberGroup_149g6_1 ._endInputNumber_149g6_21{border-top-left-radius:0;border-bottom-left-radius:0;border-left-color:transparent}._inputNumberGroup_149g6_1 ._endInputNumber_149g6_21:focus,._inputNumberGroup_149g6_1 ._endInputNumber_149g6_21:hover{border-left-color:#1677ff}._inputNumberGroup_149g6_1 ._divider_149g6_29{display:inline-block;padding:0 8px;line-height:30px;border-top:1px solid #d9d9d9;border-bottom:1px solid #d9d9d9}._formFieldItem_1imun_1{display:flex;align-items:center;min-width:0}._inputGroup_1imun_7{width:unset}._formFieldItemLabel_1imun_11{padding-left:8px;padding-right:8px;background-color:transparent!important;text-align:center;cursor:default!important;border-right:none!important}._customItemLabel_1imun_20{font-size:14px;padding-right:8px;color:#000000e0}.super-table-input-group{width:100%}.super-table-input-group .super-table-filter-form-item-label+.ant-input,.super-table-input-group .super-table-filter-form-item-label+.ant-input-number,.super-table-input-group .super-table-filter-form-item-label+.ant-select .ant-select-selector,.super-table-input-group .super-table-filter-form-item-label+.ant-picker,.super-table-input-group .super-table-filter-form-item-label+.ant-input-group{border-left-color:transparent!important}.super-table-input-group .super-table-filter-form-item-label+.ant-input:focus,.super-table-input-group .super-table-filter-form-item-label+.ant-input:hover,.super-table-input-group .super-table-filter-form-item-label+.ant-input-number:focus,.super-table-input-group .super-table-filter-form-item-label+.ant-input-number:hover,.super-table-input-group .super-table-filter-form-item-label+.ant-select .ant-select-selector:focus,.super-table-input-group .super-table-filter-form-item-label+.ant-select .ant-select-selector:hover,.super-table-input-group .super-table-filter-form-item-label+.ant-picker:focus,.super-table-input-group .super-table-filter-form-item-label+.ant-picker:hover,.super-table-input-group .super-table-filter-form-item-label+.ant-input-group:focus,.super-table-input-group .super-table-filter-form-item-label+.ant-input-group:hover{border-left-color:#1677ff!important}.super-table-input-group .super-table-filter-form-item-label+.ant-input-group .ant-input{border-left-color:transparent!important}.super-table-input-group .super-table-filter-form-item-label+.ant-input-group .ant-input:focus,.super-table-input-group .super-table-filter-form-item-label+.ant-input-group .ant-input:hover{border-left-color:#1677ff!important;border-right-color:#1677ff!important}.super-table-input-group .super-table-filter-form-item-label+.ant-input-group .ant-select .ant-select-selector{border-start-start-radius:0!important;border-end-start-radius:0!important;border-left-color:transparent!important;border-right-color:transparent!important}.super-table-input-group .super-table-filter-form-item-label+.ant-input-group .ant-select .ant-select-selector:focus,.super-table-input-group .super-table-filter-form-item-label+.ant-input-group .ant-select .ant-select-selector:hover{border-left-color:#1677ff!important;border-right-color:#1677ff!important}.super-table-input-group .input-number-group .ant-input-number:first-child{border-top-left-radius:0;border-bottom-left-radius:0;border-left-color:transparent!important}.super-table-input-group .input-number-group .ant-input-number:first-child:focus,.super-table-input-group .input-number-group .ant-input-number:first-child:hover{border-left-color:#1677ff!important}._sceneForm_njdgy_1 ._queryFieldItem_njdgy_1{display:flex;align-items:center;gap:8px;min-width:0}._sceneForm_njdgy_1 ._queryFieldItem_njdgy_1 ._fieldSelect_njdgy_7{width:200px}._sceneForm_njdgy_1 ._queryFieldItem_njdgy_1 ._fieldComponent_njdgy_10{flex:1;min-width:0}._sceneList_3nrgr_1{max-height:50vh;overflow:auto}._sceneList_3nrgr_1 ._sceneListHead_3nrgr_5{background-color:#fafafa}._sceneList_3nrgr_1 ._sceneListItem_3nrgr_8{border-top:1px solid #d9d9d9;transition:all .3s;background-color:#fff}._sceneList_3nrgr_1 ._sceneListItem_3nrgr_8:hover{background-color:#f9f9f9}._sceneList_3nrgr_1 ._col_3nrgr_16{padding:12px 16px}._dragIcon_3nrgr_20{cursor:grab}._searchParams_1vdwi_1{flex:1;margin:12px 0}._superTable_1rx9j_1{background-color:#fff;padding:20px 24px}._superTable_1rx9j_1 ._superTableHeader_1rx9j_5{display:flex;gap:16px;border-bottom:1px solid #d9d9d9}._superTable_1rx9j_1 ._superTableHeader_1rx9j_5 ._searchForm_1rx9j_10{flex:1;padding-bottom:12px}._superTable_1rx9j_1 ._superTableHeader_1rx9j_5 ._searchForm_1rx9j_10 ._sceneSelect_1rx9j_14{width:240px}._superTable_1rx9j_1 ._tableWrapper_1rx9j_17 ._toolbar_1rx9j_17{padding-bottom:12px;display:flex;align-items:flex-start;justify-content:flex-end;gap:16px}._superTable_1rx9j_1 ._tableWrapper_1rx9j_17 ._toolbar_1rx9j_17 ._actionBtns_1rx9j_24{display:flex;align-items:center;gap:8px}._superTable_1rx9j_1 ._tableWrapper_1rx9j_17 ._toolbar_1rx9j_17 ._tableHeadWrapper_1rx9j_29{flex:1}._superTable_1rx9j_1 ._tableWrapper_1rx9j_17 ._tableContent_1rx9j_32{position:relative}._superTable_1rx9j_1 ._tableWrapper_1rx9j_17 ._headerCell_1rx9j_35{display:flex;align-items:center;gap:4px}._superTable_1rx9j_1 ._tableWrapper_1rx9j_17 ._headerCell_1rx9j_35 ._headerCellText_1rx9j_40{flex:1}._superTable_1rx9j_1 ._tableWrapper_1rx9j_17 ._headerCell_1rx9j_35 ._headerCellTooltipIcon_1rx9j_43{cursor:pointer}._sceneOpBtnWrapper_1rx9j_47{border-top:1px solid #d9d9d9;padding-top:8px}._sceneOpBtnWrapper_1rx9j_47 ._sceneOpBtn_1rx9j_47{text-align:left}
|