Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
guns-vip
Overview
Overview
Details
Activity
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
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
chenjunxiong
guns-vip
Commits
5d482ae3
Commit
5d482ae3
authored
Dec 05, 2018
by
Shelby
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
完成登录日志功能
parent
f77d7f25
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
94 additions
and
92 deletions
+94
-92
src/main/webapp/WEB-INF/system/log/login_log.html
+63
-22
src/main/webapp/assets/modular/system/log/login_log.js
+31
-70
No files found.
src/main/webapp/WEB-INF/system/log/login_log.html
View file @
5d482ae3
@layout("/common/_container.html"){
<script
src=
"../../../../../../../../JavaProject/Guns-Train/guns-admin/src/main/webapp/static/modular/system/log/login_log.js"
></script>
@layout("/common/_container.html",{plugins:["table","layer","sweet-alert","laydate"],js:["/assets/modular/system/log/login_log.js"]}){
<div
class=
"row"
>
<div
class=
"row"
id=
"loginLogPage"
>
<div
class=
"col-sm-12"
>
<div
class=
"col-lg-12"
>
<div
class=
"ibox float-e-margins"
>
<div
class=
"card card-outline-theme m-b-10"
>
<div
class=
"ibox-title"
>
<div
class=
"card-body"
>
<h5>
登录日志
</h5>
<div
class=
"form-horizontal"
>
</div>
<div
class=
"form-body"
>
<div
class=
"ibox-content"
>
<div
class=
"row row-lg"
>
<div
class=
"col-sm-12"
>
<div
class=
"row"
>
<div
class=
"row"
>
<div
class=
"col-sm-3"
>
<div
class=
"col-md-3"
>
<
#
TimeCon
id=
"beginTime"
name=
"开始时间"
isTime=
"false"
pattern=
"YYYY-MM-DD"
/>
<div
class=
"input-group"
>
<div
class=
"input-group-prepend"
>
<div
class=
"input-group-text"
>
开始时间
</div>
</div>
<input
type=
"text"
id=
"beginTime"
class=
"form-control"
placeholder=
"开始时间"
autocomplete=
"off"
>
</div>
</div>
<div
class=
"col-md-3"
>
<div
class=
"input-group"
>
<div
class=
"input-group-prepend"
>
<div
class=
"input-group-text"
>
结束时间
</div>
</div>
<input
type=
"text"
id=
"endTime"
class=
"form-control"
placeholder=
"结束时间"
autocomplete=
"off"
>
</div>
</div>
<div
class=
"col-md-3"
>
<div
class=
"input-group"
>
<div
class=
"input-group-prepend"
>
<div
class=
"input-group-text"
>
日志名称
</div>
</div>
<input
v-model=
"logName"
type=
"text"
class=
"form-control"
placeholder=
"日志名称"
autocomplete=
"off"
>
</div>
</div>
<div
class=
"col-md-3"
>
<div
class=
"input-group condition-button"
>
<div
class=
"input-group-btn condition-button"
>
<button
type=
"button"
id=
"check-minutes"
class=
"btn btn-info waves-effect waves-light condition-button-width"
onclick=
"LoginLog.search()"
>
查询
</button>
</div>
</div>
<div
class=
"col-sm-3"
>
<
#
TimeCon
id=
"endTime"
name=
"结束时间"
isTime=
"false"
pattern=
"YYYY-MM-DD"
/>
</div>
</div>
<div
class=
"col-sm-3"
>
<
#
NameCon
id=
"logName"
name=
"日志名称"
/>
</div>
</div>
<div
class=
"col-sm-3"
>
<
#
button
name=
"搜索"
icon=
"fa-search"
clickFun=
"LoginLog.search()"
/>
</div>
</div>
</div>
</div>
<div
class=
"hidden-xs"
id=
"LoginLogTableToolbar"
role=
"group"
>
<
#
button
name=
"清空日志"
icon=
"fa-plus"
clickFun=
"LoginLog.delLog()"
/>
</div>
</div>
<
#
table
id=
"LoginLogTable"
/>
</div>
</div>
</div>
</div>
<div
class=
"row"
>
<div
class=
"col-lg-12"
>
<div
class=
"card card-outline-theme m-b-0"
>
<div
class=
"card-body p-t-0 p-b-0"
>
<div
class=
"form-horizontal"
>
<div
class=
"form-actions"
>
<div
class=
"row"
>
<div
class=
"col-lg-12"
>
<div
class=
"card m-b-0 p-b-0"
>
<div
class=
"hidden-xs"
id=
"loginLogTableToolbar"
role=
"group"
>
<button
type=
"button"
class=
"btn btn-primary waves-effect"
onclick=
"LoginLog.delLog()"
>
<i
class=
"fa fa-plus"
></i>
清空日志
</button>
</div>
<
#
table
id=
"loginLogTable"
/>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<script
src=
"${ctxPath}/static/modular/system/log/login_log.js"
></script>
@}
@}
src/main/webapp/assets/modular/system/log/login_log.js
View file @
5d482ae3
/**
/**
*
日志管理初始化
*
角色管理的单例
*/
*/
var
LoginLog
=
{
var
LoginLog
=
{
id
:
"
L
oginLogTable"
,
//表格id
id
:
"
l
oginLogTable"
,
//表格id
seItem
:
null
,
//选中的条目
seItem
:
null
,
//选中的条目
table
:
null
,
table
:
null
,
layerIndex
:
-
1
layerIndex
:
-
1
,
condition
:
{
logName
:
""
}
};
};
/**
/**
...
@@ -16,27 +19,23 @@ LoginLog.initColumn = function () {
...
@@ -16,27 +19,23 @@ LoginLog.initColumn = function () {
{
field
:
'selectItem'
,
radio
:
true
},
{
field
:
'selectItem'
,
radio
:
true
},
{
title
:
'id'
,
field
:
'id'
,
visible
:
false
,
align
:
'center'
,
valign
:
'middle'
},
{
title
:
'id'
,
field
:
'id'
,
visible
:
false
,
align
:
'center'
,
valign
:
'middle'
},
{
title
:
'日志名称'
,
field
:
'logname'
,
align
:
'center'
,
valign
:
'middle'
,
sortable
:
true
},
{
title
:
'日志名称'
,
field
:
'logname'
,
align
:
'center'
,
valign
:
'middle'
,
sortable
:
true
},
{
title
:
'用户名称'
,
field
:
'userName'
,
align
:
'center'
,
valign
:
'middle'
},
{
title
:
'用户名称'
,
field
:
'userName'
,
align
:
'center'
,
valign
:
'middle'
,
sortable
:
true
},
{
title
:
'时间'
,
field
:
'createtime'
,
align
:
'center'
,
valign
:
'middle'
,
sortable
:
true
},
{
title
:
'时间'
,
field
:
'createtime'
,
align
:
'center'
,
valign
:
'middle'
,
sortable
:
true
},
{
title
:
'具体消息'
,
field
:
'
m
essage'
,
align
:
'center'
,
valign
:
'middle'
,
sortable
:
true
},
{
title
:
'具体消息'
,
field
:
'
regularM
essage'
,
align
:
'center'
,
valign
:
'middle'
,
sortable
:
true
},
{
title
:
'ip'
,
field
:
'ip'
,
align
:
'center'
,
valign
:
'middle'
,
sortable
:
true
}];
{
title
:
'ip'
,
field
:
'ip'
,
align
:
'center'
,
valign
:
'middle'
,
sortable
:
true
}];
};
};
/**
/**
*
检查是否选中
*
日志搜索
*/
*/
LoginLog
.
check
=
function
()
{
LoginLog
.
search
=
function
()
{
var
selected
=
$
(
'#'
+
this
.
id
).
bootstrapTable
(
'getSelections'
);
var
queryData
=
{};
if
(
selected
.
length
==
0
)
{
queryData
[
'beginTime'
]
=
$
(
"#beginTime"
).
val
();
Feng
.
info
(
"请先选中表格中的某一记录!"
);
queryData
[
'endTime'
]
=
$
(
"#endTime"
).
val
();
return
false
;
queryData
[
'logName'
]
=
LoginLog
.
condition
.
logName
;
}
else
{
LoginLog
.
table
.
refresh
({
query
:
queryData
});
LoginLog
.
seItem
=
selected
[
0
];
return
true
;
}
};
};
/**
/**
* 清空日志
* 清空日志
*/
*/
...
@@ -48,66 +47,28 @@ LoginLog.delLog = function () {
...
@@ -48,66 +47,28 @@ LoginLog.delLog = function () {
});
});
}
}
/**
* 查询日志列表
*/
LoginLog
.
search
=
function
()
{
var
queryData
=
{};
queryData
[
'logName'
]
=
$
(
"#logName"
).
val
();
queryData
[
'beginTime'
]
=
$
(
"#beginTime"
).
val
();
queryData
[
'endTime'
]
=
$
(
"#endTime"
).
val
();
LoginLog
.
table
.
refresh
({
query
:
queryData
});
};
$
(
function
()
{
$
(
function
()
{
init
();
LoginLog
.
app
=
new
Vue
({
el
:
'#loginLogPage'
,
data
:
LoginLog
.
condition
});
var
defaultColunms
=
LoginLog
.
initColumn
();
var
defaultColunms
=
LoginLog
.
initColumn
();
var
table
=
new
BSTable
(
LoginLog
.
id
,
"/loginLog/list"
,
defaultColunms
);
var
table
=
new
BSTable
(
LoginLog
.
id
,
"/loginLog/list"
,
defaultColunms
);
table
.
setPaginationType
(
"server"
);
table
.
setPaginationType
(
"server"
);
LoginLog
.
table
=
table
.
init
();
table
.
init
();
});
LoginLog
.
table
=
table
;
function
init
()
{
var
BootstrapTable
=
$
.
fn
.
bootstrapTable
.
Constructor
;
BootstrapTable
.
prototype
.
onSort
=
function
(
event
)
{
var
$this
=
event
.
type
===
"keypress"
?
$
(
event
.
currentTarget
)
:
$
(
event
.
currentTarget
).
parent
(),
$this_
=
this
.
$header
.
find
(
'th'
).
eq
(
$this
.
index
()),
sortName
=
this
.
header
.
sortNames
[
$this
.
index
()];
this
.
$header
.
add
(
this
.
$header_
).
find
(
'span.order'
).
remove
();
if
(
this
.
options
.
sortName
===
$this
.
data
(
'field'
))
{
this
.
options
.
sortOrder
=
this
.
options
.
sortOrder
===
'asc'
?
'desc'
:
'asc'
;
}
else
{
this
.
options
.
sortName
=
sortName
||
$this
.
data
(
'field'
);
this
.
options
.
sortOrder
=
$this
.
data
(
'order'
)
===
'asc'
?
'desc'
:
'asc'
;
}
this
.
trigger
(
'sort'
,
this
.
options
.
sortName
,
this
.
options
.
sortOrder
);
$this
.
add
(
$this_
).
data
(
'order'
,
this
.
options
.
sortOrder
);
// Assign the correct sortable arrow
this
.
getCaret
();
if
(
this
.
options
.
sidePagination
===
'server'
)
{
this
.
initServer
(
this
.
options
.
silentSort
);
return
;
}
this
.
initSort
();
laydate
.
render
({
this
.
initBody
();
elem
:
'#beginTime'
,
};
theme
:
'#009efb'
,
BootstrapTable
.
prototype
.
getCaret
=
function
()
{
max
:
Feng
.
currentDate
()
var
that
=
this
;
})
;
$
.
each
(
this
.
$header
.
find
(
'th'
),
function
(
i
,
th
)
{
laydate
.
render
({
var
sortName
=
that
.
header
.
sortNames
[
i
];
elem
:
'#endTime'
,
$
(
th
).
find
(
'.sortable'
).
removeClass
(
'desc asc'
).
addClass
((
sortName
||
$
(
th
).
data
(
'field'
))
===
that
.
options
.
sortName
?
that
.
options
.
sortOrder
:
'both'
);
theme
:
'#009efb'
,
max
:
Feng
.
currentDate
()
});
});
};
});
}
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