1 |
- (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-485913bc"],{"2f21":function(t,e,o){"use strict";var n=o("79e5");t.exports=function(t,e){return!!t&&n(function(){e?t.call(null,function(){},1):t.call(null)})}},"55dd":function(t,e,o){"use strict";var n=o("5ca1"),l=o("d8e8"),a=o("4bf8"),r=o("79e5"),i=[].sort,s=[1,2,3];n(n.P+n.F*(r(function(){s.sort(void 0)})||!r(function(){s.sort(null)})||!o("2f21")(i)),"Array",{sort:function(t){return void 0===t?i.call(a(this)):i.call(a(this),l(t))}})},"5bed":function(t,e,o){"use strict";o.r(e);var n=function(){var t=this,e=t.$createElement,o=t._self._c||e;return o("div",{staticClass:"slider-container"},[o("el-button",{on:{click:function(e){return t.onOperation("create")}}},[t._v("添加按钮")]),t._v(" "),o("el-table",{staticStyle:{width:"100%","margin-bottom":"20px"},attrs:{data:t.tableList,"row-key":"id",border:"","tree-props":{children:"children",hasChildren:"hasChildren"}}},[o("el-table-column",{attrs:{prop:"name",label:"菜单名称"}}),t._v(" "),o("el-table-column",{attrs:{prop:"id",label:"元素ID"}}),t._v(" "),o("el-table-column",{attrs:{prop:"type",label:"菜单类型"}}),t._v(" "),o("el-table-column",{attrs:{prop:"path",label:"文件路径"}}),t._v(" "),o("el-table-column",{attrs:{prop:"permission",label:"权限标识"}}),t._v(" "),o("el-table-column",{attrs:{prop:"hid",label:"是否隐藏"}}),t._v(" "),o("el-table-column",{attrs:{label:"操作"},scopedSlots:t._u([{key:"default",fn:function(e){return[o("el-button",{attrs:{type:"text"},on:{click:function(o){return t.onOperation("update",e.row)}}},[t._v("修改")]),t._v(" "),o("el-button",{attrs:{type:"text"},on:{click:function(o){return t.onDelete(e.row)}}},[t._v("删除")])]}}])})],1),t._v(" "),o("el-dialog",{attrs:{title:"侧边栏管理",visible:t.branchStatus,width:"500px"},on:{"update:visible":function(e){t.branchStatus=e},close:function(e){return t.onFormClose("ruleForm")}}},[o("el-form",{ref:"ruleForm",attrs:{model:t.form}},[o("el-form-item",{attrs:{label:"菜单名","label-width":t.formLabelWidth}},[o("el-input",{attrs:{autocomplete:"off"},model:{value:t.form.name,callback:function(e){t.$set(t.form,"name",e)},expression:"form.name"}})],1),t._v(" "),o("el-form-item",{attrs:{label:"文件路径","label-width":t.formLabelWidth}},[o("el-input",{attrs:{autocomplete:"off"},model:{value:t.form.path,callback:function(e){t.$set(t.form,"path",e)},expression:"form.path"}})],1),t._v(" "),o("el-form-item",{attrs:{label:"权限标识","label-width":t.formLabelWidth}},[o("el-input",{attrs:{autocomplete:"off"},model:{value:t.form.permission,callback:function(e){t.$set(t.form,"permission",e)},expression:"form.permission"}})],1),t._v(" "),o("el-form-item",{attrs:{label:"组件名","label-width":t.formLabelWidth}},[o("el-input",{attrs:{autocomplete:"off"},model:{value:t.form.component,callback:function(e){t.$set(t.form,"component",e)},expression:"form.component"}})],1),t._v(" "),o("el-form-item",{attrs:{label:"父元素ID","label-width":t.formLabelWidth}},[o("el-input",{attrs:{autocomplete:"off"},model:{value:t.form.parentId,callback:function(e){t.$set(t.form,"parentId",e)},expression:"form.parentId"}})],1),t._v(" "),o("el-form-item",{attrs:{label:"是否隐藏","label-width":t.formLabelWidth}},[o("el-select",{model:{value:t.form.hid,callback:function(e){t.$set(t.form,"hid",e)},expression:"form.hid"}},[o("el-option",{attrs:{label:"否",value:0}}),t._v(" "),o("el-option",{attrs:{label:"是",value:1}})],1)],1),t._v(" "),o("el-form-item",{attrs:{label:"菜单类型","label-width":t.formLabelWidth}},[o("el-select",{model:{value:t.form.type,callback:function(e){t.$set(t.form,"type",e)},expression:"form.type"}},[o("el-option",{attrs:{label:"菜单",value:0}}),t._v(" "),o("el-option",{attrs:{label:"按钮",value:1}})],1)],1),t._v(" "),o("el-form-item",{attrs:{label:"排序","label-width":t.formLabelWidth}},[o("el-input",{attrs:{autocomplete:"off"},model:{value:t.form.sort,callback:function(e){t.$set(t.form,"sort",e)},expression:"form.sort"}})],1)],1),t._v(" "),o("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[o("el-button",{on:{click:function(e){t.branchStatus=!1}}},[t._v("取 消")]),t._v(" "),o("el-button",{attrs:{type:"primary"},on:{click:t.onBranchSubmit}},[t._v("确 定")])],1)],1)],1)},l=[],a=o("bd86"),r=(o("55dd"),o("7f7f"),o("1a62")),i={data:function(){return{tableList:[],formLabelWidth:"100px",branchStatus:!1,operationType:"create",form:{name:null,path:null,permission:null,parentId:null,sort:1,component:null,hid:0,type:0}}},mounted:function(){this.lookSilder()},methods:{onOperation:function(t,e){this.branchStatus=!0,this.operationType=t,"update"==t&&(this.form={name:e.name,path:e.path,permission:e.permission,parentId:e.parentId,sort:e.sort,component:e.component,id:e.id,hid:e.hid,type:e.type})},onBranchSubmit:function(t){var e=this,o=this.form;"create"==this.operationType?Object(r["a"])({path:o.path,component:o.component,name:o.name,permission:o.permission,sort:o.sort,parentId:o.parentId,hid:o.hid,type:o.type}).then(function(t){200==t.code&&(e.$message({message:"添加成功",type:"success"}),e.lookSilder(),e.branchStatus=!1)}):"update"==this.operationType&&Object(r["d"])(o).then(function(t){200==t.code&&(e.$message({message:"修改成功",type:"success"}),e.lookSilder(),e.branchStatus=!1)})},lookSilder:function(){var t=this;Object(r["c"])().then(function(e){200==e.code&&(t.tableList=t.setTableData(e.data))})},setTableData:function(t){var e=this,o=[];return o=t.map(function(t){var o={};return o=Object(a["a"])({id:t.id,name:t.name,type:t.type,path:t.path,permission:t.permission,icon:t.icon,parentId:t.parentId,component:t.component,sort:t.sort,hid:t.hid},"type",t.type),t.sysMenus&&t.sysMenus.length>0&&(o.children=e.setTableData(t.sysMenus)),o}),o},onDelete:function(t){var e=this;Object(r["b"])(t.id).then(function(t){200==t.code&&(e.$message({message:"删除成功",type:"success"}),e.lookSilder(),e.branchStatus=!1)})},onFormClose:function(t){this.form={name:null,path:null,permission:null,parentId:null,sort:1,component:null,hid:0,type:0},this.$refs[t].resetFields()}}},s=i,c=(o("b2b3"),o("2877")),u=Object(c["a"])(s,n,l,!1,null,null,null);e["default"]=u.exports},9183:function(t,e,o){},b2b3:function(t,e,o){"use strict";var n=o("9183"),l=o.n(n);l.a}}]);
|