<commit_before><div class="am-cf am-padding am-padding-bottom-0">
    <div class="am-fl am-cf">
          <strong class="am-text-primary am-text-lg">系统管理</strong> /
          <small>菜单管理</small>
    </div>
</div>

<hr>

<div class="am-g">
     <!--位置信息-->
     <div class="am-u-sm-12 am-u-md-4">
          <!--边框-->
          <div class="am-panel am-panel-default am-panel-bd">

              <div class="am-g">
                  <div class="am-u-md-12">
                          <div class="am-btn-group" data-am-button>
                              <label id="addButton" class="am-btn am-btn-success">
                                  <input type="checkbox" name="doc-js-btn"/> 新增
                              </label>
                              <label id="delButton" class="am-btn am-btn-danger">
                                  <input type="checkbox" name="doc-js-btn"/> 删除
                              </label>
                          </div>
                  </div>
                  <div class="am-u-md-12">
                      <div id="firstTree">
                      </div>
                  </div>
              </div>
          </div>
     </div>

    <!--位置信息-->
     <div class="am-u-sm-12 am-u-md-8">
         <!--边框-->
         <div class="am-panel am-panel-default am-panel-bd">
              <!--内容-->
              <div class="am-form am-form-horizontal" id="formSubmitData">
                  <input type="hidden" id="id" name="id"/>
                  <input type="hidden" id="pid" name="pid" value="0"/>

                  <div class="am-form-group">
                      <label for="name" class="am-u-sm-3 am-form-label">父菜单名称</label>
                      <div class="am-u-sm-9">
                          <input type="text" id="pName" name="pName" disabled="disabled">
                      </div>
                  </div>

                  <div class="am-form-group">
                      <label for="name" class="am-u-sm-3 am-form-label">菜单名称</label>
                      <div class="am-u-sm-9">
                          <input type="text" id="name" name="name" placeholder="输入菜单名称">
                      </div>
                  </div>

                  <div class="am-form-group">
                      <label for="url" class="am-u-sm-3 am-form-label">url</label>
                      <div class="am-u-sm-9">
                          <input type="text" id="url" name="url" placeholder="输入跳转的链接">
                      </div>
                  </div>

                  <div class="am-form-group">
                      <label for="icon" class="am-u-sm-3 am-form-label">是否新页面打开</label>
                      <div class="am-u-sm-9">
                          <input type="hidden" id="newpage" value="0" >
                          <input type="radio" name="newpage" onchange="changeRadio(this,'newpage')" value="0"  checked >否
                          <input type="radio" name="newpage" onchange="changeRadio(this,'newpage')" value="1" >是
                      </div>
                  </div>

                  <div class="am-form-group">
                      <label for="icon" class="am-u-sm-3 am-form-label">菜单图标</label>
                      <div class="am-u-sm-9">
                          <div class="form-inline">
                              <div class="form-group input-group">
                                  <div class="input-group-addon"> <span class="am-icon-eyedropper"></span></div>
                                  <input type="text" id="icon" name="icon" placeholder="请选择菜单图标" />
                              </div>
                          </div>
                      </div>
                  </div>

                  <div class="am-form-group">
                      <div class="am-u-sm-9 am-u-sm-push-3">
                          <button id="subButton" type="button" class="am-btn am-btn-primary">保存修改</button>
                      </div>
                  </div>
              </div>
             <!--内容-->
         </div>
     </div>
</div>

<script>
    var treeData;

    $(function() {
        getTree();
        $("#firstTree li:first-child").trigger("click");
    });

    function getTree(){
        treeData = buildDomTree();
        $("#firstTree").treeview({
            bootstrap2: false,
            showTags: true,
            levels: 2,
            enableLinks:true,
            data: treeData
        });
        /**
         * 树节点选中点击事件
         */
        $("#firstTree").on("nodeSelected", function(event, data) {
            $.each(data,function(i,e){
                $("#"+i).val(e);
            });
        });

        /**
         * 树节点取消选中点击事件
         */
        $("#firstTree").on("nodeUnselected", function(event, data) {
            $("#formSubmitData :input").val("");
            $("#newpage").val("0");
            $("#pid").val("0");
            $("#pName").val("")
        });
    }

    /**
     * 保存提交
     */
    $("#subButton").on("click",function(){
        var data = {};
        $("#formSubmitData :input").each(function(i,e){
            var name = $(e).attr("id");
            if(name!=null&&name!=undefined){
                alert(name+"====="+$(e).val());
                data[name] = $(e).val();
            }
        });
    alert(JSON.stringify(data));
        $.post("/menu/save",data,function(data){
            alert(data.status);
            getTree();
            $("#firstTree li:first-child").trigger("click");
        });
    });

    /**
     * 新增
     */
    $("#addButton").on("click",function(){
        $("#pName").val($("#name").val());
        $("#pid").val($("#id").val());
        $("#formSubmitData :input").not("#pid,#pName,#newpage").val("");<commit_msg>menu parentId 改为 pid<commit_after><div class="am-cf am-padding am-padding-bottom-0">
    <div class="am-fl am-cf">
          <strong class="am-text-primary am-text-lg">系统管理</strong> /
          <small>菜单管理</small>
    </div>
</div>

<hr>

<div class="am-g">
     <!--位置信息-->
     <div class="am-u-sm-12 am-u-md-4">
          <!--边框-->
          <div class="am-panel am-panel-default am-panel-bd">

              <div class="am-g">
                  <div class="am-u-md-12">
                          <div class="am-btn-group" data-am-button>
                              <label id="addButton" class="am-btn am-btn-success">
                                  <input type="checkbox" name="doc-js-btn"/> 新增
                              </label>
                              <label id="delButton" class="am-btn am-btn-danger">
                                  <input type="checkbox" name="doc-js-btn"/> 删除
                              </label>
                          </div>
                  </div>
                  <div class="am-u-md-12">
                      <div id="firstTree">
                      </div>
                  </div>
              </div>
          </div>
     </div>

    <!--位置信息-->
     <div class="am-u-sm-12 am-u-md-8">
         <!--边框-->
         <div class="am-panel am-panel-default am-panel-bd">
              <!--内容-->
              <div class="am-form am-form-horizontal" id="formSubmitData">
                  <input type="hidden" id="id" name="id"/>
                  <input type="hidden" id="pid" name="pid" value="0"/>

                  <div class="am-form-group">
                      <label for="name" class="am-u-sm-3 am-form-label">父菜单名称</label>
                      <div class="am-u-sm-9">
                          <input type="text" id="pName" name="pName" disabled="disabled">
                      </div>
                  </div>

                  <div class="am-form-group">
                      <label for="name" class="am-u-sm-3 am-form-label">菜单名称</label>
                      <div class="am-u-sm-9">
                          <input type="text" id="name" name="name" placeholder="输入菜单名称">
                      </div>
                  </div>

                  <div class="am-form-group">
                      <label for="url" class="am-u-sm-3 am-form-label">url</label>
                      <div class="am-u-sm-9">
                          <input type="text" id="url" name="url" placeholder="输入跳转的链接">
                      </div>
                  </div>

                  <div class="am-form-group">
                      <label for="icon" class="am-u-sm-3 am-form-label">是否新页面打开</label>
                      <div class="am-u-sm-9">
                          <input type="hidden" id="newpage" value="0" >
                          <input type="radio" name="newpage" onchange="changeRadio(this,'newpage')" value="0"  checked >否
                          <input type="radio" name="newpage" onchange="changeRadio(this,'newpage')" value="1" >是
                      </div>
                  </div>

                  <div class="am-form-group">
                      <label for="icon" class="am-u-sm-3 am-form-label">菜单图标</label>
                      <div class="am-u-sm-9">
                          <div class="form-inline">
                              <div class="form-group input-group">
                                  <div class="input-group-addon"> <span class="am-icon-eyedropper"></span></div>
                                  <input type="text" id="icon" name="icon" placeholder="请选择菜单图标" />
                              </div>
                          </div>
                      </div>
                  </div>

                  <div class="am-form-group">
                      <div class="am-u-sm-9 am-u-sm-push-3">
                          <button id="subButton" type="button" class="am-btn am-btn-primary">保存修改</button>
                      </div>
                  </div>
              </div>
             <!--内容-->
         </div>
     </div>
</div>

<script>
    var treeData;

    $(function() {
        getTree();
        $("#firstTree li:first-child").trigger("click");
    });

    function getTree(){
        treeData = buildDomTree();
        $("#firstTree").treeview({
            bootstrap2: false,
            showTags: true,
            levels: 2,
            enableLinks:true,
            data: treeData
        });
        /**
         * 树节点选中点击事件
         */
        $("#firstTree").on("nodeSelected", function(event, data) {
            $.each(data,function(i,e){
                $("#"+i).val(e);
            });
        });

        /**
         * 树节点取消选中点击事件
         */
        $("#firstTree").on("nodeUnselected", function(event, data) {
            $("#formSubmitData :input").val("");
            $("#newpage").val("0");
            $("#pid").val("0");
            $("#pName").val("")
        });
    }

    /**
     * 保存提交
     */
    $("#subButton").on("click",function(){
        var data = {};
        $("#formSubmitData :input").each(function(i,e){
            var name = $(e).attr("id");
            if(name!=null&&name!=undefined){
                data[name] = $(e).val();
            }
        });

        $.post("/menu/save",data,function(data){
            alert(data.status);
            getTree();
            $("#firstTree li:first-child").trigger("click");
        });
    });

    /**
     * 新增
     */
    $("#addButton").on("click",function(){
        $("#pName").val($("#name").val());
        $("#pid").val($("#id").val());
        $("#formSubmitData :input").not("#pid,#pName,#newpage").val("");
{'fraction_non_alphanumeric': 0.1838228808326718, 'fraction_numerical': 0.005468818911528623, 'mean_word_length': 1.1985650572038007, 'pattern_counts': {'":': 0, '<': 197, '<?xml version=': 0, '>': 197, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 8, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2604274', 'n_tokens_mistral': 3398, 'n_tokens_neox': 3388, 'n_words': 520}