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
a4db626d
Commit
a4db626d
authored
Apr 26, 2017
by
fsn
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
更新判断表格中是否选中条目的机制
parent
afc2e240
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
45 additions
and
85 deletions
+45
-85
src/main/webapp/static/modular/system/dept/dept.js
+4
-14
src/main/webapp/static/modular/system/log/log.js
+4
-12
src/main/webapp/static/modular/system/menu/menu.js
+3
-10
src/main/webapp/static/modular/system/role/role.js
+31
-38
src/main/webapp/static/modular/system/user/user.js
+3
-11
No files found.
src/main/webapp/static/modular/system/dept/dept.js
View file @
a4db626d
...
...
@@ -23,22 +23,15 @@ Dept.initColumn = function () {
};
/**
* 绑定表格的事件
*/
Dept
.
bindEvent
=
function
()
{
$
(
'#'
+
this
.
id
).
on
(
'click-row.bs.table'
,
function
(
e
,
row
)
{
Dept
.
seItem
=
row
;
});
};
/**
* 检查是否选中
*/
Dept
.
check
=
function
()
{
if
(
this
.
seItem
==
null
)
{
var
selected
=
$
(
'#'
+
this
.
id
).
bootstrapTable
(
'getSelections'
);
if
(
selected
.
length
==
0
){
Feng
.
info
(
"请先选中表格中的某一记录!"
);
return
false
;
}
else
{
}
else
{
Dept
.
seItem
=
selected
[
0
];
return
true
;
}
};
...
...
@@ -95,9 +88,7 @@ Dept.delete = function () {
*/
Dept
.
search
=
function
()
{
var
queryData
=
{};
queryData
[
'condition'
]
=
$
(
"#condition"
).
val
();
Dept
.
table
.
refresh
({
query
:
queryData
});
};
...
...
@@ -106,5 +97,4 @@ $(function () {
var
table
=
new
BSTable
(
Dept
.
id
,
"/dept/list"
,
defaultColunms
);
table
.
setPaginationType
(
"client"
);
Dept
.
table
=
table
.
init
();
Dept
.
bindEvent
();
});
src/main/webapp/static/modular/system/log/log.js
View file @
a4db626d
...
...
@@ -25,22 +25,15 @@ OptLog.initColumn = function () {
};
/**
* 绑定表格的事件
*/
OptLog
.
bindEvent
=
function
()
{
$
(
'#'
+
this
.
id
).
on
(
'click-row.bs.table'
,
function
(
e
,
row
)
{
OptLog
.
seItem
=
row
;
});
};
/**
* 检查是否选中
*/
OptLog
.
check
=
function
()
{
if
(
this
.
seItem
==
null
)
{
var
selected
=
$
(
'#'
+
this
.
id
).
bootstrapTable
(
'getSelections'
);
if
(
selected
.
length
==
0
){
Feng
.
info
(
"请先选中表格中的某一记录!"
);
return
false
;
}
else
{
}
else
{
OptLog
.
seItem
=
selected
[
0
];
return
true
;
}
};
...
...
@@ -88,5 +81,4 @@ $(function () {
var
table
=
new
BSTable
(
OptLog
.
id
,
"/log/list"
,
defaultColunms
);
table
.
setPaginationType
(
"server"
);
OptLog
.
table
=
table
.
init
();
OptLog
.
bindEvent
();
});
src/main/webapp/static/modular/system/menu/menu.js
View file @
a4db626d
...
...
@@ -25,23 +25,17 @@ Menu.initColumn = function () {
return
columns
;
};
/**
* 绑定表格的事件
*/
Menu
.
bindEvent
=
function
()
{
$
(
'#'
+
this
.
id
).
on
(
'click-row.bs.table'
,
function
(
e
,
row
,
$element
)
{
Menu
.
seItem
=
row
;
});
};
/**
* 检查是否选中
*/
Menu
.
check
=
function
()
{
if
(
this
.
seItem
==
null
)
{
var
selected
=
$
(
'#'
+
this
.
id
).
bootstrapTable
(
'getSelections'
);
if
(
selected
.
length
==
0
)
{
Feng
.
info
(
"请先选中表格中的某一记录!"
);
return
false
;
}
else
{
Menu
.
seItem
=
selected
[
0
];
return
true
;
}
};
...
...
@@ -110,6 +104,5 @@ $(function () {
var
table
=
new
BSTable
(
Menu
.
id
,
"/menu/list"
,
defaultColunms
);
table
.
setPaginationType
(
"client"
);
table
.
init
();
Menu
.
bindEvent
();
Menu
.
table
=
table
;
});
src/main/webapp/static/modular/system/role/role.js
View file @
a4db626d
...
...
@@ -2,43 +2,37 @@
* 角色管理的单例
*/
var
Role
=
{
id
:
"roleTable"
,
//表格id
seItem
:
null
,
//选中的条目
table
:
null
,
layerIndex
:
-
1
id
:
"roleTable"
,
//表格id
seItem
:
null
,
//选中的条目
table
:
null
,
layerIndex
:
-
1
};
/**
* 初始化表格的列
*/
Role
.
initColumn
=
function
()
{
Role
.
initColumn
=
function
()
{
var
columns
=
[
{
field
:
'selectItem'
,
radio
:
true
},
{
title
:
'id'
,
field
:
'id'
,
visible
:
false
,
align
:
'center'
,
valign
:
'middle'
},
{
title
:
'名称'
,
field
:
'name'
,
align
:
'center'
,
valign
:
'middle'
},
{
title
:
'上级角色'
,
field
:
'pName'
,
align
:
'center'
,
valign
:
'middle'
},
{
title
:
'所在部门'
,
field
:
'deptName'
,
align
:
'center'
,
valign
:
'middle'
},
{
title
:
'别名'
,
field
:
'tips'
,
align
:
'center'
,
valign
:
'middle'
}]
{
field
:
'selectItem'
,
radio
:
true
},
{
title
:
'id'
,
field
:
'id'
,
visible
:
false
,
align
:
'center'
,
valign
:
'middle'
},
{
title
:
'名称'
,
field
:
'name'
,
align
:
'center'
,
valign
:
'middle'
},
{
title
:
'上级角色'
,
field
:
'pName'
,
align
:
'center'
,
valign
:
'middle'
},
{
title
:
'所在部门'
,
field
:
'deptName'
,
align
:
'center'
,
valign
:
'middle'
},
{
title
:
'别名'
,
field
:
'tips'
,
align
:
'center'
,
valign
:
'middle'
}]
return
columns
;
};
/**
* 绑定表格的事件
*/
Role
.
bindEvent
=
function
(){
$
(
'#'
+
this
.
id
).
on
(
'click-row.bs.table'
,
function
(
e
,
row
,
$element
)
{
Role
.
seItem
=
row
;
});
};
/**
* 检查是否选中
*/
Role
.
check
=
function
(){
if
(
this
.
seItem
==
null
){
Role
.
check
=
function
()
{
var
selected
=
$
(
'#'
+
this
.
id
).
bootstrapTable
(
'getSelections'
);
if
(
selected
.
length
==
0
)
{
Feng
.
info
(
"请先选中表格中的某一记录!"
);
return
false
;
}
else
{
}
else
{
Role
.
seItem
=
selected
[
0
];
return
true
;
}
};
...
...
@@ -46,14 +40,14 @@ Role.check = function(){
/**
* 点击添加管理员
*/
Role
.
openAddRole
=
function
()
{
Role
.
openAddRole
=
function
()
{
var
index
=
layer
.
open
({
type
:
2
,
title
:
'添加角色'
,
area
:
[
'800px'
,
'450px'
],
//宽高
fix
:
false
,
//不固定
maxmin
:
true
,
content
:
Feng
.
ctxPath
+
'/role/role_add'
content
:
Feng
.
ctxPath
+
'/role/role_add'
});
this
.
layerIndex
=
index
;
};
...
...
@@ -61,15 +55,15 @@ Role.openAddRole = function(){
/**
* 点击修改按钮时
*/
Role
.
openChangeRole
=
function
()
{
if
(
this
.
check
())
{
Role
.
openChangeRole
=
function
()
{
if
(
this
.
check
())
{
var
index
=
layer
.
open
({
type
:
2
,
title
:
'修改角色'
,
area
:
[
'800px'
,
'450px'
],
//宽高
fix
:
false
,
//不固定
maxmin
:
true
,
content
:
Feng
.
ctxPath
+
'/role/role_edit/'
+
this
.
seItem
.
id
content
:
Feng
.
ctxPath
+
'/role/role_edit/'
+
this
.
seItem
.
id
});
this
.
layerIndex
=
index
;
}
...
...
@@ -78,12 +72,12 @@ Role.openChangeRole = function(){
/**
* 删除角色
*/
Role
.
delRole
=
function
()
{
if
(
this
.
check
())
{
var
ajax
=
new
$ax
(
Feng
.
ctxPath
+
"/role/remove/"
+
this
.
seItem
.
id
,
function
(
data
)
{
Role
.
delRole
=
function
()
{
if
(
this
.
check
())
{
var
ajax
=
new
$ax
(
Feng
.
ctxPath
+
"/role/remove/"
+
this
.
seItem
.
id
,
function
(
data
)
{
Feng
.
success
(
"删除成功!"
);
Role
.
table
.
refresh
();
},
function
(
data
)
{
},
function
(
data
)
{
Feng
.
error
(
"删除失败!"
);
});
ajax
.
start
();
...
...
@@ -93,15 +87,15 @@ Role.delRole = function(){
/**
* 权限配置
*/
Role
.
assign
=
function
()
{
if
(
this
.
check
())
{
Role
.
assign
=
function
()
{
if
(
this
.
check
())
{
var
index
=
layer
.
open
({
type
:
2
,
title
:
'权限配置'
,
area
:
[
'300px'
,
'450px'
],
//宽高
fix
:
false
,
//不固定
maxmin
:
true
,
content
:
Feng
.
ctxPath
+
'/role/role_assign/'
+
this
.
seItem
.
id
content
:
Feng
.
ctxPath
+
'/role/role_assign/'
+
this
.
seItem
.
id
});
this
.
layerIndex
=
index
;
}
...
...
@@ -110,17 +104,16 @@ Role.assign = function(){
/**
* 搜索角色
*/
Role
.
search
=
function
()
{
Role
.
search
=
function
()
{
var
queryData
=
{};
queryData
[
'roleName'
]
=
$
(
"#roleName"
).
val
();
Role
.
table
.
refresh
({
query
:
queryData
});
}
$
(
function
()
{
$
(
function
()
{
var
defaultColunms
=
Role
.
initColumn
();
var
table
=
new
BSTable
(
Role
.
id
,
"/role/list"
,
defaultColunms
);
var
table
=
new
BSTable
(
Role
.
id
,
"/role/list"
,
defaultColunms
);
table
.
setPaginationType
(
"client"
);
table
.
init
();
Role
.
bindEvent
();
Role
.
table
=
table
;
});
src/main/webapp/static/modular/system/user/user.js
View file @
a4db626d
...
...
@@ -28,22 +28,15 @@ MgrUser.initColumn = function () {
};
/**
* 绑定表格的事件
*/
MgrUser
.
bindEvent
=
function
()
{
$
(
'#'
+
this
.
id
).
on
(
'click-row.bs.table'
,
function
(
e
,
row
,
$element
)
{
MgrUser
.
seItem
=
row
;
});
};
/**
* 检查是否选中
*/
MgrUser
.
check
=
function
()
{
if
(
this
.
seItem
==
null
)
{
var
selected
=
$
(
'#'
+
this
.
id
).
bootstrapTable
(
'getSelections'
);
if
(
selected
.
length
==
0
)
{
Feng
.
info
(
"请先选中表格中的某一记录!"
);
return
false
;
}
else
{
MgrUser
.
seItem
=
selected
[
0
];
return
true
;
}
};
...
...
@@ -184,5 +177,4 @@ $(function () {
var
table
=
new
BSTable
(
"managerTable"
,
"/mgr/list"
,
defaultColunms
);
table
.
setPaginationType
(
"client"
);
MgrUser
.
table
=
table
.
init
();
MgrUser
.
bindEvent
();
});
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