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

2 lines
9.5 KiB
JavaScript

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?i("el-button",{attrs:{type:"text",size:"mini"},on:{click:function(i){return e.addChildMenu(t.row)}}},[e._v("添加下级菜单")]):e._e(),e._v(" "),i("el-button",{attrs:{type:"text",size:"mini"},on:{click:function(i){return e.detailMenu(t.row)}}},[e._v("查看")]),e._v(" "),i("el-button",{attrs:{type:"text",size:"mini"},on:{click:function(i){return e.showEditDialog(t.row)}}},[e._v("编辑")]),e._v(" "),i("el-button",{attrs:{type:"text",size:"mini"},on:{click:function(i){return e.delMenu(t.row)}}},[e._v("删除")])]}}])})],1)],1),e._v(" "),i("el-dialog",{attrs:{title:"添加",visible:e.addDialogVisible,"close-on-click-modal":!1,width:"40%"},on:{"update:visible":function(t){e.addDialogVisible=t},close:e.addDialogClose}},[i("el-form",{ref:"addFormRef",attrs:{model:e.addForm,rules:e.addFormRules,"label-width":"100px"}},[i("el-form-item",{attrs:{label:"菜单ID",prop:"menuId"}},[i("el-input",{model:{value:e.addForm.menuId,callback:function(t){e.$set(e.addForm,"menuId",t)},expression:"addForm.menuId"}})],1),e._v(" "),i("el-form-item",{attrs:{label:"菜单名",prop:"menuName"}},[i("el-input",{model:{value:e.addForm.menuName,callback:function(t){e.$set(e.addForm,"menuName",t)},expression:"addForm.menuName"}})],1),e._v(" "),e.fatherMenuFlag?i("el-form-item",{attrs:{label:"路由地址",prop:"urlPath"}},[i("el-input",{model:{value:e.addForm.urlPath,callback:function(t){e.$set(e.addForm,"urlPath",t)},expression:"addForm.urlPath"}})],1):e._e(),e._v(" "),i("el-form-item",{attrs:{label:"菜单图标",prop:"menuIcon"}},[i("el-input",{model:{value:e.addForm.menuIcon,callback:function(t){e.$set(e.addForm,"menuIcon",t)},expression:"addForm.menuIcon"}})],1),e._v(" "),i("el-form-item",{attrs:{label:"备注",prop:"comments"}},[i("el-input",{attrs:{type:"textarea"},model:{value:e.addForm.comments,callback:function(t){e.$set(e.addForm,"comments",t)},expression:"addForm.comments"}})],1)],1),e._v(" "),i("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[i("el-button",{on:{click:function(t){e.addDialogVisible=!1}}},[e._v("取 消")]),e._v(" "),i("el-button",{attrs:{type:"primary"},on:{click:e.addMenu}},[e._v("确 定")])],1)],1),e._v(" "),i("el-dialog",{attrs:{title:"修改",visible:e.editDialogVisible,"close-on-click-modal":!1,width:"40%"},on:{"update:visible":function(t){e.editDialogVisible=t},close:e.editDialogClose}},[i("el-form",{ref:"editFormRef",attrs:{model:e.editForm,rules:e.addFormRules,"label-width":"100px"}},[i("el-form-item",{attrs:{label:"菜单ID",prop:""}},[i("el-input",{attrs:{disabled:""},model:{value:e.editForm.menuId,callback:function(t){e.$set(e.editForm,"menuId",t)},expression:"editForm.menuId"}})],1),e._v(" "),i("el-form-item",{attrs:{label:"菜单名称",prop:"menuName"}},[i("el-input",{model:{value:e.editForm.menuName,callback:function(t){e.$set(e.editForm,"menuName",t)},expression:"editForm.menuName"}})],1),e._v(" "),0==e.editForm.isFather?i("el-form-item",{attrs:{label:"路由地址",prop:"urlPath"}},[i("el-input",{model:{value:e.editForm.urlPath,callback:function(t){e.$set(e.editForm,"urlPath",t)},expression:"editForm.urlPath"}})],1):e._e(),e._v(" "),i("el-form-item",{attrs:{label:"菜单图标",prop:"menuIcon"}},[i("el-input",{model:{value:e.editForm.menuIcon,callback:function(t){e.$set(e.editForm,"menuIcon",t)},expression:"editForm.menuIcon"}})],1),e._v(" "),i("el-form-item",{attrs:{label:"备注",prop:"comments"}},[i("el-input",{attrs:{type:"textarea"},model:{value:e.editForm.comments,callback:function(t){e.$set(e.editForm,"comments",t)},expression:"editForm.comments"}})],1)],1),e._v(" "),i("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[i("el-button",{on:{click:function(t){e.editDialogVisible=!1}}},[e._v("取 消")]),e._v(" "),i("el-button",{attrs:{type:"primary"},on:{click:e.editMenu}},[e._v("确 定")])],1)],1),e._v(" "),i("el-dialog",{attrs:{title:"查看",visible:e.detailDialogVisible,"close-on-click-modal":!1,width:"40%"},on:{"update:visible":function(t){e.detailDialogVisible=t}}},[i("el-form",{attrs:{model:e.detailForm,"label-width":"100px"}},[i("el-form-item",{attrs:{label:"菜单ID",prop:"menuId"}},[i("el-input",{attrs:{disabled:""},model:{value:e.detailForm.menuId,callback:function(t){e.$set(e.detailForm,"menuId",t)},expression:"detailForm.menuId"}})],1),e._v(" "),i("el-form-item",{attrs:{label:"菜单名称",prop:"menuName"}},[i("el-input",{attrs:{disabled:""},model:{value:e.detailForm.menuName,callback:function(t){e.$set(e.detailForm,"menuName",t)},expression:"detailForm.menuName"}})],1),e._v(" "),0==e.detailForm.isFather?i("el-form-item",{attrs:{label:"路由地址",prop:"urlPath"}},[i("el-input",{attrs:{disabled:""},model:{value:e.detailForm.urlPath,callback:function(t){e.$set(e.detailForm,"urlPath",t)},expression:"detailForm.urlPath"}})],1):e._e(),e._v(" "),i("el-form-item",{attrs:{label:"菜单图标",prop:"menuIcon"}},[i("el-input",{attrs:{disabled:""},model:{value:e.detailForm.menuIcon,callback:function(t){e.$set(e.detailForm,"menuIcon",t)},expression:"detailForm.menuIcon"}})],1),e._v(" "),i("el-form-item",{attrs:{label:"备注",prop:"comments"}},[i("el-input",{attrs:{type:"textarea",disabled:""},model:{value:e.detailForm.comments,callback:function(t){e.$set(e.detailForm,"comments",t)},expression:"detailForm.comments"}})],1)],1),e._v(" "),i("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[i("el-button",{on:{click:function(t){e.detailDialogVisible=!1}}},[e._v("取 消")])],1)],1)],1)},staticRenderFns:[]};var r=i("VU/8")(l,n,!1,function(e){i("TdLA")},"data-v-cbb5c08e",null);t.default=r.exports}});
//# sourceMappingURL=13.8370202bba15496a1326.js.map