Commit 9263f8d7 authored by Data Governance Dev's avatar Data Governance Dev

fix(web3): 空数据时隐藏结果表「备注」列

无任务 / 选了任务但跑出 0 条不合规行 / 用户还没点「查询」时,
rows=[],「备注」列还是会被 allColumns 自动追加,整张表只有一列「备注」
加占位符「—」,看起来很怪。

allColumns 计算属性改成 rows.length > 0 才追加「备注」列。
rows 为空时整张表只渲染业务列 + 「暂无数据」占位。

Vite HMR 自动生效,不用重启。
parent 135fef49
......@@ -149,10 +149,14 @@ const emit = defineEmits(['page-change'])
// 业务列 + 自动追加的「备注」列
// 任务配置里「默认展示」未勾选的列(showDefault === false)→ 不进结果表
// 兜底:`showDefault !== false` —— 未传 showDefault 的列(mock / 老调用方)全部展示,向后兼容
const allColumns = computed(() => [
...props.columns.filter((c) => c.showDefault !== false),
{ key: '__reason', cn: '备注' },
])
// rows 为空时(无任务 / 查询 0 行)也不追加备注列 —— 没数据时备注列只会显示「—」占位,没意义
const allColumns = computed(() => {
const cols = props.columns.filter((c) => c.showDefault !== false)
if (props.rows.length > 0) {
cols.push({ key: '__reason', cn: '备注' })
}
return cols
})
// ── 分页状态(组件内自治) ──
const currentPage = ref(1)
......
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