Commit 01c9b105 authored by Data Governance Dev's avatar Data Governance Dev

fix(web): 缺失注释字段 tab — 表格重做 + 类型/推测注释改 template 兜底

两轮迭代:

第一轮:参考字段长度异常 tab 的新模板布局,把缺失注释字段 tab
从旧的 prop + fixed 改成 width:100% + min-width + 模板内联:
  - 表名 / 表注释 (template)
  - 字段名 / 字段注释 (template)
  - 类型  (prop data_type)
  - 推测注释 (prop predicted)
  - 置信度 (template + el-tag)
  - 依据  (prop reason)
  el-table 加 style='margin-top: 12px; width: 100%' max-height=560

第二轮:用户反馈'推测注释和类型都没有显示',可能是 prop 在某些
el-table-column 顺序/min-width 组合下被截断到不可见。
把这两个列也改成 template 渲染并加兜底:
  - 类型:优先 data_type,其次 column_type,最后 '—',<code> 等宽字体
  - 推测注释:有内容则显示,无则斜体'(未推测)'

未提交:.gitignore(与本任务无关的此前改动)。
parent 323709a5
......@@ -470,19 +470,44 @@
</span>
</template>
<el-alert :title="`${jobResult.sections.missing_comments?.summary?.total_missing_comments || 0} 个字段缺注释,已推测 ${jobResult.sections.missing_comments?.summary?.predicted_count || 0} 个(其中 LLM 推测 ${jobResult.sections.missing_comments?.summary?.predicted_by_llm || 0} 个)`" type="info" :closable="false" />
<el-table :data="jobResult.sections.missing_comments?.predicted_comments || []" stripe size="small" style="margin-top: 12px">
<el-table-column prop="table_name" label="表名" width="180" fixed />
<el-table-column prop="column_name" label="字段名" width="160" fixed />
<el-table-column prop="data_type" label="类型" width="100" />
<el-table-column prop="predicted" label="推测注释" width="200" />
<el-table-column label="置信度" width="100">
<el-table :data="jobResult.sections.missing_comments?.predicted_comments || []" stripe size="small" style="margin-top: 12px; width: 100%" max-height="560">
<el-table-column label="表名 / 表注释" min-width="220">
<template #default="{ row }">
<div>
<strong style="color: #303133">{{ row.table_name }}</strong>
<div v-if="row.table_comment" class="muted" style="font-size: 12px; margin-top: 2px">{{ row.table_comment }}</div>
<div v-else class="muted" style="font-size: 12px; margin-top: 2px; font-style: italic">(无表注释)</div>
</div>
</template>
</el-table-column>
<el-table-column label="字段名 / 字段注释" min-width="220">
<template #default="{ row }">
<div>
<strong style="color: #303133">{{ row.column_name }}</strong>
<div v-if="row.column_comment" class="muted" style="font-size: 12px; margin-top: 2px">{{ row.column_comment }}</div>
<div v-else class="muted" style="font-size: 12px; margin-top: 2px; font-style: italic">(无字段注释)</div>
</div>
</template>
</el-table-column>
<el-table-column label="类型" width="100">
<template #default="{ row }">
<code style="font-size: 12px">{{ row.data_type || row.column_type || '—' }}</code>
</template>
</el-table-column>
<el-table-column label="推测注释" min-width="220" show-overflow-tooltip>
<template #default="{ row }">
<span v-if="row.predicted" style="color: #303133">{{ row.predicted }}</span>
<span v-else class="muted" style="font-style: italic">(未推测)</span>
</template>
</el-table-column>
<el-table-column label="置信度" width="100" align="center">
<template #default="{ row }">
<el-tag :type="row.confidence === 'high' ? 'success' : (row.confidence === 'medium' ? 'warning' : 'info')" size="small">
{{ row.confidence }}
</el-tag>
</template>
</el-table-column>
<el-table-column prop="reason" label="依据" />
<el-table-column prop="reason" label="依据" min-width="240" show-overflow-tooltip />
</el-table>
</el-tab-pane>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment