Compare commits

...

2 Commits

Author SHA1 Message Date
Dawn1Ocean a6d435a22f fix: logs table layout 2024-04-16 12:11:42 +08:00
Dawn1Ocean 136acf2731 fix: conclusion table layout 2024-04-16 12:09:52 +08:00
5 changed files with 63 additions and 24 deletions

View File

@ -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}值班总结"

View File

@ -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 台正在维修交接给下一班"
} }
] ]

View File

@ -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 } = {

View File

@ -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">

View File

@ -34,15 +34,12 @@ const Logs: React.FC = () => {
search: false, search: false,
}, },
description: { description: {
dataIndex: ['time', 'operation', 'target', 'prev', 'curr'], dataIndex: ['operation', 'target', 'prev', 'curr'],
search: false, search: false,
render: (_, row) => { render: (_, row) => {
return ( return (
<div> <div>
{'于 ' + {transInfo(row.operation, 'operation') +
moment(row.time).format('YYYY-M-D HH:mm:ss') +
' ' +
transInfo(row.operation, 'operation') +
'了' + '了' +
transInfo(row.target, 'target') + transInfo(row.target, 'target') +
'' + '' +
@ -53,6 +50,17 @@ const Logs: React.FC = () => {
); );
}, },
}, },
extra: {
dataIndex: 'time',
render: (_: React.ReactNode, row: LogsItem) => {
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">