|
|
@@ -601,7 +601,8 @@ export class DisabledPersonService extends GenericCrudService<DisabledPerson> {
|
|
|
// 转换结果格式 - 注意:PostgreSQL列名是小写的
|
|
|
const data = rawResults.map((row) => {
|
|
|
const workStatus = row.workstatus as WorkStatus | undefined;
|
|
|
- const workStatusLabel = workStatus ? workStatusLabelMap[workStatus] : '未知状态';
|
|
|
+ // 使用 nullish coalescing 确保无效状态返回 '未知状态'
|
|
|
+ const workStatusLabel = workStatus !== undefined ? (workStatusLabelMap[workStatus] ?? '未知状态') : '未知状态';
|
|
|
|
|
|
return {
|
|
|
personId: row.personid,
|
|
|
@@ -681,7 +682,8 @@ export class DisabledPersonService extends GenericCrudService<DisabledPerson> {
|
|
|
|
|
|
// 确定工作状态
|
|
|
const workStatus = latestOrderPerson?.workStatus as WorkStatus | undefined;
|
|
|
- const workStatusLabel = workStatus ? workStatusLabelMap[workStatus] : '未知状态';
|
|
|
+ // 使用 nullish coalescing 确保无效状态返回 '未知状态'
|
|
|
+ const workStatusLabel = workStatus !== undefined ? (workStatusLabelMap[workStatus] ?? '未知状态') : '未知状态';
|
|
|
|
|
|
return {
|
|
|
personId: person.id,
|