|
|
@@ -1,7 +1,85 @@
|
|
|
<!-- 系统运行管理-登录异常流水查询 -->
|
|
|
<template>
|
|
|
- <app-view></app-view>
|
|
|
+ <app-view>
|
|
|
+ <template #header>
|
|
|
+ <app-filter :options="filterOptons" />
|
|
|
+ </template>
|
|
|
+ <app-table :data="dataList" showIndex v-model:columns="tableColumns" :loading="loading">
|
|
|
+ <template #headerLeft>
|
|
|
+ <app-operation :data-list="getFilteredButtons(['system_loginfailed_export'])"
|
|
|
+ @click="openComponentOnClick" />
|
|
|
+ </template>
|
|
|
+ <template #footer>
|
|
|
+ <app-pagination :total="total" v-model:page-size="pageSize" v-model:page-index="pageIndex"
|
|
|
+ @change="onSearch" />
|
|
|
+ </template>
|
|
|
+ </app-table>
|
|
|
+ <component :is="componentMap.get(componentId)" v-bind="{ selectedRow, queryParams }" @closed="closeComponent"
|
|
|
+ v-if="componentId" />
|
|
|
+ </app-view>
|
|
|
</template>
|
|
|
|
|
|
<script lang="ts" setup>
|
|
|
+import { shallowRef } from 'vue'
|
|
|
+import { ElMessage } from 'element-plus'
|
|
|
+import { useRequest } from '@/hooks/request'
|
|
|
+import { useDataFilter } from '@/hooks/datatable'
|
|
|
+import { queryError } from '@/services/api/system'
|
|
|
+import { useOperation } from '@/hooks/operation'
|
|
|
+import AppTable from '@pc/components/base/table/index.vue'
|
|
|
+import AppFilter from '@pc/components/base/table-filter/index.vue'
|
|
|
+import AppPagination from '@pc/components/base/pagination/index.vue'
|
|
|
+import AppOperation from '@pc/components/base/operation/index.vue'
|
|
|
+
|
|
|
+const queryParams = shallowRef<Model.SystemErrorReq>()
|
|
|
+const { filterOptons, getQueryParams } = useDataFilter<Model.SystemErrorReq>()
|
|
|
+
|
|
|
+const { componentMap, componentId, selectedRow, openComponent, closeComponent, getFilteredButtons } = useOperation<Model.SystemErrorRsp>({
|
|
|
+ onClose: () => onSearch()
|
|
|
+})
|
|
|
+
|
|
|
+const { dataList, total, pageSize, pageIndex, loading, run } = useRequest(queryError, {
|
|
|
+ params: {
|
|
|
+ pageNum: 1,
|
|
|
+ pageSize: 20,
|
|
|
+ },
|
|
|
+ onError: (err) => {
|
|
|
+ ElMessage.error(err)
|
|
|
+ }
|
|
|
+})
|
|
|
+
|
|
|
+const tableColumns = shallowRef<Model.TableColumn[]>([
|
|
|
+ { field: 'userName', label: '登录账号' },
|
|
|
+ { field: 'memberUserName', label: '登录时间' },
|
|
|
+ { field: 'areaName', label: '客户端类型' },
|
|
|
+ { field: 'openMode', label: '登录ip' },
|
|
|
+ { field: 'userState', label: '失败原因' }
|
|
|
+])
|
|
|
+
|
|
|
+filterOptons.inputList = [
|
|
|
+ {
|
|
|
+ label: '登录人:', placeholder: '请输入账号或用户名', keys: ['userName']
|
|
|
+ }
|
|
|
+]
|
|
|
+
|
|
|
+filterOptons.buttonList = [
|
|
|
+ { lable: '查询', className: 'el-button--primary', onClick: () => onSearch() },
|
|
|
+ { lable: '重置', className: 'el-button--primary', onClick: () => onSearch(true) }
|
|
|
+]
|
|
|
+
|
|
|
+// 处理请求参数
|
|
|
+const processRequiredParams = (callback: (params: Model.SystemErrorReq) => void, clear = false) => {
|
|
|
+ const qs = getQueryParams(clear)
|
|
|
+ queryParams.value = qs
|
|
|
+ callback(qs)
|
|
|
+}
|
|
|
+
|
|
|
+const onSearch = (clear = false) => {
|
|
|
+ processRequiredParams((qs) => run(qs), clear)
|
|
|
+}
|
|
|
+
|
|
|
+const openComponentOnClick = (code: string) => {
|
|
|
+ processRequiredParams(() => openComponent(code))
|
|
|
+}
|
|
|
+
|
|
|
</script>
|