text: (window.webpackJsonp=window.webpackJsonp||[]).push([["chunk-82b5"],{"9dka":function(e,t,a){},BKbu:function(e,t,a){"use strict";a.r(t);var n={name:"ManagerListPage",filters:{dialogTitle:function(e){return e?"创建管理账户":"编辑管理账户"}},data:function(){return{roles:null,list:null,listLoading:!1,listTotal:0,manager:{manageid:null,loginName:null,roleid:null,nickName:null,loginPwd:null},managerRules:{loginName:[{required:!0,trigger:"blur",message:"必填项"}],roleid:[{required:!0,trigger:"blur",message:"必填项"}],nickName:[{required:!0,trigger:"blur",message:"必填项"}]},dialogNewOrEditManagerVisible:!1,newFlag:!1,createBtnLoading:!1,updateBtnLoading:!1,resetBtnLoading:!1,createManagerBtn:!0,disableManagerBtn:!0,editManagerBtn:!0}},created:function(){this.query(),this.validateRole()},mounted:function(){this.queryRoles()},methods:{queryRoles:function(){var e=this;this.$store.dispatch("ListRole").then(function(t){e.roles=t.data})},query:function(){var e=this;this.listLoading=!0,this.$store.dispatch("ListManagerByQry").then(function(t){e.list=t.data,e.listLoading=!1}).catch(function(){e.listLoading=!1})},showManagerEditPage:function(){this.newFlag=!0,this.resetForm(),this.dialogNewOrEditManagerVisible=!0},createManager:function(){var e=this;this.$refs.managerForm.validate(function(t){t&&e.$confirm("是否确定创建管理账户?","提示",{confirmButtonText:"确定",cancelButtonText:"取消"}).then(function(){e.createBtnLoading=!0,e.$store.dispatch("AddManager",e.manager).then(function(t){e.createBtnLoading=!1,e.dialogNewOrEditManagerVisible=!1,e.$message({message:t.msg,type:"success"}),e.query()}).catch(function(){e.createBtnLoading=!1})})})},updateManager:function(){var e=this;this.$refs.managerForm.validate(function(t){t&&e.$confirm("是否确定修改管理账户?","提示",{confirmButtonText:"确定",cancelButtonText:"取消"}).then(function(){e.updateBtnLoading=!0;var t={manageid:e.manager.manageid,roleid:e.manager.roleid,nickName:e.manager.nickName,loginPwd:e.manager.loginPwd};e.$store.dispatch("UpdateManager",t).then(function(t){e.updateBtnLoading=!1,e.dialogNewOrEditManagerVisible=!1,e.$message({message:t.msg,type:"success"}),e.query()}).catch(function(){e.updateBtnLoading=!1})})})},resetPassword:function(){var e=this;this.$confirm("是否确定重置该账户密码?","提示",{confirmButtonText:"确定",cancelButtonText:"取消"}).then(function(){e.resetBtnLoading=!0;var t={manageid:e.manager.manageid,roleid:e.manager.roleid,nickName:e.manager.nickName};e.$store.dispatch("ResetPassword",t).then(function(t){e.resetBtnLoading=!1,e.dialogNewOrEditManagerVisible=!1,e.$message({message:t.msg,type:"success"}),e.query()}).catch(function(){e.resetBtnLoading=!1})})},enableManager:function(e){var t=this;this.$confirm("是否确定启用该管理账号?","提示",{confirmButtonText:"确定",cancelButtonText:"取消"}).then(function(){t.$store.dispatch("TransformManagerStateByQry",{manageid:e}).then(function(e){t.$message({message:e.msg,type:"success"}),t.query()})})},disableManager:function(e){var t=this;this.$confirm("是否确定禁用该管理帐号?","提示",{confirmButtonText:"确定",cancelButtonText:"取消"}).then(function(){t.$store.dispatch("TransformManagerStateByQry",{manageid:e}).then(function(e){t.$message({message:e.msg,type:"success"}),t.query()})})},editManager:function(e){this.newFlag=!1,this.manager={manageid:e.manageid,loginName:e.loginName,roleid:e.roleid,nickName:e.nickName,loginPwd:e.loginPwd},this.dialogNewOrEditManagerVisible=!0},resetForm:function(){this.$refs.roleForm&&this.$refs.roleForm.clearValidate(),this.manager={manageid:null,loginName:null,roleid:null,nickName:null,loginPwd:null}},validateRole:function(){var e=this.$store.state.user.roleId,t=this.$store.state.user.menus;1!==e&&(this.hasPermission(t,10101)||(this.createManagerBtn=!1),this.hasPermission(t,10102)||(this.disableManagerBtn=!1),this.hasPermission(t,10103)||(this.editManagerBtn=!1))},hasPermission:function(e,t){return!!e&&e.some(function(e){return e.menuId===t})}}},i=(a("lET7"),a("ZrdR")),r=Object(i.a)(n,function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"app-container"},[a("div",{staticClass:"filter-container"},[a("el-form",{ref:"filterForm",attrs:{inline:!0,size:"mini"}},[a("el-form-item",[e.createManagerBtn?a("el-button",{staticClass:"btn-form",attrs:{type:"primary"},on:{click:e.showManagerEditPage}},[e._v("创建管理账户")]):e._e()],1)],1)],1),e._v(" "),a("el-table",{directives:[{name:"loading",rawName:"v-loading",value:e.listLoading,expression:"listLoading"}],attrs:{data:e.list,size:"mini",border:"",fit:"","highlight-current-row":""}},[a("el-table-column",{attrs:{align:"center",label:"登录帐号"},scopedSlots:e._u([{key:"default",fn:function(t){return[e._v("\n        "+e._s(t.row.loginName)+"\n      ")]}}])}),e._v(" "),a("el-table-column",{attrs:{align:"center",label:"显示名称"},scopedSlots:e._u([{key:"default",fn:function(t){return[e._v("\n        "+e._s(t.row.nickName)+"\n      ")]}}])}),e._v(" "),a("el-table-column",{attrs:{align:"center",label:"后台角色"},scopedSlots:e._u([{key:"default",fn:function(t){return[e._v("\n        "+e._s(t.row.roleName)+"\n      ")]}}])}),e._v(" "),a("el-table-column",{attrs:{align:"center",label:"用户状态"},scopedSlots:e._u([{key:"default",fn:function(t){return[a("el-tag",{attrs:{type:t.row.isdel?"danger":"success"}},[e._v(e._s(t.row.isdel?"禁用":"启用"))])]}}])}),e._v(" "),a("el-table-column",{attrs:{align:"center",label:"管理操作"},scopedSlots:e._u([{key:"default",fn:function(t){return[!t.row.isdel&&1!==t.row.manageid&&e.disableManagerBtn?a("el-button",{attrs:{type:"text",size:"mini"},on:{click:function(a){e.disableManager(t.row.manageid)}}},[e._v("禁用帐号")]):e._e(),e._v(" "),t.row.isdel&&1!==t.row.manageid&&e.disableManagerBtn?a("el-button",{attrs:{type:"text",size:"mini"},on:{click:function(a){e.enableManager(t.row.manageid)}}},[e._v("启用帐号")]):e._e(),e._v(" "),1!==t.row.manageid&&e.editManagerBtn?a("el-button",{attrs:{type:"text",size:"mini"},on:{click:function(a){e.editManager(t.row)}}},[e._v("编辑帐号")]):e._e()]}}])})],1),e._v(" "),a("el-dialog",{attrs:{visible:e.dialogNewOrEditManagerVisible,title:e._f("dialogTitle")(e.newFlag),width:"600px"},on:{"update:visible":function(t){e.dialogNewOrEditManagerVisible=t}}},[a("el-form",{ref:"managerForm",attrs:{model:e.manager,rules:e.managerRules}},[a("el-form-item",{attrs:{label:"登录帐号",prop:"loginName"}},[a("el-input",{attrs:{disabled:!e.newFlag,type:"text"},model:{value:e.manager.loginName,callback:function(t){e.$set(e.manager,"loginName",t)},expression:"manager.loginName"}})],1),e._v(" "),a("el-form-item",{attrs:{label:"用户名称",prop:"nickName"}},[a("el-input",{attrs:{type:"text"},model:{value:e.manager.nickName,callback:function(t){e.$set(e.manager,"nickName",t)},expression:"manager.nickName"}})],1),e._v(" "),a("el-form-item",{attrs:{label:"角色",prop:"roleid"}},[a("el-select",{staticClass:"filter-item",attrs:{placeholder:"请选择",value:""},model:{value:e.manager.roleid,callback:function(t){e.$set(e.manager,"roleid",t)},expression:"manager.roleid"}},e._l(e.roles,function(e){return a("el-option",{key:e.roleid,attrs:{label:e.roleName,value:e.roleid}})}))],1)],1),e._v(" "),a("div",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[a("el-button",{on:{click:function(t){e.dialogNewOrEditManagerVisible=!1}}},[e._v("取消")]),e._v(" "),e.newFlag?a("el-button",{attrs:{loading:e.createBtnLoading,type:"primary"},on:{click:e.createManager}},[e._v("创建")]):e._e(),e._v(" "),e.newFlag?e._e():a("el-button",{attrs:{loading:e.resetBtnLoading,type:"primary"},on:{click:e.resetPassword}},[e._v("重置密码")]),e._v(" "),e.newFlag?e._e():a("el-button",{attrs:{loading:e.updateBtnLoading,type:"primary"},on:{click:e.updateManager}},[e._v("修改")])],1)],1)],1)},[],!1,null,"036f3bc2",null);r.options.__file="index.vue";t.default=r.exports},lET7:function(e,t,a){"use strict";var n=a("9dka");a.n(n).a}}]);