add.vm 5.39 KB
#set($page_title="编辑菜单")
#set($crumbs="首页:/home,菜单列表:/menu/list.do")

#set($url_save = "/menu/save.do")

<link href="$!{webUtils.getAssetsPath("/css/i-layout.css")}" rel="stylesheet" type="text/css" />
<style type="text/css">
    .width-100{width:344px !important}
</style>

<div class="page-content">
    <div class="page-header">

        <h1>
            <small>
                <i class="icon-double-angle-right"></i>
                编辑菜单
            </small>
        </h1>
    </div>
    <!-- /.page-header -->

    <div class="row">
        <div class="col-xs-12">
            <!-- PAGE CONTENT BEGINS -->

            <form id="menuAdd" class="form-horizontal" role="form" method="post" action="$url_save">
                #if($model.id)
                    <input type="hidden" value="$model.id" name="id">
                #end

                #if($model.parentId)
                    <input type="hidden" value="$model.parentId" name="parentId">
                #elseif($obj.parentId)
                    <input type="hidden" value="$obj.parentId" name="parentId">
                #end


##                <div class="form-group">
##                    <label class="col-sm-3 control-label no-padding-right"
##                           for="form-field-8"> 所属系统: </label>
##
##                    <div class="col-xs-12 col-sm-4">
##                        <select required="true" name="navbarId">
##                            #foreach($sys in $navbars)
##                                <option value="${sys.id}" #if($!{model.navbarId} == ${sys.id}) selected #end>${sys.projectName}</option>
##                            #end
##                        </select>
##                    </div>
##                </div>
                <div class="form-group">
                    <label class="col-sm-3 control-label no-padding-right"
                           for="form-field-5"> 菜单名字: </label>

                    <div class="col-xs-12 col-sm-4">
                        <input required="true" type="text" id="form-field-5"
                               placeholder="菜单名字" name="label"
                               value="$!{model.label}"
                               class="width-100">
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-3 control-label no-padding-right"
                           for="form-field-4"> 类型: </label>

                    <div class="col-xs-12 col-sm-4">
                        <input type="radio" id="form-field-4"
                               name="type"
                               #if(!${model.type} || ${model.type} == 0)
                                   checked
                               #end
                               value="0">目录
                        <input type="radio" id="form-field-4"
                               name="type"
                            #if(${model.type} == 1)
                               checked
                            #end
                               value="1">链接
                    </div>
                </div>
                <div class="form-group" id="menuUrl">
                    <label class="col-sm-3 control-label no-padding-right"
                           for="form-field-4"> 菜单url: </label>

                    <div class="col-xs-12 col-sm-4">
                        <input type="text" id="form-field-14"
                               placeholder="菜单url" name="menuUrl"
                               value="$!{model.menuUrl}"
                               class="width-100">
                    </div>
                </div>

                <div class="form-group">
                    <label class="col-sm-3 control-label no-padding-right"
                           for="form-field-6"> 菜单描述: </label>

                    <div class="col-xs-12 col-sm-4">
                        <textarea placeholder="菜单描述" rows="3" name="description" class="width-100">$!{model.description}</textarea>
                    </div>
                </div>


                <div class="clearfix form-actions">
                    <div class="col-md-offset-3 col-md-9">
                        <button class="btn btn-info" type="submit">
                            <i class="icon-ok bigger-110"></i>
                            提交
                        </button>

                        &nbsp; &nbsp; &nbsp;
                        <a class="btn btn-info" href="javascript:history.back()">
                            <i class="icon-undo bigger-110"></i>
                            返回
                        </a>
                    </div>
                </div>
            </form>
        </div>
    </div>
</div>

<script type='text/javascript'>
    $(function () {
        #if(!${model.type} || ${model.type} == 0)
        $("#menuUrl").hide();
        #end
        $("[name='type']").change(function(){
            var val = $(this).val();
            if(val == 0) {
                $("#menuUrl").hide();
            } else {
                $("#menuUrl").show();
                $("#form-field-14").attr('required',true);
            }
        });

    });
</script>

<script type="text/javascript" src="/static/module/ztree/js/lab2.js"></script>
<script src="$!{webUtils.getAssetsPath("/js/jquery.validate.min.js")}"></script>
<script src="$!{webUtils.getAssetsPath("/js/jquery.validate.extend.js")}"></script>