
@{
    ViewBag.Title = "Managerlist";
    Layout = "~/Views/Shared/_LayoutList.cshtml";
}
<!--模糊搜索区域-->
<div class="layui-row">
    <form class="layui-form layui-col-md12 angel-search">
        <div class="layui-input-inline">
            <input class="layui-input" placeholder="请输入登录名称" name="sortName" autocomplete="off">
        </div>
			<button class="layui-btn" lay-submit="" lay-filter="search">
				<i class="layui-icon">&#xe615;</i>
			</button>
    </form>
</div>
<!--数据表格-->
<table class="layui-hide" id="tableId" lay-filter="tableFilter"></table>
<script>
    layui.use(["table", "form", "laydate", "angelLayer", "angelUtils"], function () {
        var table = layui.table;
        var form = layui.form;
        var laydate = layui.laydate;
        var angelLayer = layui.angelLayer;
        var angelUtils = layui.angelUtils;

        var AllTable = table.render({
            elem: "#tableId",
            url: "/api/amemberapi/loglist",
            limit: 10,
            page: true,
            toolbar: "#toolbarTpl",
            size: "sm",
            cols: [[
                { type: "checkbox" },
                { field: "id", title: "", width: 80, sort: true },
                { field: "userName", title: "登录账号", width: 120 },
                { field: "keMuName", title: "考试科目", width: 120 },
                { field: "clientIp", title: "登录IP", width: 120 },
                { field: "isSucceed", title: "是否成功", width: 120 },
                { field: "addTime", title: "登录日期", width: 220 }
            ]],
            done: function (res, curr, count) {
                console.log(res, curr, count);
            }
        });

        form.on("submit(search)", function (data) {
            AllTable.reload({
                where: data.field,
                page: { curr: 1 }
            });
            return false;
        });

        table.on("toolbar(tableFilter)", function (obj) {
            switch (obj.event) {
                case "batchDel":
                    batchDel();
                    break;
            }
        });



        function batchDel() {
            angelLayer.confirm("确定要批量删除吗？", function (index) {
                layer.close(index);
                var idsStr = angelUtils.tableBatchCheck(table);
                alert(idsStr);
                if (idsStr) {
                    angelUtils.ajax("api/amemberapi/memberlogbatchdel", "get", { idsStr: idsStr }, true).done(function (response) {
                        angelUtils.tableSuccessMsg(response.message);
                    }).fail(function (error) {
                        console.log(error)
                    });
                }
            });
        }



    })
</script>
<!-- 头工具栏模板 -->
<script type="text/html" id="toolbarTpl">
	<div class="layui-btn-container">
@*		<button class="layui-btn layui-btn-sm layui-btn-danger" lay-event="batchDel">批量删除</button>*@
	</div>
</script>
<!-- 行工具栏模板 -->
<!-- 启用|停用模板 -->
<script type="text/html" id="enableddisplayTpl">
    {{#  if(d.display){ }}
    <span class="layui-btn layui-btn-normal layui-btn-xs">已启用</span>
    {{#  } else{ }}
    <span class="layui-btn layui-btn-warm layui-btn-xs">已停用</span>
    {{#  } }}
</script>
<!-- 性别模板 -->
<script type="text/html" id="genderTpl">
    {{#  if(d.Gender){ }}
    <span>男</span>
    {{#  } else{ }}
    <span>女</span>
    {{#  } }}
</script>
