(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-2d0d9f81"],{"6a33":function(e,t,a){"use strict";a.r(t);a("fb6a");var l=function(){var e=this,t=e._self._c;return t("div",{staticClass:"app-container"},[t("h4",{staticClass:"form-header h4"},[e._v("基本信息")]),t("el-form",{ref:"form",attrs:{model:e.form,"label-width":"80px"}},[t("el-row",[t("el-col",{attrs:{span:8,offset:2}},[t("el-form-item",{attrs:{label:"用户昵称",prop:"nickName"}},[t("el-input",{attrs:{disabled:""},model:{value:e.form.nickName,callback:function(t){e.$set(e.form,"nickName",t)},expression:"form.nickName"}})],1)],1),t("el-col",{attrs:{span:8,offset:2}},[t("el-form-item",{attrs:{label:"登录账号",prop:"userName"}},[t("el-input",{attrs:{disabled:""},model:{value:e.form.userName,callback:function(t){e.$set(e.form,"userName",t)},expression:"form.userName"}})],1)],1)],1)],1),t("h4",{staticClass:"form-header h4"},[e._v("角色信息")]),t("el-table",{directives:[{name:"loading",rawName:"v-loading",value:e.loading,expression:"loading"}],ref:"table",attrs:{"row-key":e.getRowKey,data:e.roles.slice((e.pageNum-1)*e.pageSize,e.pageNum*e.pageSize)},on:{"row-click":e.clickRow,"selection-change":e.handleSelectionChange}},[t("el-table-column",{attrs:{label:"序号",type:"index",align:"center"},scopedSlots:e._u([{key:"default",fn:function(a){return[t("span",[e._v(e._s((e.pageNum-1)*e.pageSize+a.$index+1))])]}}])}),t("el-table-column",{attrs:{type:"selection","reserve-selection":!0,width:"55"}}),t("el-table-column",{attrs:{label:"角色编号",align:"center",prop:"roleId"}}),t("el-table-column",{attrs:{label:"角色名称",align:"center",prop:"roleName"}}),t("el-table-column",{attrs:{label:"权限字符",align:"center",prop:"roleKey"}}),t("el-table-column",{attrs:{label:"创建时间",align:"center",prop:"createTime",width:"180"},scopedSlots:e._u([{key:"default",fn:function(a){return[t("span",[e._v(e._s(e.parseTime(a.row.createTime)))])]}}])})],1),t("pagination",{directives:[{name:"show",rawName:"v-show",value:e.total>0,expression:"total>0"}],attrs:{total:e.total,page:e.pageNum,limit:e.pageSize},on:{"update:page":function(t){e.pageNum=t},"update:limit":function(t){e.pageSize=t}}}),t("el-form",{attrs:{"label-width":"100px"}},[t("el-form-item",{staticStyle:{"text-align":"center","margin-left":"-120px","margin-top":"30px"}},[t("el-button",{attrs:{type:"primary"},on:{click:function(t){return e.submitForm()}}},[e._v("提交")]),t("el-button",{on:{click:function(t){return e.close()}}},[e._v("返回")])],1)],1)],1)},o=[],n=(a("a15b"),a("d81d"),a("d3b7"),a("159b"),a("c0c7")),r={name:"AuthRole",data:function(){return{loading:!0,total:0,pageNum:1,pageSize:10,roleIds:[],roles:[],form:{}}},created:function(){var e=this,t=this.$route.params&&this.$route.params.userId;t&&(this.loading=!0,Object(n["d"])(t).then((function(t){e.form=t.user,e.roles=t.roles,e.total=e.roles.length,e.$nextTick((function(){e.roles.forEach((function(t){t.flag&&e.$refs.table.toggleRowSelection(t)}))})),e.loading=!1})))},methods:{clickRow:function(e){this.$refs.table.toggleRowSelection(e)},handleSelectionChange:function(e){this.roleIds=e.map((function(e){return e.roleId}))},getRowKey:function(e){return e.roleId},submitForm:function(){var e=this,t=this.form.userId,a=this.roleIds.join(",");Object(n["k"])({userId:t,roleIds:a}).then((function(t){e.$modal.msgSuccess("授权成功"),e.close()}))},close:function(){var e={path:"/system/user"};this.$tab.closeOpenPage(e)}}},i=r,s=a("2877"),c=Object(s["a"])(i,l,o,!1,null,null,null);t["default"]=c.exports}}]);