move week&shift process to src/utils/common

This commit is contained in:
Dawn1Ocean
2024-05-07 12:21:51 +08:00
parent edcd5dcbb7
commit 1ff36f366d
7 changed files with 35 additions and 59 deletions
@@ -5,28 +5,3 @@ export type ConclusionItem = {
shift: string;
detail: string;
};
const weekMap: { [key: string]: string } = {
'1': '周一',
'2': '周二',
'3': '周三',
'4': '周四',
'5': '周五',
'6': '周六',
'7': '周日',
};
const shiftMap: { [key: string]: string } = {
'1': '第一班',
'2': '第二班',
'3': '第三班',
};
const transConclusion = (week: string, shift: string) => {
if (week === '7' && shift === '3') {
return '其他值班时间';
} else {
return weekMap[week] + shiftMap[shift];
}
};
export default transConclusion;