个人中心增加查看自己操作日志
This commit is contained in:
parent
989700cb30
commit
dd01e00bb6
@ -38,7 +38,7 @@ namespace ZR.Admin.WebApi.Controllers.monitor
|
||||
[HttpGet("list")]
|
||||
public IActionResult OperList([FromQuery] SysOperLogDto sysOperLog)
|
||||
{
|
||||
PagerInfo pagerInfo = new PagerInfo(sysOperLog.pageNum);
|
||||
PagerInfo pagerInfo = new(sysOperLog.pageNum, sysOperLog.PageSize);
|
||||
|
||||
var list = sysOperLogService.SelectOperLogList(sysOperLog, pagerInfo);
|
||||
|
||||
|
||||
@ -45,7 +45,7 @@ namespace ZR.Admin.WebApi.Hubs
|
||||
{
|
||||
clientUsers.Add(new OnlineUsers(Context.ConnectionId, name));
|
||||
Console.WriteLine($"{DateTime.Now}:{name},{Context.ConnectionId}连接服务端success,当前已连接{clientUsers.Count}个");
|
||||
Clients.All.SendAsync("welcome", $"欢迎您:{name},当前时间:{DateTime.Now}");
|
||||
//Clients.All.SendAsync("welcome", $"欢迎您:{name},当前时间:{DateTime.Now}");
|
||||
Clients.All.SendAsync(HubsConstant.MoreNotice, SendNotice());
|
||||
}
|
||||
|
||||
|
||||
@ -11,6 +11,7 @@ namespace ZR.Model.System.Dto
|
||||
/// 页码
|
||||
/// </summary>
|
||||
public int pageNum { get; set; }
|
||||
public int PageSize { get; set; }
|
||||
/// <summary>
|
||||
/// 操作人员
|
||||
/// </summary>
|
||||
|
||||
@ -43,9 +43,9 @@
|
||||
</el-col>
|
||||
<el-col :span="18" :xs="24">
|
||||
<el-card>
|
||||
<div slot="header" class="clearfix">
|
||||
<!-- <div slot="header" class="clearfix">
|
||||
<span>基本资料</span>
|
||||
</div>
|
||||
</div> -->
|
||||
<el-tabs v-model="activeTab">
|
||||
<el-tab-pane label="基本资料" name="userinfo">
|
||||
<userInfo :user="user" />
|
||||
@ -53,6 +53,9 @@
|
||||
<el-tab-pane label="修改密码" name="resetPwd">
|
||||
<resetPwd :user="user" />
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="操作日志" name="log">
|
||||
<operLog></operLog>
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
</el-card>
|
||||
</el-col>
|
||||
@ -64,17 +67,19 @@
|
||||
import userAvatar from "./userAvatar";
|
||||
import userInfo from "./userInfo";
|
||||
import resetPwd from "./resetPwd";
|
||||
import operLog from "./operLog.vue";
|
||||
import { getUserProfile } from "@/api/system/user";
|
||||
|
||||
export default {
|
||||
name: "Profile",
|
||||
components: { userAvatar, userInfo, resetPwd },
|
||||
components: { userAvatar, userInfo, resetPwd, operLog },
|
||||
data() {
|
||||
return {
|
||||
user: {},
|
||||
roles: [],
|
||||
postGroup: '',
|
||||
postGroup: "",
|
||||
activeTab: "userinfo",
|
||||
activeName: "first",
|
||||
};
|
||||
},
|
||||
created() {
|
||||
@ -89,6 +94,9 @@ export default {
|
||||
this.postGroup = response.data.postGroup;
|
||||
});
|
||||
},
|
||||
handleTabClick(tab, event) {
|
||||
console.log(tab, event);
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
135
ZR.Vue/src/views/system/user/profile/operLog.vue
Normal file
135
ZR.Vue/src/views/system/user/profile/operLog.vue
Normal file
@ -0,0 +1,135 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
|
||||
<el-form-item label="操作时间">
|
||||
<el-date-picker v-model="dateRange" size="small" style="width: 240px" value-format="yyyy-MM-dd" type="daterange" range-separator="-"
|
||||
start-placeholder="开始日期" end-placeholder="结束日期"></el-date-picker>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<el-table v-loading="loading" :data="list">
|
||||
<el-table-column label="编号" align="center" prop="operId" width="60px" :show-overflow-tooltip="true" />
|
||||
<el-table-column label="系统模块" align="center" prop="title" :show-overflow-tooltip="true" />
|
||||
<el-table-column prop="businessType" label="业务类型" align="center">
|
||||
<template slot-scope="scope">
|
||||
<dict-tag :options="businessTypeOptions" :value="scope.row.businessType" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="请求方式" align="center" prop="requestMethod" />
|
||||
<el-table-column label="操作地点" align="center" prop="operLocation" :show-overflow-tooltip="true" />
|
||||
<el-table-column label="操作状态" align="center" prop="status">
|
||||
<template slot-scope="{row}">
|
||||
<dict-tag :options="statusOptions" :value="row.status"></dict-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column label="日志内容" align="center" prop="errorMsg" :show-overflow-tooltip="true" />
|
||||
<el-table-column label="操作日期" align="center" prop="operTime" width="180">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ scope.row.operTime }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<pagination v-show="total>0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize" @pagination="getList" />
|
||||
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { list } from "@/api/monitor/operlog";
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
// 遮罩层
|
||||
loading: true,
|
||||
// 选中数组
|
||||
ids: [],
|
||||
// 非多个禁用
|
||||
multiple: true,
|
||||
// 显示搜索条件
|
||||
showSearch: true,
|
||||
// 总条数
|
||||
total: 0,
|
||||
// 表格数据
|
||||
list: [],
|
||||
// 是否显示弹出层
|
||||
open: false,
|
||||
// 类型数据字典
|
||||
statusOptions: [],
|
||||
// 业务类型(0其它 1新增 2修改 3删除)选项列表 格式 eg:{ dictLabel: '标签', dictValue: '0'}
|
||||
businessTypeOptions: [],
|
||||
// 日期范围
|
||||
dateRange: [],
|
||||
// 表单参数
|
||||
form: {},
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
title: undefined,
|
||||
operName: undefined,
|
||||
businessType: undefined,
|
||||
status: undefined,
|
||||
},
|
||||
};
|
||||
},
|
||||
created() {
|
||||
this.getList();
|
||||
var dictParams = [
|
||||
{ dictType: "sys_oper_type", columnName: "businessTypeOptions" },
|
||||
{ dictType: "sys_common_status", columnName: "statusOptions" },
|
||||
];
|
||||
this.getDicts(dictParams).then((response) => {
|
||||
response.data.forEach((element) => {
|
||||
this[element.columnName] = element.list;
|
||||
});
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
/** 查询登录日志 */
|
||||
getList() {
|
||||
this.loading = true;
|
||||
this.queryParams.operName = this.$store.getters.userinfo.userName;
|
||||
list(this.addDateRange(this.queryParams, this.dateRange)).then(
|
||||
(response) => {
|
||||
this.loading = false;
|
||||
if (response.code == 200) {
|
||||
this.list = response.data.result;
|
||||
this.total = response.data.totalNum;
|
||||
} else {
|
||||
this.total = 0;
|
||||
this.list = [];
|
||||
}
|
||||
}
|
||||
);
|
||||
},
|
||||
// 操作日志状态字典翻译
|
||||
statusFormat(row, column) {
|
||||
return this.selectDictLabel(this.statusOptions, row.status);
|
||||
},
|
||||
/** 搜索按钮操作 */
|
||||
handleQuery() {
|
||||
this.queryParams.pageNum = 1;
|
||||
this.getList();
|
||||
},
|
||||
/** 重置按钮操作 */
|
||||
resetQuery() {
|
||||
this.dateRange = [];
|
||||
this.resetForm("queryForm");
|
||||
this.handleQuery();
|
||||
},
|
||||
/** 详细按钮操作 */
|
||||
handleView(row) {
|
||||
this.open = true;
|
||||
this.form = row;
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user