change /duty/info api

This commit is contained in:
Dawn1Ocean
2024-04-07 12:29:07 +08:00
parent ff926676bd
commit 7a198cfe03
3 changed files with 25 additions and 4 deletions
+2 -2
View File
@@ -21,7 +21,7 @@ export class DutyData {
isInDuty: boolean;
inDutyCnt?: number;
currentDuty?: '0' | '1' | '2' | '3' | 'others';
currentDuty?: 'off' | '0' | '1' | '2' | '3' | 'others';
otherDutyStart?: string;
otherDutyEnd?: string;
offDutyReason?: string;
@@ -122,7 +122,7 @@ export class DutyInfo extends Component {
moment(data.otherDutyStart).format('H:mm') +
' - ' +
moment(data.otherDutyEnd).format('H:mm')
: id.currentDutyText(data.currentDuty || '0'),
: id.currentDutyText(data.currentDuty || 'off'),
},
{ title: id.inDutyCnt(data.inDutyCnt as number) },
]}
+6 -2
View File
@@ -37,7 +37,7 @@ export interface MainPageText {
};
inDuty: {
title: string;
currentDutyText: (c: '0' | '1' | '2' | '3' | 'others') => string;
currentDutyText: (c: 'off' | '0' | '1' | '2' | '3' | 'others') => string;
inDutyCnt: (n: number) => string;
};
};
@@ -93,8 +93,10 @@ export const mainPageZhCn: MainPageText = {
title: '值班中',
currentDutyText: (c) => {
switch (c) {
case 'off':
return '暂停值班';
case '0':
return '当前未值班';
return '休息中';
case '1':
return '第一班 13:30-16:00';
case '2':
@@ -160,6 +162,8 @@ export const mainPageEnUs: MainPageText = {
title: 'On Duty',
currentDutyText: (c) => {
switch (c) {
case 'off':
return 'Duty paused';
case '0':
return 'Normal Shift';
case '1':