Merge branch 'framework' of https://gitee.com/ccnetcore/Yi into framework
This commit is contained in:
@@ -9,15 +9,7 @@ namespace Yi.Framework.OperLog
|
|||||||
{
|
{
|
||||||
public class OperationLogGetListInputVo : PagedAllResultRequestDto
|
public class OperationLogGetListInputVo : PagedAllResultRequestDto
|
||||||
{
|
{
|
||||||
public string? Title { get; set; }
|
public OperEnum? OperType { get; set; }
|
||||||
public OperEnum OperType { get; set; }
|
|
||||||
public string? RequestMethod { get; set; }
|
|
||||||
public string? OperUser { get; set; }
|
public string? OperUser { get; set; }
|
||||||
public string? OperIp { get; set; }
|
|
||||||
public string? OperLocation { get; set; }
|
|
||||||
public string? Method { get; set; }
|
|
||||||
public string? RequestParam { get; set; }
|
|
||||||
public string? RequestResult { get; set; }
|
|
||||||
public DateTime CreationTime { get; set; }
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -12,9 +12,23 @@ namespace Yi.Framework.OperLog
|
|||||||
public class OperationLogService : CrudAppService<OperationLogEntity, OperationLogGetListOutputDto, long, OperationLogGetListInputVo>,
|
public class OperationLogService : CrudAppService<OperationLogEntity, OperationLogGetListOutputDto, long, OperationLogGetListInputVo>,
|
||||||
IOperationLogService, IAutoApiService
|
IOperationLogService, IAutoApiService
|
||||||
{
|
{
|
||||||
public override Task<PagedResultDto<OperationLogGetListOutputDto>> GetListAsync(OperationLogGetListInputVo input)
|
public override async Task<PagedResultDto<OperationLogGetListOutputDto>> GetListAsync(OperationLogGetListInputVo input)
|
||||||
{
|
{
|
||||||
return base.GetListAsync(input);
|
var entity = await MapToEntityAsync(input);
|
||||||
|
|
||||||
|
RefAsync<int> total = 0;
|
||||||
|
|
||||||
|
var entities = await _DbQueryable.WhereIF(!string.IsNullOrEmpty(input.OperUser), x => x.OperUser.Contains(input.OperUser!))
|
||||||
|
.WhereIF(input.OperType is not null, x => x.OperType==input.OperType)
|
||||||
|
.WhereIF(input.StartTime is not null && input.EndTime is not null, x => x.CreationTime >= input.StartTime && x.CreationTime <= input.EndTime)
|
||||||
|
.ToPageListAsync(input.PageNum, input.PageSize, total);
|
||||||
|
return new PagedResultDto<OperationLogGetListOutputDto>(total, await MapToGetListOutputDtosAsync(entities));
|
||||||
|
}
|
||||||
|
|
||||||
|
[NonAction]
|
||||||
|
public override Task<OperationLogGetListOutputDto> UpdateAsync(long id, OperationLogGetListOutputDto input)
|
||||||
|
{
|
||||||
|
return base.UpdateAsync(id, input);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -99,6 +99,7 @@ namespace Yi.RBAC.Application.Identity
|
|||||||
}
|
}
|
||||||
|
|
||||||
entity.State = state;
|
entity.State = state;
|
||||||
|
await _repository.UpdateAsync(entity);
|
||||||
return await MapToGetOutputDtoAsync(entity);
|
return await MapToGetOutputDtoAsync(entity);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
using NET.AutoWebApi.Setting;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
|
using NET.AutoWebApi.Setting;
|
||||||
using SqlSugar;
|
using SqlSugar;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
@@ -29,5 +30,10 @@ namespace Yi.RBAC.Application.Logs
|
|||||||
return new PagedResultDto<LoginLogGetListOutputDto>(total, await MapToGetListOutputDtosAsync(entities));
|
return new PagedResultDto<LoginLogGetListOutputDto>(total, await MapToGetListOutputDtosAsync(entities));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[NonAction]
|
||||||
|
public override Task<LoginLogGetListOutputDto> UpdateAsync(long id, LoginLogGetListOutputDto input)
|
||||||
|
{
|
||||||
|
return base.UpdateAsync(id, input);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ import request from '@/utils/request'
|
|||||||
// 查询操作日志列表
|
// 查询操作日志列表
|
||||||
export function list(query) {
|
export function list(query) {
|
||||||
return request({
|
return request({
|
||||||
url: '/operationLog/pageList',
|
url: '/operation-log',
|
||||||
method: 'get',
|
method: 'get',
|
||||||
params: query
|
params: query
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -155,8 +155,8 @@
|
|||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
<el-form-item label="操作状态:">
|
<el-form-item label="操作状态:">
|
||||||
<div v-if="form.isDeleted === false">正常</div>
|
<div v-if="form.state === true">正常</div>
|
||||||
<div v-else-if="form.isDeleted === true">失败</div>
|
<div v-else-if="form.state === false">失败</div>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
@@ -212,7 +212,7 @@ const { queryParams, form } = toRefs(data);
|
|||||||
function getList() {
|
function getList() {
|
||||||
loading.value = true;
|
loading.value = true;
|
||||||
list(proxy.addDateRange(queryParams.value, dateRange.value)).then(response => {
|
list(proxy.addDateRange(queryParams.value, dateRange.value)).then(response => {
|
||||||
operlogList.value = response.data.data;
|
operlogList.value = response.data.items;
|
||||||
total.value = response.data.total;
|
total.value = response.data.total;
|
||||||
loading.value = false;
|
loading.value = false;
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user