@{
    string RightInfo = ViewBag.RightInfo as string;
    string right = ViewBag.right as string;
    string Id = ViewBag.Id as string;
    Dictionary<string, string> query = ViewBag.query as Dictionary<string, string>;
    string dateJs = "";
}
<!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">
    <script src="/admin/js/jquery-1.10.1.min.js"></script>
</head>
<body>

    <div class="layui-form" lay-filter="layuiadmin-form-useradmin" id="layuiadmin-form-useradmin">
        <input type="hidden" name="Id" value="@Id" />
        <div class="layui-card">
          <div class="layui-card-body">
            <div class="layui-tab" lay-filter="mytabbar">
                <ul class="layui-tab-title">
                    <li class="layui-this" lay-id="1">基本信息</li>
                </ul>
                <div class="layui-tab-content mt20">
                    <div class="layui-tab-item layui-show">
                        @foreach(string key in query.Keys)
                        {
                            string[] dataList = query[key].Split(new string[] { "#cut#" }, StringSplitOptions.None);
                            string text = dataList[0];
                            string control = dataList[1];
                            if(control == "datetime" || control == "date" || control == "time" || control == "month")
                            {
                                dateJs += key + "_" + control + "|";
                            }
                            <div class="layui-form-item">
                                <label class="layui-form-label">@(text)</label>
                                @if(control == "textarea")
                                {
                                <div class="layui-input-block">
                                    <textarea class="layui-textarea" id="@(key)" name="@(key)" lay-verify="required|" placeholder="请输入@(text)" style="height: 300px;"></textarea>
                                </div>
                                }
                                else if(control == "select")
                                {
                                    string[] options = dataList[2].Split(',');
                                    <div class="layui-input-block">
                                        <select id="@(key)" name="@(key)" lay-search="" lay-verify="required|" placeholder="请选择@(text)">
                                            <option value="">请选择</option>
                                            @foreach (string option in options)
                                            {
                                                <option value="@option">@option</option>
                                            }
                                        </select>
                                    </div>
                                }
                                else
                                {
                                <div class="layui-input-block">
                                    <input class="layui-input" type="text" id="@(key)" name="@(key)" lay-verify="required|" autocomplete="off" placeholder="请输入@(text)">
                                </div>
                                }
                            </div>
                        }
                    </div>

                    </div>
            </div>
            <div class="layui-form-item layui-hide">
                <input type="button" lay-submit lay-filter="LAY-list-front-submit" id="LAY-list-front-submit" value="确认">
            </div>
          </div>
        </div>
    </div>

    <script src="/layuiadmin/layui/layui.js"></script>
    <script>
        
        layui.config({
            base: '/layuiadmin/' //静态资源所在路径
        }).extend({
            index: 'lib/index' //主入口模块
        }).use(['index', 'form', 'upload', 'layedit', 'laydate', 'element', 'croppers', 'transfer', 'tree', 'util'], function () {
            var $ = layui.$
                , form = layui.form
                , layer = layui.layer
                , layedit = layui.layedit
                , laydate = layui.laydate
                , croppers = layui.croppers
                , transfer = layui.transfer
                , util = layui.util
                , element = layui.element
        
            //Hash地址的定位
            var layid = location.hash.replace(/^#test=/, '');
            element.tabChange('test', layid);
            element.on('tab(test)', function (elem) {
                location.hash = 'test=' + $(this).attr('lay-id');
            });
    
            //日期
            var dateJs = "@(dateJs.TrimEnd('|'))";
            if(dateJs != "") {
                var dateJsList = dateJs.split('|');
                for(var i=0;i<dateJsList.length;i++){
                    var dataList = dateJsList[i].split('_');
                    laydate.render({
                        elem: '#' + dataList[0],
                        type: dataList[1],
                        trigger: 'click'
                    });
                }
            }
            

            //上传文件
            

            //穿梭框
            

            //TreeView，比如权限管理
            

            //省市区
            
        })

    </script>
</body>
</html>
