diff --git a/src/api/system/loginLog/index.ts b/src/api/system/loginLog/index.ts index 5b06e753..f275c3e2 100644 --- a/src/api/system/loginLog/index.ts +++ b/src/api/system/loginLog/index.ts @@ -13,18 +13,12 @@ export interface LoginLogVO { createTime: Date } -export interface LoginLogReqVO extends PageParam { - userIp?: string - username?: string - status?: boolean - createTime?: Date[] -} - // 查询登录日志列表 -export const getLoginLogPage = (params: LoginLogReqVO) => { +export const getLoginLogPage = (params: PageParam) => { return request.get({ url: '/system/login-log/page', params }) } + // 导出登录日志 -export const exportLoginLog = (params: LoginLogReqVO) => { +export const exportLoginLog = (params) => { return request.download({ url: '/system/login-log/export', params }) } diff --git a/src/styles/index.scss b/src/styles/index.scss index 02c187a5..39c4c4da 100644 --- a/src/styles/index.scss +++ b/src/styles/index.scss @@ -26,9 +26,3 @@ border-left-color: var(--el-color-primary); } } - -// 添加表头样式 -.el-table.yudao-table { - --el-table-header-bg-color: #f8f8f9; - --el-table-header-text-color: #606266; -} diff --git a/src/views/system/loginlog/detail.vue b/src/views/system/loginlog/LoginLogDetail.vue similarity index 87% rename from src/views/system/loginlog/detail.vue rename to src/views/system/loginlog/LoginLogDetail.vue index 8372d2e6..c224f147 100644 --- a/src/views/system/loginlog/detail.vue +++ b/src/views/system/loginlog/LoginLogDetail.vue @@ -1,5 +1,5 @@ <template> - <Dialog title="详情" v-model="modelVisible" :scroll="true" :max-height="500" width="800"> + <Dialog title="详情" v-model="modelVisible" width="800"> <el-descriptions border :column="1"> <el-descriptions-item label="日志编号" min-width="120"> {{ detailData.id }} @@ -35,7 +35,7 @@ const detailLoading = ref(false) // 表单的加载中 const detailData = ref() // 详情数据 /** 打开弹窗 */ -const openModal = async (data: LoginLogApi.LoginLogVO) => { +const open = async (data: LoginLogApi.LoginLogVO) => { modelVisible.value = true // 设置数据 detailLoading.value = true @@ -45,5 +45,5 @@ const openModal = async (data: LoginLogApi.LoginLogVO) => { detailLoading.value = false } } -defineExpose({ openModal }) // 提供 openModal 方法,用于打开弹窗 +defineExpose({ open }) // 提供 open 方法,用于打开弹窗 </script> diff --git a/src/views/system/loginlog/index.vue b/src/views/system/loginlog/index.vue index f5a695fc..7b1aca5f 100644 --- a/src/views/system/loginlog/index.vue +++ b/src/views/system/loginlog/index.vue @@ -55,7 +55,7 @@ <!-- 列表 --> <content-wrap> - <el-table class="yudao-table" v-loading="loading" :data="list"> + <el-table v-loading="loading" :data="list"> <el-table-column label="日志编号" align="center" prop="id" /> <el-table-column label="操作类型" align="center" prop="logType"> <template #default="scope"> @@ -64,7 +64,6 @@ </el-table-column> <el-table-column label="用户名称" align="center" prop="username" width="180" /> <el-table-column label="登录地址" align="center" prop="userIp" width="180" /> - <el-table-column label="浏览器" align="center" prop="userAgent" /> <el-table-column label="登陆结果" align="center" prop="result"> <template #default="scope"> @@ -83,7 +82,7 @@ <el-button link type="primary" - @click="openModal(scope.row)" + @click="openDetail(scope.row)" v-hasPermi="['infra:config:query']" > 详情 @@ -101,14 +100,14 @@ </content-wrap> <!-- 表单弹窗:详情 --> - <login-log-detail ref="modalRef" /> + <LoginLogDetail ref="detailRef" /> </template> <script setup lang="ts" name="LoginLog"> import { DICT_TYPE } from '@/utils/dict' import { dateFormatter } from '@/utils/formatTime' import download from '@/utils/download' import * as LoginLogApi from '@/api/system/loginLog' -import LoginLogDetail from './detail.vue' +import LoginLogDetail from './LoginLogDetail.vue' const message = useMessage() // 消息弹窗 const loading = ref(true) // 列表的加载中 @@ -149,9 +148,9 @@ const resetQuery = () => { } /** 详情操作 */ -const modalRef = ref() -const openModal = (data: LoginLogApi.LoginLogVO) => { - modalRef.value.openModal(data) +const detailRef = ref() +const openDetail = (data: LoginLogApi.LoginLogVO) => { + detailRef.value.open(data) } /** 导出按钮操作 */