vue3:测试 loginlog 模块,导出需要优化
This commit is contained in:
parent
9832fe5992
commit
b249b11753
@ -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')
|
||||||
|
Loading…
Reference in New Issue
Block a user