Commit b249b117533af295159b5fd770688c92e8db6d97

Authored by YunaiV
1 parent 9832fe59

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

yudao-ui-admin-vue3/src/views/system/loginlog/index.vue
@@ -34,6 +34,7 @@ import { ref } from 'vue' @@ -34,6 +34,7 @@ import { ref } from 'vue'
34 import { useI18n } from '@/hooks/web/useI18n' 34 import { useI18n } from '@/hooks/web/useI18n'
35 import { useVxeGrid } from '@/hooks/web/useVxeGrid' 35 import { useVxeGrid } from '@/hooks/web/useVxeGrid'
36 import { VxeGridInstance } from 'vxe-table' 36 import { VxeGridInstance } from 'vxe-table'
  37 +// 业务相关的 import
37 import { allSchemas } from './loginLog.data' 38 import { allSchemas } from './loginLog.data'
38 import { getLoginLogPageApi, exportLoginLogApi, LoginLogVO } from '@/api/system/loginLog' 39 import { getLoginLogPageApi, exportLoginLogApi, LoginLogVO } from '@/api/system/loginLog'
39 import download from '@/utils/download' 40 import download from '@/utils/download'
@@ -50,6 +51,7 @@ const { gridOptions } = useVxeGrid<LoginLogVO>({ @@ -50,6 +51,7 @@ const { gridOptions } = useVxeGrid<LoginLogVO>({
50 const detailRef = ref() // 详情 Ref 51 const detailRef = ref() // 详情 Ref
51 const dialogVisible = ref(false) // 是否显示弹出层 52 const dialogVisible = ref(false) // 是否显示弹出层
52 const dialogTitle = ref(t('action.detail')) // 弹出层标题 53 const dialogTitle = ref(t('action.detail')) // 弹出层标题
  54 +// 详情
53 const handleDetail = async (row: LoginLogVO) => { 55 const handleDetail = async (row: LoginLogVO) => {
54 // 设置数据 56 // 设置数据
55 detailRef.value = row 57 detailRef.value = row
@@ -57,10 +59,11 @@ const handleDetail = async (row: LoginLogVO) => { @@ -57,10 +59,11 @@ const handleDetail = async (row: LoginLogVO) => {
57 } 59 }
58 60
59 // 导出操作 61 // 导出操作
  62 +// TODO @星语:导出需要有二次确认哈
60 const handleExport = async () => { 63 const handleExport = async () => {
61 const queryParams = Object.assign( 64 const queryParams = Object.assign(
62 {}, 65 {},
63 - JSON.parse(JSON.stringify(xGrid.value?.getRefMaps().refForm.value.data)) 66 + JSON.parse(JSON.stringify(xGrid.value?.getRefMaps().refForm.value.data)) // TODO @星语:这个有没办法,封装个 util 获取哈?
64 ) 67 )
65 const res = await exportLoginLogApi(queryParams) 68 const res = await exportLoginLogApi(queryParams)
66 download.excel(res, '登录列表.xls') 69 download.excel(res, '登录列表.xls')