vue3:测试 loginlog 模块,导出需要优化

This commit is contained in:
YunaiV 2022-11-13 18:57:39 +08:00
parent 9832fe5992
commit b249b11753

View File

@ -34,6 +34,7 @@ import { ref } from 'vue'
import { useI18n } from '@/hooks/web/useI18n' import { useI18n } from '@/hooks/web/useI18n'
import { useVxeGrid } from '@/hooks/web/useVxeGrid' import { useVxeGrid } from '@/hooks/web/useVxeGrid'
import { VxeGridInstance } from 'vxe-table' import { VxeGridInstance } from 'vxe-table'
// import
import { allSchemas } from './loginLog.data' import { allSchemas } from './loginLog.data'
import { getLoginLogPageApi, exportLoginLogApi, LoginLogVO } from '@/api/system/loginLog' import { getLoginLogPageApi, exportLoginLogApi, LoginLogVO } from '@/api/system/loginLog'
import download from '@/utils/download' import download from '@/utils/download'
@ -50,6 +51,7 @@ const { gridOptions } = useVxeGrid<LoginLogVO>({
const detailRef = ref() // Ref const detailRef = ref() // Ref
const dialogVisible = ref(false) // const dialogVisible = ref(false) //
const dialogTitle = ref(t('action.detail')) // const dialogTitle = ref(t('action.detail')) //
//
const handleDetail = async (row: LoginLogVO) => { const handleDetail = async (row: LoginLogVO) => {
// //
detailRef.value = row detailRef.value = row
@ -57,10 +59,11 @@ const handleDetail = async (row: LoginLogVO) => {
} }
// //
// TODO @
const handleExport = async () => { const handleExport = async () => {
const queryParams = Object.assign( const queryParams = Object.assign(
{}, {},
JSON.parse(JSON.stringify(xGrid.value?.getRefMaps().refForm.value.data)) JSON.parse(JSON.stringify(xGrid.value?.getRefMaps().refForm.value.data)) // TODO @ util
) )
const res = await exportLoginLogApi(queryParams) const res = await exportLoginLogApi(queryParams)
download.excel(res, '登录列表.xls') download.excel(res, '登录列表.xls')