(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-d101def2"],{"921f":function(t,e,o){"use strict";o("fe59")},ae0c:function(t,e,o){"use strict";o.r(e);var r=function(){var t=this,e=t.$createElement,o=t._self._c||e;return o("div",{staticClass:"box"},[o("h2",{staticStyle:{"margin-bottom":"20px","padding-bottom":"7px","border-bottom":"2px solid #ddd"}},[t._v(" 菜单管理 ")]),o("div",[o("div",{staticStyle:{"margin-bottom":"10px"}},[o("el-button",{attrs:{type:"primary"},on:{click:t.addMenu}},[t._v("添加菜单")])],1),o("div",[o("el-table",{attrs:{data:t.tableData,border:"","row-key":"id",height:"700px","tree-props":{children:"children"},"default-expand-all":""}},[o("el-table-column",{attrs:{prop:"menuName",label:"菜单名称"}}),o("el-table-column",{attrs:{prop:"url",label:"菜单路由"}}),o("el-table-column",{attrs:{prop:"remark",label:"备注"}}),o("el-table-column",{attrs:{label:"操作",fixed:"right"},scopedSlots:t._u([{key:"default",fn:function(e){return[o("el-button",{attrs:{size:"mini",type:"info"},on:{click:function(o){return t.setEdit(e.row)}}},[t._v("编辑")]),o("el-button",{staticStyle:{"margin-right":"10px"},attrs:{size:"mini",type:"primary"},on:{click:function(o){return t.addChildren(e.row,e.$index)}}},[t._v("添加子菜单")]),o("el-popconfirm",{attrs:{title:0===e.row.parentId?"这是父菜单，删除后，子菜单将不复存在！确定要删除这个菜单吗":"确定要删除这个菜单吗？"},on:{confirm:function(o){return t.del(e.row)}}},[o("el-button",{attrs:{slot:"reference",size:"mini",type:"danger"},slot:"reference"},[t._v("删除")])],1)]}}])})],1)],1)]),o("el-dialog",{attrs:{title:t.showType?"编辑菜单":"新增菜单",visible:t.dialogFormVisible},on:{"update:visible":function(e){t.dialogFormVisible=e}}},[o("el-form",{ref:"ruleForm",attrs:{model:t.form}},[o("el-form-item",{attrs:{label:"父级菜单","label-width":t.formLabelWidth}},[o("el-input",{attrs:{disabled:"",autocomplete:"off"},model:{value:t.form.parentId,callback:function(e){t.$set(t.form,"parentId",e)},expression:"form.parentId"}})],1),o("el-form-item",{attrs:{label:"菜单名字","label-width":t.formLabelWidth,prop:"name"}},[o("el-input",{attrs:{autocomplete:"off"},model:{value:t.form.name,callback:function(e){t.$set(t.form,"name",e)},expression:"form.name"}})],1),o("el-form-item",{attrs:{label:"备注","label-width":t.formLabelWidth,prop:"name"}},[o("el-input",{attrs:{autocomplete:"off"},model:{value:t.form.remark,callback:function(e){t.$set(t.form,"remark",e)},expression:"form.remark"}})],1),o("el-form-item",{attrs:{label:"菜单路由","label-width":t.formLabelWidth}},[o("el-input",{attrs:{disabled:0===t.form.parentId,autocomplete:"off"},model:{value:t.form.url,callback:function(e){t.$set(t.form,"url",e)},expression:"form.url"}})],1)],1),o("div",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[o("el-button",{on:{click:function(e){t.dialogFormVisible=!1}}},[t._v("取 消")]),t.showType?o("el-button",{attrs:{type:"primary"},on:{click:function(e){return t.setUpdate("ruleForm")}}},[t._v("更 新")]):o("el-button",{attrs:{type:"primary"},on:{click:function(e){return t.add("ruleForm")}}},[t._v("新 增")])],1)],1)],1)},a=[],i=(o("99af"),o("b0c0"),o("d3b7"),{name:"menuAdmin",data:function(){return{tableData:[],showType:!1,dialogFormVisible:!1,form:{name:"",parentId:0,url:"",id:"",remark:""},formLabelWidth:"120px",rules:[]}},methods:{add:function(){var t=this;this.dialogFormVisible=!1,this.$axios.post("http://192.168.1.6:8081/menu/add?parentId=".concat(this.form.parentId,"&menuName=").concat(this.form.name,"&url=").concat(this.form.url,"&remark=").concat(this.form.remark)).then((function(e){1e4===e.data.code&&(t.init(),t.reset()),t.$message(e.data.message),t.dialogFormVisible=!1}))},setEdit:function(t){this.showType=!0,this.dialogFormVisible=!0,this.form.id=t.id,this.form.name=t.menuName,this.form.url=t.url,this.form.parentId=t.parentId,this.form.remark=t.remark},addMenu:function(){this.dialogFormVisible=!0},addChildren:function(t){this.dialogFormVisible=!0,this.form.parentId=t.id},del:function(t){var e=this,o=[];o.push(t.id),console.log(o.toString()),this.$axios.post("http://192.168.1.6:8081/menu/remove?menuId=".concat(o)).then((function(t){1e4==t.data.code&&e.init(),e.$message(t.data.message)}))},setUpdate:function(){var t=this;this.$axios.post("http://192.168.1.6:8081/menu/edit?id=".concat(this.form.id,"&remark=").concat(this.form.remark,"&url=").concat(this.form.url,"&menuName=").concat(this.form.name,"&parentId=").concat(this.form.parentId)).then((function(e){1e4===e.data.code&&(t.init(),t.reset()),t.$message(e.data.message),t.dialogFormVisible=!1}))},reset:function(){this.form.name="",this.form.parentId=0,this.form.url="",this.form.id="",this.form.remark="",this.showType=!1},init:function(){var t=this;this.$axios.post("http://192.168.1.6:8081/menu/list").then((function(e){console.log(e),t.tableData=e.data}))}},mounted:function(){this.init()}}),n=i,l=(o("921f"),o("2877")),s=Object(l["a"])(n,r,a,!1,null,"144e6d1e",null);e["default"]=s.exports},fe59:function(t,e,o){}}]);
//# sourceMappingURL=chunk-d101def2.f12093d0.js.map