lepu-test-platform-web/dist/static/js/13.8370202bba15496a1326.js

2 lines
9.5 KiB
JavaScript
Raw Normal View History

webpackJsonp([13],{TdLA:function(e,t){},iEjd:function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=i("mvHQ"),o=i.n(a),l={data:function(){return{detailForm:{},editForm:{},expandList:[],menuList:[],fatherMenuFlag:!1,addDialogVisible:!1,editDialogVisible:!1,detailDialogVisible:!1,addForm:{menuId:"",menuName:"",menuIcon:"",urlPath:"",comments:""},addFormRules:{menuId:[{required:!0,message:"请输入菜单ID",trigger:"blur"},{min:1,max:20,message:"长度在 1 到 20 个字符",trigger:"blur"}],menuName:[{required:!0,message:"请输入菜单名称",trigger:"blur"},{min:1,max:50,message:"长度在 1 到 50 个字符",trigger:"blur"}],urlPath:[{required:!0,message:"请输入路由地址",trigger:"blur"},{min:1,max:100,message:"长度在 1 到 100 个字符",trigger:"blur"}],menuIcon:[{required:!0,message:"请输入菜单图标",trigger:"blur"},{min:1,max:50,message:"长度在 1 到 50 个字符",trigger:"blur"}],comments:[{required:!1,message:"请输入备注信息",trigger:"blur"},{min:0,max:250,message:"长度在 0 到 250 个字符",trigger:"blur"}]}}},mounted:function(){},created:function(){this.getMenuList()},methods:{getMenuList:function(){var e=this;this.loading=!0,this.$api.menu.queryAllMenuInfo().then(function(t){e.loading=!1,e.menuList=t.data.data;for(var i=0;i<e.menuList.length;i++)e.expandList.push(e.menuList[i].id+"")}).catch(function(){e.loading=!1})},addDialogClose:function(){this.$refs.addFormRef.resetFields()},addMenu:function(){var e=this;this.$refs.addFormRef.validate(function(t){t&&(e.loading=!0,e.$api.menu.addMenu(o()(e.addForm)).then(function(t){e.$notify({message:t.data.msg,type:"success"}),e.loading=!1,e.addDialogVisible=!1,e.getMenuList()}).catch(function(){e.loading=!1}))})},addChildMenu:function(e){this.addForm.isFather=0,this.addForm.fatherId=e.menuId,this.fatherMenuFlag=!0,this.addDialogVisible=!0},addFatherMenu:function(){this.addForm.isFather=1,this.addForm.fatherId=0,this.addForm.menuIcon="",this.fatherMenuFlag=!1,this.addDialogVisible=!0},editDialogClose:function(){this.$refs.editFormRef.resetFields()},showEditDialog:function(e){var t=this;this.editDialogVisible=!0,this.$api.menu.queryMenuByMenuId(e.menuId).then(function(e){t.editForm=e.data.data}).catch(function(){})},editMenu:function(){var e=this;this.$refs.editFormRef.validate(function(t){t&&(e.loading=!0,e.$api.menu.editMenu(o()(e.editForm)).then(function(t){e.$notify({message:t.data.msg,type:"success"}),e.loading=!1,e.editDialogVisible=!1,e.getMenuList()}).catch(function(){e.loading=!1}))})},detailMenu:function(e){var t=this;this.detailDialogVisible=!0,this.$api.menu.queryMenuByMenuId(e.menuId).then(function(e){t.loading=!1,t.detailForm=e.data.data}).catch(function(){t.loading=!1})},delMenu:function(e){var t=this;this.$confirm("确定删除该菜单吗?","提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then(function(){t.loading=!0,t.$api.menu.deleteMenuByMenuId(e.menuId).then(function(e){t.$notify({message:e.data.msg,type:"success"}),t.loading=!1,t.getMenuList()}).catch(function(){t.loading=!1})}).catch(function(){})}}},n={render:function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{staticClass:"menu-box",attrs:{id:"menu-box"}},[i("el-row",{staticClass:"add_button"},[i("el-col",{attrs:{span:2}},[i("el-button",{attrs:{type:"primary"},on:{click:e.addFatherMenu}},[e._v("添加")])],1)],1),e._v(" "),i("el-row",[i("el-table",{staticStyle:{width:"100%"},attrs:{data:e.menuList,"row-key":"id","tree-props":{children:"children",hasChildren:"hasChildren"},"expand-row-keys":e.expandList}},[i("el-table-column",{attrs:{prop:"menuName",label:"菜单名称"}}),e._v(" "),e._e(),e._v(" "),i("el-table-column",{attrs:{prop:"urlPath",label:"路由地址"}}),e._v(" "),i("el-table-column",{attrs:{prop:"menuIcon",label:"菜单图标"}}),e._v(" "),i("el-table-column",{attrs:{prop:"comments",label:"备注","show-overflow-tooltip":""}}),e._v(" "),i("el-table-column",{attrs:{label:"操作",fixed:"right",width:"260"},scopedSlots:e._u([{key:"default",fn:function(t){return[1==t.row.isFather?
//# sourceMappingURL=13.8370202bba15496a1326.js.map