fix: 优化后台体验与导出日志交互
This commit is contained in:
@@ -24,6 +24,7 @@
|
||||
remote
|
||||
:scroll-x="1180"
|
||||
:row-key="(r) => r.id"
|
||||
@update:sorter="onSorterChange"
|
||||
/>
|
||||
<div class="table-pagination">
|
||||
<n-pagination v-bind="pagination" :disabled="loading" />
|
||||
@@ -58,6 +59,7 @@ import { fmt } from '@/utils/format';
|
||||
import { useTablePage } from '@/composables/useTablePage';
|
||||
import { renderTableFilterTitle } from '@/utils/tableFilter';
|
||||
import { openMediaViewer } from '@/composables/openMediaViewer';
|
||||
import { useRemoteSort } from '@/utils/tableSort';
|
||||
|
||||
const { t } = useI18n();
|
||||
const router = useRouter();
|
||||
@@ -70,6 +72,7 @@ const query = reactive<{ keyword: string; auditStatus: string | null }>({
|
||||
auditStatus: AuditStatus.PENDING,
|
||||
});
|
||||
const { pagination, page, pageSize, resetPage, setPageResult } = useTablePage(load);
|
||||
const { sortProps, onSorterChange, sortParams } = useRemoteSort(onSearch);
|
||||
const auditStatusOptions = Object.values(AuditStatus).map((v) => ({ label: t(`common.auditStatus.${v}`), value: v }));
|
||||
|
||||
function auditTagType(s: string) {
|
||||
@@ -106,7 +109,7 @@ const columns: DataTableColumns<any> = [
|
||||
render: (r) => h(NTag, { size: 'small', type: auditTagType(r.auditStatus) }, { default: () => t(`common.auditStatus.${r.auditStatus}`) }),
|
||||
},
|
||||
{ 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.updatedAt'), key: 'updatedAt', width: 160, align: 'center', render: (r) => fmt(r.updatedAt), ...sortProps('updatedAt') },
|
||||
{
|
||||
title: () => t('common.label.operation'),
|
||||
key: 'ops',
|
||||
@@ -130,6 +133,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