diff --git a/src/pages/list/list/index.less b/src/pages/list/list/index.less new file mode 100644 index 0000000..4906448 --- /dev/null +++ b/src/pages/list/list/index.less @@ -0,0 +1,14 @@ +@import '~antd/es/style/themes/default.less'; + +.pro-table { + :global { + .ant-table-container { + height: 100%; + .ant-table-body { + width: 100%; + height: calc(100% - 47px); + overflow: auto; + } + } + } +} diff --git a/src/pages/list/list/index.tsx b/src/pages/list/list/index.tsx index 8a2ec4d..5b4534c 100644 --- a/src/pages/list/list/index.tsx +++ b/src/pages/list/list/index.tsx @@ -20,6 +20,8 @@ import type { TableListItem, TableListPagination } from './data'; import { useParams } from 'react-router'; import { history } from 'umi'; import moment from 'moment'; +import classNames from 'classnames'; +import styles from './index.less'; const XLSX = require('xlsx'); const handleExport = async (fields: TableListItem[]) => { const hide = message.loading('正在添加'); @@ -174,6 +176,7 @@ const TableList: React.FC = () => { dataIndex: 'id', width: 160, fixed: 'left', + align: 'center', hideInSearch: true, hideInDescriptions: true, render: (dom, entity) => { @@ -347,12 +350,14 @@ const TableList: React.FC = () => { tabActiveKey={tabActiveKey} > + className={classNames('pro-table', styles['pro-table'])} style={{ height: '100%' }} + sticky actionRef={actionRef} ghost={true} rowKey="id" search={{ - labelWidth: 100, + labelWidth: 80, }} toolBarRender={() => [ , + { + if (actionRef.current) { + actionRef.current.reload(); + } + }} + > + + , { diff --git a/src/pages/list/template/1.json b/src/pages/list/template/1.json index a39bc2c..1e3e96b 100644 --- a/src/pages/list/template/1.json +++ b/src/pages/list/template/1.json @@ -40,7 +40,7 @@ "hideInTable": false, "table": { "type": "text", - "width": 60 + "width": 100 }, "create": { "rules": [ @@ -69,7 +69,7 @@ "hideInTable": false, "table": { "type": "text", - "width": 60 + "width": 100 }, "create": { "rules": [ @@ -102,7 +102,7 @@ { "value": true, "name": "否" }, { "value": false, "name": "是" } ], - "width": 80 + "width": 100 }, "create": { "rules": [ @@ -135,7 +135,7 @@ { "value": true, "name": "否" }, { "value": false, "name": "是" } ], - "width": 80 + "width": 100 }, "create": { "rules": [ @@ -197,7 +197,7 @@ { "value": true, "name": "否" }, { "value": false, "name": "是" } ], - "width": 80 + "width": 100 }, "create": { "rules": [ @@ -226,7 +226,7 @@ "hideInTable": false, "table": { "type": "text", - "width": 160 + "width": 260 }, "create": { "rules": [ @@ -255,7 +255,7 @@ "hideInTable": false, "table": { "type": "text", - "width": 160 + "width": 260 }, "create": { "rules": [ @@ -310,10 +310,10 @@ "title": "创建时间", "dataIndex": "createdAt", "hideInSearch": true, - "hideInTable": true, + "hideInTable": false, "table": { "type": "time", - "width": 60 + "width": 100 }, "create": false, "edit": false, @@ -323,13 +323,115 @@ "title": "更新时间", "dataIndex": "updatedAt", "hideInSearch": true, - "hideInTable": true, + "hideInTable": false, "table": { "type": "time", - "width": 60 + "width": 100 }, "create": false, "edit": false, "view": true + }, + { + "title": "后端增", + "dataIndex": "add", + "hideInSearch": false, + "hideInTable": false, + "table": { + "type": "text", + "width": 100 + }, + "create": { + "colProps": { "span": 24 } + }, + "edit": { + "colProps": { "span": 24 } + }, + "view": true + }, + { + "title": "后端删", + "dataIndex": "delete", + "hideInSearch": false, + "hideInTable": false, + "table": { + "type": "text", + "width": 100 + }, + "create": { + "colProps": { "span": 24 } + }, + "edit": { + "colProps": { "span": 24 } + }, + "view": true + }, + { + "title": "后端改", + "dataIndex": "modify", + "hideInSearch": false, + "hideInTable": false, + "table": { + "type": "text", + "width": 100 + }, + "create": { + "colProps": { "span": 24 } + }, + "edit": { + "colProps": { "span": 24 } + }, + "view": true + }, + { + "title": "后端查", + "dataIndex": "query", + "hideInSearch": false, + "hideInTable": false, + "table": { + "type": "text", + "width": 100 + }, + "create": { + "colProps": { "span": 24 } + }, + "edit": { + "colProps": { "span": 24 } + }, + "view": true + }, + { + "title": "后端类型", + "dataIndex": "typesof", + "hideInSearch": false, + "hideInTable": false, + "table": { + "type": "text", + "width": 100 + }, + "create": { + "colProps": { "span": 24 } + }, + "edit": { + "colProps": { "span": 24 } + }, + "view": true + }, + { + "title": "后端默认值", + "dataIndex": "defaults", + "hideInSearch": false, + "hideInTable": false, + "table": { + "type": "text", + "width": 100 + }, + "create": { + "colProps": { "span": 24 } + }, + "edit": { + "colProps": { "span": 24 } + }, + "view": true } ]