fix: 详情页状态显示中文
This commit is contained in:
@@ -631,8 +631,9 @@ async function loadDeliveryPointCounts() {
|
||||
);
|
||||
}
|
||||
|
||||
// 将通用实体状态转换为面向用户的中文说明,并保留未知原值便于排查。
|
||||
function recordStatusLabel(status: number) {
|
||||
return { 0: '待审核', 1: '启用', 2: '停用', 3: '已归档', 4: '已冻结' }[status] ?? '未知';
|
||||
return { 0: '待审核', 1: '启用', 2: '停用', 3: '已归档', 4: '已冻结' }[status] ?? `未知(${status})`;
|
||||
}
|
||||
|
||||
function recordStatusColor(status: number) {
|
||||
@@ -1105,7 +1106,8 @@ function displayValue(key: string, value: unknown) {
|
||||
const date = dayjs(String((value as { Time?: unknown }).Time ?? ''));
|
||||
return date.isValid() ? date.format('YYYY-MM-DD HH:mm:ss') : '-';
|
||||
}
|
||||
if (props.definition.name === 'gas_basic' && key === 'status') {
|
||||
// 所有资源详情中的标准状态字段均使用统一中文文案。
|
||||
if (key === 'status') {
|
||||
return recordStatusLabel(Number(value));
|
||||
}
|
||||
if (
|
||||
|
||||
Reference in New Issue
Block a user