yxh
2026-10-03 d553a4be94d4f6ee162cc353a28b220403909cfc
src/views/ecg/doctor/DevDataEntry.vue
@@ -1,5 +1,6 @@
<template>
    <el-form
      class="patient-compact-form"
      ref="formRef"
      :model="formData"
      :rules="formRules"
@@ -328,7 +329,16 @@
}
const getSelectedRent = async (rentId) => {
  formData.value = await DevRentApi.getDevRent(rentId)
  // ⚠️ 原实现是整体替换 formData,会把患者信息冲成 null(详见 DevReadyPanel 中同类修复的说明)
  const _record = await DevRentApi.getDevRent(rentId)
  if (_record) {
    const _merged = { ...formData.value } as Record<string, any>
    Object.keys(_record as Record<string, any>).forEach((k) => {
      const v = (_record as Record<string, any>)[k]
      if (v !== null && v !== undefined && v !== '') _merged[k] = v
    })
    formData.value = _merged as typeof formData.value
  }
}
/** 初始化 **/
@@ -338,3 +348,16 @@
})
</script>
<style scoped lang="scss">
/* ==========================================================================
   需求:表单内容挤占了下方记录表格的空间 —— 压缩行间距。
   Element Plus 默认 `.el-form-item { margin-bottom: 18px }`;
   本页表单含 18 项患者信息(4 列 = 5 行)+ 9 项设备信息,
   仅间距就要上百 px,把 el-table 挤到看不见。
   这里统一压到 4px。注意 :deep 是必需的(el-form-item 是本组件的子组件渲染)。
   ========================================================================== */
.patient-compact-form :deep(.el-form-item) {
  margin-bottom: 4px;
}
</style>