Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
W
web-template
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
张伯涛
web-template
Commits
b15898e2
Commit
b15898e2
authored
Dec 31, 2020
by
Asjoker
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
操作日志-导出
parent
3fa32d71
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
62 additions
and
36 deletions
+62
-36
loginInfo.js
src/api/monitor/loginInfo.js
+2
-1
operLog.js
src/api/monitor/operLog.js
+5
-4
index.vue
src/views/monitor/loginInfo/index.vue
+28
-16
index.vue
src/views/monitor/operLog/index.vue
+27
-15
No files found.
src/api/monitor/loginInfo.js
View file @
b15898e2
...
...
@@ -30,7 +30,8 @@ export function exportLogininfo(query) {
return
request
({
url
:
'/monitor/loginInfo/export'
,
method
:
'get'
,
params
:
query
params
:
query
,
responseType
:
'blob'
})
}
src/api/monitor/operLog.js
View file @
b15898e2
...
...
@@ -12,7 +12,7 @@ export function list(query) {
// 删除操作日志
export
function
delOperLog
(
operId
)
{
return
request
({
url
:
'/
authority/
monitor/operLog/'
+
operId
,
url
:
'/monitor/operLog/'
+
operId
,
method
:
'delete'
})
}
...
...
@@ -20,7 +20,7 @@ export function delOperLog(operId) {
// 清空操作日志
export
function
cleanOperLog
()
{
return
request
({
url
:
'/
authority/
monitor/operLog/clean/0'
,
url
:
'/monitor/operLog/clean/0'
,
method
:
'delete'
})
}
...
...
@@ -28,8 +28,9 @@ export function cleanOperLog() {
// 导出操作日志
export
function
exportOperLog
(
query
)
{
return
request
({
url
:
'/
authority/
monitor/operLog/export'
,
url
:
'/monitor/operLog/export'
,
method
:
'get'
,
params
:
query
params
:
query
,
responseType
:
'blob'
})
}
src/views/monitor/loginInfo/index.vue
View file @
b15898e2
...
...
@@ -126,7 +126,7 @@
<!-- <el-table-column label="浏览器" align="center" prop="browser" />
<el-table-column label="操作系统" align="center" prop="os" />-->
<el-table-column
label=
"登录状态"
align=
"center"
prop=
"status"
:formatter=
"statusFormat"
/>
<el-table-column
label=
"
操作
信息"
align=
"center"
prop=
"msg"
/>
<el-table-column
label=
"
提示
信息"
align=
"center"
prop=
"msg"
/>
<el-table-column
label=
"登录时间"
align=
"center"
prop=
"loginTime"
width=
"180"
show-overflow-tooltip
>
<
template
slot-scope=
"scope"
>
<span>
{{
parseTime
(
scope
.
row
.
loginTime
)
|
transformDateByFormat
(
'YYYY-MM-DD HH:mm:ss'
)
}}
</span>
...
...
@@ -244,21 +244,33 @@ export default {
},
/** 导出按钮操作 */
handleExport
()
{
const
queryParams
=
Object
.
assign
({},
this
.
queryParams
)
// queryParams.loginTime = queryParams.loginTime ? this.$parseDate(new Date(queryParams.loginTime), 'YYYY-MM-DD HH:mm:ss') : ''
delete
queryParams
.
page
delete
queryParams
.
rows
queryParams
.
ids
=
this
.
ids
.
join
(
','
)
||
null
exportLogininfo
(
queryParams
).
then
(
response
=>
{
this
.
download
(
response
.
msg
)
}).
catch
(
function
()
{})
// this.$confirm('是否确认导出所有操作日志数据项?', '提示', {
// confirmButtonText: '确定',
// cancelButtonText: '取消',
// type: 'warning'
// }).then(function() {
// return exportLogininfo(queryParams)
// })
// const queryParams = Object.assign({}, this.queryParams)
// // queryParams.loginTime = queryParams.loginTime ? this.$parseDate(new Date(queryParams.loginTime), 'YYYY-MM-DD HH:mm:ss') : ''
// delete queryParams.page
// delete queryParams.rows
// queryParams.ids = this.ids.join(',') || null
// exportLogininfo(queryParams).then(response => {
// this.download(response.msg)
// }).catch(function() {})
const
queryParams
=
this
.
queryParams
this
.
$confirm
(
'是否确认导出所有操作日志数据项?'
,
'提示'
,
{
confirmButtonText
:
'确定'
,
cancelButtonText
:
'取消'
,
type
:
'warning'
}).
then
(
function
()
{
return
exportLogininfo
(
queryParams
).
then
(
response
=>
{
const
blob
=
new
Blob
([
response
])
const
downloadElement
=
document
.
createElement
(
'a'
)
const
href
=
window
.
URL
.
createObjectURL
(
blob
)
// 创建下载的链接
downloadElement
.
href
=
href
downloadElement
.
download
=
'登录日志'
+
'.xls'
// 下载后文件名
document
.
body
.
appendChild
(
downloadElement
)
downloadElement
.
click
()
// 点击下载
document
.
body
.
removeChild
(
downloadElement
)
// 下载完成移除元素
window
.
URL
.
revokeObjectURL
(
href
)
// 释放掉blob对象
// this.download(response.msg)
})
})
}
}
}
...
...
src/views/monitor/operLog/index.vue
View file @
b15898e2
...
...
@@ -336,21 +336,33 @@ export default {
},
/** 导出按钮操作 */
handleExport
()
{
const
queryParams
=
Object
.
assign
({},
this
.
queryParams
)
// queryParams.operTime = queryParams.operTime ? this.$parseDate(new Date(queryParams.operTime), 'YYYY-MM-DD HH:mm:ss') : ''
delete
queryParams
.
pu
delete
queryParams
.
ps
queryParams
.
ids
=
this
.
ids
.
join
(
','
)
||
null
exportOperLog
(
queryParams
).
then
(
response
=>
{
this
.
download
(
response
.
msg
)
}).
catch
(
function
()
{})
// this.$confirm('是否确认导出所有操作日志数据项?', '提示', {
// confirmButtonText: '确定',
// cancelButtonText: '取消',
// type: 'warning'
// }).then(() => {
// exportOperLog(queryParams)
// }).catch()
// const queryParams = Object.assign({}, this.queryParams)
// // queryParams.operTime = queryParams.operTime ? this.$parseDate(new Date(queryParams.operTime), 'YYYY-MM-DD HH:mm:ss') : ''
// delete queryParams.pu
// delete queryParams.ps
// queryParams.ids = this.ids.join(',') || null
// exportOperLog(queryParams).then(response => {
// this.download(response.msg)
// }).catch(function() {})
const
queryParams
=
this
.
queryParams
this
.
$confirm
(
'是否确认导出所有操作日志数据项?'
,
'提示'
,
{
confirmButtonText
:
'确定'
,
cancelButtonText
:
'取消'
,
type
:
'warning'
}).
then
(
function
()
{
return
exportOperLog
(
queryParams
).
then
(
response
=>
{
const
blob
=
new
Blob
([
response
])
const
downloadElement
=
document
.
createElement
(
'a'
)
const
href
=
window
.
URL
.
createObjectURL
(
blob
)
// 创建下载的链接
downloadElement
.
href
=
href
downloadElement
.
download
=
'操作日志'
+
'.xls'
// 下载后文件名
document
.
body
.
appendChild
(
downloadElement
)
downloadElement
.
click
()
// 点击下载
document
.
body
.
removeChild
(
downloadElement
)
// 下载完成移除元素
window
.
URL
.
revokeObjectURL
(
href
)
// 释放掉blob对象
// this.download(response.msg)
})
})
}
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment