提交 | 用户 | 时间
|
1ac2bc
|
1 |
layui.use(['jquery', 'table'], function () { |
懒 |
2 |
|
|
3 |
var $ = layui.jquery; |
|
4 |
var table = layui.table; |
|
5 |
|
|
6 |
var SelectRoleDlg = { |
|
7 |
index: parent.layer.getFrameIndex(window.name) |
|
8 |
}; |
|
9 |
|
|
10 |
var SelectRoleTable = { |
|
11 |
tableId: 'selectRoleTable' |
|
12 |
}; |
|
13 |
|
|
14 |
SelectRoleTable.initColumn = function () { |
|
15 |
return [[ |
|
16 |
{type: 'numbers', title: 'No'}, |
|
17 |
{field: "id", hide:true, title: 'id'}, |
|
18 |
{field: "name", title: '角色名'}, |
|
19 |
{field: "description", title: '描述'} |
|
20 |
]] |
|
21 |
}; |
|
22 |
|
|
23 |
// 搜索按钮点击事件 |
|
24 |
$('#btnSearch').click(function () { |
|
25 |
SelectRoleTable.search(); |
|
26 |
}); |
|
27 |
|
|
28 |
/** |
|
29 |
* 点击查询按钮 |
|
30 |
*/ |
|
31 |
SelectRoleTable.search = function () { |
|
32 |
var queryData = {}; |
|
33 |
queryData['name'] = $("#name").val(); |
|
34 |
table.reload(SelectRoleTable.tableId, { |
|
35 |
where: queryData, page: {curr: 1} |
|
36 |
}); |
|
37 |
}; |
|
38 |
|
|
39 |
table.render({ |
|
40 |
elem: '#' + SelectRoleTable.tableId, |
|
41 |
url: Feng.ctxPath + '/role/listRole', |
|
42 |
page: true, |
|
43 |
height: "full-98", |
|
44 |
cellMinWidth: 100, |
|
45 |
cols: SelectRoleTable.initColumn() |
|
46 |
}); |
|
47 |
|
|
48 |
table.on('rowDouble(selectRoleTable)', function (obj) { |
|
49 |
parent.Handle.nextObject = obj.data.name; |
|
50 |
parent.Handle.assignee = obj.data.id; |
|
51 |
parent.layer.close(SelectRoleDlg.index); |
|
52 |
}); |
|
53 |
}); |