<%@ page import="com.censoft.db.DBUtil" %>
<%@ include file="../getMenuList.jsp"%>
<%--
  Created by IntelliJ IDEA.
  User: Administrator
  Date: 2020/9/11
  Time: 12:54
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<link rel="stylesheet" href="<%=request.getContextPath()%>/css/pagination.css">
<script type="text/javascript" src="<%=request.getContextPath()%>/js/jquery.pagination.js"></script>
<nav class="breadcrumb"><i class="Hui-iconfont">&#xe67f;</i> 首页
    <span class="c-gray en">&gt;</span> <%=menu_name%>
    <a class="btn btn-success radius r" style="line-height:1.6em;margin-top:3px"
                                               href="javascript:void(0);" onclick="window.location.reload();"
                                               title="刷新"><i
        class="Hui-iconfont">&#xe68f;</i></a></nav>
<div class="page-container">
    <form action="rolelist_ajax.jsp" method="post" id="data_form_search">
        <input type="hidden" name="page_number" id="page_number" value="1"/>
        <input type="hidden" name="page_size" id="page_size" value="10"/>
        <div class="text-l">
            <input type="text" class="input-text" style="width:250px" placeholder="输入" name="s_role_name">
            <button type="button" onclick="document.getElementById('page_number').value='1';searchModel();"
                    class="btn btn-success radius" id="aaa" name=""><i class="Hui-iconfont">&#xe665;</i>
                搜角色
            </button>
        </div>
    </form>
    <div class="cl pd-5 bg-1 bk-gray mt-20"><span class="l"><a
            href="javascript:;" name="addjs" onclick="member_add('添加角色','./role_add-t.jsp','800','500')"
            class="btn btn-primary radius"><i class="Hui-iconfont">&#xe600;</i> 添加角色</a></span></div>
    <div class="mt-20" id="datalist">

    </div>
</div>

<script type="text/javascript">
    searchModel();

    function searchModel() {
        //   alert(document.getElementById("page_number").value)
        $.ajax({
            type: "post",
            url: "rolelist_ajax.jsp",
            data: $('#data_form_search').serialize(),
            success: function (msg) {
                $("#datalist").html(msg);
                changeBtn();
            }
        });
    }

    /*用户-添加*/
    function member_add(title, url, w, h) {
        var abc = layer_show(title, url, w, h);
    }

    /*用户-编辑*/
    function member_edit(title, url, id, w, h) {
        layer_show(title, url, w, h);
    }
    function member_role(id){
        layer_show("菜单授权", "../menu/menu_tree_select-t.jsp?role_id="+id, "800", "500");
    }
    function member_haoma(id){
        layer_show("号码授权", "./hmdept_select-t.jsp?role_id="+id, "800", "500");
    }
    /*用户-删除*/
    function member_del(obj, id) {
        layer.confirm('确认要删除吗？', function (index) {
            $.ajax({
                type: 'POST',
                url: './role_add-t.jsp?action=delete&id=' + id,
                success: function (data) {
                    layer.msg('已删除!', {
                        icon: 1, time: 1000
                    }, function () {
                        searchModel();
                    });
                },
                error: function (data) {
                    layer.msg('删除失败!', {
                        icon: 1, time: 1000
                    });
                },
            });
        });
    }
</script>