diff --git a/src/views/system/notice/index.vue b/src/views/system/notice/index.vue index 89ace102..69939956 100644 --- a/src/views/system/notice/index.vue +++ b/src/views/system/notice/index.vue @@ -3,7 +3,6 @@ import { NDivider } from 'naive-ui'; import { fetchBatchDeleteNotice, fetchGetNoticeList } from '@/service/api/system/notice'; import { useAppStore } from '@/store/modules/app'; import { useAuth } from '@/hooks/business/auth'; -import { useDownload } from '@/hooks/business/download'; import { useTable, useTableOperate } from '@/hooks/common/table'; import { useDict } from '@/hooks/business/dict'; import { $t } from '@/locales'; @@ -19,7 +18,6 @@ defineOptions({ useDict('sys_notice_type'); useDict('sys_normal_disable'); const appStore = useAppStore(); -const { download } = useDownload(); const { hasAuth } = useAuth(); const { @@ -160,10 +158,6 @@ async function handleDelete(noticeId: CommonType.IdType) { async function edit(noticeId: CommonType.IdType) { handleEdit('noticeId', noticeId); } - -async function handleExport() { - download('/system/notice/export', searchParams, `通知公告_${new Date().getTime()}.xlsx`); -} diff --git a/src/views/system/user/index.vue b/src/views/system/user/index.vue index 835f885e..33465c0a 100644 --- a/src/views/system/user/index.vue +++ b/src/views/system/user/index.vue @@ -7,6 +7,7 @@ import { useAppStore } from '@/store/modules/app'; import { useTable, useTableOperate } from '@/hooks/common/table'; import { useDict } from '@/hooks/business/dict'; import { useAuth } from '@/hooks/business/auth'; +import { useDownload } from '@/hooks/business/download'; import ButtonIcon from '@/components/custom/button-icon.vue'; import { $t } from '@/locales'; import StatusSwitch from '@/components/custom/status-switch.vue'; @@ -22,6 +23,7 @@ useDict('sys_user_sex'); const { hasAuth } = useAuth(); const appStore = useAppStore(); +const { download } = useDownload(); const { bool: importVisible, setTrue: openImportModal } = useBoolean(); @@ -236,6 +238,10 @@ async function handleStatusChange( getData(); } } + +function handleExport() { + download('/system/user/export', searchParams, `用户列表_${new Date().getTime()}.xlsx`); +}