diff --git a/doc/api.md b/doc/api.md index 7417d77..a9c6826 100644 --- a/doc/api.md +++ b/doc/api.md @@ -346,10 +346,9 @@ data: "time": "2024-03-07T19:52:48.523303", "week": "2", "shift": "3", + "detail": "收到电脑 n 台,维修成功 m 台,已取回 x 台,有 y 台正在维修交接给下一班" } // ... ] } ``` - -前端显示的信息:"{op} 于 {time} 上传了{week}{shift}值班总结" diff --git a/mock/conclusionlist.json b/mock/conclusionlist.json index 75c950a..5a9706f 100644 --- a/mock/conclusionlist.json +++ b/mock/conclusionlist.json @@ -4,70 +4,80 @@ "avatar": "https://gw.alipayobjects.com/zos/rmsportal/BiazfanxmamNRoxxVxka.png", "time": "2024-03-07T19:52:48.523303", "week": "2", - "shift": "3" + "shift": "3", + "detail": "收到电脑 n 台,维修成功 m 台,已取回 x 台,有 y 台正在维修交接给下一班" }, { "op": "宇航员", "avatar": "https://gw.alipayobjects.com/zos/rmsportal/BiazfanxmamNRoxxVxka.png", "time": "2024-03-07T19:52:49.523303", "week": "2", - "shift": "1" + "shift": "1", + "detail": "收到电脑 n 台,维修成功 m 台,已取回 x 台,有 y 台正在维修交接给下一班" }, { "op": "宇航员", "avatar": "https://gw.alipayobjects.com/zos/rmsportal/BiazfanxmamNRoxxVxka.png", "time": "2024-03-07T19:52:50.523303", "week": "2", - "shift": "2" + "shift": "2", + "detail": "收到电脑 n 台,维修成功 m 台,已取回 x 台,有 y 台正在维修交接给下一班" }, { "op": "晓洋", "avatar": "https://gw.alipayobjects.com/zos/rmsportal/BiazfanxmamNRoxxVxka.png", "time": "2024-03-07T19:52:51.523303", "week": "7", - "shift": "3" + "shift": "3", + "detail": "收到电脑 n 台,维修成功 m 台,已取回 x 台,有 y 台正在维修交接给下一班" }, { "op": "宇航员", "avatar": "https://gw.alipayobjects.com/zos/rmsportal/BiazfanxmamNRoxxVxka.png", "time": "2024-03-07T19:52:52.523303", "week": "7", - "shift": "1" + "shift": "1", + "detail": "收到电脑 n 台,维修成功 m 台,已取回 x 台,有 y 台正在维修交接给下一班" }, { "op": "宇航员", "avatar": "https://gw.alipayobjects.com/zos/rmsportal/BiazfanxmamNRoxxVxka.png", "time": "2024-03-07T19:52:53.523303", "week": "2", - "shift": "3" + "shift": "3", + "detail": "收到电脑 n 台,维修成功 m 台,已取回 x 台,有 y 台正在维修交接给下一班" }, { "op": "宇航员", "avatar": "https://gw.alipayobjects.com/zos/rmsportal/BiazfanxmamNRoxxVxka.png", "time": "2024-03-07T19:52:54.523303", "week": "2", - "shift": "3" + "shift": "3", + "detail": "收到电脑 n 台,维修成功 m 台,已取回 x 台,有 y 台正在维修交接给下一班" }, { "op": "宇航员", "avatar": "https://gw.alipayobjects.com/zos/rmsportal/BiazfanxmamNRoxxVxka.png", "time": "2024-03-07T19:52:55.523303", "week": "2", - "shift": "3" + "shift": "3", + "detail": "收到电脑 n 台,维修成功 m 台,已取回 x 台,有 y 台正在维修交接给下一班" }, { "op": "宇航员", "avatar": "https://gw.alipayobjects.com/zos/rmsportal/BiazfanxmamNRoxxVxka.png", "time": "2024-03-07T19:52:56.523303", "week": "2", - "shift": "3" + "shift": "3", + "detail": "收到电脑 n 台,维修成功 m 台,已取回 x 台,有 y 台正在维修交接给下一班" }, { "op": "宇航员", "avatar": "https://gw.alipayobjects.com/zos/rmsportal/BiazfanxmamNRoxxVxka.png", "time": "2024-03-07T19:52:57.523303", "week": "2", - "shift": "3" + "shift": "3", + "detail": "收到电脑 n 台,维修成功 m 台,已取回 x 台,有 y 台正在维修交接给下一班" } ] \ No newline at end of file diff --git a/src/pages/Admin/Conclusion/conclusionItem.ts b/src/pages/Admin/Conclusion/conclusionItem.ts index 3eef70b..1aac8eb 100644 --- a/src/pages/Admin/Conclusion/conclusionItem.ts +++ b/src/pages/Admin/Conclusion/conclusionItem.ts @@ -3,6 +3,7 @@ export type ConclusionItem = { time: string; week: string; shift: string; + detail: string; }; const weekMap: { [key: string]: string } = { diff --git a/src/pages/Admin/Conclusion/index.tsx b/src/pages/Admin/Conclusion/index.tsx index 652d4a8..8cbf435 100644 --- a/src/pages/Admin/Conclusion/index.tsx +++ b/src/pages/Admin/Conclusion/index.tsx @@ -1,5 +1,5 @@ import { PageContainer, ProList } from '@ant-design/pro-components'; -import { Card } from 'antd'; +import { Card, Space, Tag } from 'antd'; import moment from 'moment'; import request from 'umi-request'; import transConclusion, { ConclusionItem } from './conclusionItem'; @@ -33,21 +33,42 @@ const Logs: React.FC = () => { dataIndex: 'avatar', search: false, }, + subTitle: { + dataIndex: ['week', 'shift'], + render: (_, row) => { + return ( + + + {transConclusion(row.week, row.shift)} + + + ); + }, + title: '值班时间', + search: false, + }, description: { - dataIndex: ['time', 'week', 'shift'], + dataIndex: 'detail', search: false, render: (_, row) => { return (
- {'于 ' + - moment(row.time).format('YYYY-M-D HH:mm:ss') + - ' 上传了' + - transConclusion(row.week, row.shift) + - '值班总结'} + {row.detail}
); }, }, + extra: { + dataIndex: 'time', + render: (_: React.ReactNode, row: ConclusionItem) => { + return ( +
+ {moment(row.time).format('YYYY-M-D HH:mm:ss')} +
+ ); + }, + search: false, + }, actions: { render: () => [