Skip to content
On this page

表格 table

基本使用

终端后台管理-案例(点击查看该table样式表)

API

table

参数说明类型默认值
--所有ant design table的props----
searchShow是否显示搜索菜单Booleantrue
tableShow是否显示table(搜索条件不影响)Booleantrue
formPropsfx-platform-ui form属性Object--
columns表格配置Object--
dataRequest表格数据请求函数 注意:数据格式(params, onChangeParams) => Promise--
showIndex是否显示索引号Booleanfalse
updatePageVnode操作分页dom(一般不会使用)Function--

columns

参数说明类型默认值
title标题string--
dataIndex数据字段string | '$action'--
width宽度number--
searchField指定搜索的字段string--
bodyCell个性化单元格VNode | string--
headerCell个性化头部单元格VNode | string--
hideInSearch在查询表单中是否隐藏此项booleanfalse
hideInTable在 Table 中是否隐藏此列booleanfalse
actions操作列Array--

actions

参数说明类型默认值
onClick点击事件Function--
label操作按钮名称string--
color操作按钮主题颜色'success' | 'error' | 'warning'--
icon按钮iconstring--
disabled按钮禁用booleanfalse
divider分割线booleanfalse
ifShow是否显示booleantrue
componentType组件类型(不填,默认'button',如果操作项是文字,可设置为'span')stringbutton

table-data

js
/**  根据科室要求规范,table返回数据类型字段、分页 要求按照如下格式:
 *   currentPage 页码
 *   pageSize 每页显示条数
 *   totalSize 总共条数
 *
 */
const callbackData = {
  "currentPage": 1,
  "pageSize": 5,
  "totalSize": 45,
  "list": [
    {
      "name": "a",
      "description": "test1",
      "tag": "demo-a"
    },
    {
      "name": "b",
      "description": "test1",
      "tag": "demo-b"
    },
    {
      "name": "c",
      "description": "test1",
      "tag": "demo-c"
    },
    {
      "name": "d",
      "description": "test1",
      "tag": "demo-d"
    },
    {
      "name": "e",
      "description": "test1",
      "tag": "demo-e"
    }
  ]
}



1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
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

事件

事件名称说明回调参数
change分页、排序、筛选变化时触发Function(pagination, filters, sorter, { currentDataSource })

ref内部事件(使用通过ref获取内部事件)

事件名称说明回调参数
reload主要用来重新请求(请求参数保持不变,多用于'删除'、'修改'等操作)Function(resetPageIndex = false)(resetPageIndex为true时默认从第一页开始查询)
handleSubmit表格查询事件Function(params, page = 1)
getQueryFormRef当外部需要动态改变搜索表单的值或选项时,需要调用此方法获取'查询表单'实例--
setProps动态改变表单配置(可以用来做动态显示或隐藏)--

Released under the MIT License.