chunk-529acf22.508b5f98.js 6.2 KB

1
  1. (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-529acf22"],{"5bed":function(t,e,o){"use strict";o.r(e);var l=function(){var t=this,e=t.$createElement,o=t._self._c||e;return o("div",{staticClass:"slider-container"},[o("el-button",{staticStyle:{position:"fixed","z-index":"100"},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:{width:"400px",prop:"name",label:"菜单名称"}}),t._v(" "),o("el-table-column",{attrs:{prop:"id",width:"100px",label:"元素ID"}}),t._v(" "),o("el-table-column",{attrs:{label:"菜单类型",width:"100px"},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v("\n "+t._s(1==e.row.type?"按钮":"菜单")+"\n ")]}}])}),t._v(" "),o("el-table-column",{attrs:{prop:"sort",width:"100px",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",width:"100px",label:"是否隐藏"},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v("\n "+t._s(1==e.row.hid?"隐藏":"不隐藏")+"\n ")]}}])}),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:"侧边栏管理","close-on-click-modal":!1,visible:t.branchStatus,"default-expand-all":"",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",t._n(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)},n=[],a=o("bd86"),r=(o("c5f6"),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:1,type:1}}},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:Number(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.success("添加成功"),e.lookSilder(),e.branchStatus=!1)})):"update"==this.operationType&&Object(r["d"])(o).then((function(t){200==t.code&&(e.$message.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.success("删除成功"),e.lookSilder(),e.branchStatus=!1)}))},onFormClose:function(t){this.form={name:null,path:null,permission:null,parentId:null,sort:1,component:null,hid:1,type:1},this.$refs[t].resetFields()}}},s=i,c=(o("b2b3"),o("2877")),p=Object(c["a"])(s,l,n,!1,null,null,null);e["default"]=p.exports},9183:function(t,e,o){},b2b3:function(t,e,o){"use strict";var l=o("9183"),n=o.n(l);n.a}}]);