add other duty time display with mock
parent
c8dd8061b2
commit
2d148e7aa4
19
doc/api.md
19
doc/api.md
|
|
@ -36,7 +36,7 @@
|
||||||
|
|
||||||
### 值班信息 `GET /duty/info`
|
### 值班信息 `GET /duty/info`
|
||||||
|
|
||||||
#### 当前在值班
|
#### 当前在值班(正常值班时间)
|
||||||
|
|
||||||
data:
|
data:
|
||||||
|
|
||||||
|
|
@ -45,7 +45,22 @@ data:
|
||||||
"isInDuty": true,
|
"isInDuty": true,
|
||||||
"inDutyCnt": 3,
|
"inDutyCnt": 3,
|
||||||
"currentDuty": "2",
|
"currentDuty": "2",
|
||||||
"place": "东三-204"
|
"place": "东三-204",
|
||||||
|
"otherDutyTime": ""
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
#### 当前在值班(其他值班时间)
|
||||||
|
|
||||||
|
data:
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"isInDuty": true,
|
||||||
|
"inDutyCnt": 3,
|
||||||
|
"currentDuty": "others",
|
||||||
|
"place": "蓝田",
|
||||||
|
"otherDutyTime": "9:30-11:30"
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -9,8 +9,9 @@ export default {
|
||||||
token: 'token_test',
|
token: 'token_test',
|
||||||
isInDuty: true,
|
isInDuty: true,
|
||||||
inDutyCnt: 3,
|
inDutyCnt: 3,
|
||||||
currentDuty: '2',
|
currentDuty: 'others',
|
||||||
place: '204',
|
otherDutyTime: '9:30-11:30',
|
||||||
|
place: '蓝田',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
'GET /user/info': {
|
'GET /user/info': {
|
||||||
|
|
|
||||||
|
|
@ -12,6 +12,7 @@ export class DutyData {
|
||||||
this.isInDuty = false;
|
this.isInDuty = false;
|
||||||
this.inDutyCnt = 3;
|
this.inDutyCnt = 3;
|
||||||
this.currentDuty = '2';
|
this.currentDuty = '2';
|
||||||
|
this.otherDutyTime = '9:30-11:30';
|
||||||
this.offDutyReason = '学园维修';
|
this.offDutyReason = '学园维修';
|
||||||
this.dutyRecoverTime = '下周一';
|
this.dutyRecoverTime = '下周一';
|
||||||
this.place = '东三-204';
|
this.place = '东三-204';
|
||||||
|
|
@ -20,6 +21,7 @@ export class DutyData {
|
||||||
isInDuty: boolean;
|
isInDuty: boolean;
|
||||||
inDutyCnt?: number;
|
inDutyCnt?: number;
|
||||||
currentDuty?: 'off' | '1' | '2' | '3' | 'others';
|
currentDuty?: 'off' | '1' | '2' | '3' | 'others';
|
||||||
|
otherDutyTime?: string;
|
||||||
offDutyReason?: string;
|
offDutyReason?: string;
|
||||||
dutyRecoverTime?: string;
|
dutyRecoverTime?: string;
|
||||||
place: string;
|
place: string;
|
||||||
|
|
@ -101,7 +103,12 @@ export class DutyInfo extends Component {
|
||||||
<Card isInDuty={data.isInDuty} place={data.place} />
|
<Card isInDuty={data.isInDuty} place={data.place} />
|
||||||
<AtTimeline
|
<AtTimeline
|
||||||
items={[
|
items={[
|
||||||
{ title: id.currentDutyText(data.currentDuty || 'off') },
|
{
|
||||||
|
title:
|
||||||
|
data.currentDuty == 'others'
|
||||||
|
? id.currentDutyText('others') + data.otherDutyTime
|
||||||
|
: id.currentDutyText(data.currentDuty || 'off'),
|
||||||
|
},
|
||||||
{ title: id.inDutyCnt(data.inDutyCnt as number) },
|
{ title: id.inDutyCnt(data.inDutyCnt as number) },
|
||||||
]}
|
]}
|
||||||
/>
|
/>
|
||||||
|
|
|
||||||
|
|
@ -90,7 +90,7 @@ export const mainPageZhCn: MainPageText = {
|
||||||
case '3':
|
case '3':
|
||||||
return '第三班 18:00-20:30';
|
return '第三班 18:00-20:30';
|
||||||
case 'others':
|
case 'others':
|
||||||
return '其他值班时间,见通知';
|
return '当班 ';
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
inDutyCnt: (n) => '当前值班人数:' + n,
|
inDutyCnt: (n) => '当前值班人数:' + n,
|
||||||
|
|
@ -151,7 +151,7 @@ export const mainPageEnUs: MainPageText = {
|
||||||
case '3':
|
case '3':
|
||||||
return '3rd Shift 18:00-20:30';
|
return '3rd Shift 18:00-20:30';
|
||||||
case 'others':
|
case 'others':
|
||||||
return 'Other duty time, see notice';
|
return 'Current Shift ';
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
inDutyCnt: (n) => 'EVA members on duty: ' + n,
|
inDutyCnt: (n) => 'EVA members on duty: ' + n,
|
||||||
|
|
|
||||||
|
|
@ -27,6 +27,7 @@ export function getDutyInfo(that: MainPage) {
|
||||||
isInDuty: data.isInDuty,
|
isInDuty: data.isInDuty,
|
||||||
inDutyCnt: data.inDutyCnt,
|
inDutyCnt: data.inDutyCnt,
|
||||||
currentDuty: data.currentDuty,
|
currentDuty: data.currentDuty,
|
||||||
|
otherDutyTime: data.otherDutyTime,
|
||||||
place: data.place,
|
place: data.place,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue