completepage: 🍻 用户登录日志完成
This commit is contained in:
parent
f119f943f9
commit
792cd9a198
|
@ -6,11 +6,6 @@ export const fetchGetUserLoginLogList = (data: any) => {
|
|||
return http.request<BaseResult<ResultTable>>('get', `userLoginLog/getUserLoginLogList/${data.currentPage}/${data.pageSize}`, { params: data });
|
||||
};
|
||||
|
||||
/** 用户登录日志---更新用户登录日志 */
|
||||
export const fetchUpdateUserLoginLog = (data: any) => {
|
||||
return http.request<BaseResult<object>>('put', 'userLoginLog/updateUserLoginLog', { data });
|
||||
};
|
||||
|
||||
/** 用户登录日志---删除用户登录日志 */
|
||||
export const fetchDeleteUserLoginLog = (data: any) => {
|
||||
return http.request<BaseResult<object>>('delete', 'userLoginLog/deleteUserLoginLog', { data });
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import { defineStore } from 'pinia';
|
||||
import { fetchDeleteUserLoginLog, fetchGetUserLoginLogList, fetchUpdateUserLoginLog } from '@/api/v1/userLoginLog';
|
||||
import { fetchDeleteUserLoginLog, fetchGetUserLoginLogList } from '@/api/v1/userLoginLog';
|
||||
import { pageSizes } from '@/enums/baseConstant';
|
||||
import { storeMessage } from '@/utils/message';
|
||||
import { storePagination } from '@/store/useStorePagination';
|
||||
|
@ -32,34 +32,10 @@ export const useUserLoginLogStore = defineStore('userLoginLogStore', {
|
|||
xRequestedWith: undefined,
|
||||
// 用户代理的品牌和版本
|
||||
secChUa: undefined,
|
||||
// 用户代理的底层平台架构
|
||||
secChUaArch: undefined,
|
||||
// 用户代理的底层CPU架构位数
|
||||
secChUaBitness: undefined,
|
||||
// 用户代理是否在手机设备上运行
|
||||
secChUaMobile: undefined,
|
||||
// 用户代理的设备模型
|
||||
secChUaModel: undefined,
|
||||
// 用户代理的底层操作系统/平台
|
||||
secChUaPlatform: undefined,
|
||||
// 用户代理的底层操作系统版本
|
||||
secChUaPlatformVersion: undefined,
|
||||
// 客户端设备像素比
|
||||
contentDpr: undefined,
|
||||
// 客户端RAM内存的近似值
|
||||
deviceMemory: undefined,
|
||||
// 客户端设备像素比
|
||||
dpr: undefined,
|
||||
// 布局视口宽度
|
||||
viewportWidth: undefined,
|
||||
// 所需资源宽度
|
||||
width: undefined,
|
||||
// 客户端连接到服务器的近似带宽
|
||||
downlink: undefined,
|
||||
// 有效连接类型
|
||||
ect: undefined,
|
||||
// 应用层往返时间
|
||||
rtt: undefined,
|
||||
},
|
||||
// 分页查询结果
|
||||
pagination: {
|
||||
|
@ -90,12 +66,6 @@ export const useUserLoginLogStore = defineStore('userLoginLogStore', {
|
|||
return pagination(result);
|
||||
},
|
||||
|
||||
/** 修改用户登录日志 */
|
||||
async updateUserLoginLog(data: any) {
|
||||
const result = await fetchUpdateUserLoginLog(data);
|
||||
return storeMessage(result);
|
||||
},
|
||||
|
||||
/** 删除用户登录日志 */
|
||||
async deleteUserLoginLog(data: any) {
|
||||
const result = await fetchDeleteUserLoginLog(data);
|
||||
|
|
|
@ -3,7 +3,7 @@ import { onMounted, ref } from 'vue';
|
|||
import { columns } from '@/views/monitor/schedulerExecuteLog/utils/columns';
|
||||
import PureTableBar from '@/components/TableBar/src/bar';
|
||||
import PureTable from '@pureadmin/table';
|
||||
import { deleteIds, onDelete, onDeleteBatch, onSearch } from '@/views/monitor/schedulerExecuteLog/utils/hooks';
|
||||
import { deleteIds, onDelete, onDeleteBatch, onSearch, onView } from '@/views/monitor/schedulerExecuteLog/utils/hooks';
|
||||
import Delete from '@iconify-icons/ep/delete';
|
||||
import Refresh from '@iconify-icons/ep/refresh';
|
||||
import { selectUserinfo } from '@/components/Table/Userinfo/columns';
|
||||
|
@ -11,6 +11,7 @@ import { $t } from '@/plugins/i18n';
|
|||
import { useQuartzExecuteLogStore } from '@/store/monitor/quartzExecuteLog';
|
||||
import { useRenderIcon } from '@/components/CommonIcon/src/hooks';
|
||||
import { FormInstance } from 'element-plus';
|
||||
import View from '@iconify-icons/ep/view';
|
||||
|
||||
const tableRef = ref();
|
||||
const formRef = ref();
|
||||
|
@ -83,7 +84,7 @@ onMounted(() => {
|
|||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<PureTableBar :columns="columns" title="调度任务执行日志" @fullscreen="tableRef.setAdaptive()" @refresh="onSearch">
|
||||
<PureTableBar :columns="columns" :title="$t('quartzExecuteLog')" @fullscreen="tableRef.setAdaptive()" @refresh="onSearch">
|
||||
<template #buttons>
|
||||
<!-- 批量删除按钮 -->
|
||||
<el-button v-show="deleteIds.length > 0" :icon="useRenderIcon(Delete)" type="danger" @click="onDeleteBatch">
|
||||
|
@ -121,6 +122,7 @@ onMounted(() => {
|
|||
</template>
|
||||
|
||||
<template #operation="{ row }">
|
||||
<el-button :icon="useRenderIcon(View)" :size="size" class="reset-margin" link type="primary" @click="onView(row)"> {{ $t('view') }} </el-button>
|
||||
<el-popconfirm :title="`${$t('delete')}${row.jobName}?`" @confirm="onDelete(row)">
|
||||
<template #reference>
|
||||
<el-button :icon="useRenderIcon(Delete)" :size="size" class="reset-margin" link type="primary">
|
||||
|
|
|
@ -0,0 +1,77 @@
|
|||
<script lang="ts" setup>
|
||||
import { ref } from 'vue';
|
||||
import { FormInstance } from 'element-plus';
|
||||
import { rules } from '@/views/monitor/schedulerExecuteLog/utils/columns';
|
||||
import { FormProps } from '@/views/monitor/schedulerExecuteLog/utils/types';
|
||||
import { $t } from '@/plugins/i18n';
|
||||
|
||||
const props = withDefaults(defineProps<FormProps>(), {
|
||||
formInline: () => ({
|
||||
// 任务名称
|
||||
jobName: undefined,
|
||||
// 任务分组
|
||||
jobGroup: undefined,
|
||||
// 执行任务类名
|
||||
jobClassName: undefined,
|
||||
// 执行任务core表达式
|
||||
cronExpression: undefined,
|
||||
// 触发器名称
|
||||
triggerName: undefined,
|
||||
// 执行结果
|
||||
executeResult: undefined,
|
||||
// 执行时间
|
||||
duration: undefined,
|
||||
// 结束时间
|
||||
endTime: undefined,
|
||||
}),
|
||||
});
|
||||
|
||||
const formRef = ref<FormInstance>();
|
||||
const form = ref(props.formInline);
|
||||
|
||||
defineExpose({ formRef });
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<el-form ref="formRef" :model="form" :rules="rules" label-width="auto">
|
||||
<!-- 任务名称 -->
|
||||
<el-form-item :label="$t('quartzExecuteLog_jobName')" prop="jobName">
|
||||
<el-input v-model="form.jobName" :placeholder="$t('input') + $t('quartzExecuteLog_jobName')" autocomplete="off" type="text" />
|
||||
</el-form-item>
|
||||
|
||||
<!-- 任务分组 -->
|
||||
<el-form-item :label="$t('quartzExecuteLog_jobGroup')" prop="jobGroup">
|
||||
<el-input v-model="form.jobGroup" :placeholder="$t('input') + $t('quartzExecuteLog_jobGroup')" autocomplete="off" type="text" />
|
||||
</el-form-item>
|
||||
|
||||
<!-- 执行任务类名 -->
|
||||
<el-form-item :label="$t('quartzExecuteLog_jobClassName')" prop="jobClassName">
|
||||
<el-input v-model="form.jobClassName" :placeholder="$t('input') + $t('quartzExecuteLog_jobClassName')" autocomplete="off" type="text" />
|
||||
</el-form-item>
|
||||
|
||||
<!-- 执行任务core表达式 -->
|
||||
<el-form-item :label="$t('quartzExecuteLog_cronExpression')" prop="cronExpression">
|
||||
<el-input v-model="form.cronExpression" :placeholder="$t('input') + $t('quartzExecuteLog_cronExpression')" autocomplete="off" type="text" />
|
||||
</el-form-item>
|
||||
|
||||
<!-- 触发器名称 -->
|
||||
<el-form-item :label="$t('quartzExecuteLog_triggerName')" prop="triggerName">
|
||||
<el-input v-model="form.triggerName" :placeholder="$t('input') + $t('quartzExecuteLog_triggerName')" autocomplete="off" type="text" />
|
||||
</el-form-item>
|
||||
|
||||
<!-- 执行结果 -->
|
||||
<el-form-item :label="$t('quartzExecuteLog_executeResult')" prop="executeResult">
|
||||
<el-input v-model="form.executeResult" :placeholder="$t('input') + $t('quartzExecuteLog_executeResult')" autocomplete="off" type="text" />
|
||||
</el-form-item>
|
||||
|
||||
<!-- 用执行时间户Id -->
|
||||
<el-form-item :label="$t('quartzExecuteLog_duration')" prop="duration">
|
||||
<el-input v-model="form.duration" :placeholder="$t('input') + $t('quartzExecuteLog_duration')" autocomplete="off" type="text" />
|
||||
</el-form-item>
|
||||
|
||||
<!-- 结束时间 -->
|
||||
<el-form-item :label="$t('quartzExecuteLog_endTime')" prop="endTime">
|
||||
<el-input v-model="form.endTime" :placeholder="$t('input') + $t('quartzExecuteLog_endTime')" autocomplete="off" type="text" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</template>
|
|
@ -1,4 +1,5 @@
|
|||
import { $t } from '@/plugins/i18n';
|
||||
import { reactive } from 'vue';
|
||||
|
||||
// 表格列
|
||||
export const columns: TableColumnList = [
|
||||
|
@ -24,5 +25,7 @@ export const columns: TableColumnList = [
|
|||
{ label: $t('table.createTime'), prop: 'createTime', sortable: true, width: 160 },
|
||||
{ label: $t('table.createUser'), prop: 'createUser', slot: 'createUser', width: 90 },
|
||||
{ label: $t('table.updateUser'), prop: 'updateUser', slot: 'updateUser', width: 90 },
|
||||
{ label: $t('table.operation'), fixed: 'right', width: 100, slot: 'operation' },
|
||||
{ label: $t('table.operation'), fixed: 'right', width: 160, slot: 'operation' },
|
||||
];
|
||||
// 添加规则
|
||||
export const rules = reactive({});
|
||||
|
|
|
@ -1,7 +1,9 @@
|
|||
import { useQuartzExecuteLogStore } from '@/store/monitor/quartzExecuteLog';
|
||||
import { ref } from 'vue';
|
||||
import { h, ref } from 'vue';
|
||||
import { messageBox } from '@/utils/message';
|
||||
import { $t } from '@/plugins/i18n';
|
||||
import { addDialog } from '@/components/BaseDialog/index';
|
||||
import ScheduleExecuteLog from '@/views/monitor/schedulerExecuteLog/schedule-execute-log.vue';
|
||||
|
||||
export const formRef = ref();
|
||||
// 删除ids
|
||||
|
@ -17,6 +19,37 @@ export async function onSearch() {
|
|||
quartzExecuteLogStore.loading = false;
|
||||
}
|
||||
|
||||
/**
|
||||
* * 查看用户登录日志
|
||||
* @param row
|
||||
*/
|
||||
export function onView(row: any) {
|
||||
addDialog({
|
||||
title: `${$t('view')}${$t('schedulerExecuteLog')}`,
|
||||
width: '30%',
|
||||
props: {
|
||||
formInline: {
|
||||
jobName: row.jobName,
|
||||
jobGroup: row.jobGroup,
|
||||
jobClassName: row.jobClassName,
|
||||
cronExpression: row.cronExpression,
|
||||
triggerName: row.triggerName,
|
||||
executeResult: row.executeResult,
|
||||
duration: row.duration,
|
||||
endTime: row.endTime,
|
||||
},
|
||||
},
|
||||
draggable: true,
|
||||
fullscreenIcon: true,
|
||||
closeOnClickModal: false,
|
||||
contentRenderer: () => h(ScheduleExecuteLog, { ref: formRef }),
|
||||
beforeSure: async done => {
|
||||
done();
|
||||
await onSearch();
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* * 删除调度任务执行日志
|
||||
*/
|
||||
|
|
|
@ -3,9 +3,9 @@ import { onMounted, ref } from 'vue';
|
|||
import { columns } from '@/views/monitor/userLoginLog/utils/columns';
|
||||
import PureTableBar from '@/components/TableBar/src/bar';
|
||||
import PureTable from '@pureadmin/table';
|
||||
import { deleteIds, onDelete, onDeleteBatch, onSearch, onUpdate } from '@/views/monitor/userLoginLog/utils/hooks';
|
||||
import { deleteIds, onDelete, onDeleteBatch, onSearch, onView } from '@/views/monitor/userLoginLog/utils/hooks';
|
||||
import Delete from '@iconify-icons/ep/delete';
|
||||
import EditPen from '@iconify-icons/ep/edit-pen';
|
||||
import View from '@iconify-icons/ep/view';
|
||||
import Refresh from '@iconify-icons/ep/refresh';
|
||||
import { selectUserinfo } from '@/components/Table/Userinfo/columns';
|
||||
import { $t } from '@/plugins/i18n';
|
||||
|
@ -105,82 +105,23 @@ onMounted(() => {
|
|||
<el-input v-model="userLoginLogStore.form.secChUa" :placeholder="`${$t('input')}${$t('userLoginLog_secChUa')}`" class="!w-[180px]" clearable />
|
||||
</el-form-item>
|
||||
|
||||
<!-- 用户代理的底层平台架构 -->
|
||||
<el-form-item :label="$t('userLoginLog_secChUaArch')" prop="secChUaArch">
|
||||
<el-input v-model="userLoginLogStore.form.secChUaArch" :placeholder="`${$t('input')}${$t('userLoginLog_secChUaArch')}`" class="!w-[180px]" clearable />
|
||||
</el-form-item>
|
||||
|
||||
<!-- 用户代理的底层CPU架构位数 -->
|
||||
<el-form-item :label="$t('userLoginLog_secChUaBitness')" prop="secChUaBitness">
|
||||
<el-input v-model="userLoginLogStore.form.secChUaBitness" :placeholder="`${$t('input')}${$t('userLoginLog_secChUaBitness')}`" class="!w-[180px]" clearable />
|
||||
</el-form-item>
|
||||
|
||||
<!-- 用户代理是否在手机设备上运行 -->
|
||||
<el-form-item :label="$t('userLoginLog_secChUaMobile')" prop="secChUaMobile">
|
||||
<el-input v-model="userLoginLogStore.form.secChUaMobile" :placeholder="`${$t('input')}${$t('userLoginLog_secChUaMobile')}`" class="!w-[180px]" clearable />
|
||||
</el-form-item>
|
||||
|
||||
<!-- 用户代理的设备模型 -->
|
||||
<el-form-item :label="$t('userLoginLog_secChUaModel')" prop="secChUaModel">
|
||||
<el-input v-model="userLoginLogStore.form.secChUaModel" :placeholder="`${$t('input')}${$t('userLoginLog_secChUaModel')}`" class="!w-[180px]" clearable />
|
||||
</el-form-item>
|
||||
|
||||
<!-- 用户代理的底层操作系统/平台 -->
|
||||
<el-form-item :label="$t('userLoginLog_secChUaPlatform')" prop="secChUaPlatform">
|
||||
<el-input v-model="userLoginLogStore.form.secChUaPlatform" :placeholder="`${$t('input')}${$t('userLoginLog_secChUaPlatform')}`" class="!w-[180px]" clearable />
|
||||
</el-form-item>
|
||||
|
||||
<!-- 用户代理的底层操作系统版本 -->
|
||||
<el-form-item :label="$t('userLoginLog_secChUaPlatformVersion')" prop="secChUaPlatformVersion">
|
||||
<el-input v-model="userLoginLogStore.form.secChUaPlatformVersion" :placeholder="`${$t('input')}${$t('userLoginLog_secChUaPlatformVersion')}`" class="!w-[180px]" clearable />
|
||||
</el-form-item>
|
||||
|
||||
<!-- 客户端设备像素比 -->
|
||||
<el-form-item :label="$t('userLoginLog_contentDpr')" prop="contentDpr">
|
||||
<el-input v-model="userLoginLogStore.form.contentDpr" :placeholder="`${$t('input')}${$t('userLoginLog_contentDpr')}`" class="!w-[180px]" clearable />
|
||||
</el-form-item>
|
||||
|
||||
<!-- 客户端RAM内存的近似值 -->
|
||||
<el-form-item :label="$t('userLoginLog_deviceMemory')" prop="deviceMemory">
|
||||
<el-input v-model="userLoginLogStore.form.deviceMemory" :placeholder="`${$t('input')}${$t('userLoginLog_deviceMemory')}`" class="!w-[180px]" clearable />
|
||||
</el-form-item>
|
||||
|
||||
<!-- 客户端设备像素比 -->
|
||||
<el-form-item :label="$t('userLoginLog_dpr')" prop="dpr">
|
||||
<el-input v-model="userLoginLogStore.form.dpr" :placeholder="`${$t('input')}${$t('userLoginLog_dpr')}`" class="!w-[180px]" clearable />
|
||||
</el-form-item>
|
||||
|
||||
<!-- 布局视口宽度 -->
|
||||
<el-form-item :label="$t('userLoginLog_viewportWidth')" prop="viewportWidth">
|
||||
<el-input v-model="userLoginLogStore.form.viewportWidth" :placeholder="`${$t('input')}${$t('userLoginLog_viewportWidth')}`" class="!w-[180px]" clearable />
|
||||
</el-form-item>
|
||||
|
||||
<!-- 所需资源宽度 -->
|
||||
<el-form-item :label="$t('userLoginLog_width')" prop="width">
|
||||
<el-input v-model="userLoginLogStore.form.width" :placeholder="`${$t('input')}${$t('userLoginLog_width')}`" class="!w-[180px]" clearable />
|
||||
</el-form-item>
|
||||
|
||||
<!-- 客户端连接到服务器的近似带宽 -->
|
||||
<el-form-item :label="$t('userLoginLog_downlink')" prop="downlink">
|
||||
<el-input v-model="userLoginLogStore.form.downlink" :placeholder="`${$t('input')}${$t('userLoginLog_downlink')}`" class="!w-[180px]" clearable />
|
||||
</el-form-item>
|
||||
|
||||
<!-- 有效连接类型 -->
|
||||
<el-form-item :label="$t('userLoginLog_ect')" prop="ect">
|
||||
<el-input v-model="userLoginLogStore.form.ect" :placeholder="`${$t('input')}${$t('userLoginLog_ect')}`" class="!w-[180px]" clearable />
|
||||
</el-form-item>
|
||||
|
||||
<!-- 应用层往返时间 -->
|
||||
<el-form-item :label="$t('userLoginLog_rtt')" prop="rtt">
|
||||
<el-input v-model="userLoginLogStore.form.rtt" :placeholder="`${$t('input')}${$t('userLoginLog_rtt')}`" class="!w-[180px]" clearable />
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button :icon="useRenderIcon('ri:search-line')" :loading="userLoginLogStore.loading" type="primary" @click="onSearch"> {{ $t('search') }} </el-button>
|
||||
<el-button :icon="useRenderIcon(Refresh)" @click="resetForm(formRef)"> {{ $t('buttons.reset') }}</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<PureTableBar :columns="columns" title="用户登录日志" @fullscreen="tableRef.setAdaptive()" @refresh="onSearch">
|
||||
<PureTableBar :columns="columns" :title="$t('userLoginLog')" @fullscreen="tableRef.setAdaptive()" @refresh="onSearch">
|
||||
<template #buttons>
|
||||
<!-- 批量删除按钮 -->
|
||||
<el-button v-show="deleteIds.length > 0" :icon="useRenderIcon(Delete)" type="danger" @click="onDeleteBatch">
|
||||
|
@ -218,7 +159,7 @@ onMounted(() => {
|
|||
</template>
|
||||
|
||||
<template #operation="{ row }">
|
||||
<el-button :icon="useRenderIcon(EditPen)" :size="size" class="reset-margin" link type="primary" @click="onUpdate(row)"> {{ $t('modify') }} </el-button>
|
||||
<el-button :icon="useRenderIcon(View)" :size="size" class="reset-margin" link type="primary" @click="onView(row)"> {{ $t('view') }} </el-button>
|
||||
<el-popconfirm :title="`${$t('delete')}${row.username}?`" @confirm="onDelete(row)">
|
||||
<template #reference>
|
||||
<el-button :icon="useRenderIcon(Delete)" :size="size" class="reset-margin" link type="primary">
|
||||
|
|
|
@ -25,34 +25,14 @@ const props = withDefaults(defineProps<FormProps>(), {
|
|||
xRequestedWith: undefined,
|
||||
// 用户代理的品牌和版本
|
||||
secChUa: undefined,
|
||||
// 用户代理的底层平台架构
|
||||
secChUaArch: undefined,
|
||||
// 用户代理的底层CPU架构位数
|
||||
secChUaBitness: undefined,
|
||||
// 用户代理是否在手机设备上运行
|
||||
secChUaMobile: undefined,
|
||||
// 用户代理的设备模型
|
||||
secChUaModel: undefined,
|
||||
// 用户代理的底层操作系统/平台
|
||||
secChUaPlatform: undefined,
|
||||
// 用户代理的底层操作系统版本
|
||||
secChUaPlatformVersion: undefined,
|
||||
// 客户端设备像素比
|
||||
contentDpr: undefined,
|
||||
// 客户端RAM内存的近似值
|
||||
deviceMemory: undefined,
|
||||
// 客户端设备像素比
|
||||
dpr: undefined,
|
||||
// 布局视口宽度
|
||||
viewportWidth: undefined,
|
||||
// 所需资源宽度
|
||||
width: undefined,
|
||||
// 客户端连接到服务器的近似带宽
|
||||
downlink: undefined,
|
||||
// 有效连接类型
|
||||
ect: undefined,
|
||||
// 应用层往返时间
|
||||
rtt: undefined,
|
||||
}),
|
||||
});
|
||||
|
||||
|
@ -76,7 +56,7 @@ defineExpose({ formRef });
|
|||
|
||||
<!-- 登录token -->
|
||||
<el-form-item :label="$t('userLoginLog_token')" prop="token">
|
||||
<el-input v-model="form.token" :placeholder="$t('input') + $t('userLoginLog_token')" autocomplete="off" type="text" />
|
||||
<el-input v-model="form.token" :autosize="{ minRows: 2, maxRows: 8 }" :placeholder="$t('input') + $t('userLoginLog_token')" autocomplete="off" type="textarea" />
|
||||
</el-form-item>
|
||||
|
||||
<!-- 登录Ip -->
|
||||
|
@ -91,7 +71,7 @@ defineExpose({ formRef });
|
|||
|
||||
<!-- 登录时代理 -->
|
||||
<el-form-item :label="$t('userLoginLog_userAgent')" prop="userAgent">
|
||||
<el-input v-model="form.userAgent" :placeholder="$t('input') + $t('userLoginLog_userAgent')" autocomplete="off" type="text" />
|
||||
<el-input v-model="form.userAgent" :autosize="{ minRows: 2, maxRows: 8 }" :placeholder="$t('input') + $t('userLoginLog_userAgent')" autocomplete="off" type="textarea" />
|
||||
</el-form-item>
|
||||
|
||||
<!-- 操作类型 -->
|
||||
|
@ -109,74 +89,14 @@ defineExpose({ formRef });
|
|||
<el-input v-model="form.secChUa" :placeholder="$t('input') + $t('userLoginLog_secChUa')" autocomplete="off" type="text" />
|
||||
</el-form-item>
|
||||
|
||||
<!-- 用户代理的底层平台架构 -->
|
||||
<el-form-item :label="$t('userLoginLog_secChUaArch')" prop="secChUaArch">
|
||||
<el-input v-model="form.secChUaArch" :placeholder="$t('input') + $t('userLoginLog_secChUaArch')" autocomplete="off" type="text" />
|
||||
</el-form-item>
|
||||
|
||||
<!-- 用户代理的底层CPU架构位数 -->
|
||||
<el-form-item :label="$t('userLoginLog_secChUaBitness')" prop="secChUaBitness">
|
||||
<el-input v-model="form.secChUaBitness" :placeholder="$t('input') + $t('userLoginLog_secChUaBitness')" autocomplete="off" type="text" />
|
||||
</el-form-item>
|
||||
|
||||
<!-- 用户代理是否在手机设备上运行 -->
|
||||
<el-form-item :label="$t('userLoginLog_secChUaMobile')" prop="secChUaMobile">
|
||||
<el-input v-model="form.secChUaMobile" :placeholder="$t('input') + $t('userLoginLog_secChUaMobile')" autocomplete="off" type="text" />
|
||||
</el-form-item>
|
||||
|
||||
<!-- 用户代理的设备模型 -->
|
||||
<el-form-item :label="$t('userLoginLog_secChUaModel')" prop="secChUaModel">
|
||||
<el-input v-model="form.secChUaModel" :placeholder="$t('input') + $t('userLoginLog_secChUaModel')" autocomplete="off" type="text" />
|
||||
</el-form-item>
|
||||
|
||||
<!-- 用户代理的底层操作系统/平台 -->
|
||||
<el-form-item :label="$t('userLoginLog_secChUaPlatform')" prop="secChUaPlatform">
|
||||
<el-input v-model="form.secChUaPlatform" :placeholder="$t('input') + $t('userLoginLog_secChUaPlatform')" autocomplete="off" type="text" />
|
||||
</el-form-item>
|
||||
|
||||
<!-- 用户代理的底层操作系统版本 -->
|
||||
<el-form-item :label="$t('userLoginLog_secChUaPlatformVersion')" prop="secChUaPlatformVersion">
|
||||
<el-input v-model="form.secChUaPlatformVersion" :placeholder="$t('input') + $t('userLoginLog_secChUaPlatformVersion')" autocomplete="off" type="text" />
|
||||
</el-form-item>
|
||||
|
||||
<!-- 客户端设备像素比 -->
|
||||
<el-form-item :label="$t('userLoginLog_contentDpr')" prop="contentDpr">
|
||||
<el-input v-model="form.contentDpr" :placeholder="$t('input') + $t('userLoginLog_contentDpr')" autocomplete="off" type="text" />
|
||||
</el-form-item>
|
||||
|
||||
<!-- 客户端RAM内存的近似值 -->
|
||||
<el-form-item :label="$t('userLoginLog_deviceMemory')" prop="deviceMemory">
|
||||
<el-input v-model="form.deviceMemory" :placeholder="$t('input') + $t('userLoginLog_deviceMemory')" autocomplete="off" type="text" />
|
||||
</el-form-item>
|
||||
|
||||
<!-- 客户端设备像素比 -->
|
||||
<el-form-item :label="$t('userLoginLog_dpr')" prop="dpr">
|
||||
<el-input v-model="form.dpr" :placeholder="$t('input') + $t('userLoginLog_dpr')" autocomplete="off" type="text" />
|
||||
</el-form-item>
|
||||
|
||||
<!-- 布局视口宽度 -->
|
||||
<el-form-item :label="$t('userLoginLog_viewportWidth')" prop="viewportWidth">
|
||||
<el-input v-model="form.viewportWidth" :placeholder="$t('input') + $t('userLoginLog_viewportWidth')" autocomplete="off" type="text" />
|
||||
</el-form-item>
|
||||
|
||||
<!-- 所需资源宽度 -->
|
||||
<el-form-item :label="$t('userLoginLog_width')" prop="width">
|
||||
<el-input v-model="form.width" :placeholder="$t('input') + $t('userLoginLog_width')" autocomplete="off" type="text" />
|
||||
</el-form-item>
|
||||
|
||||
<!-- 客户端连接到服务器的近似带宽 -->
|
||||
<el-form-item :label="$t('userLoginLog_downlink')" prop="downlink">
|
||||
<el-input v-model="form.downlink" :placeholder="$t('input') + $t('userLoginLog_downlink')" autocomplete="off" type="text" />
|
||||
</el-form-item>
|
||||
|
||||
<!-- 有效连接类型 -->
|
||||
<el-form-item :label="$t('userLoginLog_ect')" prop="ect">
|
||||
<el-input v-model="form.ect" :placeholder="$t('input') + $t('userLoginLog_ect')" autocomplete="off" type="text" />
|
||||
</el-form-item>
|
||||
|
||||
<!-- 应用层往返时间 -->
|
||||
<el-form-item :label="$t('userLoginLog_rtt')" prop="rtt">
|
||||
<el-input v-model="form.rtt" :placeholder="$t('input') + $t('userLoginLog_rtt')" autocomplete="off" type="text" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</template>
|
||||
|
|
|
@ -10,47 +10,23 @@ export const columns: TableColumnList = [
|
|||
// 用户名
|
||||
{ label: $t('userLoginLog_username'), prop: 'username', width: 180 },
|
||||
// 登录Ip
|
||||
{ label: $t('userLoginLog_ipAddress'), prop: 'ipAddress', width: 180 },
|
||||
{ label: $t('userLoginLog_ipAddress'), prop: 'ipAddress', width: 140 },
|
||||
// 登录Ip归属地
|
||||
{ label: $t('userLoginLog_ipRegion'), prop: 'ipRegion', width: 130 },
|
||||
{ label: $t('userLoginLog_ipRegion'), prop: 'ipRegion', width: 100 },
|
||||
// 登录时代理
|
||||
{ label: $t('userLoginLog_userAgent'), prop: 'userAgent', width: 200 },
|
||||
// 操作类型
|
||||
{ label: $t('userLoginLog_type'), prop: 'type', width: 130 },
|
||||
{ label: $t('userLoginLog_type'), prop: 'type', width: 90 },
|
||||
// 标识客户端是否是通过Ajax发送请求的
|
||||
{ label: $t('userLoginLog_xRequestedWith'), prop: 'xRequestedWith', width: 130 },
|
||||
{ label: $t('userLoginLog_xRequestedWith'), prop: 'xRequestedWith', width: 150 },
|
||||
// 用户代理的品牌和版本
|
||||
{ label: $t('userLoginLog_secChUa'), prop: 'secChUa', width: 150 },
|
||||
// 用户代理的底层平台架构
|
||||
{ label: $t('userLoginLog_secChUaArch'), prop: 'secChUaArch', width: 150 },
|
||||
// 用户代理的底层CPU架构位数
|
||||
{ label: $t('userLoginLog_secChUaBitness'), prop: 'secChUaBitness', width: 150 },
|
||||
// 用户代理是否在手机设备上运行
|
||||
{ label: $t('userLoginLog_secChUaMobile'), prop: 'secChUaMobile', width: 150 },
|
||||
// 用户代理的设备模型
|
||||
{ label: $t('userLoginLog_secChUaModel'), prop: 'secChUaModel', width: 150 },
|
||||
{ label: $t('userLoginLog_secChUaMobile'), prop: 'secChUaMobile', width: 130 },
|
||||
// 用户代理的底层操作系统/平台
|
||||
{ label: $t('userLoginLog_secChUaPlatform'), prop: 'secChUaPlatform', width: 160 },
|
||||
// 用户代理的底层操作系统版本
|
||||
{ label: $t('userLoginLog_secChUaPlatformVersion'), prop: 'secChUaPlatformVersion', width: 180 },
|
||||
// 客户端设备像素比
|
||||
{ label: $t('userLoginLog_contentDpr'), prop: 'contentDpr', width: 150 },
|
||||
// 客户端RAM内存的近似值
|
||||
{ label: $t('userLoginLog_deviceMemory'), prop: 'deviceMemory', width: 150 },
|
||||
// 客户端设备像素比
|
||||
{ label: $t('userLoginLog_dpr'), prop: 'dpr', width: 150 },
|
||||
// 布局视口宽度
|
||||
{ label: $t('userLoginLog_viewportWidth'), prop: 'viewportWidth', width: 150 },
|
||||
// 所需资源宽度
|
||||
{ label: $t('userLoginLog_width'), prop: 'width', width: 150 },
|
||||
// 客户端连接到服务器的近似带宽
|
||||
{ label: $t('userLoginLog_downlink'), prop: 'downlink', width: 150 },
|
||||
// 有效连接类型
|
||||
{ label: $t('userLoginLog_ect'), prop: 'ect', width: 150 },
|
||||
// 应用层往返时间
|
||||
{ label: $t('userLoginLog_rtt'), prop: 'rtt', width: 150 },
|
||||
{ label: $t('userLoginLog_secChUaPlatform'), prop: 'secChUaPlatform', width: 130 },
|
||||
// 登录token
|
||||
{ label: $t('userLoginLog_token'), prop: 'token', width: 260 },
|
||||
{ label: $t('userLoginLog_token'), prop: 'token', width: 200 },
|
||||
{ label: $t('table.updateTime'), prop: 'updateTime', sortable: true, width: 160 },
|
||||
{ label: $t('table.createTime'), prop: 'createTime', sortable: true, width: 160 },
|
||||
{ label: $t('table.createUser'), prop: 'createUser', slot: 'createUser', width: 90 },
|
||||
|
@ -59,63 +35,4 @@ export const columns: TableColumnList = [
|
|||
];
|
||||
|
||||
// 添加规则
|
||||
export const rules = reactive({
|
||||
// 用户Id
|
||||
userId: [{ required: true, message: `${$t('input')}${$t('userLoginLog_userId')}`, trigger: 'blur' }],
|
||||
// 用户名
|
||||
username: [{ required: true, message: `${$t('input')}${$t('userLoginLog_username')}`, trigger: 'blur' }],
|
||||
// 登录token
|
||||
token: [{ required: true, message: `${$t('input')}${$t('userLoginLog_token')}`, trigger: 'blur' }],
|
||||
// 登录Ip
|
||||
ipAddress: [{ required: true, message: `${$t('input')}${$t('userLoginLog_ipAddress')}`, trigger: 'blur' }],
|
||||
// 登录Ip归属地
|
||||
ipRegion: [{ required: true, message: `${$t('input')}${$t('userLoginLog_ipRegion')}`, trigger: 'blur' }],
|
||||
// 登录时代理
|
||||
userAgent: [{ required: true, message: `${$t('input')}${$t('userLoginLog_userAgent')}`, trigger: 'blur' }],
|
||||
// 操作类型
|
||||
type: [{ required: true, message: `${$t('input')}${$t('userLoginLog_type')}`, trigger: 'blur' }],
|
||||
// 标识客户端是否是通过Ajax发送请求的
|
||||
xRequestedWith: [{ required: true, message: `${$t('input')}${$t('userLoginLog_xRequestedWith')}`, trigger: 'blur' }],
|
||||
// 用户代理的品牌和版本
|
||||
secChUa: [{ required: true, message: `${$t('input')}${$t('userLoginLog_secChUa')}`, trigger: 'blur' }],
|
||||
// 用户代理的底层平台架构
|
||||
secChUaArch: [{ required: true, message: `${$t('input')}${$t('userLoginLog_secChUaArch')}`, trigger: 'blur' }],
|
||||
// 用户代理的底层CPU架构位数
|
||||
secChUaBitness: [{ required: true, message: `${$t('input')}${$t('userLoginLog_secChUaBitness')}`, trigger: 'blur' }],
|
||||
// 用户代理是否在手机设备上运行
|
||||
secChUaMobile: [{ required: true, message: `${$t('input')}${$t('userLoginLog_secChUaMobile')}`, trigger: 'blur' }],
|
||||
// 用户代理的设备模型
|
||||
secChUaModel: [{ required: true, message: `${$t('input')}${$t('userLoginLog_secChUaModel')}`, trigger: 'blur' }],
|
||||
// 用户代理的底层操作系统/平台
|
||||
secChUaPlatform: [
|
||||
{
|
||||
required: true,
|
||||
message: `${$t('input')}${$t('userLoginLog_secChUaPlatform')}`,
|
||||
trigger: 'blur',
|
||||
},
|
||||
],
|
||||
// 用户代理的底层操作系统版本
|
||||
secChUaPlatformVersion: [
|
||||
{
|
||||
required: true,
|
||||
message: `${$t('input')}${$t('userLoginLog_secChUaPlatformVersion')}`,
|
||||
trigger: 'blur',
|
||||
},
|
||||
],
|
||||
// 客户端设备像素比
|
||||
contentDpr: [{ required: true, message: `${$t('input')}${$t('userLoginLog_contentDpr')}`, trigger: 'blur' }],
|
||||
// 客户端RAM内存的近似值
|
||||
deviceMemory: [{ required: true, message: `${$t('input')}${$t('userLoginLog_deviceMemory')}`, trigger: 'blur' }],
|
||||
// 客户端设备像素比
|
||||
dpr: [{ required: true, message: `${$t('input')}${$t('userLoginLog_dpr')}`, trigger: 'blur' }],
|
||||
// 布局视口宽度
|
||||
viewportWidth: [{ required: true, message: `${$t('input')}${$t('userLoginLog_viewportWidth')}`, trigger: 'blur' }],
|
||||
// 所需资源宽度
|
||||
width: [{ required: true, message: `${$t('input')}${$t('userLoginLog_width')}`, trigger: 'blur' }],
|
||||
// 客户端连接到服务器的近似带宽
|
||||
downlink: [{ required: true, message: `${$t('input')}${$t('userLoginLog_downlink')}`, trigger: 'blur' }],
|
||||
// 有效连接类型
|
||||
ect: [{ required: true, message: `${$t('input')}${$t('userLoginLog_ect')}`, trigger: 'blur' }],
|
||||
// 应用层往返时间
|
||||
rtt: [{ required: true, message: `${$t('input')}${$t('userLoginLog_rtt')}`, trigger: 'blur' }],
|
||||
});
|
||||
export const rules = reactive({});
|
||||
|
|
|
@ -3,7 +3,6 @@ import UserLoginLogDialog from '@/views/monitor/userLoginLog/user-login-log-dial
|
|||
import { useUserLoginLogStore } from '@/store/monitor/userLoginLog';
|
||||
import { h, ref } from 'vue';
|
||||
import { messageBox } from '@/utils/message';
|
||||
import type { FormItemProps } from '@/views/monitor/userLoginLog/utils/types';
|
||||
import { $t } from '@/plugins/i18n';
|
||||
|
||||
export const formRef = ref();
|
||||
|
@ -21,12 +20,12 @@ export async function onSearch() {
|
|||
}
|
||||
|
||||
/**
|
||||
* * 更新用户登录日志
|
||||
* * 查看用户登录日志
|
||||
* @param row
|
||||
*/
|
||||
export function onUpdate(row: any) {
|
||||
export function onView(row: any) {
|
||||
addDialog({
|
||||
title: `${$t('modify')}${$t('userLoginLog')}`,
|
||||
title: `${$t('view')}${$t('userLoginLog')}`,
|
||||
width: '30%',
|
||||
props: {
|
||||
formInline: {
|
||||
|
@ -39,36 +38,17 @@ export function onUpdate(row: any) {
|
|||
type: row.type,
|
||||
xRequestedWith: row.xRequestedWith,
|
||||
secChUa: row.secChUa,
|
||||
secChUaArch: row.secChUaArch,
|
||||
secChUaBitness: row.secChUaBitness,
|
||||
secChUaMobile: row.secChUaMobile,
|
||||
secChUaModel: row.secChUaModel,
|
||||
secChUaPlatform: row.secChUaPlatform,
|
||||
secChUaPlatformVersion: row.secChUaPlatformVersion,
|
||||
contentDpr: row.contentDpr,
|
||||
deviceMemory: row.deviceMemory,
|
||||
dpr: row.dpr,
|
||||
viewportWidth: row.viewportWidth,
|
||||
width: row.width,
|
||||
downlink: row.downlink,
|
||||
ect: row.ect,
|
||||
rtt: row.rtt,
|
||||
},
|
||||
},
|
||||
draggable: true,
|
||||
fullscreenIcon: true,
|
||||
closeOnClickModal: false,
|
||||
contentRenderer: () => h(UserLoginLogDialog, { ref: formRef }),
|
||||
beforeSure: (done, { options }) => {
|
||||
const form = options.props.formInline as FormItemProps;
|
||||
formRef.value.formRef.validate(async (valid: any) => {
|
||||
if (!valid) return;
|
||||
|
||||
const result = await userLoginLogStore.updateUserLoginLog({ ...form, id: row.id });
|
||||
if (!result) return;
|
||||
beforeSure: async done => {
|
||||
done();
|
||||
await onSearch();
|
||||
});
|
||||
},
|
||||
});
|
||||
}
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
// 添加或者修改表单元素
|
||||
|
||||
export interface FormItemProps {
|
||||
// 用户Id
|
||||
userId: number;
|
||||
|
@ -18,34 +19,12 @@ export interface FormItemProps {
|
|||
xRequestedWith: string;
|
||||
// 用户代理的品牌和版本
|
||||
secChUa: string;
|
||||
// 用户代理的底层平台架构
|
||||
secChUaArch: string;
|
||||
// 用户代理的底层CPU架构位数
|
||||
secChUaBitness: string;
|
||||
// 用户代理是否在手机设备上运行
|
||||
secChUaMobile: string;
|
||||
// 用户代理的设备模型
|
||||
secChUaModel: string;
|
||||
// 用户代理的底层操作系统/平台
|
||||
secChUaPlatform: string;
|
||||
// 用户代理的底层操作系统版本
|
||||
secChUaPlatformVersion: string;
|
||||
// 客户端设备像素比
|
||||
contentDpr: string;
|
||||
// 客户端RAM内存的近似值
|
||||
deviceMemory: string;
|
||||
// 客户端设备像素比
|
||||
dpr: string;
|
||||
// 布局视口宽度
|
||||
viewportWidth: string;
|
||||
// 所需资源宽度
|
||||
width: string;
|
||||
// 客户端连接到服务器的近似带宽
|
||||
downlink: string;
|
||||
// 有效连接类型
|
||||
ect: string;
|
||||
// 应用层往返时间
|
||||
rtt: string;
|
||||
}
|
||||
|
||||
// 添加或修改表单Props
|
||||
|
|
Loading…
Reference in New Issue