From e27e7d1991ffe75f9c968012f905076416a8b66a Mon Sep 17 00:00:00 2001 From: xingyu4j Date: Wed, 18 Dec 2024 15:35:33 +0800 Subject: [PATCH] feat: add export --- apps/web-antd/src/views/system/post/index.vue | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/apps/web-antd/src/views/system/post/index.vue b/apps/web-antd/src/views/system/post/index.vue index 5386ee54..9ec7700a 100644 --- a/apps/web-antd/src/views/system/post/index.vue +++ b/apps/web-antd/src/views/system/post/index.vue @@ -15,6 +15,7 @@ import { type PostVO, } from '#/api/system/post'; import { ActionButtons, IconEnum } from '#/components/action-buttons'; +import { downloadByData } from '#/utils/file/download'; import { columns, formSchema } from './post.data'; import PostForm from './post-form.vue'; @@ -74,7 +75,8 @@ async function handleDelete(id: number) { } // TODO async function handleExport() { - await exportPost(tableApi.formApi.form.values); + const res = await exportPost(tableApi.formApi.form.values); + downloadByData(res.data, '导出岗位.xls'); } @@ -93,8 +95,6 @@ async function handleExport() { }, { label: $t('page.action.export'), - class: - 'bg-green-500 text-white border-green-400 hover:bg-green-400 hover:!text-white hover:!border-green-400 active:!bg-green-600 active:!text-white active:!border-green-600', icon: IconEnum.EXPORT, auth: ['system:post:export'], onClick: handleExport.bind(null),