diff --git a/doc/api.md b/doc/api.md index 504f949..51fc384 100644 --- a/doc/api.md +++ b/doc/api.md @@ -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": "", diff --git a/mock/requestRecord.mock.js b/mock/requestRecord.mock.js index 4647598..d51fb2b 100644 --- a/mock/requestRecord.mock.js +++ b/mock/requestRecord.mock.js @@ -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: '下周一', diff --git a/src/pages/Admin/DutyInfo/index.tsx b/src/pages/Admin/DutyInfo/index.tsx index 37924fa..1495143 100644 --- a/src/pages/Admin/DutyInfo/index.tsx +++ b/src/pages/Admin/DutyInfo/index.tsx @@ -26,6 +26,7 @@ const DutyInfo: React.FC = () => { useEffect(() => { getDutyInfo() .then((res) => { + console.log(res.data); setDutyInfo(res.data); setLoading(false); }) diff --git a/src/pages/Admin/DutyInfo/info.ts b/src/pages/Admin/DutyInfo/info.ts index aa1489d..c7917e2 100644 --- a/src/pages/Admin/DutyInfo/info.ts +++ b/src/pages/Admin/DutyInfo/info.ts @@ -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; };