refactor main page service
This commit is contained in:
@@ -15,10 +15,10 @@ export class DutyData {
|
||||
}
|
||||
|
||||
isInDuty: boolean;
|
||||
inDutyCnt: number;
|
||||
currentDuty: 'off' | '1' | '2' | '3';
|
||||
offDutyReason: string; // from backend
|
||||
dutyRecoverTime: string; // from backend
|
||||
inDutyCnt?: number;
|
||||
currentDuty?: 'off' | '1' | '2' | '3';
|
||||
offDutyReason?: string;
|
||||
dutyRecoverTime?: string;
|
||||
}
|
||||
|
||||
class Card extends Component {
|
||||
@@ -73,8 +73,8 @@ export class DutyInfo extends Component {
|
||||
<Card isInDuty={data.isInDuty} />
|
||||
<AtTimeline
|
||||
items={[
|
||||
{ title: od.reason(data.offDutyReason) },
|
||||
{ title: od.recoverTime(data.dutyRecoverTime) },
|
||||
{ title: od.reason(data.offDutyReason as string) },
|
||||
{ title: od.recoverTime(data.dutyRecoverTime as string) },
|
||||
]}
|
||||
/>
|
||||
</View>
|
||||
@@ -89,8 +89,8 @@ export class DutyInfo extends Component {
|
||||
<Card isInDuty={data.isInDuty} />
|
||||
<AtTimeline
|
||||
items={[
|
||||
{ title: id.currentDutyText(data.currentDuty) },
|
||||
{ title: id.inDutyCnt(data.inDutyCnt) },
|
||||
{ title: id.currentDutyText(data.currentDuty || 'off') },
|
||||
{ title: id.inDutyCnt(data.inDutyCnt as number) },
|
||||
]}
|
||||
/>
|
||||
</View>
|
||||
|
||||
Reference in New Issue
Block a user