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