fix: conclusion table layout
parent
d6a42f6087
commit
136acf2731
|
|
@ -346,10 +346,9 @@ data:
|
||||||
"time": "2024-03-07T19:52:48.523303",
|
"time": "2024-03-07T19:52:48.523303",
|
||||||
"week": "2",
|
"week": "2",
|
||||||
"shift": "3",
|
"shift": "3",
|
||||||
|
"detail": "收到电脑 n 台,维修成功 m 台,已取回 x 台,有 y 台正在维修交接给下一班"
|
||||||
}
|
}
|
||||||
// ...
|
// ...
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
前端显示的信息:"{op} 于 {time} 上传了{week}{shift}值班总结"
|
|
||||||
|
|
|
||||||
|
|
@ -4,70 +4,80 @@
|
||||||
"avatar": "https://gw.alipayobjects.com/zos/rmsportal/BiazfanxmamNRoxxVxka.png",
|
"avatar": "https://gw.alipayobjects.com/zos/rmsportal/BiazfanxmamNRoxxVxka.png",
|
||||||
"time": "2024-03-07T19:52:48.523303",
|
"time": "2024-03-07T19:52:48.523303",
|
||||||
"week": "2",
|
"week": "2",
|
||||||
"shift": "3"
|
"shift": "3",
|
||||||
|
"detail": "收到电脑 n 台,维修成功 m 台,已取回 x 台,有 y 台正在维修交接给下一班"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"op": "宇航员",
|
"op": "宇航员",
|
||||||
"avatar": "https://gw.alipayobjects.com/zos/rmsportal/BiazfanxmamNRoxxVxka.png",
|
"avatar": "https://gw.alipayobjects.com/zos/rmsportal/BiazfanxmamNRoxxVxka.png",
|
||||||
"time": "2024-03-07T19:52:49.523303",
|
"time": "2024-03-07T19:52:49.523303",
|
||||||
"week": "2",
|
"week": "2",
|
||||||
"shift": "1"
|
"shift": "1",
|
||||||
|
"detail": "收到电脑 n 台,维修成功 m 台,已取回 x 台,有 y 台正在维修交接给下一班"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"op": "宇航员",
|
"op": "宇航员",
|
||||||
"avatar": "https://gw.alipayobjects.com/zos/rmsportal/BiazfanxmamNRoxxVxka.png",
|
"avatar": "https://gw.alipayobjects.com/zos/rmsportal/BiazfanxmamNRoxxVxka.png",
|
||||||
"time": "2024-03-07T19:52:50.523303",
|
"time": "2024-03-07T19:52:50.523303",
|
||||||
"week": "2",
|
"week": "2",
|
||||||
"shift": "2"
|
"shift": "2",
|
||||||
|
"detail": "收到电脑 n 台,维修成功 m 台,已取回 x 台,有 y 台正在维修交接给下一班"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"op": "晓洋",
|
"op": "晓洋",
|
||||||
"avatar": "https://gw.alipayobjects.com/zos/rmsportal/BiazfanxmamNRoxxVxka.png",
|
"avatar": "https://gw.alipayobjects.com/zos/rmsportal/BiazfanxmamNRoxxVxka.png",
|
||||||
"time": "2024-03-07T19:52:51.523303",
|
"time": "2024-03-07T19:52:51.523303",
|
||||||
"week": "7",
|
"week": "7",
|
||||||
"shift": "3"
|
"shift": "3",
|
||||||
|
"detail": "收到电脑 n 台,维修成功 m 台,已取回 x 台,有 y 台正在维修交接给下一班"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"op": "宇航员",
|
"op": "宇航员",
|
||||||
"avatar": "https://gw.alipayobjects.com/zos/rmsportal/BiazfanxmamNRoxxVxka.png",
|
"avatar": "https://gw.alipayobjects.com/zos/rmsportal/BiazfanxmamNRoxxVxka.png",
|
||||||
"time": "2024-03-07T19:52:52.523303",
|
"time": "2024-03-07T19:52:52.523303",
|
||||||
"week": "7",
|
"week": "7",
|
||||||
"shift": "1"
|
"shift": "1",
|
||||||
|
"detail": "收到电脑 n 台,维修成功 m 台,已取回 x 台,有 y 台正在维修交接给下一班"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"op": "宇航员",
|
"op": "宇航员",
|
||||||
"avatar": "https://gw.alipayobjects.com/zos/rmsportal/BiazfanxmamNRoxxVxka.png",
|
"avatar": "https://gw.alipayobjects.com/zos/rmsportal/BiazfanxmamNRoxxVxka.png",
|
||||||
"time": "2024-03-07T19:52:53.523303",
|
"time": "2024-03-07T19:52:53.523303",
|
||||||
"week": "2",
|
"week": "2",
|
||||||
"shift": "3"
|
"shift": "3",
|
||||||
|
"detail": "收到电脑 n 台,维修成功 m 台,已取回 x 台,有 y 台正在维修交接给下一班"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"op": "宇航员",
|
"op": "宇航员",
|
||||||
"avatar": "https://gw.alipayobjects.com/zos/rmsportal/BiazfanxmamNRoxxVxka.png",
|
"avatar": "https://gw.alipayobjects.com/zos/rmsportal/BiazfanxmamNRoxxVxka.png",
|
||||||
"time": "2024-03-07T19:52:54.523303",
|
"time": "2024-03-07T19:52:54.523303",
|
||||||
"week": "2",
|
"week": "2",
|
||||||
"shift": "3"
|
"shift": "3",
|
||||||
|
"detail": "收到电脑 n 台,维修成功 m 台,已取回 x 台,有 y 台正在维修交接给下一班"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"op": "宇航员",
|
"op": "宇航员",
|
||||||
"avatar": "https://gw.alipayobjects.com/zos/rmsportal/BiazfanxmamNRoxxVxka.png",
|
"avatar": "https://gw.alipayobjects.com/zos/rmsportal/BiazfanxmamNRoxxVxka.png",
|
||||||
"time": "2024-03-07T19:52:55.523303",
|
"time": "2024-03-07T19:52:55.523303",
|
||||||
"week": "2",
|
"week": "2",
|
||||||
"shift": "3"
|
"shift": "3",
|
||||||
|
"detail": "收到电脑 n 台,维修成功 m 台,已取回 x 台,有 y 台正在维修交接给下一班"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"op": "宇航员",
|
"op": "宇航员",
|
||||||
"avatar": "https://gw.alipayobjects.com/zos/rmsportal/BiazfanxmamNRoxxVxka.png",
|
"avatar": "https://gw.alipayobjects.com/zos/rmsportal/BiazfanxmamNRoxxVxka.png",
|
||||||
"time": "2024-03-07T19:52:56.523303",
|
"time": "2024-03-07T19:52:56.523303",
|
||||||
"week": "2",
|
"week": "2",
|
||||||
"shift": "3"
|
"shift": "3",
|
||||||
|
"detail": "收到电脑 n 台,维修成功 m 台,已取回 x 台,有 y 台正在维修交接给下一班"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"op": "宇航员",
|
"op": "宇航员",
|
||||||
"avatar": "https://gw.alipayobjects.com/zos/rmsportal/BiazfanxmamNRoxxVxka.png",
|
"avatar": "https://gw.alipayobjects.com/zos/rmsportal/BiazfanxmamNRoxxVxka.png",
|
||||||
"time": "2024-03-07T19:52:57.523303",
|
"time": "2024-03-07T19:52:57.523303",
|
||||||
"week": "2",
|
"week": "2",
|
||||||
"shift": "3"
|
"shift": "3",
|
||||||
|
"detail": "收到电脑 n 台,维修成功 m 台,已取回 x 台,有 y 台正在维修交接给下一班"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
@ -3,6 +3,7 @@ export type ConclusionItem = {
|
||||||
time: string;
|
time: string;
|
||||||
week: string;
|
week: string;
|
||||||
shift: string;
|
shift: string;
|
||||||
|
detail: string;
|
||||||
};
|
};
|
||||||
|
|
||||||
const weekMap: { [key: string]: string } = {
|
const weekMap: { [key: string]: string } = {
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
import { PageContainer, ProList } from '@ant-design/pro-components';
|
import { PageContainer, ProList } from '@ant-design/pro-components';
|
||||||
import { Card } from 'antd';
|
import { Card, Space, Tag } from 'antd';
|
||||||
import moment from 'moment';
|
import moment from 'moment';
|
||||||
import request from 'umi-request';
|
import request from 'umi-request';
|
||||||
import transConclusion, { ConclusionItem } from './conclusionItem';
|
import transConclusion, { ConclusionItem } from './conclusionItem';
|
||||||
|
|
@ -33,21 +33,42 @@ const Logs: React.FC = () => {
|
||||||
dataIndex: 'avatar',
|
dataIndex: 'avatar',
|
||||||
search: false,
|
search: false,
|
||||||
},
|
},
|
||||||
|
subTitle: {
|
||||||
|
dataIndex: ['week', 'shift'],
|
||||||
|
render: (_, row) => {
|
||||||
|
return (
|
||||||
|
<Space size={0}>
|
||||||
|
<Tag color="blue" key={row.op}>
|
||||||
|
{transConclusion(row.week, row.shift)}
|
||||||
|
</Tag>
|
||||||
|
</Space>
|
||||||
|
);
|
||||||
|
},
|
||||||
|
title: '值班时间',
|
||||||
|
search: false,
|
||||||
|
},
|
||||||
description: {
|
description: {
|
||||||
dataIndex: ['time', 'week', 'shift'],
|
dataIndex: 'detail',
|
||||||
search: false,
|
search: false,
|
||||||
render: (_, row) => {
|
render: (_, row) => {
|
||||||
return (
|
return (
|
||||||
<div>
|
<div>
|
||||||
{'于 ' +
|
{row.detail}
|
||||||
moment(row.time).format('YYYY-M-D HH:mm:ss') +
|
|
||||||
' 上传了' +
|
|
||||||
transConclusion(row.week, row.shift) +
|
|
||||||
'值班总结'}
|
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
extra: {
|
||||||
|
dataIndex: 'time',
|
||||||
|
render: (_: React.ReactNode, row: ConclusionItem) => {
|
||||||
|
return (
|
||||||
|
<div style={{ marginLeft: '3vh' }}>
|
||||||
|
{moment(row.time).format('YYYY-M-D HH:mm:ss')}
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
},
|
||||||
|
search: false,
|
||||||
|
},
|
||||||
actions: {
|
actions: {
|
||||||
render: () => [
|
render: () => [
|
||||||
<a href="" target="_blank" rel="noopener noreferrer" key="view">
|
<a href="" target="_blank" rel="noopener noreferrer" key="view">
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue