(window.webpackJsonp=window.webpackJsonp||[]).push([["chunk-503f"],{"0aXy":function(e,t,i){"use strict";var n=i("6THS");i.n(n).a},"6THS":function(e,t,i){},A9HQ:function(e,t,i){},M1nL:function(e,t,i){"use strict";i.r(t);var n=i("KTTK"),l=i("jVVe"),a={name:"RelateEmpoyee",components:{XhUserCell:i("8GhS").p},mixins:[],props:{visible:{type:Boolean,required:!0,default:!1},roleId:[Number,String]},data:function(){return{loading:!0,selectUsers:[]}},computed:{},watch:{visible:function(e){e&&(this.selectUsers=[])}},mounted:function(){},methods:{handleCancel:function(){this.$emit("update:visible",!1)},changeCheckout:function(e){this.selectUsers=e.value},handleConfirm:function(){var e=this;0==this.selectUsers.length?this.$message.error("请选择员工"):Object(l.c)({users:this.selectUsers.map(function(e){return e.id}),groups:[this.roleId]}).then(function(t){e.$message.success("操作成功"),e.$emit("save")}).catch(function(){})}}},o=(i("hrDL"),i("KHd+")),s=Object(o.a)(a,function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("el-dialog",{directives:[{name:"loading",rawName:"v-loading",value:e.loading,expression:"loading"}],attrs:{visible:e.visible,"append-to-body":!0,"close-on-click-modal":!1,title:"关联员工",width:"600px"},on:{close:e.handleCancel}},[i("div",{staticClass:"handle-box"},[i("flexbox",{staticClass:"handle-item",attrs:{align:"stretch"}},[i("div",{staticClass:"handle-item-name",staticStyle:{"margin-top":"8px"}},[e._v("选择员工:")]),e._v(" "),i("xh-user-cell",{staticClass:"handle-item-content",attrs:{radio:!1,value:e.selectUsers},on:{"value-change":e.changeCheckout}})],1)],1),e._v(" "),i("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[i("el-button",{nativeOn:{click:function(t){return e.handleCancel(t)}}},[e._v("取消")]),e._v(" "),i("el-button",{attrs:{type:"primary"},nativeOn:{click:function(t){return e.handleConfirm(t)}}},[e._v("保存")])],1)])},[],!1,null,"382714aa",null);s.options.__file="RelateEmpoyee.vue";var r=s.exports,c=i("ZoMv"),d={name:"FieldSetDialog",components:{},mixins:[],props:{label:[String,Number],roleId:[String,Number],visible:{type:Boolean,required:!0,default:!1}},data:function(){return{loading:!1,list:[],grant_id:""}},computed:{title:function(){return c.a.convertTypeToName(this.label)+"字段授权"}},watch:{visible:{handler:function(){this.visible&&this.getFieldList()},immediate:!0}},mounted:function(){},methods:{getFieldList:function(){var e=this;this.list=[],this.loading=!0,Object(l.i)({label:this.label,role_id:this.roleId,module:"crm",column:c.a.typeToKeyData[this.label]}).then(function(t){e.loading=!1;var i=t.data.content||[];e.grant_id=t.data.grant_id,i.forEach(function(e){e.canCheck=1==e.read,e.canEdit=1==e.write}),e.list=t.data.content||[]}).catch(function(){e.loading=!1})},handleCancel:function(){this.$emit("update:visible",!1)},getCanOpreateRead:function(e){return 1==e||2==e},getCanOpreateEdit:function(e){return 1==e||3==e},handleConfirm:function(){var e=this;this.loading=!0,this.list.forEach(function(e){e.canCheck?e.read=1:e.read=0,e.canEdit?e.write=1:e.write=0}),this.list.forEach(function(e){e.hasOwnProperty("acuthLevel")&&delete e.acuthLevel,e.hasOwnProperty("canCheck")&&delete e.canCheck,e.hasOwnProperty("canEdit")&&delete e.canEdit}),Object(l.j)({grant_id:this.grant_id,content:this.list}).then(function(t){e.loading=!1,e.$message.success("操作成功"),e.handleCancel()}).catch(function(){e.loading=!1})},editCheckboxChange:function(e){e.canEdit&&this.$set(e,"canCheck",!0)},checkCheckboxChange:function(e){!e.canCheck&&e.canEdit&&this.$set(e,"canEdit",!1)}}},u=(i("wRx7"),Object(o.a)(d,function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("el-dialog",{attrs:{visible:e.visible,"append-to-body":!0,"close-on-click-modal":!1,title:e.title,width:"700px"},on:{close:e.handleCancel}},[i("div",{directives:[{name:"loading",rawName:"v-loading",value:e.loading,expression:"loading"}],staticClass:"field-set-dialog"},[i("el-table",{staticStyle:{width:"100%"},attrs:{data:e.list,height:"50vh",border:""}},[i("el-table-column",{attrs:{label:"字段名称",prop:"name"}}),e._v(" "),i("el-table-column",{attrs:{label:"初步权限"},scopedSlots:e._u([{key:"default",fn:function(t){return[i("el-checkbox",{attrs:{disabled:!e.getCanOpreateRead(t.row.read_operation)},on:{change:function(i){e.checkCheckboxChange(t.row)}},model:{value:t.row.canCheck,callback:function(i){e.$set(t.row,"canCheck",i)},expression:"scope.row.canCheck"}},[e._v("可以查看")]),e._v(" "),i("el-checkbox",{attrs:{disabled:!e.getCanOpreateEdit(t.row.write_operation)},on:{change:function(i){e.editCheckboxChange(t.row)}},model:{value:t.row.canEdit,callback:function(i){e.$set(t.row,"canEdit",i)},expression:"scope.row.canEdit"}},[e._v("可以修改")])]}}])})],1)],1),e._v(" "),i("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[i("el-button",{staticStyle:{float:"left"},attrs:{type:"text"},on:{click:e.getFieldList}},[e._v("重置")]),e._v(" "),i("el-button",{on:{click:e.handleCancel}},[e._v("取消")]),e._v(" "),i("el-button",{directives:[{name:"debounce",rawName:"v-debounce",value:e.handleConfirm,expression:"handleConfirm"}],attrs:{type:"primary"}},[e._v("保存")])],1)])},[],!1,null,"1c67a498",null));u.options.__file="FieldSetDialog.vue";var h=u.exports,p=i("jzeO"),v=i("9GgJ"),f=i("Tdi9"),g={components:{RelateEmpoyee:r,FieldSetDialog:h,Reminder:p.a,XrHeader:v.a,EditRoleDialog:f.a},data:function(){return{pid:"",title:"",searchInput:"",tableData:[],tableHeight:document.documentElement.clientHeight-305,treeHeight:document.documentElement.clientHeight-230,currentPage:1,pageSize:15,pageSizes:[15,30,45,60],total:0,tableList:[{label:"姓名",field:"realname"},{label:"部门",field:"s_name"},{label:"职位",field:"post"},{label:"角色",field:"groups"}],newRoleVisible:!1,role:{},roleList:[],mainMenuIndex:"user",ruleMenuIndex:"data",ruleMenuList:[],defaultProps:{children:"children",label:"title"},relateEmpoyeeShow:!1,roleActive:null,dropdownHandleRole:null,roleTitle:"",roleMenuLoading:!1,ruleLoading:!1,userLoading:!1,setFieldLabel:"",setFieldShow:!1,selectionList:[],editRoleType:"",editRoleDialogShow:!1}},computed:{id:function(){return this.roleActive?this.roleActive.id:""},showRuleSet:function(){return!!this.roleActive&&("超级管理员角色"!=this.roleActive.remark&&"项目管理员"!=this.roleActive.remark)},showReminder:function(){return!!this.roleActive&&"项目管理员"==this.roleActive.remark}},watch:{},mounted:function(){var e=this;window.onresize=function(){e.tableHeight=document.documentElement.clientHeight-305,e.treeHeight=document.documentElement.clientHeight-230},this.pid=this.$route.params.pid,this.title=this.$route.params.title,this.getRulesList(),this.getRoleList()},beforeRouteUpdate:function(e,t,i){this.pid=e.params.pid,this.title=e.params.title,this.roleActive=null,this.roleList=[],this.mainMenuIndex="user",this.currentPage=1,this.total=0,this.tableData=[],this.$refs.xrHeader&&(this.$refs.xrHeader.search="",this.searchInput=""),this.getRulesList(),this.getRoleList(),i()},methods:{getRulesList:function(){var e=this;Object(l.k)({pid:this.pid,type:"tree"}).then(function(t){t.data?(e.ruleMenuList=[{label:"模块功能",index:"data",type:"tree",value:[],data:[t.data[0]]}],t.data[1]&&e.ruleMenuList.push({label:"数据分析",index:"bi",type:"tree",value:[],data:[t.data[1]]})):e.ruleMenuList=[],e.getRoleRulesInfo()})},getRoleList:function(){var e=this;this.roleMenuLoading=!0,Object(l.h)({pid:this.pid,rules:1}).then(function(t){e.roleList=t.data;var i=!1;if(e.roleActive)for(var n=0;n0&&e.splice(i,1)},containItem:function(e,t){for(var i=0;i