Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
zhoubichuan committed Oct 31, 2023
1 parent 3471f4f commit 8ded6ab
Show file tree
Hide file tree
Showing 3 changed files with 144 additions and 13 deletions.
14 changes: 14 additions & 0 deletions src/pages/list/list/index.less
Original file line number Diff line number Diff line change
@@ -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;
}
}
}
}
19 changes: 17 additions & 2 deletions src/pages/list/list/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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('正在添加');
Expand Down Expand Up @@ -174,6 +176,7 @@ const TableList: React.FC = () => {
dataIndex: 'id',
width: 160,
fixed: 'left',
align: 'center',
hideInSearch: true,
hideInDescriptions: true,
render: (dom, entity) => {
Expand Down Expand Up @@ -347,12 +350,14 @@ const TableList: React.FC = () => {
tabActiveKey={tabActiveKey}
>
<ProTable<TableListItem, TableListPagination>
className={classNames('pro-table', styles['pro-table'])}
style={{ height: '100%' }}
sticky
actionRef={actionRef}
ghost={true}
rowKey="id"
search={{
labelWidth: 100,
labelWidth: 80,
}}
toolBarRender={() => [
<Button
Expand All @@ -377,8 +382,18 @@ const TableList: React.FC = () => {
});
}}
>
<PlusOutlined /> 批量删除
批量删除
</Button>,
<Upload
{...uploadprops}
onChange={() => {
if (actionRef.current) {
actionRef.current.reload();
}
}}
>
<Button type="primary">批量导出</Button>
</Upload>,
<Upload
{...uploadprops}
onChange={() => {
Expand Down
124 changes: 113 additions & 11 deletions src/pages/list/template/1.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
"hideInTable": false,
"table": {
"type": "text",
"width": 60
"width": 100
},
"create": {
"rules": [
Expand Down Expand Up @@ -69,7 +69,7 @@
"hideInTable": false,
"table": {
"type": "text",
"width": 60
"width": 100
},
"create": {
"rules": [
Expand Down Expand Up @@ -102,7 +102,7 @@
{ "value": true, "name": "" },
{ "value": false, "name": "" }
],
"width": 80
"width": 100
},
"create": {
"rules": [
Expand Down Expand Up @@ -135,7 +135,7 @@
{ "value": true, "name": "" },
{ "value": false, "name": "" }
],
"width": 80
"width": 100
},
"create": {
"rules": [
Expand Down Expand Up @@ -197,7 +197,7 @@
{ "value": true, "name": "" },
{ "value": false, "name": "" }
],
"width": 80
"width": 100
},
"create": {
"rules": [
Expand Down Expand Up @@ -226,7 +226,7 @@
"hideInTable": false,
"table": {
"type": "text",
"width": 160
"width": 260
},
"create": {
"rules": [
Expand Down Expand Up @@ -255,7 +255,7 @@
"hideInTable": false,
"table": {
"type": "text",
"width": 160
"width": 260
},
"create": {
"rules": [
Expand Down Expand Up @@ -310,10 +310,10 @@
"title": "创建时间",
"dataIndex": "createdAt",
"hideInSearch": true,
"hideInTable": true,
"hideInTable": false,
"table": {
"type": "time",
"width": 60
"width": 100
},
"create": false,
"edit": false,
Expand All @@ -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
}
]

0 comments on commit 8ded6ab

Please sign in to comment.