|
|
@@ -1,7 +1,107 @@
|
|
|
<!-- 系统运行管理-终端登录日志 -->
|
|
|
<template>
|
|
|
- <app-view></app-view>
|
|
|
+ <app-view>
|
|
|
+ <template #header>
|
|
|
+ <app-filter :option="filterOption">
|
|
|
+ <!-- 历史查询 -->
|
|
|
+ <template #ishis="{ item }">
|
|
|
+ <el-form-item :label="item.label" prop="ishis">
|
|
|
+ <el-switch v-model="item.value" active-value="1" inactive-value="0" />
|
|
|
+ </el-form-item>
|
|
|
+ </template>
|
|
|
+ </app-filter>
|
|
|
+ </template>
|
|
|
+ <app-table :data="dataList" showIndex :columns="tableColumns" :loading="loading">
|
|
|
+ <!-- 操作 -->
|
|
|
+ <template #operate="{ row }">
|
|
|
+ <app-operation size="small" :data-list="getActionButtons(['system_clientlog_details'])"
|
|
|
+ @click="(code: string) => openComponent(code, row)" circle />
|
|
|
+ </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="{ record }" @closed="closeComponent"
|
|
|
+ v-if="componentId" />
|
|
|
+ </app-view>
|
|
|
</template>
|
|
|
|
|
|
<script lang="ts" setup>
|
|
|
+import { ref } from 'vue'
|
|
|
+import { ElMessage } from 'element-plus'
|
|
|
+import { useDataFilter } from '@/hooks/datatable-v2'
|
|
|
+import { useRequest } from '@/hooks/request'
|
|
|
+import { useOperation } from '@/hooks/operation'
|
|
|
+import { queryloginlog } from '@/services/api/system'
|
|
|
+import { i18n } from '@/stores'
|
|
|
+import { useEnum } from '@/hooks/enum'
|
|
|
+import AppTable from '@pc/components/base/table/index.vue'
|
|
|
+import AppPagination from '@pc/components/base/pagination/index.vue'
|
|
|
+import AppOperation from '@pc/components/base/operation/index.vue'
|
|
|
+import AppFilter from '@pc/components/base/table-filter-v2/index.vue'
|
|
|
+import { formatDate } from '@/filters'
|
|
|
+
|
|
|
+const { global: { t } } = i18n
|
|
|
+// 状态
|
|
|
+const logintypeEnum = useEnum('logintype')
|
|
|
+const operatetypeEnum = useEnum('operatetype')
|
|
|
+const loginretcodeEnum = useEnum('loginretcode')
|
|
|
+
|
|
|
+const { componentMap, componentId, record, openComponent, closeComponent, getActionButtons } = useOperation<Model.LoginLogViewRsp>({
|
|
|
+ onClose: () => onSearch()
|
|
|
+})
|
|
|
+
|
|
|
+const { dataList, total, pageSize, pageIndex, loading, run } = useRequest(queryloginlog, {
|
|
|
+ params: {
|
|
|
+ pageNum: 1,
|
|
|
+ pageSize: 20
|
|
|
+ },
|
|
|
+ onError: (err) => {
|
|
|
+ ElMessage.error(err)
|
|
|
+ }
|
|
|
+})
|
|
|
+
|
|
|
+const tableColumns = ref<Model.TableColumn[]>([
|
|
|
+ { field: 'logincode', label: '登录账号' },
|
|
|
+ { field: 'accountname', label: '客户名称 ' },
|
|
|
+ { field: 'areaname', label: '所属机构' },
|
|
|
+ { field: 'membername', label: '所属会员' },
|
|
|
+ { field: 'loginip', label: '登录IP' },
|
|
|
+ { field: 'logintype', label: '登录/登出', formatValue: (val) => logintypeEnum.getEnumTypeName(val) },
|
|
|
+ { field: 'operatetime', label: '时间', formatValue: (val) => formatDate(val) },
|
|
|
+ { field: 'loginretcode', label: '结果', formatValue: (val) => loginretcodeEnum.getEnumTypeName(val) },
|
|
|
+ { field: 'operatetype', label: '操作类型', formatValue: (val) => operatetypeEnum.getEnumTypeName(val) },
|
|
|
+ { field: 'operate', label: 'common.operate', fixed: 'right' }
|
|
|
+])
|
|
|
+
|
|
|
+const { filterOption, getQueryParams, resetFilters } = useDataFilter<Model.LoginLogExportReq>({
|
|
|
+ filters: [
|
|
|
+ {
|
|
|
+ field: 'logincode',
|
|
|
+ label: '登录账号',
|
|
|
+ placeholder: '模糊匹配',
|
|
|
+ },
|
|
|
+ {
|
|
|
+ field: 'accountname',
|
|
|
+ label: '客户名称',
|
|
|
+ placeholder: '模糊匹配',
|
|
|
+ },
|
|
|
+ {
|
|
|
+ field: 'ishis',
|
|
|
+ label: '历史查询',
|
|
|
+ value: 0
|
|
|
+ },
|
|
|
+ ],
|
|
|
+ buttons: [
|
|
|
+ { label: t('operation.search'), className: 'el-button--primary', onClick: () => onSearch() },
|
|
|
+ { label: t('operation.reset'), className: 'el-button--primary', validateEvent: false, onClick: () => resetFilters() }
|
|
|
+ ]
|
|
|
+})
|
|
|
+
|
|
|
+const onSearch = () => {
|
|
|
+ const qs = getQueryParams()
|
|
|
+ run(qs)
|
|
|
+}
|
|
|
+
|
|
|
</script>
|