Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
D
dataease
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
njgzx
dataease
Commits
bab9634d
提交
bab9634d
authored
5月 26, 2022
作者:
fit2cloud-chenyw
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix: 日志导出增加条件
上级
04fe29a9
隐藏空白字符变更
内嵌
并排
正在显示
7 个修改的文件
包含
45 行增加
和
16 行删除
+45
-16
SysLogController.java
...ain/java/io/dataease/controller/sys/SysLogController.java
+3
-3
LogService.java
...src/main/java/io/dataease/service/sys/log/LogService.java
+15
-7
log.js
frontend/src/api/system/log.js
+3
-2
en.js
frontend/src/lang/en.js
+1
-0
tw.js
frontend/src/lang/tw.js
+1
-0
zh.js
frontend/src/lang/zh.js
+2
-1
index.vue
frontend/src/views/system/log/index.vue
+20
-3
没有找到文件。
backend/src/main/java/io/dataease/controller/sys/SysLogController.java
浏览文件 @
bab9634d
...
...
@@ -17,7 +17,6 @@ import io.swagger.annotations.ApiOperation;
import
org.springframework.web.bind.annotation.*
;
import
javax.annotation.Resource
;
import
javax.servlet.http.HttpServletResponse
;
import
java.util.List
;
@RestController
...
...
@@ -51,7 +50,8 @@ public class SysLogController {
@ApiOperation
(
"导出操作日志"
)
@PostMapping
(
"/export"
)
public
void
export
(
HttpServletResponse
response
)
throws
Exception
{
logService
.
exportExcel
(
response
);
@ApiImplicitParam
(
name
=
"request"
,
value
=
"查询条件"
,
required
=
true
)
public
void
export
(
@RequestBody
BaseGridRequest
request
)
throws
Exception
{
logService
.
exportExcel
(
request
);
}
}
backend/src/main/java/io/dataease/service/sys/log/LogService.java
浏览文件 @
bab9634d
...
...
@@ -11,6 +11,7 @@ import io.dataease.commons.constants.SysLogConstants;
import
io.dataease.commons.utils.AuthUtils
;
import
io.dataease.commons.utils.BeanUtils
;
import
io.dataease.commons.utils.CustomCellWriteUtil
;
import
io.dataease.commons.utils.ServletUtils
;
import
io.dataease.controller.sys.base.BaseGridRequest
;
import
io.dataease.controller.sys.base.ConditionEntity
;
import
io.dataease.dto.SysLogDTO
;
...
...
@@ -76,6 +77,15 @@ public class LogService {
public
List
<
SysLogGridDTO
>
query
(
BaseGridRequest
request
)
{
request
=
detailRequest
(
request
);
GridExample
gridExample
=
request
.
convertExample
();
List
<
SysLogWithBLOBs
>
voLogs
=
extSysLogMapper
.
query
(
gridExample
);
List
<
SysLogGridDTO
>
dtos
=
voLogs
.
stream
().
map
(
this
::
convertDTO
).
collect
(
Collectors
.
toList
());
return
dtos
;
}
private
BaseGridRequest
detailRequest
(
BaseGridRequest
request
)
{
List
<
ConditionEntity
>
conditions
=
request
.
getConditions
();
if
(
CollectionUtils
.
isNotEmpty
(
conditions
))
{
ConditionEntity
optypeCondition
=
null
;
...
...
@@ -107,11 +117,7 @@ public class LogService {
if
(
ObjectUtils
.
isNotEmpty
(
sourceCondition
))
conditions
.
add
(
sourceCondition
);
}
}
GridExample
gridExample
=
request
.
convertExample
();
List
<
SysLogWithBLOBs
>
voLogs
=
extSysLogMapper
.
query
(
gridExample
);
List
<
SysLogGridDTO
>
dtos
=
voLogs
.
stream
().
map
(
this
::
convertDTO
).
collect
(
Collectors
.
toList
());
return
dtos
;
return
request
;
}
...
...
@@ -206,8 +212,10 @@ public class LogService {
sysLogMapper
.
insert
(
sysLogWithBLOBs
);
}
public
void
exportExcel
(
HttpServletResponse
response
)
throws
Exception
{
BaseGridRequest
request
=
new
BaseGridRequest
();
public
void
exportExcel
(
BaseGridRequest
request
)
throws
Exception
{
request
=
detailRequest
(
request
);
HttpServletResponse
response
=
ServletUtils
.
response
();
GridExample
gridExample
=
request
.
convertExample
();
List
<
SysLogWithBLOBs
>
lists
=
extSysLogMapper
.
query
(
gridExample
);
List
<
LogExcel
>
excels
=
lists
.
stream
().
map
(
item
->
{
...
...
frontend/src/api/system/log.js
浏览文件 @
bab9634d
...
...
@@ -17,11 +17,12 @@ export function opTypes() {
})
}
export
function
exportExcel
()
{
export
function
exportExcel
(
data
)
{
return
request
({
url
:
'/api/log/export'
,
method
:
'post'
,
loading
:
true
,
responseType
:
'blob'
responseType
:
'blob'
,
data
})
}
frontend/src/lang/en.js
浏览文件 @
bab9634d
...
...
@@ -2054,6 +2054,7 @@ export default {
user
:
'User'
,
time
:
'Time'
,
export
:
'Export'
,
confirm
:
'Sure Export ?'
,
search_by_key
:
'Search by key'
},
plugin_style
:
{
...
...
frontend/src/lang/tw.js
浏览文件 @
bab9634d
...
...
@@ -2065,6 +2065,7 @@ export default {
user
:
'操作用戶'
,
time
:
'操作時間'
,
export
:
'導出'
,
confirm
:
'確定導出嗎?'
,
search_by_key
:
'搜索詳情'
},
plugin_style
:
{
...
...
frontend/src/lang/zh.js
浏览文件 @
bab9634d
...
...
@@ -1340,7 +1340,7 @@ export default {
show_info
:
'驱动信息'
,
file_name
:
'文件名'
,
version
:
'版本'
,
please_set_driverClass
:
'请指定驱动类'
,
please_set_driverClass
:
'请指定驱动类'
},
datasource
:
{
auth_method
:
'认证方式'
,
...
...
@@ -2072,6 +2072,7 @@ export default {
user
:
'操作用户'
,
time
:
'操作时间'
,
export
:
'导出'
,
confirm
:
'确定导出吗?'
,
search_by_key
:
'搜索详情'
},
plugin_style
:
{
...
...
frontend/src/views/system/log/index.vue
浏览文件 @
bab9634d
...
...
@@ -11,7 +11,7 @@
@
sort-change=
"sortChange"
>
<template
#
toolbar
>
<el-button
v-permission=
"['log:export']"
icon=
"el-icon-download"
size=
"mini"
@
click=
"export
Data
"
>
{{
$t
(
'log.export'
)
}}
</el-button>
<el-button
v-permission=
"['log:export']"
icon=
"el-icon-download"
size=
"mini"
@
click=
"export
Confirm
"
>
{{
$t
(
'log.export'
)
}}
</el-button>
</
template
>
<el-table-column
:show-overflow-tooltip=
"true"
prop=
"opType"
:label=
"$t('log.optype')"
width=
"140"
>
...
...
@@ -92,9 +92,26 @@ export default {
},
methods
:
{
exportConfirm
()
{
this
.
$confirm
(
this
.
$t
(
'log.confirm'
),
''
,
{
confirmButtonText
:
this
.
$t
(
'commons.confirm'
),
cancelButtonText
:
this
.
$t
(
'commons.cancel'
),
type
:
'warning'
}).
then
(()
=>
{
this
.
exportData
()
}).
catch
(()
=>
{
// this.$info(this.$t('commons.delete_cancel'))
})
},
exportData
()
{
console
.
log
(
'exportting...'
)
exportExcel
().
then
(
res
=>
{
let
condition
=
this
.
last_condition
condition
=
formatQuickCondition
(
condition
,
'key'
)
const
temp
=
formatCondition
(
condition
)
const
param
=
temp
||
{}
param
[
'orders'
]
=
formatOrders
(
this
.
orderConditions
)
exportExcel
(
param
).
then
(
res
=>
{
const
blob
=
new
Blob
([
res
],
{
type
:
'application/vnd.ms-excel'
})
const
link
=
document
.
createElement
(
'a'
)
link
.
style
.
display
=
'none'
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论