fix: 优化后台列表字段宽度

This commit is contained in:
Nixevol
2026-07-04 22:32:46 +08:00
parent 2333033b19
commit f493dc061d
11 changed files with 103 additions and 79 deletions
+8 -7
View File
@@ -27,7 +27,7 @@
class="table-fill"
flex-height
remote
:scroll-x="1080"
:scroll-x="1120"
:row-key="(r) => r.id"
/>
<div class="table-pagination">
@@ -131,23 +131,24 @@ const form = reactive<{ name: string; remark: string; status: string; fields: an
const rules: FormRules = { name: { required: true, message: () => t('pages.template.namePlaceholder'), trigger: 'blur' } };
const columns: DataTableColumns<any> = [
{ title: 'ID', key: 'id', width: 70 },
{ title: () => t('pages.template.name'), key: 'name', width: 180, ellipsis: { tooltip: true } },
{ title: 'ID', key: 'id', width: 70, align: 'center' },
{ title: () => t('pages.template.name'), key: 'name', minWidth: 220, ellipsis: { tooltip: true } },
{
title: () => t('pages.template.fields'),
key: 'fields',
width: 340,
minWidth: 380,
ellipsis: { tooltip: true },
render: (r) => (r.fields || []).map((f: any) => f.label).join('、') || '-',
},
{
title: () => renderTableFilterTitle(t('common.label.status'), query.status, statusOptions, (value) => setStatusFilter(value)),
key: 'status',
width: 90,
width: 96,
align: 'center',
render: (r) => h(NTag, { type: statusType(r.status), size: 'small' }, { default: () => t(`common.status.${r.status}`) }),
},
{ title: () => t('pages.template.useCount'), key: 'useCount', width: 100, render: (r) => r._count?.artworks ?? 0 },
{ title: () => t('common.label.createdAt'), key: 'createdAt', width: 160, render: (r) => fmt(r.createdAt) },
{ title: () => t('pages.template.useCount'), key: 'useCount', width: 100, align: 'center', render: (r) => r._count?.artworks ?? 0 },
{ title: () => t('common.label.createdAt'), key: 'createdAt', width: 160, align: 'center', render: (r) => fmt(r.createdAt) },
{
title: () => t('common.label.operation'),
key: 'ops',