chunk-7c87bbe2.2d860953.js 10 KB

1
  1. (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-7c87bbe2"],{"5bedd":function(e,t,o){"use strict";o.r(t);var r=function(){var e=this,t=e.$createElement,o=e._self._c||t;return o("div",{staticClass:"m-container"},[o("div",{staticClass:"m-core slider-container"},[o("div",{staticStyle:{position:"fixed","z-index":"100",top:"155px",right:"75px"}},[o("el-button",{directives:[{name:"permission",rawName:"v-permission",value:"menu/add",expression:"'menu/add'"}],on:{click:function(t){return e.onOperation("create")}}},[e._v("添加按钮")])],1),e._v(" "),o("div",{staticClass:"tableWrap"},[o("el-table",{staticStyle:{width:"100%","margin-bottom":"20px","margin-top":"40px"},attrs:{data:e.tableList,"row-key":"id",border:"","tree-props":{children:"children",hasChildren:"hasChildren"}}},[o("el-table-column",{attrs:{width:"300px",prop:"name",label:"菜单名称"},scopedSlots:e._u([{key:"default",fn:function(t){return[e._v("\n "+e._s(t.row.name)+" - "+e._s(t.row.id)+"\n ")]}}])}),e._v(" "),o("el-table-column",{attrs:{label:"菜单类型",width:"100px"},scopedSlots:e._u([{key:"default",fn:function(t){return[e._v("\n "+e._s(1==t.row.type?"按钮":"菜单")+"\n ")]}}])}),e._v(" "),o("el-table-column",{attrs:{prop:"sort",width:"100px",label:"排序"}}),e._v(" "),o("el-table-column",{attrs:{prop:"path",label:"文件路径"}}),e._v(" "),o("el-table-column",{attrs:{prop:"parentPermission",label:"高亮路径"}}),e._v(" "),o("el-table-column",{attrs:{prop:"icon",label:"菜单图标"}}),e._v(" "),o("el-table-column",{attrs:{prop:"permission",label:"接口权限"}}),e._v(" "),o("el-table-column",{attrs:{prop:"memo",label:"页面权限"}}),e._v(" "),o("el-table-column",{attrs:{prop:"hid",width:"100px",label:"是否隐藏"},scopedSlots:e._u([{key:"default",fn:function(t){return[e._v("\n "+e._s(1==t.row.hid?"隐藏":"不隐藏")+"\n ")]}}])}),e._v(" "),o("el-table-column",{attrs:{width:"100px",label:"是否缓存"},scopedSlots:e._u([{key:"default",fn:function(t){return[o("div",[e._v("\n "+e._s("0"==parseInt(t.row.keepAlive)?"缓存":"不缓存")+"\n ")])]}}])}),e._v(" "),o("el-table-column",{attrs:{label:"操作"},scopedSlots:e._u([{key:"default",fn:function(t){return[o("el-button",{directives:[{name:"permission",rawName:"v-permission",value:"menu/update",expression:"'menu/update'"}],attrs:{type:"text"},on:{click:function(o){return e.onOperation("update",t.row)}}},[e._v("修改")]),e._v(" "),o("el-button",{directives:[{name:"permission",rawName:"v-permission",value:"menu/del",expression:"'menu/del'"}],attrs:{type:"text"},on:{click:function(o){return e.onDelete(t.row)}}},[e._v("删除")])]}}])})],1)],1),e._v(" "),o("el-dialog",{attrs:{title:"侧边栏管理","close-on-click-modal":!1,visible:e.branchStatus,"default-expand-all":"",width:"500px"},on:{"update:visible":function(t){e.branchStatus=t},close:function(t){return e.onFormClose("ruleForm")}}},[o("el-form",{ref:"ruleForm",attrs:{model:e.form,rules:e.rules}},[o("el-form-item",{attrs:{label:"菜单类型","label-width":e.formLabelWidth}},[o("el-select",{staticStyle:{width:"100% !important"},model:{value:e.form.type,callback:function(t){e.$set(e.form,"type",e._n("string"===typeof t?t.trim():t))},expression:"form.type"}},[o("el-option",{attrs:{label:"菜单",value:0}}),e._v(" "),o("el-option",{attrs:{label:"按钮",value:1}})],1)],1),e._v(" "),o("el-form-item",{attrs:{label:"菜单名",prop:"name","label-width":e.formLabelWidth}},[o("el-input",{attrs:{autocomplete:"off"},model:{value:e.form.name,callback:function(t){e.$set(e.form,"name","string"===typeof t?t.trim():t)},expression:"form.name"}})],1),e._v(" "),0==e.form.type?o("el-form-item",{attrs:{label:"文件路径",prop:"path","label-width":e.formLabelWidth}},[o("el-input",{attrs:{autocomplete:"off"},model:{value:e.form.path,callback:function(t){e.$set(e.form,"path","string"===typeof t?t.trim():t)},expression:"form.path"}})],1):e._e(),e._v(" "),o("el-form-item",{attrs:{label:"接口权限",prop:"permission","label-width":e.formLabelWidth}},[o("el-input",{attrs:{autocomplete:"off"},model:{value:e.form.permission,callback:function(t){e.$set(e.form,"permission","string"===typeof t?t.trim():t)},expression:"form.permission"}})],1),e._v(" "),o("el-form-item",{attrs:{label:"页面权限",prop:"memo","label-width":e.formLabelWidth}},[o("el-input",{attrs:{autocomplete:"off"},model:{value:e.form.memo,callback:function(t){e.$set(e.form,"memo","string"===typeof t?t.trim():t)},expression:"form.memo"}})],1),e._v(" "),0==e.form.type?o("el-form-item",{attrs:{label:"高亮路径","label-width":e.formLabelWidth}},[o("el-input",{attrs:{autocomplete:"off"},model:{value:e.form.parentPermission,callback:function(t){e.$set(e.form,"parentPermission","string"===typeof t?t.trim():t)},expression:"form.parentPermission"}})],1):e._e(),e._v(" "),0==e.form.type?o("el-form-item",{attrs:{label:"组件名",prop:"component","label-width":e.formLabelWidth}},[o("el-input",{attrs:{autocomplete:"off"},model:{value:e.form.component,callback:function(t){e.$set(e.form,"component","string"===typeof t?t.trim():t)},expression:"form.component"}})],1):e._e(),e._v(" "),o("el-form-item",{attrs:{label:"父元素ID",prop:"parentId","label-width":e.formLabelWidth}},[o("el-cascader",{staticStyle:{width:"100%"},attrs:{options:e.cascaderList,props:e.optionProps},model:{value:e.form.parentId,callback:function(t){e.$set(e.form,"parentId",t)},expression:"form.parentId"}})],1),e._v(" "),o("el-form-item",{attrs:{label:"是否隐藏","label-width":e.formLabelWidth}},[o("el-select",{staticStyle:{width:"100% !important"},model:{value:e.form.hid,callback:function(t){e.$set(e.form,"hid","string"===typeof t?t.trim():t)},expression:"form.hid"}},[o("el-option",{attrs:{label:"否",value:0}}),e._v(" "),o("el-option",{attrs:{label:"是",value:1}})],1)],1),e._v(" "),o("el-form-item",{attrs:{label:"是否缓存","label-width":e.formLabelWidth}},[o("el-select",{staticStyle:{width:"100% !important"},model:{value:e.form.keepAlive,callback:function(t){e.$set(e.form,"keepAlive","string"===typeof t?t.trim():t)},expression:"form.keepAlive"}},[o("el-option",{attrs:{label:"是",value:0}}),e._v(" "),o("el-option",{attrs:{label:"否",value:1}})],1)],1),e._v(" "),o("el-form-item",{attrs:{label:"ICON名称",prop:"icon","label-width":e.formLabelWidth}},[o("el-input",{attrs:{autocomplete:"off"},model:{value:e.form.icon,callback:function(t){e.$set(e.form,"icon","string"===typeof t?t.trim():t)},expression:"form.icon"}})],1),e._v(" "),o("el-form-item",{attrs:{label:"排序","label-width":e.formLabelWidth}},[o("el-input",{attrs:{autocomplete:"off"},model:{value:e.form.sort,callback:function(t){e.$set(e.form,"sort","string"===typeof t?t.trim():t)},expression:"form.sort"}})],1)],1),e._v(" "),o("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[o("el-button",{on:{click:function(t){e.branchStatus=!1}}},[e._v("取 消")]),e._v(" "),o("el-button",{attrs:{type:"primary"},on:{click:e.onBranchSubmit}},[e._v("确 定")])],1)],1)],1)])},n=[],i=o("bd86"),l=o("7618"),a=(o("c5f6"),o("55dd"),o("7f7f"),o("1a62")),s=(o("2ef0"),{name:"addSilder",data:function(){return{keyword:"",tableListFilter:[],tableList:[],cascaderList:[],formLabelWidth:"100px",branchStatus:!1,operationType:"create",form:{name:null,path:null,permission:null,parentId:null,sort:1,component:null,hid:0,type:0,icon:null,parentPermission:null,keepAlive:1},rules:{name:[{required:!0,message:"请输入菜单名",trigger:"blur"}],path:[{required:!0,message:"请输入文件路径",trigger:"blur"}],component:[{required:!0,message:"请输入组件名",trigger:"blur"}],permission:[{required:!0,message:"请输入接口权限",trigger:"blur"}],memo:[{required:!0,message:"请输入页面权限",trigger:"blur"}],parentId:[{required:!0,message:"请输入父元素ID",trigger:"blur"}]},optionProps:{value:"id",label:"name",children:"children",checkStrictly:!0}}},mounted:function(){this.lookSilder()},methods:{filterList:function(e,t){var o=this;return e.filter((function(e){var r=(e.name||"").indexOf(t)>-1||(e.memo||"").indexOf(t)>-1||(e.memo||"").indexOf(t)>-1||(e.permission||"").indexOf(t)>-1,n=o.filterList(e.children||[],t);return r||n.length}))},onOperation:function(e,t){this.branchStatus=!0,this.operationType=e,"update"==e&&(this.form={name:t.name,path:t.path,permission:t.permission,parentId:t.parentId,sort:t.sort,component:t.component,id:t.id,hid:t.hid,icon:t.icon,type:Number(t.type),parentPermission:t.parentPermission,keepAlive:Number(t.keepAlive),memo:t.memo})},onBranchSubmit:function(e){var t=this;this.$refs["ruleForm"].validate((function(e){if(!e)return!1;var o=t.form;"create"==t.operationType?Object(a["a"])({path:o.path,component:o.component,name:o.name,permission:o.permission,sort:o.sort,parentId:o.parentId.pop(),hid:o.hid,icon:o.icon,type:o.type,parentPermission:o.parentPermission,keepAlive:o.keepAlive,memo:o.memo}).then((function(e){200==e.code&&(t.$message.success("添加成功"),t.lookSilder(),t.branchStatus=!1)})):"update"==t.operationType&&("object"===Object(l["a"])(o.parentId)&&(o.parentId=o.parentId.pop()),Object(a["d"])(o).then((function(e){200==e.code&&(t.$message.success("修改成功"),t.lookSilder(),t.branchStatus=!1)})))}))},lookSilder:function(){var e=this;Object(a["c"])().then((function(t){200==t.code&&(e.tableList=e.setTableData(t.data),e.cascaderList=e.setTableData(t.data),e.cascaderList.unshift({id:0,name:"根结点",children:[]}))}))},setTableData:function(e){var t=this,o=[];return o=e.map((function(e){var o,r={};return o={id:e.id,name:e.name,type:e.type,path:e.path,permission:e.permission,icon:e.icon,parentId:e.parentId,component:e.component,sort:e.sort,hid:e.hid},Object(i["a"])(o,"icon",e.icon),Object(i["a"])(o,"type",e.type),Object(i["a"])(o,"keepAlive",e.keepAlive),Object(i["a"])(o,"parentPermission",e.parentPermission),Object(i["a"])(o,"memo",e.memo),r=o,e.sysMenus&&e.sysMenus.length>0&&(r.children=t.setTableData(e.sysMenus)),r})),o},onDelete:function(e){var t=this;Object(a["b"])(e.id).then((function(e){200==e.code&&(t.$message.success("删除成功"),t.lookSilder(),t.branchStatus=!1)}))},onFormClose:function(e){this.form={name:null,path:null,permission:null,parentId:null,sort:1,component:null,hid:0,type:0,icon:null,parentPermission:null,keepAlive:1},this.$refs[e].resetFields()}}}),m=s,p=(o("b2b3"),o("2877")),c=Object(p["a"])(m,r,n,!1,null,null,null);t["default"]=c.exports},9183:function(e,t,o){},b2b3:function(e,t,o){"use strict";o("9183")}}]);