@using MySystem.Models;
@{
    string RightInfo = ViewBag.RightInfo as string;
    string right = ViewBag.right as string;
    List<Users> TopUsers = ViewBag.TopUsers as List<Users>;
}
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>创客展业城市</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
    <link rel="stylesheet" href="/layuiadmin/layui/css/layui.css" media="all">
    <link rel="stylesheet" href="/layuiadmin/style/admin.css" media="all">
    <script src="/admin/js/jquery-1.10.1.min.js"></script>
    <script src="/admin/js/LAreaData2.js"></script>
    <style>
        .layui-input-inline{
            width: 175px !important;
        }
        .layui-form-label{
            width: 85px !important;
        }
        .layui-inline{
            margin-right: 0px !important;
        }        
        .w100{
            width: 100px !important;
        }
        .ml50{
            margin-left: 50px !important;
        }
    </style>
</head>
<body>
    <div class="layui-fluid">
        <div class="layui-card">
            <div class="layui-form layui-card-header layuiadmin-card-header-auto">
                <div class="layui-form-item">
                    <div class="layui-form-item">
                        <div class="layui-inline">
                            <label class="layui-form-label">创客编号</label>
                            <div class="layui-input-inline">
                                <input class="layui-input" type="text" name="MakerCode" autocomplete="off">
                            </div>
                        </div>
                        <div class="layui-inline">
                            <label class="layui-form-label">创客名称</label>
                            <div class="layui-input-inline">
                                <input class="layui-input" type="text" name="RealName" autocomplete="off">
                            </div>
                        </div>
                        <div class="layui-inline">
                            <label class="layui-form-label">上级创客编号</label>
                            <div class="layui-input-inline">
                                <input class="layui-input" type="text" name="ParentMakerCode" autocomplete="off">
                            </div>
                        </div>
                        <div class="layui-inline">
                            <label class="layui-form-label">上级创客名称</label>
                            <div class="layui-input-inline">
                                <input class="layui-input" type="text" name="ParentRealName" autocomplete="off">
                            </div>
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <div class="layui-inline">
                            <label class="layui-form-label">顶级创客</label>
                            <div class="layui-input-inline">
                                <select id="TopUserId" name="TopUserId" lay-search="">
                                    <option value="">全部...</option>
                                    @foreach(Users TopUser in TopUsers)
                                    {
                                    <option value="@TopUser.Id">@TopUser.RealName</option>
                                    }
                                </select>
                            </div>
                        </div>
                        <div class="layui-inline">
                            <label class="layui-form-label">创建时间</label>
                            <div class="layui-input-inline">
                                <input class="layui-input" type="text" readonly name="CitySetDateData" id="CitySetDate" autocomplete="off">
                            </div>
                        </div>
                        <div class="layui-inline">
                            <label class="layui-form-label">所在地区</label>
                            <input type="hidden" id="Areas" name="Areas" value="" />
                            <div class="layui-input-inline">
                                <select id="AreasProvince" lay-search="" lay-filter="AreasProvince">
                                    <option value="">省</option>
                                </select>
                            </div>
                            <div class="layui-input-inline">
                                <select id="AreasCity" lay-search="" lay-filter="AreasCity">
                                    <option value="">市</option>
                                </select>
                            </div>
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <div class="layui-inline ml50">
                            <button class="layui-btn" lay-submit lay-filter="LAY-list-front-search">
                                <i class="layui-icon layui-icon-search layuiadmin-button-btn"></i>查询
                            </button>
                            <button class="layui-btn" lay-submit lay-filter="LAY-list-front-searchall">
                                <i class="layui-icon layui-icon-list layuiadmin-button-btn"></i>全部
                            </button>
                            @if (RightInfo.Contains("," + right + "_export,"))
                            {
                                <button class="layui-btn" data-type="ExportExcel"><i class="layui-icon layui-icon-export layuiadmin-button-btn"></i>导出</button>
                            }
                        </div>
                    </div>
                </div>
            </div>

            <div class="layui-card-body">
                <table id="LAY-list-manage" lay-filter="LAY-list-manage"></table>
                <script type="text/html" id="table-list-tools">
                </script>
            </div>
        </div>
    </div>

    <script src="/layuiadmin/layui/layui.js"></script>
    <script src="/layuiadmin/modules_main/Users_City_Admin.js?r=@DateTime.Now.ToString("yyyyMMddHHmmss")"></script>
    <script>
        function AreasProvinceInit(tagId, areasVal, form) {
            for (var i = 0; i < provs_data.length; i++) {
                var sel = "";
                if (areasVal.indexOf(provs_data[i].text) > -1) {
                    sel = " selected=selected";
                }
                $("#" + tagId + "Province").append('<option value="' + provs_data[i].value + '"' + sel + '>' + provs_data[i].text + '</option>');
            }
            form.render();
        }

        function AreasProvinceSelected(tagId, areasVal, form, value) {
            $("#" + tagId + "City").html('<option value="">市</option>');
            var list = citys_data[value];
            for (var i = 0; i < list.length; i++) {
                var sel = "";
                if (areasVal.indexOf(list[i].text) > -1) {
                    sel = " selected=selected";
                }
                $("#" + tagId + "City").append('<option value="' + list[i].value + '"' + sel + '>' + list[i].text + '</option>');
            }
            form.render();
            $("#" + tagId + "").val($("#" + tagId + "Province option:selected").text() + "," + $("#" + tagId + "City option:selected").text());
        }

        function AreasCitySelected(tagId, areasVal, form, value) {
            form.render();
            $("#" + tagId + "").val($("#" + tagId + "Province option:selected").text() + "," + $("#" + tagId + "City option:selected").text());
        }
    </script>
</body>
</html>