text: /**
   * Created by BaoMi花 on 2018/9/27.
   */
  var ztree;
  
  var vm = new Vue({
      el:'#rrapp',
      data:{
          showList: true,
          title: null,
          menu:{
              parentName:null,
              parentId:0,
              type:1,
              orderNum:0
          }
      },
      methods: {
          getMenu: function(menuId){
              //加载菜单树
              $.get("../sys/menu/select", function(r){
                  ztree = $.fn.zTree.init($("#menuTree"), setting, r.menuList);
                  var node = ztree.getNodeByParam("menuId", vm.menu.parentId);
                  ztree.selectNode(node);
  
                  vm.menu.parentName = node.name;
              })
          },
  
  
          menuTree: function(){
              layer.open({
                  type: 1,
                  offset: '50px',
                  skin: 'layui-layer-molv',
                  title: "选择菜单",
                  area: ['300px', '450px'],
                  shade: 0,
                  shadeClose: false,
                  content: jQuery("#menuLayer"),
                  btn: ['确定', '取消'],
                  btn1: function (index) {
                      var node = ztree.getSelectedNodes();
                      //选择上级菜单
                      vm.menu.parentId = node[0].menuId;
                      vm.menu.parentName = node[0].name;
  
                      layer.close(index);
                  }
              });
          },
          reload: function (event) {
              vm.showList = true;
              var page = $("#jqGrid").jqGrid('getGridParam','page');
              $("#jqGrid").jqGrid('setGridParam',{
                  page:page
              }).trigger("reloadGrid");
          }
      }
  });