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 34 import { useI18n } from '@/hooks/web/useI18n'
35 35 import { useVxeGrid } from '@/hooks/web/useVxeGrid'
36 36 import { VxeGridInstance } from 'vxe-table'
  37 +// 业务相关的 import
37 38 import { allSchemas } from './loginLog.data'
38 39 import { getLoginLogPageApi, exportLoginLogApi, LoginLogVO } from '@/api/system/loginLog'
39 40 import download from '@/utils/download'
... ... @@ -50,6 +51,7 @@ const { gridOptions } = useVxeGrid<LoginLogVO>({
50 51 const detailRef = ref() // 详情 Ref
51 52 const dialogVisible = ref(false) // 是否显示弹出层
52 53 const dialogTitle = ref(t('action.detail')) // 弹出层标题
  54 +// 详情
53 55 const handleDetail = async (row: LoginLogVO) => {
54 56 // 设置数据
55 57 detailRef.value = row
... ... @@ -57,10 +59,11 @@ const handleDetail = async (row: LoginLogVO) => {
57 59 }
58 60  
59 61 // 导出操作
  62 +// TODO @星语:导出需要有二次确认哈
60 63 const handleExport = async () => {
61 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 68 const res = await exportLoginLogApi(queryParams)
66 69 download.excel(res, '登录列表.xls')
... ...