This commit is contained in:
Your Name
2026-04-18 11:42:39 +08:00
parent b6e98d6c95
commit fa3da15228
@@ -38,17 +38,17 @@
<el-table-column prop="record_time" label="记录时间" width="100" />
<el-table-column label="空腹血糖(mmol/L)" width="120">
<template #default="{ row }">
{{ row.fasting_blood_sugar || '-' }}
{{ formatBloodGlucoseCell(row.fasting_blood_sugar) }}
</template>
</el-table-column>
<el-table-column label="餐后2小时血糖(mmol/L)" width="150">
<template #default="{ row }">
{{ row.postprandial_blood_sugar || '-' }}
{{ formatBloodGlucoseCell(row.postprandial_blood_sugar) }}
</template>
</el-table-column>
<el-table-column label="其他血糖(mmol/L)" width="120">
<template #default="{ row }">
{{ row.other_blood_sugar || '-' }}
{{ formatBloodGlucoseCell(row.other_blood_sugar) }}
</template>
</el-table-column>
<el-table-column label="血压(mmHg)" width="150">
@@ -221,6 +221,14 @@ const recordForm = ref({
remark: ''
})
/** 列表展示:空值或 0 / 0.00(含字符串)统一显示为 - */
function formatBloodGlucoseCell(v: unknown): string {
if (v === null || v === undefined || v === '') return '-'
const n = Number(String(v).trim())
if (!Number.isFinite(n) || n === 0) return '-'
return String(n.toFixed(2).replace(/\.?0+$/, ''))
}
const loadTrendData = async () => {
if (!props.diagnosisId && !props.patientId) {
return