fix: 优化后台体验与导出日志交互
This commit is contained in:
@@ -29,6 +29,7 @@
|
||||
remote
|
||||
:scroll-x="1400"
|
||||
:row-key="(r) => r.id"
|
||||
@update:sorter="onSorterChange"
|
||||
/>
|
||||
<div class="table-pagination">
|
||||
<n-pagination v-bind="pagination" :disabled="loading" />
|
||||
@@ -50,6 +51,7 @@ import { useTablePage } from '@/composables/useTablePage';
|
||||
import { dialog, message } from '@/utils/feedback';
|
||||
import { renderTableFilterTitle } from '@/utils/tableFilter';
|
||||
import { openMediaViewer } from '@/composables/openMediaViewer';
|
||||
import { useRemoteSort } from '@/utils/tableSort';
|
||||
|
||||
const { t } = useI18n();
|
||||
const router = useRouter();
|
||||
@@ -63,6 +65,7 @@ const query = reactive<{ keyword: string; status: string | null; auditStatus: st
|
||||
auditStatus: null,
|
||||
});
|
||||
const { pagination, page, pageSize, resetPage, setPageResult } = useTablePage(load);
|
||||
const { sortProps, onSorterChange, sortParams } = useRemoteSort(onSearch);
|
||||
const statusOptions = Object.values(ArtworkStatus).map((v) => ({ label: t(`common.status.${v}`), value: v }));
|
||||
const auditStatusOptions = Object.values(AuditStatus).map((v) => ({ label: t(`common.auditStatus.${v}`), value: v }));
|
||||
|
||||
@@ -82,7 +85,19 @@ const columns: DataTableColumns<any> = [
|
||||
})
|
||||
: h(NAvatar, { size: 44, style: 'border-radius:8px' }, { default: () => '—' }),
|
||||
},
|
||||
{ title: () => t('pages.artwork.archiveNo'), key: 'archiveNo', width: 170, align: 'center', ellipsis: { tooltip: true }, render: (r) => r.archiveNo || '-' },
|
||||
{
|
||||
title: () => t('pages.artwork.archiveNo'),
|
||||
key: 'archiveNo',
|
||||
width: 170,
|
||||
align: 'center',
|
||||
ellipsis: { tooltip: true },
|
||||
render: (r) =>
|
||||
h(
|
||||
NButton,
|
||||
{ text: true, type: 'primary', title: t('pages.artwork.traceCodeManage'), onClick: () => router.push(`/artworks/${r.id}/trace-codes`) },
|
||||
{ default: () => 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 || '-' },
|
||||
@@ -107,7 +122,7 @@ const columns: DataTableColumns<any> = [
|
||||
{ default: () => t(`common.auditStatus.${r.auditStatus || 'PENDING'}`) },
|
||||
),
|
||||
},
|
||||
{ title: () => t('common.label.createdAt'), key: 'createdAt', width: 150, align: 'center', ellipsis: { tooltip: true }, render: (r) => fmt(r.createdAt) },
|
||||
{ title: () => t('common.label.createdAt'), key: 'createdAt', width: 150, align: 'center', ellipsis: { tooltip: true }, render: (r) => fmt(r.createdAt), ...sortProps('createdAt') },
|
||||
{
|
||||
title: () => t('common.label.operation'),
|
||||
key: 'ops',
|
||||
@@ -166,6 +181,7 @@ async function load() {
|
||||
auditStatus: query.auditStatus || undefined,
|
||||
page: page.value,
|
||||
pageSize: pageSize.value,
|
||||
...sortParams(),
|
||||
});
|
||||
rows.value = res.list;
|
||||
setPageResult(res);
|
||||
|
||||
Reference in New Issue
Block a user