File: /www/wwwroot/douyin.dsfnj.com/static/js/chunk-718d.82f823de.js
(window.webpackJsonp=window.webpackJsonp||[]).push([["chunk-718d"],{"0pCk":function(e,t,i){},"6R3Q":function(e,t,i){"use strict";var n={name:"reminder",components:{},computed:{},data:function(){return{}},props:{content:{type:String,default:"内容"},fontSize:{type:String,default:"13"}},mounted:function(){},methods:{},destroyed:function(){}},s=(i("7h1T"),i("KHd+")),o=Object(s.a)(n,function(){var e=this.$createElement,t=this._self._c||e;return t("flexbox",{staticClass:"reminder-wrapper"},[t("flexbox",{staticClass:"reminder-body",attrs:{align:"stretch"}},[t("i",{staticClass:"wukong wukong-reminder reminder-icon"}),this._v(" "),t("div",{staticClass:"reminder-content",style:{"font-size":this.fontSize+"px"}},[this._v("\n "+this._s(this.content)+"\n ")])])],1)},[],!1,null,"123d95d5",null);o.options.__file="reminder.vue";t.a=o.exports},"7h1T":function(e,t,i){"use strict";var n=i("0pCk");i.n(n).a},JYMl:function(e,t,i){"use strict";i.r(t);var n=i("FyfS"),s=i.n(n),o=i("sGAf"),l={components:{XhUserCell:i("8GhS").p},watch:{selectRoleList:function(e){this.selectRoles=e},selectUserList:function(e){this.selectUsers=e},dialogVisible:function(e){e&&this.role&&(this.selectRoles=[this.role.id])}},data:function(){return{selectUsers:[],selectRoles:[]}},props:{dialogTitle:String,dialogVisible:Boolean,roleList:Array,role:Object,selectRoleList:Array,selectUserList:Array},mounted:function(){this.role&&(this.selectRoles=[this.role.id])},methods:{handleClose:function(){this.$emit("handleClose")},employeesDetermine:function(){var e=this;0==this.selectUsers.length?this.$message.error("请选择员工"):Object(o.h)({users:this.selectUsers.map(function(e){return e.id}),groups:this.selectRoles}).then(function(t){e.$message.success(t.data),e.$emit("save")}).catch(function(e){})},changeCheckout:function(e){this.selectUsers=e.value},selectDelect:function(e,t){this.$refs.xhuser.cancelCheckItem(e),this.selectUsers.splice(t,1)}}},r=(i("XVEG"),i("KHd+")),a=Object(r.a)(l,function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{staticClass:"new-dialog"},[i("el-dialog",{attrs:{title:e.dialogTitle,visible:e.dialogVisible,width:"700px","close-on-click-modal":!1,"before-close":e.handleClose},on:{"update:visible":function(t){e.dialogVisible=t}}},[i("div",{staticClass:"label-input"},[i("label",{staticClass:"label-title"},[e._v("选择员工")]),e._v(" "),i("xh-user-cell",{attrs:{radio:!1,value:e.selectUsers},on:{"value-change":e.changeCheckout}})],1),e._v(" "),i("label",{staticClass:"label-title"},[e._v("员工角色配置")]),e._v(" "),i("div",{staticClass:"role-allocation"},e._l(e.roleList,function(t,n){return i("div",{key:n,staticClass:"role-label-checkout"},[i("label",[e._v(e._s(t.name))]),e._v(" "),i("el-checkbox-group",{model:{value:e.selectRoles,callback:function(t){e.selectRoles=t},expression:"selectRoles"}},e._l(t.list,function(t,n){return i("el-checkbox",{key:n,attrs:{label:t.id}},[e._v("\n "+e._s(t.title)+"\n ")])}))],1)})),e._v(" "),i("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[i("el-button",{attrs:{type:"primary"},on:{click:e.employeesDetermine}},[e._v("确 定")]),e._v(" "),i("el-button",{on:{click:e.handleClose}},[e._v("取 消")])],1)])],1)},[],!1,null,"e21cb16a",null);a.options.__file="newDialog.vue";var c=a.exports,d=i("csZP"),u={components:{NewDialog:c,Reminder:i("6R3Q").a},data:function(){return{activeIndex:"1",tableData:[],tableList:[{label:"姓名",field:"realname"},{label:"部门",field:"s_name"},{label:"职位",field:"post"},{label:"角色",field:"groups"}],newRoleVisible:!1,role:{},roleList:[],jurisdictionIndex:"crm",muneList:[{label:"客户管理",index:"crm"},{label:"商业智能",index:"bi"}],treeData:[],showTreeData:[],defaultProps:{children:"children",label:"title"},radioModel:2,dialogTitle:"",newEmployeeVisible:!1,newDialogSelectUsers:[],newDialogSelectRoles:[],roleActive:null,roleRulesEdit:{},dropdownHandleRole:null,roleTitle:"",navLoading:!1,jurisdictionLoading:!1,menuLoading:!1}},computed:{},mounted:function(){this.getRulesList()},methods:{getRulesList:function(){var e=this;Object(o.f)({type:"tree"}).then(function(t){e.treeData=t.data,e.showTreeData=[e.treeData[e.jurisdictionIndex]],e.getRoleList()})},getRoleList:function(){var e=this;this.navLoading=!0,Object(o.d)({tree:1}).then(function(t){e.roleList=t.data;var i=!1;if(e.roleActive)for(var n=0;n<e.roleList.length;n++)for(var o=e.roleList[n],l=0;l<o.list.length;l++){var r=o.list[l];if(r.id==e.roleActive.id){e.roleActive=r,e.getRoleRulesInfo(r),i=!0;break}}if(!i){var a=!0,c=!1,d=void 0;try{for(var u,h=s()(e.roleList);!(a=(u=h.next()).done);a=!0){var f=u.value;if(0!=f.list.length){e.roleActive=f.list[0],e.getRoleRulesInfo(e.roleActive);break}}}catch(e){c=!0,d=e}finally{try{!a&&h.return&&h.return()}finally{if(c)throw d}}}e.getUserListWithRole(e.roleActive),e.getUserRulesWithRole(e.roleActive),e.navLoading=!1}).catch(function(t){e.navLoading=!1})},handleSelect:function(e,t){this.activeIndex=e},addEmployees:function(){this.newDialogSelectUsers=[],this.newDialogSelectRoles=[],this.dialogTitle="添加员工",this.newEmployeeVisible=!0},employeesSave:function(e){this.newEmployeeVisible=!1,this.getUserListWithRole(this.roleActive),this.getUserRulesWithRole(this.roleActive)},delectBtn:function(e){var t=this;this.$confirm("此操作将永久删除是否继续?","提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then(function(){t.menuLoading=!0,Object(o.g)({user_id:e.id,group_id:t.roleActive.id}).then(function(e){t.menuLoading=!0,t.getUserListWithRole(t.roleActive),t.$message.success("删除成功")})}).catch(function(){t.$message({type:"info",message:"已取消删除"})})},editBtn:function(e){this.newDialogSelectUsers=[e],this.newDialogSelectRoles=e.groupids.split(",").map(function(e){return+e}),this.dialogTitle="编辑员工",this.newEmployeeVisible=!0},jurisdictionSelect:function(e){var t=this;this.roleRulesEdit[this.jurisdictionIndex]=this.$refs.tree.getCheckedKeys(),this.roleRulesEdit[this.jurisdictionIndex+"_upload"]=this.$refs.tree.getCheckedKeys().concat(this.$refs.tree.getHalfCheckedKeys()),this.jurisdictionIndex=e,this.showTreeData=[this.treeData[this.jurisdictionIndex]],this.$nextTick(function(){t.$refs.tree&&t.$refs.tree.setCheckedKeys(t.roleRulesEdit[t.jurisdictionIndex])})},managerGroupReminderContent:function(e){return 1==e?"超级管理员不可被任何管理员删除,默认系统所有权限,也可添加其他超级管理员":2==e?"系统设置管理员拥有整个系统的“系统设置”权限":3==e?"员工与角色权限管理的管理权限,可管理公司的组织结构和员工账号的增加、停用,可创建角色并为员工分配角色授权":4==e?"审批管理员可配置、管理所有审批流程":5==e?"办公管理员可以对“办公”的所有设置进行管理":6==e?"客户管理管理员可以对“客户管理”的所有设置进行管理":8==e?"公告管理员有新建、删除、结束公告的操作":7==e?"项目管理员拥有“项目管理”模块所有权限,能看到并维护所有项目信息":""},newRoleClose:function(){this.newRoleVisible=!1},newRoleBtn:function(){this.roleTitle="新建角色",this.newRoleVisible=!0,this.role={}},roleDropdownClick:function(e){this.dropdownHandleRole=e},roleHandleClick:function(e){"edit"==e?this.roleEditBtn(this.dropdownHandleRole):"copy"==e?this.ticketsBtn(this.dropdownHandleRole):"delete"==e&&this.roleDelect(this.dropdownHandleRole)},roleEditBtn:function(e){this.roleTitle="编辑角色",this.role={title:e.title,pid:e.pid,id:e.id},this.newRoleVisible=!0},ticketsBtn:function(e){var t=this;this.$confirm("确定此操作?","提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then(function(){Object(o.b)({id:e.id}).then(function(e){t.$message.success("复制成功"),t.getRoleList()})}).catch(function(){t.$message({type:"info",message:"已取消删除"})})},roleDelect:function(e){var t=this;this.$confirm("此操作将永久删除是否继续?","提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then(function(){Object(o.c)({id:e.id}).then(function(e){t.roleList.length>0&&t.roleList[0].list.length>0&&(t.roleActive=t.roleList[0].list[0],t.getRoleRulesInfo(t.roleActive)),t.getRoleList(),t.$message.success("删除成功")})}).catch(function(){t.$message({type:"info",message:"已取消删除"})})},newRoleSubmit:function(){var e=this;this.role.title?this.role.pid||0==this.role.pid?"新建角色"==this.roleTitle?Object(o.a)({title:this.role.title,pid:this.role.pid}).then(function(t){e.getRoleList(),e.$message.success("添加成功"),e.newRoleClose()}):Object(o.e)(this.role).then(function(t){e.getRoleList(),e.$message.success("编辑成功"),e.newRoleClose()}):this.$message.error("角色类型不能为空"):this.$message.error("角色名称不能为空")},roleListClick:function(e){1==e.pid&&(this.activeIndex="1"),this.roleActive=e,this.getRoleRulesInfo(e),this.getUserListWithRole(this.roleActive),this.getUserRulesWithRole(this.roleActive)},getRoleRulesInfo:function(e){this.roleRulesEdit.crm=this.getUserModuleRules(e.rules.crm,"crm"),this.roleRulesEdit.crm_upload=e.rules.crm?e.rules.crm:[],this.roleRulesEdit.bi=this.getUserModuleRules(e.rules.bi,"bi"),this.roleRulesEdit.bi_upload=e.rules.bi?e.rules.bi:[]},getUserListWithRole:function(e){var t=this;this.menuLoading=!0,Object(d.b)({group_id:e.id}).then(function(e){t.tableData=e.data.list,t.menuLoading=!1}).catch(function(e){t.menuLoading=!1})},getUserRulesWithRole:function(e){var t=this;this.$nextTick(function(){t.$refs.tree&&t.$refs.tree.setCheckedKeys(t.roleRulesEdit[t.jurisdictionIndex])}),e.type?this.radioModel=e.type:this.radioModel=""},getUserModuleRules:function(e,t){e||(e=[]);for(var i=this.treeData[t],n=!1,s=this.copyItem(e),o=0;o<i.children.length;o++)for(var l=i.children[o],r=0;r<e.length;r++){for(var a=e[r],c=[],d=0;d<l.children.length;d++){var u=l.children[d];u.id==a&&c.push(u)}c.length!=l.children.length&&(n=!0,this.removeItem(s,l.id))}n&&this.removeItem(s,i.id);for(var h=[],f=0;f<s.length;f++){var v=s[f];v&&h.push(parseInt(v))}return h},copyItem:function(e){for(var t=[],i=0;i<e.length;i++)t.push(e[i]);return t},removeItem:function(e,t){for(var i=-1,n=0;n<e.length;n++)if(t==e[n]){i=n;break}i>0&&e.splice(i,1)},containItem:function(e,t){for(var i=0;i<e.length;i++)if(t==e[i])return!0;return!1},jurisdictionSubmit:function(){var e=this;this.roleRulesEdit[this.jurisdictionIndex]=this.$refs.tree.getCheckedKeys(),this.roleRulesEdit[this.jurisdictionIndex+"_upload"]=this.$refs.tree.getCheckedKeys().concat(this.$refs.tree.getHalfCheckedKeys()),this.jurisdictionLoading=!0,Object(o.e)({rules:this.roleRulesEdit.crm_upload.concat(this.roleRulesEdit.bi_upload),type:this.radioModel,id:this.roleActive.id,title:this.roleActive.title}).then(function(t){e.getRoleList(),e.$message.success("编辑成功"),e.jurisdictionLoading=!1}).catch(function(){e.jurisdictionLoading=!1})}}},h=(i("ac1V"),Object(r.a)(u,function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{staticClass:"role-authorization"},[i("p",{staticClass:"title"},[e._v(" 角色权限控制 ")]),e._v(" "),i("div",{staticClass:"role-box"},[i("div",{directives:[{name:"loading",rawName:"v-loading",value:e.navLoading,expression:"navLoading"}],staticClass:"nav"},[i("div",{staticClass:"nav-new-btn"},[i("el-button",{attrs:{size:"medium"},on:{click:e.newRoleBtn}},[e._v(" 新建角色 ")])],1),e._v(" "),i("div",{staticClass:"role-nav-box"},e._l(e.roleList,function(t,n){return i("div",{key:n,staticClass:"role-list"},[i("div",{staticClass:"item-label"},[e._v("\n "+e._s(t.name)+"\n ")]),e._v(" "),e._l(t.list,function(n,s){return t.list?i("div",{key:s,staticClass:"item-list",class:{"item-list-hover":n.id==e.roleActive.id},on:{click:function(t){e.roleListClick(n)}}},[e._v("\n "+e._s(n.title)+"\n "),1!=t.pid?i("div",{staticClass:"icon-close"},[i("el-dropdown",{attrs:{trigger:"click"},on:{command:e.roleHandleClick}},[i("i",{staticClass:"el-icon-arrow-down",on:{click:function(t){e.roleDropdownClick(n)}}}),e._v(" "),i("el-dropdown-menu",{attrs:{slot:"dropdown"},slot:"dropdown"},[i("el-dropdown-item",{attrs:{command:"copy"}},[e._v("复制")]),e._v(" "),i("el-dropdown-item",{attrs:{command:"edit"}},[e._v("编辑")]),e._v(" "),i("el-dropdown-item",{attrs:{command:"delete"}},[e._v("删除")])],1)],1)],1):e._e()]):e._e()})],2)}))]),e._v(" "),i("el-dialog",{attrs:{title:e.roleTitle,visible:e.newRoleVisible,width:"30%","before-close":e.newRoleClose},on:{"update:visible":function(t){e.newRoleVisible=t}}},[i("label",{staticClass:"label-title"},[e._v("角色名称")]),e._v(" "),i("el-input",{staticClass:"input-role",model:{value:e.role.title,callback:function(t){e.$set(e.role,"title",t)},expression:"role.title"}}),e._v(" "),i("label",{staticClass:"label-title"},[e._v("角色类型")]),e._v(" "),i("el-select",{staticClass:"input-role",attrs:{placeholder:"请选择"},model:{value:e.role.pid,callback:function(t){e.$set(e.role,"pid",t)},expression:"role.pid"}},e._l(e.roleList,function(t){return 1!=t.pid?i("el-option",{key:t.pid,attrs:{label:t.name,value:t.pid}}):e._e()})),e._v(" "),i("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[i("el-button",{attrs:{type:"primary"},on:{click:e.newRoleSubmit}},[e._v("确 定")]),e._v(" "),i("el-button",{on:{click:e.newRoleClose}},[e._v("取 消")])],1)],1),e._v(" "),i("div",{staticClass:"content-box"},[i("el-menu",{staticClass:"el-menu-demo",attrs:{"default-active":e.activeIndex,mode:"horizontal"},on:{select:e.handleSelect}},[i("el-menu-item",{attrs:{index:"1"}},[e._v("角色员工")]),e._v(" "),!e.roleActive||1==e.roleActive.pid&&0!=e.roleActive.pid?e._e():i("el-menu-item",{attrs:{index:"2"}},[e._v("角色权限")])],1),e._v(" "),i("div",{directives:[{name:"loading",rawName:"v-loading",value:e.menuLoading,expression:"menuLoading"},{name:"show",rawName:"v-show",value:"1"==e.activeIndex,expression:"activeIndex == '1'"}],staticClass:"content-table"},[i("flexbox",{staticClass:"content-table-header"},[i("div",{staticClass:"content-table-header-reminder"},[this.roleActive&&1==this.roleActive.pid?i("reminder",{attrs:{content:e.managerGroupReminderContent(this.roleActive.types)}}):e._e()],1),e._v(" "),i("el-button",{attrs:{size:"medium",type:"primary"},on:{click:e.addEmployees}},[e._v(" 关联员工 ")])],1),e._v(" "),i("el-table",{staticStyle:{width:"100%"},attrs:{data:e.tableData}},[e._l(e.tableList,function(t,n){return i("el-table-column",{key:n,attrs:{prop:t.field,"show-overflow-tooltip":"",label:t.label},scopedSlots:e._u([{key:"header",fn:function(t){return[i("div",{staticClass:"table-head-name"},[e._v(e._s(t.column.label))])]}}])})}),e._v(" "),i("el-table-column",{attrs:{fixed:"right",label:"操作","show-overflow-tooltip":""},scopedSlots:e._u([{key:"default",fn:function(t){return[i("span",{staticClass:"el-icon-delete content-table-span",on:{click:function(i){e.delectBtn(t.row)}}})]}}])})],2)],1),e._v(" "),i("div",{directives:[{name:"loading",rawName:"v-loading",value:e.jurisdictionLoading,expression:"jurisdictionLoading"},{name:"show",rawName:"v-show",value:"2"==e.activeIndex,expression:"activeIndex == '2'"}],staticClass:"jurisdiction-box"},[i("div",{staticStyle:{position:"relative"}},[i("el-menu",{staticClass:"el-menu-demo",attrs:{"default-active":e.jurisdictionIndex,mode:"horizontal"},on:{select:e.jurisdictionSelect}},e._l(e.muneList,function(t,n){return i("el-menu-item",{key:n,attrs:{index:t.index}},[e._v(e._s(t.label))])})),e._v(" "),i("el-button",{staticClass:"jurisdiction-edit",attrs:{size:"medium",type:"primary"},on:{click:e.jurisdictionSubmit}},[e._v(" 保 存 ")])],1),e._v(" "),i("div",{staticClass:"jurisdiction-content"},[i("div",{staticClass:"content-left"},[i("p",{staticClass:"jurisdiction-title"},[e._v("功能权限管理")]),e._v(" "),i("div",{staticClass:"jurisdiction-content-checkbox"},[i("el-tree",{ref:"tree",staticStyle:{height:"0"},attrs:{data:e.showTreeData,"show-checkbox":"","node-key":"id",indent:0,"empty-text":"","default-expand-all":"","expand-on-click-node":!1,props:e.defaultProps}})],1)]),e._v(" "),i("div",{staticClass:"content-right"},[i("p",{staticClass:"jurisdiction-title"},[e._v("数据权限")]),e._v(" "),i("div",{staticClass:"data-radio"},[i("el-radio-group",{model:{value:e.radioModel,callback:function(t){e.radioModel=t},expression:"radioModel"}},[i("el-radio",{attrs:{label:1}},[e._v("本人")]),e._v(" "),i("el-radio",{attrs:{label:2}},[e._v("本人及下属")]),e._v(" "),i("el-radio",{attrs:{label:3}},[e._v("本部门")]),e._v(" "),i("el-radio",{attrs:{label:4}},[e._v("本部门及下属部门")]),e._v(" "),i("el-radio",{attrs:{label:5}},[e._v("全部")])],1)],1)])])])],1)],1),e._v(" "),i("new-dialog",{attrs:{dialogVisible:e.newEmployeeVisible,roleList:e.roleList,role:e.roleActive,selectRoleList:e.newDialogSelectRoles,selectUserList:e.newDialogSelectUsers,dialogTitle:e.dialogTitle},on:{handleClose:function(t){e.newEmployeeVisible=!1},save:e.employeesSave}})],1)},[],!1,null,"cab5f506",null));h.options.__file="RoleAuthorization.vue";t.default=h.exports},W3aS:function(e,t,i){},XVEG:function(e,t,i){"use strict";var n=i("W3aS");i.n(n).a},ac1V:function(e,t,i){"use strict";var n=i("h1JR");i.n(n).a},csZP:function(e,t,i){"use strict";i.d(t,"h",function(){return s}),i.d(t,"e",function(){return o}),i.d(t,"f",function(){return l}),i.d(t,"g",function(){return r}),i.d(t,"b",function(){return a}),i.d(t,"j",function(){return c}),i.d(t,"l",function(){return d}),i.d(t,"i",function(){return u}),i.d(t,"c",function(){return h}),i.d(t,"d",function(){return f}),i.d(t,"k",function(){return v}),i.d(t,"a",function(){return m});var n=i("t3Un");function s(){return Object(n.a)({url:"admin/structures/index",method:"post",data:{type:"tree"}})}function o(e){return Object(n.a)({url:"admin/structures/delete",method:"post",data:e})}function l(e){return Object(n.a)({url:"admin/structures/update",method:"post",data:e})}function r(e){return Object(n.a)({url:"admin/structures/save",method:"post",data:e})}function a(e){return Object(n.a)({url:"admin/users/index",method:"post",data:e})}function c(e){return Object(n.a)({url:"admin/users/save",method:"post",data:e})}function d(e){return Object(n.a)({url:"admin/users/update",method:"post",data:e})}function u(e){return Object(n.a)({url:"admin/groups/index",method:"post",data:e})}function h(e){return Object(n.a)({url:"admin/users/updatePwd",method:"post",data:e})}function f(e){return Object(n.a)({url:"admin/users/usernameEdit",method:"post",data:e})}function v(e){return Object(n.a)({url:"admin/users/enables",method:"post",data:e})}function m(e){return Object(n.a)({url:"admin/structures/listDialog",method:"post",data:e})}},h1JR:function(e,t,i){},sGAf:function(e,t,i){"use strict";i.d(t,"d",function(){return s}),i.d(t,"f",function(){return o}),i.d(t,"a",function(){return l}),i.d(t,"c",function(){return r}),i.d(t,"b",function(){return a}),i.d(t,"e",function(){return c}),i.d(t,"h",function(){return d}),i.d(t,"g",function(){return u});var n=i("t3Un");function s(e){return Object(n.a)({url:"admin/groups/index",method:"post",data:e})}function o(e){return Object(n.a)({url:"admin/rules/index",method:"post",data:e})}function l(e){return Object(n.a)({url:"admin/groups/save",method:"post",data:e})}function r(e){return Object(n.a)({url:"admin/groups/delete",method:"post",data:e})}function a(e){return Object(n.a)({url:"admin/groups/copy",method:"post",data:e})}function c(e){return Object(n.a)({url:"admin/groups/update",method:"post",data:e})}function d(e){return Object(n.a)({url:"admin/users/groups",method:"post",data:e})}function u(e){return Object(n.a)({url:"admin/users/groupsDel",method:"post",data:e})}}}]);