feat: export

This commit is contained in:
xingyu4j
2022-11-15 14:51:39 +08:00
parent 9794d1cfd7
commit 4065387b54
4 changed files with 27 additions and 27 deletions

View File

@ -84,16 +84,16 @@ import { FormExpose } from '@/components/Form'
// 业务相关的 import
import * as PostApi from '@/api/system/post'
import { rules, allSchemas } from './post.data'
import download from '@/utils/download'
const { t } = useI18n() // 国际化
const message = useMessage() // 消息弹窗
// 列表相关的变量
const xGrid = ref<VxeGridInstance>() // 列表 Grid Ref
const { gridOptions, reloadList, delList, getSearchData } = useVxeGrid<PostApi.PostVO>({
const { gridOptions, reloadList, delList, exportList } = useVxeGrid<PostApi.PostVO>({
allSchemas: allSchemas,
getListApi: PostApi.getPostPageApi,
delListApi: PostApi.deletePostApi
delListApi: PostApi.deletePostApi,
exportListApi: PostApi.exportPostApi
})
// 弹窗相关的变量
const dialogVisible = ref(false) // 是否显示弹出层
@ -117,9 +117,7 @@ const handleCreate = () => {
// 导出操作
const handleExport = async () => {
const queryParams = await getSearchData(xGrid)
const res = await PostApi.exportPostApi(queryParams)
download.excel(res, '岗位列表.xls')
await exportList(xGrid, '岗位列表.xls')
}
// 修改操作