2022-11-13 14:49:59 +08:00
|
|
|
|
<template>
|
|
|
|
|
<ContentWrap>
|
|
|
|
|
<!-- 列表 -->
|
|
|
|
|
<vxe-grid ref="xGrid" v-bind="gridOptions" class="xtable-scrollbar">
|
2022-11-16 09:56:57 +08:00
|
|
|
|
<!-- 操作:导出 -->
|
2022-11-13 14:49:59 +08:00
|
|
|
|
<template #toolbar_buttons>
|
|
|
|
|
<XButton
|
2022-11-13 15:13:38 +08:00
|
|
|
|
type="warning"
|
2022-11-13 14:49:59 +08:00
|
|
|
|
preIcon="ep:download"
|
|
|
|
|
:title="t('action.export')"
|
|
|
|
|
@click="handleExport()"
|
|
|
|
|
/>
|
|
|
|
|
</template>
|
|
|
|
|
<template #actionbtns_default="{ row }">
|
|
|
|
|
<!-- 操作:详情 -->
|
|
|
|
|
<XTextButton preIcon="ep:view" :title="t('action.detail')" @click="handleDetail(row)" />
|
|
|
|
|
</template>
|
|
|
|
|
</vxe-grid>
|
|
|
|
|
</ContentWrap>
|
|
|
|
|
<!-- 弹窗 -->
|
2022-11-15 12:25:19 +08:00
|
|
|
|
<XModal id="postModel" v-model="dialogVisible" :title="dialogTitle">
|
2022-11-14 09:15:11 +08:00
|
|
|
|
<!-- 表单:详情 -->
|
2022-12-06 23:46:13 +08:00
|
|
|
|
<Descriptions :schema="allSchemas.detailSchema" :data="detailData" />
|
2022-11-13 14:49:59 +08:00
|
|
|
|
<template #footer>
|
|
|
|
|
<!-- 按钮:关闭 -->
|
|
|
|
|
<XButton :title="t('dialog.close')" @click="dialogVisible = false" />
|
|
|
|
|
</template>
|
2022-11-15 12:25:19 +08:00
|
|
|
|
</XModal>
|
2022-11-13 14:49:59 +08:00
|
|
|
|
</template>
|
2022-11-23 22:26:25 +08:00
|
|
|
|
<script setup lang="ts" name="Loginlog">
|
2022-11-13 14:49:59 +08:00
|
|
|
|
// 全局相关的 import
|
2022-07-18 19:06:37 +08:00
|
|
|
|
import { ref } from 'vue'
|
|
|
|
|
import { useI18n } from '@/hooks/web/useI18n'
|
2022-11-13 14:49:59 +08:00
|
|
|
|
import { useVxeGrid } from '@/hooks/web/useVxeGrid'
|
|
|
|
|
import { VxeGridInstance } from 'vxe-table'
|
2022-11-13 18:57:39 +08:00
|
|
|
|
// 业务相关的 import
|
2022-11-13 14:49:59 +08:00
|
|
|
|
import { allSchemas } from './loginLog.data'
|
|
|
|
|
import { getLoginLogPageApi, exportLoginLogApi, LoginLogVO } from '@/api/system/loginLog'
|
2022-07-18 19:06:37 +08:00
|
|
|
|
|
|
|
|
|
const { t } = useI18n() // 国际化
|
2022-11-13 14:49:59 +08:00
|
|
|
|
// 列表相关的变量
|
|
|
|
|
const xGrid = ref<VxeGridInstance>() // 列表 Grid Ref
|
2022-11-15 14:51:39 +08:00
|
|
|
|
const { gridOptions, exportList } = useVxeGrid<LoginLogVO>({
|
2022-11-13 14:49:59 +08:00
|
|
|
|
allSchemas: allSchemas,
|
2022-11-15 14:51:39 +08:00
|
|
|
|
getListApi: getLoginLogPageApi,
|
|
|
|
|
exportListApi: exportLoginLogApi
|
2022-07-18 19:06:37 +08:00
|
|
|
|
})
|
2022-11-13 18:39:19 +08:00
|
|
|
|
|
2022-07-18 19:06:37 +08:00
|
|
|
|
// 详情操作
|
2022-12-06 23:46:13 +08:00
|
|
|
|
const detailData = ref() // 详情 Ref
|
2022-07-18 19:06:37 +08:00
|
|
|
|
const dialogVisible = ref(false) // 是否显示弹出层
|
|
|
|
|
const dialogTitle = ref(t('action.detail')) // 弹出层标题
|
2022-11-13 18:57:39 +08:00
|
|
|
|
// 详情
|
2022-07-18 19:06:37 +08:00
|
|
|
|
const handleDetail = async (row: LoginLogVO) => {
|
|
|
|
|
// 设置数据
|
2022-12-06 23:46:13 +08:00
|
|
|
|
detailData.value = row
|
2022-07-18 19:06:37 +08:00
|
|
|
|
dialogVisible.value = true
|
|
|
|
|
}
|
2022-11-13 18:39:19 +08:00
|
|
|
|
|
2022-11-13 14:49:59 +08:00
|
|
|
|
// 导出操作
|
|
|
|
|
const handleExport = async () => {
|
2022-11-16 10:28:28 +08:00
|
|
|
|
await exportList(xGrid, '登录列表.xls')
|
2022-11-13 14:49:59 +08:00
|
|
|
|
}
|
2022-07-18 19:06:37 +08:00
|
|
|
|
</script>
|