fix: 优化后台列表字段宽度
This commit is contained in:
@@ -25,7 +25,7 @@
|
||||
class="table-fill backup-table"
|
||||
flex-height
|
||||
remote
|
||||
:scroll-x="1180"
|
||||
:scroll-x="1320"
|
||||
:row-key="(r) => r.id"
|
||||
/>
|
||||
<div class="table-pagination">
|
||||
@@ -57,12 +57,13 @@ const statusOptions = ['PENDING', 'PROCESSING', 'SUCCESS', 'FAILED'].map((value)
|
||||
const modeOptions = ['BACKUP', 'RESTORE', 'SCHEDULED', 'AUTO_BEFORE_RESTORE'].map((value) => ({ label: value, value }));
|
||||
|
||||
const columns = computed<DataTableColumns<any>>(() => [
|
||||
{ title: '创建时间', key: 'createdAt', width: 170, render: (row) => fmt(row.createdAt) },
|
||||
{ title: '文件名', key: 'fileName', minWidth: 260, ellipsis: { tooltip: true } },
|
||||
{ title: '创建时间', key: 'createdAt', width: 170, align: 'center', render: (row) => fmt(row.createdAt) },
|
||||
{ title: '文件名', key: 'fileName', minWidth: 360, ellipsis: { tooltip: true } },
|
||||
{
|
||||
title: () => renderFilterTitle('类型', query.mode, modeOptions, (value) => setFilter('mode', value)),
|
||||
key: 'mode',
|
||||
width: 170,
|
||||
align: 'center',
|
||||
},
|
||||
{
|
||||
title: () => renderFilterTitle('状态', query.status, statusOptions, (value) => setFilter('status', value)),
|
||||
@@ -71,8 +72,8 @@ const columns = computed<DataTableColumns<any>>(() => [
|
||||
align: 'center',
|
||||
render: (row) => h(NTag, { size: 'small', type: statusType(row.status) }, { default: () => row.status }),
|
||||
},
|
||||
{ title: '大小', key: 'size', width: 120, render: (row) => formatSize(row.size) },
|
||||
{ title: '错误', key: 'error', minWidth: 240, ellipsis: { tooltip: true }, render: (row) => row.error || '-' },
|
||||
{ title: '大小', key: 'size', width: 120, align: 'center', render: (row) => formatSize(row.size) },
|
||||
{ title: '错误', key: 'error', minWidth: 320, ellipsis: { tooltip: true }, render: (row) => row.error || '-' },
|
||||
{
|
||||
title: '操作',
|
||||
key: 'ops',
|
||||
|
||||
@@ -53,7 +53,7 @@
|
||||
class="table-fill"
|
||||
flex-height
|
||||
remote
|
||||
:scroll-x="1680"
|
||||
:scroll-x="1780"
|
||||
:row-key="(r) => r.id"
|
||||
v-model:checked-row-keys="checkedKeys"
|
||||
/>
|
||||
@@ -301,6 +301,7 @@ const columns = computed<DataTableColumns<any>>(() => {
|
||||
title: () => renderFilterTitle(t('pages.traceCode.batchNo'), query.batchId, batchOptions.value, (value) => setHeaderFilter('batchId', value)),
|
||||
key: 'batch',
|
||||
width: 150,
|
||||
align: 'center',
|
||||
render: (r) => r.batch?.batchNo || '-',
|
||||
},
|
||||
{
|
||||
@@ -309,28 +310,30 @@ const columns = computed<DataTableColumns<any>>(() => {
|
||||
setHeaderFilter('outboundStatus', value),
|
||||
),
|
||||
key: 'outboundStatus',
|
||||
width: 96,
|
||||
width: 124,
|
||||
align: 'center',
|
||||
render: (r) =>
|
||||
r.outTime || r.outImage || getOutImages(r).length
|
||||
? h(NTag, { size: 'small', type: 'success' }, { default: () => t('pages.traceCode.outRegistered') })
|
||||
: h(NText, { depth: 3 }, { default: () => t('pages.traceCode.notOutbound') }),
|
||||
},
|
||||
{ title: () => t('pages.outbound.outTime'), key: 'outTime', width: 150, render: (r) => fmt(r.outTime) },
|
||||
{ title: () => t('pages.outbound.outTime'), key: 'outTime', width: 150, align: 'center', render: (r) => fmt(r.outTime) },
|
||||
{
|
||||
title: () => t('pages.traceCode.onchainStatus'),
|
||||
key: 'onchainStatus',
|
||||
width: 100,
|
||||
width: 112,
|
||||
align: 'center',
|
||||
render: (r) =>
|
||||
r.latestAnyProof
|
||||
? h(NTag, { size: 'small', type: statusType(r.latestAnyProof.status) }, { default: () => t(`common.status.${r.latestAnyProof.status}`) })
|
||||
: h(NText, { depth: 3 }, { default: () => t('pages.traceCode.noOnchain') }),
|
||||
},
|
||||
{ title: () => t('pages.traceCode.shortCode'), key: 'shortCode', width: 120 },
|
||||
{ title: () => t('common.label.createdAt'), key: 'createdAt', width: 150, render: (r) => fmt(r.createdAt) },
|
||||
{ title: () => t('pages.traceCode.shortCode'), key: 'shortCode', width: 120, align: 'center' },
|
||||
{ title: () => t('common.label.createdAt'), key: 'createdAt', width: 150, align: 'center', render: (r) => fmt(r.createdAt) },
|
||||
{
|
||||
title: () => t('pages.traceCode.url'),
|
||||
key: 'url',
|
||||
width: 320,
|
||||
minWidth: 420,
|
||||
ellipsis: { tooltip: true },
|
||||
render: (r) =>
|
||||
h(
|
||||
@@ -343,16 +346,18 @@ const columns = computed<DataTableColumns<any>>(() => {
|
||||
title: () => renderFilterTitle(t('pages.traceCode.group'), query.groupId, groupFilterOptions.value, (value) => setHeaderFilter('groupId', value)),
|
||||
key: 'group',
|
||||
width: 110,
|
||||
align: 'center',
|
||||
render: (r) => r.group?.name || h(NText, { depth: 3 }, { default: () => t('pages.traceCode.noGroup') }),
|
||||
},
|
||||
{
|
||||
title: () => renderFilterTitle(t('common.label.status'), query.status, statusOptions, (value) => setHeaderFilter('status', value)),
|
||||
key: 'status',
|
||||
width: 96,
|
||||
width: 108,
|
||||
align: 'center',
|
||||
render: (r) => h(NTag, { size: 'small', type: statusType(r.status) }, { default: () => t(`common.status.${r.status}`) }),
|
||||
},
|
||||
{ title: () => t('pages.traceCode.queryCount'), key: 'queryCount', width: 84 },
|
||||
{ title: () => t('pages.traceCode.firstActivatedAt'), key: 'firstActivatedAt', width: 150, render: (r) => fmt(r.firstActivatedAt) },
|
||||
{ title: () => t('pages.traceCode.queryCount'), key: 'queryCount', width: 100, align: 'center' },
|
||||
{ title: () => t('pages.traceCode.firstActivatedAt'), key: 'firstActivatedAt', width: 150, align: 'center', render: (r) => fmt(r.firstActivatedAt) },
|
||||
{
|
||||
title: () => t('common.label.operation'),
|
||||
key: 'ops',
|
||||
@@ -384,8 +389,8 @@ const columns = computed<DataTableColumns<any>>(() => {
|
||||
base.splice(
|
||||
4,
|
||||
0,
|
||||
{ title: () => t('pages.artwork.archiveNo'), key: 'archiveNo', width: 130, render: (r) => r.artwork?.archiveNo || '-' },
|
||||
{ title: () => t('pages.artwork.title'), key: 'artwork', width: 130, render: (r) => r.artwork?.title || '-' },
|
||||
{ title: () => t('pages.artwork.archiveNo'), key: 'archiveNo', width: 130, align: 'center', render: (r) => r.artwork?.archiveNo || '-' },
|
||||
{ title: () => t('pages.artwork.title'), key: 'artwork', minWidth: 180, ellipsis: { tooltip: true }, render: (r) => r.artwork?.title || '-' },
|
||||
);
|
||||
}
|
||||
return base;
|
||||
@@ -879,9 +884,8 @@ onUnmounted(() => {
|
||||
min-width: 0;
|
||||
}
|
||||
.filter-title-text {
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
flex: 0 0 auto;
|
||||
}
|
||||
.filter-trigger {
|
||||
flex: 0 0 auto;
|
||||
|
||||
@@ -59,6 +59,9 @@ body,
|
||||
flex: 1 1 auto !important;
|
||||
min-height: 0;
|
||||
}
|
||||
.table-fill .n-data-table-th {
|
||||
white-space: nowrap;
|
||||
}
|
||||
.table-fill .n-data-table-td--fixed-right,
|
||||
.table-fill .n-data-table-th--fixed-right {
|
||||
background-color: var(--n-td-color);
|
||||
@@ -102,9 +105,8 @@ body,
|
||||
min-width: 0;
|
||||
}
|
||||
.filter-title-text {
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
flex: 0 0 auto;
|
||||
}
|
||||
.filter-trigger {
|
||||
flex: 0 0 auto;
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
class="table-fill"
|
||||
flex-height
|
||||
remote
|
||||
:scroll-x="1280"
|
||||
:scroll-x="1360"
|
||||
:row-key="(r) => r.id"
|
||||
/>
|
||||
<div class="table-pagination">
|
||||
@@ -71,6 +71,7 @@ const columns: DataTableColumns<any> = [
|
||||
title: () => t('pages.artwork.images'),
|
||||
key: 'cover',
|
||||
width: 76,
|
||||
align: 'center',
|
||||
render: (r) =>
|
||||
r.images?.[0]?.url
|
||||
? h(NAvatar, {
|
||||
@@ -81,22 +82,24 @@ const columns: DataTableColumns<any> = [
|
||||
})
|
||||
: h(NAvatar, { size: 44, style: 'border-radius:8px' }, { default: () => '—' }),
|
||||
},
|
||||
{ title: () => t('pages.artwork.archiveNo'), key: 'archiveNo', width: 140, render: (r) => r.archiveNo || '-' },
|
||||
{ title: () => t('pages.artwork.title'), key: 'title', width: 200, ellipsis: { tooltip: true } },
|
||||
{ title: () => t('pages.artwork.artist'), key: 'artist', width: 110, render: (r) => r.artist || '-' },
|
||||
{ title: () => t('pages.artwork.template'), key: 'template', width: 120, render: (r) => r.template?.name || '-' },
|
||||
{ title: () => t('pages.artwork.codeCount'), key: 'codeCount', width: 80, render: (r) => r.codeCount ?? 0 },
|
||||
{ title: () => t('pages.artwork.queryTotal'), key: 'queryTotal', width: 90, render: (r) => r.queryTotal ?? 0 },
|
||||
{ title: () => t('pages.artwork.archiveNo'), key: 'archiveNo', width: 140, align: 'center', render: (r) => r.archiveNo || '-' },
|
||||
{ title: () => t('pages.artwork.title'), key: 'title', minWidth: 220, ellipsis: { tooltip: true } },
|
||||
{ title: () => t('pages.artwork.artist'), key: 'artist', minWidth: 130, ellipsis: { tooltip: true }, render: (r) => r.artist || '-' },
|
||||
{ title: () => t('pages.artwork.template'), key: 'template', minWidth: 150, ellipsis: { tooltip: true }, render: (r) => r.template?.name || '-' },
|
||||
{ title: () => t('pages.artwork.codeCount'), key: 'codeCount', width: 100, align: 'center', render: (r) => r.codeCount ?? 0 },
|
||||
{ title: () => t('pages.artwork.queryTotal'), key: 'queryTotal', width: 100, align: 'center', render: (r) => r.queryTotal ?? 0 },
|
||||
{
|
||||
title: () => renderTableFilterTitle(t('common.label.status'), query.status, statusOptions, (value) => setFilter('status', value)),
|
||||
key: 'status',
|
||||
width: 84,
|
||||
width: 96,
|
||||
align: 'center',
|
||||
render: (r) => h(NTag, { type: statusType(r.status), size: 'small' }, { default: () => t(`common.status.${r.status}`) }),
|
||||
},
|
||||
{
|
||||
title: () => renderTableFilterTitle(t('pages.audit.status'), query.auditStatus, auditStatusOptions, (value) => setFilter('auditStatus', value)),
|
||||
key: 'auditStatus',
|
||||
width: 90,
|
||||
width: 124,
|
||||
align: 'center',
|
||||
render: (r) =>
|
||||
h(
|
||||
NTag,
|
||||
@@ -104,7 +107,7 @@ const columns: DataTableColumns<any> = [
|
||||
{ default: () => t(`common.auditStatus.${r.auditStatus || 'PENDING'}`) },
|
||||
),
|
||||
},
|
||||
{ title: () => t('common.label.createdAt'), key: 'createdAt', width: 150, render: (r) => fmt(r.createdAt) },
|
||||
{ title: () => t('common.label.createdAt'), key: 'createdAt', width: 150, align: 'center', render: (r) => fmt(r.createdAt) },
|
||||
{
|
||||
title: () => t('common.label.operation'),
|
||||
key: 'ops',
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
class="table-fill"
|
||||
flex-height
|
||||
remote
|
||||
:scroll-x="1120"
|
||||
:scroll-x="1180"
|
||||
:row-key="(r) => r.id"
|
||||
/>
|
||||
<div class="table-pagination">
|
||||
@@ -85,6 +85,7 @@ const columns: DataTableColumns<any> = [
|
||||
title: () => t('pages.artwork.images'),
|
||||
key: 'cover',
|
||||
width: 70,
|
||||
align: 'center',
|
||||
render: (r) =>
|
||||
r.images?.[0]?.url
|
||||
? h(NAvatar, {
|
||||
@@ -95,16 +96,17 @@ const columns: DataTableColumns<any> = [
|
||||
})
|
||||
: h(NAvatar, { size: 40, style: 'border-radius:8px' }, { default: () => '—' }),
|
||||
},
|
||||
{ title: () => t('pages.artwork.title'), key: 'title', width: 220, ellipsis: { tooltip: true } },
|
||||
{ title: () => t('pages.artwork.artist'), key: 'artist', width: 110, render: (r) => r.artist || '-' },
|
||||
{ title: () => t('pages.artwork.title'), key: 'title', minWidth: 240, ellipsis: { tooltip: true } },
|
||||
{ title: () => t('pages.artwork.artist'), key: 'artist', minWidth: 140, ellipsis: { tooltip: true }, render: (r) => r.artist || '-' },
|
||||
{
|
||||
title: () => renderTableFilterTitle(t('pages.audit.status'), query.auditStatus, auditStatusOptions, (value) => setAuditFilter(value)),
|
||||
key: 'auditStatus',
|
||||
width: 100,
|
||||
width: 130,
|
||||
align: 'center',
|
||||
render: (r) => h(NTag, { size: 'small', type: auditTagType(r.auditStatus) }, { default: () => t(`common.auditStatus.${r.auditStatus}`) }),
|
||||
},
|
||||
{ title: () => t('pages.audit.remark'), key: 'auditRemark', width: 260, ellipsis: { tooltip: true }, render: (r) => r.auditRemark || '-' },
|
||||
{ title: () => t('common.label.updatedAt'), key: 'updatedAt', width: 160, render: (r) => fmt(r.updatedAt) },
|
||||
{ title: () => t('pages.audit.remark'), key: 'auditRemark', minWidth: 280, ellipsis: { tooltip: true }, render: (r) => r.auditRemark || '-' },
|
||||
{ title: () => t('common.label.updatedAt'), key: 'updatedAt', width: 160, align: 'center', render: (r) => fmt(r.updatedAt) },
|
||||
{
|
||||
title: () => t('common.label.operation'),
|
||||
key: 'ops',
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
class="table-fill operation-log-table"
|
||||
flex-height
|
||||
remote
|
||||
:scroll-x="1460"
|
||||
:scroll-x="1860"
|
||||
:row-key="(r) => r.id"
|
||||
/>
|
||||
<div class="table-pagination">
|
||||
@@ -60,33 +60,35 @@ const resultOptions = [
|
||||
];
|
||||
|
||||
const columns = computed<DataTableColumns<any>>(() => [
|
||||
{ title: '时间', key: 'createdAt', width: 170, ellipsis: { tooltip: true }, render: (row) => fmt(row.createdAt) },
|
||||
{ title: '账号', key: 'username', width: 130, ellipsis: { tooltip: true }, render: (row) => row.username || '-' },
|
||||
{ title: '角色', key: 'role', width: 130, ellipsis: { tooltip: true } },
|
||||
{ title: '时间', key: 'createdAt', width: 155, align: 'center', ellipsis: { tooltip: true }, render: (row) => fmt(row.createdAt) },
|
||||
{ title: '账号', key: 'username', width: 120, ellipsis: { tooltip: true }, render: (row) => row.username || '-' },
|
||||
{ title: '角色', key: 'role', width: 130, align: 'center', ellipsis: { tooltip: true } },
|
||||
{
|
||||
title: () => renderFilterTitle('模块', query.module, moduleOptions, (value) => setFilter('module', value)),
|
||||
key: 'module',
|
||||
width: 140,
|
||||
width: 120,
|
||||
align: 'center',
|
||||
ellipsis: { tooltip: true },
|
||||
},
|
||||
{
|
||||
title: () => renderFilterTitle('操作', query.action, actionOptions, (value) => setFilter('action', value)),
|
||||
key: 'action',
|
||||
width: 110,
|
||||
width: 100,
|
||||
align: 'center',
|
||||
ellipsis: { tooltip: true },
|
||||
},
|
||||
{
|
||||
title: () => renderFilterTitle('结果', query.status, resultOptions, (value) => setFilter('status', value)),
|
||||
key: 'status',
|
||||
width: 110,
|
||||
width: 100,
|
||||
align: 'center',
|
||||
render: (row) => h(NTag, { size: 'small', type: statusType(row.status) }, { default: () => row.status }),
|
||||
},
|
||||
{ title: '目标 ID', key: 'targetId', width: 150, ellipsis: { tooltip: true }, render: (row) => row.targetId || '-' },
|
||||
{ title: '路径', key: 'path', width: 260, ellipsis: { tooltip: true } },
|
||||
{ title: 'IP', key: 'ip', width: 150, ellipsis: { tooltip: true } },
|
||||
{ title: '耗时', key: 'durationMs', width: 90, ellipsis: { tooltip: true }, render: (row) => `${row.durationMs || 0}ms` },
|
||||
{ title: '消息', key: 'message', minWidth: 260, ellipsis: { tooltip: true }, render: (row) => row.message || '-' },
|
||||
{ title: '目标 ID', key: 'targetId', minWidth: 180, align: 'center', ellipsis: { tooltip: true }, render: (row) => row.targetId || '-' },
|
||||
{ title: '路径', key: 'path', minWidth: 430, ellipsis: { tooltip: true } },
|
||||
{ title: 'IP', key: 'ip', width: 100, align: 'center', ellipsis: { tooltip: true } },
|
||||
{ title: '耗时', key: 'durationMs', width: 90, align: 'center', ellipsis: { tooltip: true }, render: (row) => `${row.durationMs || 0}ms` },
|
||||
{ title: '消息', key: 'message', minWidth: 420, ellipsis: { tooltip: true }, render: (row) => row.message || '-' },
|
||||
]);
|
||||
|
||||
function renderFilterTitle(label: string, value: string | null, options: { label: string; value: string }[], onSelect: (value: string | null) => void) {
|
||||
|
||||
@@ -66,7 +66,7 @@
|
||||
class="table-fill"
|
||||
flex-height
|
||||
remote
|
||||
:scroll-x="1320"
|
||||
:scroll-x="1480"
|
||||
:row-key="(r) => r.id"
|
||||
/>
|
||||
<div class="table-pagination">
|
||||
@@ -103,7 +103,7 @@ const canCommit = computed(() => session.value?.status === 'READY' && Number(ses
|
||||
const { pagination, page, pageSize, resetPage, setPageResult } = useTablePage(loadRows, 20);
|
||||
|
||||
const columns = computed<DataTableColumns<any>>(() => [
|
||||
{ title: '行号', key: 'rowNo', width: 80 },
|
||||
{ title: '行号', key: 'rowNo', width: 80, align: 'center' },
|
||||
{
|
||||
title: '状态',
|
||||
key: 'status',
|
||||
@@ -111,21 +111,22 @@ const columns = computed<DataTableColumns<any>>(() => [
|
||||
align: 'center',
|
||||
render: (row) => h(NTag, { size: 'small', type: row.status === 'VALID' || row.status === 'IMPORTED' ? 'success' : 'error' }, { default: () => row.status }),
|
||||
},
|
||||
{ title: '追溯短码', key: 'shortCode', width: 150, ellipsis: { tooltip: true } },
|
||||
{ title: '批次编号', key: 'batchNo', width: 180, ellipsis: { tooltip: true } },
|
||||
{ title: '出库时间', key: 'outTime', width: 170, render: (row) => fmt(row.outTime || row.preview?.outTime) },
|
||||
{ title: '追溯短码', key: 'shortCode', minWidth: 150, align: 'center', ellipsis: { tooltip: true } },
|
||||
{ title: '批次编号', key: 'batchNo', minWidth: 180, align: 'center', ellipsis: { tooltip: true } },
|
||||
{ title: '出库时间', key: 'outTime', width: 170, align: 'center', render: (row) => fmt(row.outTime || row.preview?.outTime) },
|
||||
{
|
||||
title: '出库实况图',
|
||||
key: 'images',
|
||||
width: 240,
|
||||
align: 'center',
|
||||
render: (row) => renderImages(row),
|
||||
},
|
||||
{ title: '上链哈希', key: 'txHash', width: 240, ellipsis: { tooltip: true } },
|
||||
{ title: '备注', key: 'remark', width: 180, ellipsis: { tooltip: true } },
|
||||
{ title: '上链哈希', key: 'txHash', minWidth: 260, ellipsis: { tooltip: true } },
|
||||
{ title: '备注', key: 'remark', minWidth: 220, ellipsis: { tooltip: true } },
|
||||
{
|
||||
title: '错误原因',
|
||||
key: 'reason',
|
||||
minWidth: 260,
|
||||
minWidth: 300,
|
||||
ellipsis: { tooltip: true },
|
||||
render: (row) => row.reason || h(NText, { depth: 3 }, { default: () => '-' }),
|
||||
},
|
||||
|
||||
@@ -43,7 +43,7 @@
|
||||
class="table-fill"
|
||||
flex-height
|
||||
remote
|
||||
:scroll-x="1320"
|
||||
:scroll-x="1420"
|
||||
:row-key="(r) => r.id"
|
||||
/>
|
||||
<div class="table-pagination">
|
||||
@@ -78,32 +78,35 @@ const { pagination, page, pageSize, resetPage, setPageResult } = useTablePage(lo
|
||||
const resultOptions = Object.values(QueryResult).map((v) => ({ label: t(`common.queryResult.${v}`), value: v }));
|
||||
|
||||
const columns: DataTableColumns<any> = [
|
||||
{ title: () => t('pages.traceCode.shortCode'), key: 'shortCode', width: 120, ellipsis: { tooltip: true }, render: (r) => r.shortCode || '-' },
|
||||
{ title: () => t('pages.artwork.archiveNo'), key: 'archiveNo', width: 140, ellipsis: { tooltip: true }, render: (r) => r.archiveNo || '-' },
|
||||
{ title: () => t('pages.traceCode.batchNo'), key: 'batchNo', width: 130, ellipsis: { tooltip: true }, render: (r) => r.batchNo || '-' },
|
||||
{ title: () => t('pages.traceCode.shortCode'), key: 'shortCode', width: 130, align: 'center', ellipsis: { tooltip: true }, render: (r) => r.shortCode || '-' },
|
||||
{ title: () => t('pages.artwork.archiveNo'), key: 'archiveNo', width: 150, align: 'center', ellipsis: { tooltip: true }, render: (r) => r.archiveNo || '-' },
|
||||
{ title: () => t('pages.traceCode.batchNo'), key: 'batchNo', width: 140, align: 'center', ellipsis: { tooltip: true }, render: (r) => r.batchNo || '-' },
|
||||
{
|
||||
title: () => renderTableFilterTitle(t('pages.queryLog.result'), query.result, resultOptions, (value) => setResultFilter(value)),
|
||||
key: 'queryResult',
|
||||
width: 104,
|
||||
width: 124,
|
||||
align: 'center',
|
||||
render: (r) => h(NTag, { size: 'small', type: statusType(r.queryResult) }, { default: () => t(`common.queryResult.${r.queryResult}`) }),
|
||||
},
|
||||
{ title: () => t('pages.traceCode.queryCount'), key: 'queryCount', width: 90, render: (r) => (r.queryCount ?? '-') },
|
||||
{ title: () => t('pages.traceCode.firstActivatedAt'), key: 'firstActivatedAt', width: 160, render: (r) => fmt(r.firstActivatedAt) },
|
||||
{ title: () => t('pages.traceCode.queryCount'), key: 'queryCount', width: 100, align: 'center', render: (r) => (r.queryCount ?? '-') },
|
||||
{ title: () => t('pages.traceCode.firstActivatedAt'), key: 'firstActivatedAt', width: 160, align: 'center', render: (r) => fmt(r.firstActivatedAt) },
|
||||
{
|
||||
title: () => t('pages.queryLog.ip'),
|
||||
key: 'ip',
|
||||
width: 160,
|
||||
align: 'center',
|
||||
ellipsis: { tooltip: true },
|
||||
render: (r) => r.ip || '-',
|
||||
},
|
||||
{
|
||||
title: () => t('pages.queryLog.device'),
|
||||
key: 'deviceType',
|
||||
width: 150,
|
||||
minWidth: 180,
|
||||
align: 'center',
|
||||
ellipsis: { tooltip: true },
|
||||
render: (r) => [r.deviceType, r.os, r.browser].filter(Boolean).join(' / ') || '-',
|
||||
},
|
||||
{ title: () => t('pages.queryLog.queriedAt'), key: 'queriedAt', width: 160, render: (r) => fmt(r.queriedAt) },
|
||||
{ title: () => t('pages.queryLog.queriedAt'), key: 'queriedAt', width: 160, align: 'center', render: (r) => fmt(r.queriedAt) },
|
||||
];
|
||||
|
||||
async function load() {
|
||||
|
||||
@@ -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',
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
class="table-fill"
|
||||
flex-height
|
||||
remote
|
||||
:scroll-x="980"
|
||||
:scroll-x="1040"
|
||||
:row-key="(r) => r.id"
|
||||
/>
|
||||
<div class="table-pagination">
|
||||
@@ -101,22 +101,24 @@ const newPwd = ref('');
|
||||
const pwdUserId = ref<number | null>(null);
|
||||
|
||||
const columns: DataTableColumns<any> = [
|
||||
{ title: 'ID', key: 'id', width: 64 },
|
||||
{ title: () => t('pages.user.username'), key: 'username', width: 160, ellipsis: { tooltip: true } },
|
||||
{ title: () => t('pages.user.realName'), key: 'realName', width: 160, ellipsis: { tooltip: true }, render: (r) => r.realName || '-' },
|
||||
{ title: 'ID', key: 'id', width: 64, align: 'center' },
|
||||
{ title: () => t('pages.user.username'), key: 'username', minWidth: 180, ellipsis: { tooltip: true } },
|
||||
{ title: () => t('pages.user.realName'), key: 'realName', minWidth: 180, ellipsis: { tooltip: true }, render: (r) => r.realName || '-' },
|
||||
{
|
||||
title: () => renderTableFilterTitle(t('pages.user.role'), query.role, roleOptions, (value) => setFilter('role', value)),
|
||||
key: 'role',
|
||||
width: 120,
|
||||
align: 'center',
|
||||
render: (r) => t(`common.role.${r.role}`),
|
||||
},
|
||||
{
|
||||
title: () => renderTableFilterTitle(t('common.label.status'), query.status, statusOptions, (value) => setFilter('status', value)),
|
||||
key: 'status',
|
||||
width: 90,
|
||||
width: 96,
|
||||
align: 'center',
|
||||
render: (r) => h(NTag, { size: 'small', type: statusType(r.status) }, { default: () => t(`common.status.${r.status}`) }),
|
||||
},
|
||||
{ title: () => t('pages.user.lastLoginAt'), key: 'lastLoginAt', width: 160, render: (r) => fmt(r.lastLoginAt) },
|
||||
{ title: () => t('pages.user.lastLoginAt'), key: 'lastLoginAt', width: 160, align: 'center', render: (r) => fmt(r.lastLoginAt) },
|
||||
{
|
||||
title: () => t('common.label.operation'),
|
||||
key: 'ops',
|
||||
|
||||
Reference in New Issue
Block a user