fix: change dutyinfo api

mgy
Dawn1Ocean 2024-04-21 22:59:19 +08:00
parent 9fc19a3ebd
commit a39cef6312
4 changed files with 35 additions and 8 deletions

View File

@ -67,7 +67,7 @@ data:
"isNormalDuty": true, // 判断是否是正常值班时间
"currentDuty": "1", // 判断是否正在值班 / 值哪一班 "1" | "2" | "3" => 正在值班,"off" => 值班下班
"inDutyCnt": 3,
"otherDutyTime": "", // 正常值班时为空
"otherDutyTime": [], // 正常值班时为空
"offDutyReason": "",
"place": "204",
"dutyRecoverTime": ""
@ -83,7 +83,17 @@ data:
"isNormalDuty": false, // 判断是否是正常值班时间
"currentDuty": "others", // 判断是否正在值班 / 值哪一班 "others" => 正在值班,"off" => 值班下班
"inDutyCnt": 3,
"otherDutyTime": "",
"otherDutyTime": [
{
"name": "第一班",
"range": ["2024-03-07T19:52:48.523303", "2024-03-07T19:52:48.523303"]
},
{
"name": "第二班",
"range": ["2024-03-07T19:52:48.523303", "2024-03-07T19:52:48.523303"]
},
...
],
"offDutyReason": "",
"place": "204",
"dutyRecoverTime": ""
@ -98,10 +108,10 @@ request:
```json
{
"isNormalDuty": false,
"isNormalDuty": true,
"currentDuty": "2",
"inDutyCnt": 3,
"otherDutyTime": "",
"otherDutyTime": [],
"offDutyReason": "",
"place": "204",
"dutyRecoverTime": "",

View File

@ -38,8 +38,20 @@ module.exports = {
isNormalDuty: false,
currentDuty: 'off',
inDutyCnt: 3,
otherDutyStart: '2024-03-07T17:53:48.523303',
otherDutyEnd: '2024-03-17T17:53:48.523303',
otherDutyTime: [
{
name: '第一班',
range: ['2024-03-07T19:52:48.523303', '2024-03-07T19:52:48.523303'],
},
{
name: '第二班',
range: ['2024-03-07T19:52:48.523303', '2024-03-07T19:52:48.523303'],
},
{
name: '第三班',
range: ['2024-03-07T19:52:48.523303', '2024-03-07T19:52:48.523303'],
},
],
offDutyReason: '期中考试周',
place: '',
dutyRecoverTime: '下周一',

View File

@ -26,6 +26,7 @@ const DutyInfo: React.FC = () => {
useEffect(() => {
getDutyInfo()
.then((res) => {
console.log(res.data);
setDutyInfo(res.data);
setLoading(false);
})

View File

@ -1,10 +1,14 @@
export type Shift = {
name: string;
range: string[];
};
export type Info = {
isNormalDuty: boolean;
inDutyCnt: number;
currentDuty: string;
place: string;
otherDutyStart: string;
otherDutyEnd: string;
otherDutyTime: Shift[];
offDutyReason: string;
dutyRecoverTime: string;
};