(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-2f8a36d9"],{"0e8f":function(e,t,r){"use strict";r.d(t,"d",(function(){return n})),r.d(t,"e",(function(){return o})),r.d(t,"c",(function(){return l})),r.d(t,"a",(function(){return c})),r.d(t,"b",(function(){return u}));var i=r("b775"),a=r("4328"),s=r.n(a);function n(e){return Object(i["a"])({url:"user-service/dept/getDeptTreeList",method:"get",params:e})}function o(e){return Object(i["a"])({url:"user-service/dept/getDeptSubByDeptId",method:"get",params:e})}function l(e){var t=s.a.stringify(e);return Object(i["a"])({url:"user-service/dept/updateDept",method:"post",data:t})}function c(e){var t=s.a.stringify(e);return Object(i["a"])({url:"user-service/dept/saveDept",method:"post",data:t})}function u(e){return Object(i["a"])({headers:{"Content-Type":"application/json"},url:"user-service/dept/removeDept",method:"get",params:e})}},"14cb":function(e,t,r){"use strict";r("1a02")},"1a02":function(e,t,r){},"333d":function(e,t,r){"use strict";var i=function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("div",{staticClass:"pagination-container"},[r("el-pagination",e._b({attrs:{background:e.background,"current-page":e.currentPage,"page-size":e.pageSize,layout:e.layout,"page-sizes":e.pageSizes,total:e.total},on:{"update:currentPage":function(t){e.currentPage=t},"update:current-page":function(t){e.currentPage=t},"update:pageSize":function(t){e.pageSize=t},"update:page-size":function(t){e.pageSize=t},"size-change":e.handleSizeChange,"current-change":e.handleCurrentChange}},"el-pagination",e.$attrs,!1))],1)},a=[],s=(r("a9e3"),{name:"Pagination",props:{total:{required:!0,type:Number},page:{type:Number,default:0},limit:{type:Number,default:20},pageSizes:{type:Array,default:function(){return[5,10,20,30,70]}},layout:{type:String,default:"total, sizes, prev, pager, next, jumper"},background:{type:Boolean,default:!0},hidden:{type:Boolean,default:!1}},computed:{currentPage:{get:function(){return this.page},set:function(e){this.$emit("update:page",e)}},pageSize:{get:function(){return this.limit},set:function(e){this.$emit("update:limit",e)}}},methods:{handleSizeChange:function(e){this.$emit("pagination",{page:this.currentPage,limit:e})},handleCurrentChange:function(e){this.$emit("pagination",{page:e,limit:this.pageSize})}}}),n=s,o=(r("14cb"),r("2877")),l=Object(o["a"])(n,i,a,!1,null,"4dfad654",null);t["a"]=l.exports},"345c":function(e,t,r){"use strict";r("7c39")},4381:function(e,t,r){"use strict";r("d3b7"),r("caad"),r("2532"),r("d9e2");var i=r("4360"),a={inserted:function(e,t){var r=t.value,a=i["a"].getters&&i["a"].getters.butPermission;if(console.log(a,"roles"),!(r&&r instanceof Array&&r.length>0))throw new Error("need roles! Like v-permission=\"['admin','editor']\"");var s=r,n=a.some((function(e){return s.includes(e)}));if(console.log(n,"hasPermission"),n)i["a"].state.user.permissionFlag[s]=!1;else{i["a"].state.user.permissionFlag[s]=!0,console.log(i["a"].state.user.permissionFlag[s],"permissionRoles");var o=document.createElement("div");o.style.cursor="not-allowed",o.style.display="inline-block",e.style.pointerEvents="none",e.parentNode.insertBefore(o,e),e.parentNode&&e.parentNode.removeChild(e),o.appendChild(e),console.log(e,"permissionRoles")}}},s=function(e){e.directive("permission",a)};window.Vue&&(window["permission"]=a,Vue.use(s)),a.install=s;t["a"]=a},"67d5":function(e,t,r){"use strict";r.d(t,"e",(function(){return n})),r.d(t,"a",(function(){return o})),r.d(t,"c",(function(){return l})),r.d(t,"b",(function(){return c})),r.d(t,"f",(function(){return u})),r.d(t,"h",(function(){return d})),r.d(t,"d",(function(){return p})),r.d(t,"g",(function(){return h}));var i=r("b775"),a=r("4328"),s=r.n(a);function n(e){return Object(i["a"])({url:"user-service/role/getRoleList",method:"get",params:e})}function o(e){return Object(i["a"])({headers:{"Content-Type":"application/json"},url:"user-service/role/saveRole",method:"post",data:e})}function l(e){return Object(i["a"])({headers:{"Content-Type":"application/json"},url:"user-service/role/updateRole",method:"post",data:e})}function c(e){var t={Roleids:e};return Object(i["a"])({headers:{"Content-Type":"application/json"},url:"user-service/role/removeRole",method:"get",params:t})}function u(e){var t={roleId:e};return Object(i["a"])({headers:{"Content-Type":"application/json"},url:"user-service/permission/getWebRolePermissionInfoByRoleId",method:"get",params:t})}function d(e){var t=s.a.stringify(e);return Object(i["a"])({url:"user-service/permission/saveWebRolePermission",method:"post",data:t})}function p(e){var t={roleId:e};return Object(i["a"])({headers:{"Content-Type":"application/json"},url:"user-service/appPermission/getAppRolePermissionInfoByRoleId",method:"get",params:t})}function h(e){var t=s.a.stringify(e);return Object(i["a"])({url:"user-service/appPermission/saveAppRolePermission",method:"post",data:t})}},"7c39":function(e,t,r){},a01f:function(e,t,r){"use strict";r.r(t);var i=function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("div",{staticClass:"app-container"},[r("div",{staticClass:"decorate"}),r("div",{staticClass:"filter-container"},[r("el-cascader",{staticClass:"filter-item",attrs:{"show-all-levels":!1,options:e.deptIdList,placeholder:e.$t("listQuery.deptId"),props:{checkStrictly:!0,emitPath:!1,props:{}},clearable:""},on:{change:e.handleFilter},model:{value:e.listQuery.deptId,callback:function(t){e.$set(e.listQuery,"deptId",t)},expression:"listQuery.deptId"}}),r("el-input",{staticClass:"filter-item",attrs:{placeholder:e.$t("pEnter")+e.$t("role.roleName")},nativeOn:{keyup:function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"enter",13,t.key,"Enter")?null:e.handleFilter.apply(null,arguments)}},model:{value:e.listQuery.roleName,callback:function(t){e.$set(e.listQuery,"roleName",t)},expression:"listQuery.roleName"}}),r("span",{staticClass:"btn-item",on:{click:e.handleFilter}},[r("i",{staticClass:"iconfont icon-sousuo"}),e._v(" "+e._s(e.$t("btn.search")))]),r("span",{staticClass:"btn-item",on:{click:e.clearListQuery}},[r("i",{staticClass:"el-icon-refresh-left"}),e._v(" "+e._s(e.$t("btn.resetting")))]),r("div",{staticClass:"control-container"},[r("span",{staticClass:"btn-item",on:{click:function(t){return e.handleCreate()}}},[r("i",{staticClass:"iconfont icon-a-"}),e._v(e._s(e.$t("btn.add")))])])],1),r("div",{staticClass:"table-container"},[r("el-table",{directives:[{name:"loading",rawName:"v-loading",value:e.listLoading,expression:"listLoading"}],attrs:{data:e.list,fit:"","max-height":"580","highlight-current-row":"","header-row-class-name":"table-header","row-class-name":"table-row"}},[r("el-table-column",{attrs:{property:"roleName",align:"left",label:e.$t("role.roleName")}}),r("el-table-column",{attrs:{property:"roleDescript",align:"left",label:e.$t("role.roleDescript")}}),r("el-table-column",{attrs:{property:"roleCode",align:"left",label:e.$t("role.roleCode")}}),r("el-table-column",{attrs:{property:"deptName",align:"left",label:e.$t("listQuery.deptId")}}),r("el-table-column",{attrs:{label:e.$t("table.operate"),width:"450",align:"left"},scopedSlots:e._u([{key:"default",fn:function(t){return[r("span",{staticClass:"btnCancel",attrs:{title:e.$t("table.update")},on:{click:function(r){return e.handleUpdate(t)}}},[r("i",{staticClass:"iconfont icon-bianji"}),e._v(e._s(e.$t("table.update")))]),r("span",{staticClass:"btnCancel delete",attrs:{title:e.$t("table.delete")},on:{click:function(r){return e.handleDelete(t)}}},[r("i",{staticClass:"iconfont icon-a--"}),e._v(e._s(e.$t("table.delete")))]),r("span",{staticClass:"btnCancel",attrs:{title:e.$t("role.setWeb")},on:{click:function(r){return e.setResource2Role(t)}}},[r("i",{staticClass:"iconfont icon-a-"}),e._v(e._s(e.$t("role.setWeb")))]),r("span",{staticClass:"btnCancel",attrs:{title:e.$t("role.setApp")},on:{click:function(r){return e.setResource1Role(t)}}},[r("i",{staticClass:"iconfont icon-a-"}),e._v(e._s(e.$t("role.setApp")))])]}}])})],1),r("pagination",{directives:[{name:"show",rawName:"v-show",value:e.total>0,expression:"total > 0"}],attrs:{total:e.total,page:e.listQuery.curPage,limit:e.listQuery.pageSize},on:{"update:page":function(t){return e.$set(e.listQuery,"curPage",t)},"update:limit":function(t){return e.$set(e.listQuery,"pageSize",t)},pagination:e.getList}})],1),r("el-dialog",{attrs:{"close-on-click-modal":!1,title:e.textMap[e.dialogStatus],visible:e.addDialog},on:{"update:visible":function(t){e.addDialog=t}}},[r("el-form",{ref:"form",staticStyle:{width:"400px"},attrs:{rules:e.rules,"status-icon":"",model:e.form,"label-width":"130px"}},[r("el-form-item",{attrs:{label:e.$t("role.roleName"),prop:"roleName"}},[r("el-input",{attrs:{placeholder:e.$t("pEnter")+e.$t("role.roleName"),maxlength:"20"},model:{value:e.form.roleName,callback:function(t){e.$set(e.form,"roleName",t)},expression:"form.roleName"}})],1),r("el-form-item",{attrs:{label:e.$t("role.roleDescript")}},[r("el-input",{attrs:{placeholder:e.$t("pEnter")+e.$t("role.roleDescript"),maxlength:"50"},model:{value:e.form.roleDescript,callback:function(t){e.$set(e.form,"roleDescript",t)},expression:"form.roleDescript"}})],1),r("el-form-item",{attrs:{label:e.$t("role.roleCode"),prop:"roleCode"}},[r("el-input",{attrs:{placeholder:e.$t("pEnter")+e.$t("role.roleCode"),maxlength:"20"},model:{value:e.form.roleCode,callback:function(t){e.$set(e.form,"roleCode",t)},expression:"form.roleCode"}})],1),r("el-form-item",{attrs:{label:e.$t("listQuery.deptId"),prop:"deptId"}},[r("el-cascader",{attrs:{"show-all-levels":!1,options:e.deptIdList,props:{checkStrictly:!0,emitPath:!1,props:{}},clearable:""},model:{value:e.form.deptId,callback:function(t){e.$set(e.form,"deptId",t)},expression:"form.deptId"}})],1)],1),r("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[r("span",{staticClass:"btn-item long",on:{click:function(t){e.addDialog=!1}}},[e._v(e._s(e.$t("btn.cancel")))]),r("span",{staticClass:"btn-item long",on:{click:function(t){"create"===e.dialogStatus?e.createData():e.updateData()}}},[e._v(e._s(e.$t("btn.save")))])])],1),r("el-dialog",{attrs:{"close-on-click-modal":!1,title:e.$t("role.setResources"),visible:e.setResourceDialog},on:{"update:visible":function(t){e.setResourceDialog=t}}},[r("el-tree",{ref:"tree",staticStyle:{"max-height":"400px",overflow:"auto"},attrs:{indent:20,props:e.multiProps,data:e.resourceList,"show-checkbox":!0,"highlight-current":"","default-expand-all":"","expand-on-click-node":!0,"check-strictly":!0,"node-key":"permissionId","default-checked-keys":e.resourceChecked},on:{check:e.clickDeal}}),r("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[r("el-button",{on:{click:function(t){e.setResourceDialog=!1}}},[e._v(e._s(e.$t("btn.cancel")))]),r("el-button",{attrs:{type:"primary"},on:{click:function(t){"web"===e.resourceStatus?e.setResourceSubmit():e.setAppResourceSubmit()}}},[e._v(e._s(e.$t("btn.define")))])],1)],1)],1)},a=[],s=r("2909"),n=r("5530"),o=(r("d81d"),r("d3b7"),r("159b"),r("a15b"),r("3ca3"),r("ddb0"),r("2f62")),l=r("67d5"),c=r("0e8f"),u=r("333d"),d=r("4381"),p={inject:["reload"],components:{Pagination:u["a"]},directives:{permission:d["a"]},data:function(){return{createStatus:!1,multiProps:{children:"children"},rules:{roleName:[{required:!0,message:this.$t("pEnter")+this.$t("role.roleName"),trigger:"blur"}],roleCode:[{required:!0,message:this.$t("pEnter")+this.$t("role.roleCode"),trigger:"blur"}],deptId:[{required:!0,message:this.$t("pSelect")+this.$t("listQuery.deptId"),trigger:"blur"}]},textMap:{update:this.$t("table.update"),create:this.$t("table.create")},deptId:null,resourceStatus:"",deptList:[],resourceChecked:[],setResourceDialog:!1,addDialog:!1,dialogStatus:"",form:{deptId:null,deptName:null,roleCode:null,roleId:null,roleDescript:null,roleName:null},total:0,listQuery:{deptId:null,roleName:null,curPage:1,pageSize:10},currentRoleId:"",resourceList:null,deptIdList:[],list:null,listLoading:!0,downloadLoading:!1}},computed:Object(n["a"])({},Object(o["b"])(["userName"])),created:function(){var e=this;this.getList(),Object(c["e"])().then((function(t){e.deptIdList=t.data&&e.getdeptIdList(t.data)})),this.deptId=this.$store.getters.deptId},methods:{validatenull:function(e){return!(e&&e.length>0)},getdeptIdList:function(e){var t=this;e.length||(e=[e]);var r=e.map((function(e){var r={};return e.subBeanList?(r.children=t.getdeptIdList(e.subBeanList),r.label=e.nodeBean.deptName,r.value=e.nodeBean.deptId,r):(r.label=e.nodeBean.deptName,r.value=e.nodeBean.deptId,r)}));return r},clearListQuery:function(){this.listQuery={deptId:null,roleName:null,curPage:1,pageSize:10},this.getList()},filterDeptList:function(e){var t=this,r=[];return e.forEach((function(e){var i={value:e.deptId,label:e.deptName,children:t.validatenull(e.children)?null:t.filterDeptList(e.children,!0)};r.push(i)})),r},getList:function(){var e=this;this.listLoading=!0,Object(l["e"])(this.listQuery).then((function(t){e.listLoading=!1,e.list=t.data.list,e.total=t.data.totalRow}))},filterRole:function(e){var t=[];return e.forEach((function(e){1!==e.userType&&t.push(e)})),t},createData:function(){var e=this;this.createStatus||this.$refs.form.validate((function(t){t&&(e.createStatus=!0,Object(l["a"])(e.form).then((function(t){200==t.status&&(e.createStatus=!1,e.addDialog=!1,e.$notify({title:e.$t("title.success"),message:e.$t("title.addSuccess"),type:"success",duration:3e3}),e.getList())})).catch((function(){e.createStatus=!1})))}))},handleFilter:function(){this.listQuery.current=1,this.getList()},updateData:function(){var e=this;this.$refs.form.validate((function(t){t&&Object(l["c"])(e.form).then((function(t){200==t.status&&(e.addDialog=!1,e.$notify({title:e.$t("title.success"),message:e.$t("title.updateSuccess"),type:"success",duration:3e3}),e.getList())}))}))},resetForm:function(){for(var e in this.form)this.form[e]=null},handleCreate:function(){var e=this;this.resetForm(),this.addDialog=!0,this.dialogStatus="create",this.$nextTick((function(){e.$refs["form"].clearValidate()}))},handleUpdate:function(e){var t=this;this.form={deptId:e.row.deptId,deptName:e.row.deptName,roleCode:e.row.roleCode,roleId:e.row.roleId,roleDescript:e.row.roleDescript,roleName:e.row.roleName},console.log(this.form),this.dialogStatus="update",this.addDialog=!0,this.$nextTick((function(){t.$refs["form"].clearValidate()}))},handleDelete:function(e){var t=this;this.$confirm(this.$t("title.delPointOutRole"),this.$t("title.pointOut"),{confirmButtonText:this.$t("title.delete"),cancelButtonText:this.$t("title.cancel"),type:"warning"}).then((function(){Object(l["b"])(e.row.roleId).then((function(e){200==e.status&&(t.getList(),t.$notify({title:t.$t("title.success"),message:t.$t("title.deleteSuccess"),type:"success",duration:3e3}))}))}))},setResource2Role:function(e){var t=this;this.currentRoleId=e.row.roleId,this.resourceList=[],this.resourceChecked=[],this.resourceStatus="web",Object(l["f"])(e.row.roleId).then((function(e){t.resourceList=e.data.permissionList,t.resourceChecked=e.data.selectList})),this.setResourceDialog=!0},setResource1Role:function(e){var t=this;this.currentRoleId=e.row.roleId,this.resourceList=[],this.resourceChecked=[],this.resourceStatus="app",Object(l["d"])(e.row.roleId).then((function(e){t.resourceList=e.data.permissionList,t.resourceChecked=e.data.selectList})),this.setResourceDialog=!0},setResourceSubmit:function(){var e=this,t=this.$refs.tree.getHalfCheckedKeys(),r=this.$refs.tree.getCheckedKeys();r.push.apply(r,Object(s["a"])(t));var i={permissionIds:r.join(","),roleId:this.currentRoleId};Object(l["h"])(i).then((function(t){200==t.status&&(e.setResourceDialog=!1,e.reload(),e.getList(),e.$notify({title:e.$t("title.success"),message:e.$t("title.setUpSuccess"),type:"success",duration:3e3}))}))},setAppResourceSubmit:function(){var e=this,t=this.$refs.tree.getHalfCheckedKeys(),r=this.$refs.tree.getCheckedKeys();r.push.apply(r,Object(s["a"])(t));var i={permissionIds:r.join(","),roleId:this.currentRoleId};Object(l["g"])(i).then((function(t){200==t.status&&(e.setResourceDialog=!1,e.getList(),e.$notify({title:e.$t("title.success"),message:e.$t("title.setUpSuccess"),type:"success",duration:3e3}))}))},handleDownload:function(){var e=this;this.downloadLoading=!0;var t=this;Object(l["e"])().then((function(i){r.e("chunk-cb390690").then(r.bind(null,"4bf8")).then((function(r){var a=[t.$t("roleId"),t.$t("roleName"),t.$t("roleDescript"),t.$t("roleCode"),t.$t("deptName")],s=["roleId","roleName","roleDescript","roleCode","deptName"],n=e.formatJson(s,i.data.list);r.export_json_to_excel({header:a,data:n,filename:"智汇管家角色信息"}),e.downloadLoading=!1}))}))},formatJson:function(e,t){return t.map((function(t){return e.map((function(e){return t[e]}))}))},clickDeal:function(e,t){this.clickCheck(e,t,this.$refs.tree)},clickCheck:function(e,t,r){var i=t.checkedKeys.indexOf(e.permissionId);-1!==i?(this.selectedParent(e,r),this.uniteChildSame(e,!0,r)):(0!==e.permissionPid&&this.removeParent(e,r),0!==e.children.length&&this.uniteChildSame(e,!1,r))},uniteChildSame:function(e,t,r){var i=e.children,a=i.length;r.setChecked(e.permissionId,t);for(var s=0;s