Compare commits
3
Commits
1caeba1225
..
mgy
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d74cbcb229 | ||
|
|
f023e4b64a | ||
|
|
5158fd19d9 |
+12
-1
@@ -13,7 +13,11 @@ export default [
|
||||
routes: [
|
||||
{ path: '/admin', redirect: '/admin/dutyinfo' },
|
||||
{ path: '/admin/dutyinfo', name: '值班信息', component: './Admin/DutyInfo' },
|
||||
{ path: '/admin/dutytable', name: '值班表管理', component: './Admin/DutyTable' },
|
||||
{
|
||||
path: '/admin/dutytable',
|
||||
name: '值班表管理',
|
||||
component: './Admin/DutyTable',
|
||||
},
|
||||
{ path: '/admin/logs', name: '日志', component: './Admin/Logs' },
|
||||
],
|
||||
},
|
||||
@@ -29,6 +33,13 @@ export default [
|
||||
{ path: '/leader/askleave', name: '请假管理', component: './Leader/AskLeave' },
|
||||
],
|
||||
},
|
||||
{
|
||||
path: '/admin/dutytable/edit',
|
||||
component: './Admin/DutyTable/EditTable',
|
||||
menu: {
|
||||
hideInMenu: true,
|
||||
},
|
||||
},
|
||||
{ name: '关于我们', icon: 'thunderbolt', path: '/about', component: './About' },
|
||||
{ path: '/', redirect: '/welcome' },
|
||||
{ path: '*', layout: false, component: './404' },
|
||||
|
||||
+10
-11
@@ -5,7 +5,7 @@
|
||||
"time": "2024-03-07T19:52:48.523303",
|
||||
"week": "2",
|
||||
"shift": "3",
|
||||
"reason": "收到电脑 n 台,维修成功 m 台,已取回 x 台,有 y 台正在维修交接给下一班",
|
||||
"reason": "英语六级口试",
|
||||
"substitute": "晓洋"
|
||||
},
|
||||
{
|
||||
@@ -14,7 +14,7 @@
|
||||
"time": "2024-03-07T19:52:49.523303",
|
||||
"week": "2",
|
||||
"shift": "1",
|
||||
"reason": "收到电脑 n 台,维修成功 m 台,已取回 x 台,有 y 台正在维修交接给下一班",
|
||||
"reason": "英语六级口试",
|
||||
"substitute": "晓洋"
|
||||
},
|
||||
{
|
||||
@@ -23,7 +23,7 @@
|
||||
"time": "2024-03-07T19:52:50.523303",
|
||||
"week": "2",
|
||||
"shift": "2",
|
||||
"reason": "收到电脑 n 台,维修成功 m 台,已取回 x 台,有 y 台正在维修交接给下一班",
|
||||
"reason": "英语六级口试",
|
||||
"substitute": "晓洋"
|
||||
},
|
||||
{
|
||||
@@ -32,7 +32,7 @@
|
||||
"time": "2024-03-07T19:52:51.523303",
|
||||
"week": "7",
|
||||
"shift": "3",
|
||||
"reason": "收到电脑 n 台,维修成功 m 台,已取回 x 台,有 y 台正在维修交接给下一班",
|
||||
"reason": "英语六级口试",
|
||||
"substitute": "晓洋"
|
||||
},
|
||||
{
|
||||
@@ -41,7 +41,7 @@
|
||||
"time": "2024-03-07T19:52:52.523303",
|
||||
"week": "7",
|
||||
"shift": "1",
|
||||
"reason": "收到电脑 n 台,维修成功 m 台,已取回 x 台,有 y 台正在维修交接给下一班",
|
||||
"reason": "英语六级口试",
|
||||
"substitute": "晓洋"
|
||||
},
|
||||
{
|
||||
@@ -50,7 +50,7 @@
|
||||
"time": "2024-03-07T19:52:53.523303",
|
||||
"week": "2",
|
||||
"shift": "3",
|
||||
"reason": "收到电脑 n 台,维修成功 m 台,已取回 x 台,有 y 台正在维修交接给下一班",
|
||||
"reason": "英语六级口试",
|
||||
"substitute": "晓洋"
|
||||
},
|
||||
{
|
||||
@@ -59,7 +59,7 @@
|
||||
"time": "2024-03-07T19:52:54.523303",
|
||||
"week": "2",
|
||||
"shift": "3",
|
||||
"reason": "收到电脑 n 台,维修成功 m 台,已取回 x 台,有 y 台正在维修交接给下一班",
|
||||
"reason": "英语六级口试",
|
||||
"substitute": ""
|
||||
},
|
||||
{
|
||||
@@ -68,7 +68,7 @@
|
||||
"time": "2024-03-07T19:52:55.523303",
|
||||
"week": "2",
|
||||
"shift": "3",
|
||||
"reason": "收到电脑 n 台,维修成功 m 台,已取回 x 台,有 y 台正在维修交接给下一班",
|
||||
"reason": "英语六级口试",
|
||||
"substitute": "晓洋"
|
||||
},
|
||||
{
|
||||
@@ -77,7 +77,7 @@
|
||||
"time": "2024-03-07T19:52:56.523303",
|
||||
"week": "2",
|
||||
"shift": "3",
|
||||
"reason": "收到电脑 n 台,维修成功 m 台,已取回 x 台,有 y 台正在维修交接给下一班",
|
||||
"reason": "英语六级口试",
|
||||
"substitute": "晓洋"
|
||||
},
|
||||
{
|
||||
@@ -86,8 +86,7 @@
|
||||
"time": "2024-03-07T19:52:57.523303",
|
||||
"week": "2",
|
||||
"shift": "3",
|
||||
"reason": "收到电脑 n 台,维修成功 m 台,已取回 x 台,有 y 台正在维修交接给下一班",
|
||||
"reason": "英语六级口试",
|
||||
"substitute": "晓洋"
|
||||
}
|
||||
]
|
||||
|
||||
@@ -80,4 +80,3 @@
|
||||
"detail": "收到电脑 n 台,维修成功 m 台,已取回 x 台,有 y 台正在维修交接给下一班"
|
||||
}
|
||||
]
|
||||
|
||||
+3
-5
@@ -1,10 +1,9 @@
|
||||
{
|
||||
"current": 514,
|
||||
"list": [
|
||||
[
|
||||
{
|
||||
"name": "2024 春学期值班表",
|
||||
"createdTime": "2024-03-07T19:52:48.523303",
|
||||
"id": 114,
|
||||
"isSelect": true,
|
||||
"sheet": [
|
||||
{
|
||||
"weekday": 1,
|
||||
@@ -132,6 +131,7 @@
|
||||
"name": "2024 秋学期值班表",
|
||||
"createdTime": "2024-03-07T11:45:14.523303",
|
||||
"id": 514,
|
||||
"isSelect": false,
|
||||
"sheet": [
|
||||
{
|
||||
"weekday": 1,
|
||||
@@ -256,5 +256,3 @@
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
Generated
-21929
File diff suppressed because it is too large
Load Diff
@@ -9,11 +9,11 @@ export interface Staff {
|
||||
|
||||
const staffList: Staff[] = [
|
||||
{
|
||||
avatar: 'https://blog.dawn-ocean.top/assets/img/avatar.jpg',
|
||||
avatar: 'https://wiki.zjueva.net/images/1/10/%E5%A4%B4%E5%83%8F.jpg',
|
||||
name: '马国洋',
|
||||
nickname: 'Dawn_Ocean',
|
||||
profile: 'Eta & Tea 总设计\n摸鱼与开发叠加态',
|
||||
link: 'https://blog.dawn-ocean.top',
|
||||
link: 'https://blog.deans.fun',
|
||||
linktext: '我的博客',
|
||||
},
|
||||
{
|
||||
@@ -39,6 +39,6 @@ const sideStaffList: Staff[] = [
|
||||
nickname: 'Tester',
|
||||
profile: 'Eta 系统总测试',
|
||||
},
|
||||
]
|
||||
];
|
||||
|
||||
export default { staffList, sideStaffList };
|
||||
|
||||
@@ -1,14 +0,0 @@
|
||||
import { Todo } from '@/components';
|
||||
import { PageContainer } from '@ant-design/pro-components';
|
||||
import { Card } from 'antd';
|
||||
|
||||
const Logs: React.FC = () => {
|
||||
return (
|
||||
<PageContainer>
|
||||
<Card>
|
||||
<Todo />
|
||||
</Card>
|
||||
</PageContainer>
|
||||
);
|
||||
};
|
||||
export default Logs;
|
||||
@@ -0,0 +1,105 @@
|
||||
import { Todo } from '@/components';
|
||||
import { PageContainer } from '@ant-design/pro-components';
|
||||
import { Card, Modal } from 'antd';
|
||||
import React, { useState } from 'react';
|
||||
|
||||
const EditTable: React.FC = () => {
|
||||
const [isSaveOpen, setIsSaveOpen] = useState(false);
|
||||
const [isSetOpen, setIsSetOpen] = useState(false);
|
||||
|
||||
// const showSave = () => {
|
||||
// setIsSaveOpen(true);
|
||||
// };
|
||||
|
||||
const handleSaveOk = () => {
|
||||
setIsSaveOpen(false);
|
||||
};
|
||||
|
||||
const handleSaveCancel = () => {
|
||||
setIsSaveOpen(false);
|
||||
};
|
||||
|
||||
// const showSet = () => {
|
||||
// setIsSetOpen(true);
|
||||
// };
|
||||
|
||||
const handleSetOk = () => {
|
||||
setIsSetOpen(false);
|
||||
};
|
||||
|
||||
const handleSetCancel = () => {
|
||||
setIsSetOpen(false);
|
||||
};
|
||||
|
||||
// const columns: ProColumns<DataSourceType>[] = [
|
||||
// {
|
||||
// title: '活动名称',
|
||||
// dataIndex: 'title',
|
||||
// width: '30%',
|
||||
// formItemProps: {
|
||||
// rules: [
|
||||
// {
|
||||
// required: true,
|
||||
// whitespace: true,
|
||||
// message: '此项是必填项',
|
||||
// },
|
||||
// {
|
||||
// message: '必须包含数字',
|
||||
// pattern: /[0-9]/,
|
||||
// },
|
||||
// {
|
||||
// max: 16,
|
||||
// whitespace: true,
|
||||
// message: '最长为 16 位',
|
||||
// },
|
||||
// {
|
||||
// min: 6,
|
||||
// whitespace: true,
|
||||
// message: '最小为 6 位',
|
||||
// },
|
||||
// ],
|
||||
// },
|
||||
// },
|
||||
// {
|
||||
// title: '状态',
|
||||
// key: 'state',
|
||||
// dataIndex: 'state',
|
||||
// valueType: 'select',
|
||||
// valueEnum: {
|
||||
// all: { text: '全部', status: 'Default' },
|
||||
// open: {
|
||||
// text: '未解决',
|
||||
// status: 'Error',
|
||||
// },
|
||||
// closed: {
|
||||
// text: '已解决',
|
||||
// status: 'Success',
|
||||
// },
|
||||
// },
|
||||
// },
|
||||
// {
|
||||
// title: '描述',
|
||||
// dataIndex: 'decs',
|
||||
// },
|
||||
// ];
|
||||
|
||||
return (
|
||||
<PageContainer>
|
||||
<Modal title="确认保存?" open={isSaveOpen} onOk={handleSaveOk} onCancel={handleSaveCancel}>
|
||||
<p>保存后将回到值班表页面!</p>
|
||||
</Modal>
|
||||
<Modal
|
||||
title="确认设为当前值班表?"
|
||||
open={isSetOpen}
|
||||
onOk={handleSetOk}
|
||||
onCancel={handleSetCancel}
|
||||
>
|
||||
<p>同一时间只能启用一份值班表!</p>
|
||||
</Modal>
|
||||
<Card>
|
||||
<Todo />
|
||||
</Card>
|
||||
</PageContainer>
|
||||
);
|
||||
};
|
||||
export default EditTable;
|
||||
@@ -0,0 +1,10 @@
|
||||
export type TableItem = {
|
||||
id: React.Key;
|
||||
mon?: string;
|
||||
tue?: string;
|
||||
wed?: string;
|
||||
thu?: string;
|
||||
fri?: string;
|
||||
sat?: string;
|
||||
sun?: string;
|
||||
};
|
||||
@@ -0,0 +1,6 @@
|
||||
export type DutyTableItem = {
|
||||
name: string;
|
||||
isSelect: boolean;
|
||||
time: string;
|
||||
id: number;
|
||||
};
|
||||
@@ -0,0 +1,133 @@
|
||||
import { PageContainer, ProList } from '@ant-design/pro-components';
|
||||
import { history } from '@umijs/max';
|
||||
import { Button, Card, Modal, Space, Tag } from 'antd';
|
||||
import moment from 'moment';
|
||||
import React, { useState } from 'react';
|
||||
import request from 'umi-request';
|
||||
import { DutyTableItem } from './dutyTableItem';
|
||||
|
||||
const DutyTable: React.FC = () => {
|
||||
const [isDeleteOpen, setIsDeleteOpen] = useState(false);
|
||||
const [isSetOpen, setIsSetOpen] = useState(false);
|
||||
|
||||
const showDelete = () => {
|
||||
setIsDeleteOpen(true);
|
||||
};
|
||||
|
||||
const handleDeleteOk = () => {
|
||||
setIsDeleteOpen(false);
|
||||
};
|
||||
|
||||
const handleDeleteCancel = () => {
|
||||
setIsDeleteOpen(false);
|
||||
};
|
||||
|
||||
const showSet = () => {
|
||||
setIsSetOpen(true);
|
||||
};
|
||||
|
||||
const handleSetOk = () => {
|
||||
setIsSetOpen(false);
|
||||
};
|
||||
|
||||
const handleSetCancel = () => {
|
||||
setIsSetOpen(false);
|
||||
};
|
||||
|
||||
const newDutyTable = () => {
|
||||
history.push('/admin/dutytable/edit');
|
||||
};
|
||||
|
||||
return (
|
||||
<PageContainer>
|
||||
<Modal
|
||||
title="确认删除?"
|
||||
open={isDeleteOpen}
|
||||
onOk={handleDeleteOk}
|
||||
onCancel={handleDeleteCancel}
|
||||
>
|
||||
<p>删除后将无法恢复!</p>
|
||||
</Modal>
|
||||
<Modal
|
||||
title="确认设为当前值班表?"
|
||||
open={isSetOpen}
|
||||
onOk={handleSetOk}
|
||||
onCancel={handleSetCancel}
|
||||
>
|
||||
<p>同一时间只能启用一份值班表!</p>
|
||||
</Modal>
|
||||
<Card>
|
||||
<ProList<DutyTableItem>
|
||||
search={{
|
||||
filterType: 'light',
|
||||
}}
|
||||
rowKey="op"
|
||||
headerTitle="值班表列表"
|
||||
request={async (params = {} as Record<string, any>) =>
|
||||
request<{
|
||||
data: DutyTableItem[];
|
||||
}>('/admin/sheet/list', {
|
||||
params,
|
||||
})
|
||||
}
|
||||
pagination={{
|
||||
pageSize: 10,
|
||||
}}
|
||||
metas={{
|
||||
title: {
|
||||
dataIndex: 'name',
|
||||
title: '值班表',
|
||||
},
|
||||
subTitle: {
|
||||
dataIndex: ['isSelect'],
|
||||
render: (_, row) => {
|
||||
return row.isSelect ? (
|
||||
<Space size={0}>
|
||||
<Tag color="blue">当前</Tag>
|
||||
</Space>
|
||||
) : (
|
||||
<div></div>
|
||||
);
|
||||
},
|
||||
title: '值班时间',
|
||||
search: false,
|
||||
},
|
||||
extra: {
|
||||
dataIndex: 'time',
|
||||
render: (_: React.ReactNode, row: DutyTableItem) => {
|
||||
return (
|
||||
<div style={{ marginLeft: '3vh' }}>
|
||||
{moment(row.time).format('YYYY-M-D HH:mm:ss')}
|
||||
</div>
|
||||
);
|
||||
},
|
||||
search: false,
|
||||
},
|
||||
actions: {
|
||||
render: () => [
|
||||
<a href="" target="_blank" rel="noopener noreferrer" key="view">
|
||||
查看
|
||||
</a>,
|
||||
<a onClick={showSet} key="view">
|
||||
设为当前值班表
|
||||
</a>,
|
||||
<a onClick={showDelete} key="view">
|
||||
删除
|
||||
</a>,
|
||||
],
|
||||
search: false,
|
||||
},
|
||||
}}
|
||||
toolbar={{
|
||||
actions: [
|
||||
<Button type="primary" key="primary" onClick={newDutyTable}>
|
||||
新建值班表
|
||||
</Button>,
|
||||
],
|
||||
}}
|
||||
/>
|
||||
</Card>
|
||||
</PageContainer>
|
||||
);
|
||||
};
|
||||
export default DutyTable;
|
||||
Reference in New Issue
Block a user