fix: 修复列表导出问题
This commit is contained in:
parent
873424e65a
commit
d337b36951
@ -3,7 +3,6 @@ import { NDivider } from 'naive-ui';
|
|||||||
import { fetchBatchDeleteNotice, fetchGetNoticeList } from '@/service/api/system/notice';
|
import { fetchBatchDeleteNotice, fetchGetNoticeList } from '@/service/api/system/notice';
|
||||||
import { useAppStore } from '@/store/modules/app';
|
import { useAppStore } from '@/store/modules/app';
|
||||||
import { useAuth } from '@/hooks/business/auth';
|
import { useAuth } from '@/hooks/business/auth';
|
||||||
import { useDownload } from '@/hooks/business/download';
|
|
||||||
import { useTable, useTableOperate } from '@/hooks/common/table';
|
import { useTable, useTableOperate } from '@/hooks/common/table';
|
||||||
import { useDict } from '@/hooks/business/dict';
|
import { useDict } from '@/hooks/business/dict';
|
||||||
import { $t } from '@/locales';
|
import { $t } from '@/locales';
|
||||||
@ -19,7 +18,6 @@ defineOptions({
|
|||||||
useDict('sys_notice_type');
|
useDict('sys_notice_type');
|
||||||
useDict('sys_normal_disable');
|
useDict('sys_normal_disable');
|
||||||
const appStore = useAppStore();
|
const appStore = useAppStore();
|
||||||
const { download } = useDownload();
|
|
||||||
const { hasAuth } = useAuth();
|
const { hasAuth } = useAuth();
|
||||||
|
|
||||||
const {
|
const {
|
||||||
@ -160,10 +158,6 @@ async function handleDelete(noticeId: CommonType.IdType) {
|
|||||||
async function edit(noticeId: CommonType.IdType) {
|
async function edit(noticeId: CommonType.IdType) {
|
||||||
handleEdit('noticeId', noticeId);
|
handleEdit('noticeId', noticeId);
|
||||||
}
|
}
|
||||||
|
|
||||||
async function handleExport() {
|
|
||||||
download('/system/notice/export', searchParams, `通知公告_${new Date().getTime()}.xlsx`);
|
|
||||||
}
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
@ -177,10 +171,9 @@ async function handleExport() {
|
|||||||
:loading="loading"
|
:loading="loading"
|
||||||
:show-add="hasAuth('system:notice:add')"
|
:show-add="hasAuth('system:notice:add')"
|
||||||
:show-delete="hasAuth('system:notice:remove')"
|
:show-delete="hasAuth('system:notice:remove')"
|
||||||
:show-export="hasAuth('system:notice:export')"
|
:show-export="false"
|
||||||
@add="handleAdd"
|
@add="handleAdd"
|
||||||
@delete="handleBatchDelete"
|
@delete="handleBatchDelete"
|
||||||
@export="handleExport"
|
|
||||||
@refresh="getData"
|
@refresh="getData"
|
||||||
/>
|
/>
|
||||||
</template>
|
</template>
|
||||||
|
@ -7,6 +7,7 @@ import { useAppStore } from '@/store/modules/app';
|
|||||||
import { useTable, useTableOperate } from '@/hooks/common/table';
|
import { useTable, useTableOperate } from '@/hooks/common/table';
|
||||||
import { useDict } from '@/hooks/business/dict';
|
import { useDict } from '@/hooks/business/dict';
|
||||||
import { useAuth } from '@/hooks/business/auth';
|
import { useAuth } from '@/hooks/business/auth';
|
||||||
|
import { useDownload } from '@/hooks/business/download';
|
||||||
import ButtonIcon from '@/components/custom/button-icon.vue';
|
import ButtonIcon from '@/components/custom/button-icon.vue';
|
||||||
import { $t } from '@/locales';
|
import { $t } from '@/locales';
|
||||||
import StatusSwitch from '@/components/custom/status-switch.vue';
|
import StatusSwitch from '@/components/custom/status-switch.vue';
|
||||||
@ -22,6 +23,7 @@ useDict('sys_user_sex');
|
|||||||
|
|
||||||
const { hasAuth } = useAuth();
|
const { hasAuth } = useAuth();
|
||||||
const appStore = useAppStore();
|
const appStore = useAppStore();
|
||||||
|
const { download } = useDownload();
|
||||||
|
|
||||||
const { bool: importVisible, setTrue: openImportModal } = useBoolean();
|
const { bool: importVisible, setTrue: openImportModal } = useBoolean();
|
||||||
|
|
||||||
@ -236,6 +238,10 @@ async function handleStatusChange(
|
|||||||
getData();
|
getData();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function handleExport() {
|
||||||
|
download('/system/user/export', searchParams, `用户列表_${new Date().getTime()}.xlsx`);
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
@ -283,6 +289,7 @@ async function handleStatusChange(
|
|||||||
:show-export="hasAuth('system:user:export')"
|
:show-export="hasAuth('system:user:export')"
|
||||||
@add="handleAdd"
|
@add="handleAdd"
|
||||||
@delete="handleBatchDelete"
|
@delete="handleBatchDelete"
|
||||||
|
@export="handleExport"
|
||||||
@refresh="getData"
|
@refresh="getData"
|
||||||
>
|
>
|
||||||
<template #after>
|
<template #after>
|
||||||
|
Loading…
Reference in New Issue
Block a user