EVA-Tea/src/pages/Logs/logItem.ts

38 lines
611 B
TypeScript

const operationMap: { [key: number]: string } = {
0: '增加',
1: '删除',
2: '修改',
};
const targetMap: { [key: number]: string } = {
0: '值班表',
1: '值班信息',
2: '值班总结',
};
export type LogsItem = {
op: string;
time: string;
operation: number;
target: number;
prev: {
id: number;
info: string;
};
curr: {
id: number;
info: string;
};
};
const transInfo = (num: number, type: string) => {
switch (type) {
case 'operation':
return operationMap[num];
case 'target':
return targetMap[num];
}
};
export default transInfo;