Files
wysite/hc-etms.sqygj.cn/static/js/chunk-19bb8f6e.bdd438af.js

1 line
27 KiB
JavaScript

(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-19bb8f6e"],{"06fa":function(e,t,a){"use strict";a.d(t,"a",(function(){return r}));var o=a("b775");function r(e){return Object(o["a"])({url:"/hakocompany/menu/selectMenuAll",method:"post",data:e})}},"3a22":function(e,t,a){},6492:function(e,t,a){},"67d5":function(e,t,a){"use strict";a.d(t,"i",(function(){return r})),a.d(t,"j",(function(){return n})),a.d(t,"f",(function(){return l})),a.d(t,"b",(function(){return s})),a.d(t,"c",(function(){return i})),a.d(t,"k",(function(){return c})),a.d(t,"e",(function(){return d})),a.d(t,"d",(function(){return u})),a.d(t,"h",(function(){return f})),a.d(t,"a",(function(){return h})),a.d(t,"g",(function(){return p}));var o=a("b775");function r(e){return Object(o["a"])({url:"/hakocompany/Role/pageList",method:"post",data:e})}function n(e){return Object(o["a"])({url:"/company/organizationalStructure/selectOsList",method:"post",data:e})}function l(e){return Object(o["a"])({url:"/company/organizationalStructure/findOsTree",method:"post",data:e})}function s(e){return Object(o["a"])({url:"/hakocompany/Role/create",method:"post",data:e})}function i(e){return Object(o["a"])({url:"/hakocompany/Role/delete",method:"post",data:e})}function c(e){return Object(o["a"])({url:"/hakocompany/Role/update",method:"post",data:e})}function d(e){return Object(o["a"])({url:"/hakocompany/RoleMenuRel/findByRoleIdAndClienId",method:"post",data:e})}function u(e){return Object(o["a"])({url:"/hakocompany/OrganizationRoleRel/findByRoleId",method:"post",data:e})}function f(e){return Object(o["a"])({url:"/company/member/pageListForRole",method:"post",data:e})}function h(e){return Object(o["a"])({url:"/company/MemberRoleRel/batchDelete",method:"post",data:e})}function p(e){return Object(o["a"])({url:"/hakocompany/account/findProjectByRole",method:"post",data:e})}},8873:function(e,t,a){"use strict";a("6492")},"9179b":function(e,t,a){},"9adb":function(e,t,a){"use strict";a.r(t);var o=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"headStys"},[a("div",{staticClass:"formContent"},[a("div",{staticClass:"container"},[a("el-form",{ref:"query",staticClass:"demo-form-inline",attrs:{inline:!0,model:e.query,"label-width":"100px"}},[a("div",{staticClass:"house-detail"},[a("div",{staticClass:"grid-half"},[a("div",{staticClass:"cell"},[a("el-form-item",{attrs:{prop:"roleStatus",label:"角色状态"}},[a("el-select",{attrs:{clearable:"",placeholder:"角色状态"},model:{value:e.query.roleStatus,callback:function(t){e.$set(e.query,"roleStatus",t)},expression:"query.roleStatus"}},e._l(e.roleStatusArr,(function(e){return a("el-option",{key:e.value,attrs:{label:e.label,value:e.value}})})),1)],1)],1)]),e._v(" "),a("div",{staticClass:"grid-half"},[a("div",{staticClass:"cell"},[a("el-form-item",{attrs:{prop:"roleName",label:"角色名称"}},[a("el-input",{attrs:{placeholder:"角色名称",clearable:""},model:{value:e.query.roleName,callback:function(t){e.$set(e.query,"roleName",t)},expression:"query.roleName"}})],1)],1)]),e._v(" "),a("div",{staticClass:"grid-half"},[a("div",{staticClass:"cell"},[a("el-form-item",[a("el-button",{directives:[{name:"points",rawName:"v-points",value:500,expression:"500"}],attrs:{type:"primary"},on:{click:e.onSearch}},[e._v("查询")])],1),e._v(" "),a("el-form-item",[a("el-button",{directives:[{name:"points",rawName:"v-points",value:500,expression:"500"}],on:{click:function(t){return e.resetForm("query")}}},[e._v("重置")])],1)],1)])])])],1)]),e._v(" "),a("div",{staticClass:"contentStys"},[a("div",{staticClass:"planLst"},[a("span",[e._v("角色管理列表")]),e._v(" "),a("span",{staticClass:"addPlan"},[a("el-button",{directives:[{name:"points",rawName:"v-points",value:500,expression:"500"}],staticClass:"cololr el-icon-plus",attrs:{type:"primary"},on:{click:e.addRoleManageClick}},[e._v("新增")])],1)]),e._v(" "),a("div",{staticStyle:{padding:"24px"}},[a("el-table",{directives:[{name:"loading",rawName:"v-loading",value:e.listLoading,expression:"listLoading"}],attrs:{data:e.listTable,"header-cell-style":e.headClass,"tooltip-effect":"dark","default-expand-all":"",border:""}},[a("el-table-column",{attrs:{label:"#",align:"center",width:"50"},scopedSlots:e._u([{key:"default",fn:function(t){return[a("span",[e._v(e._s(t.$index+(e.query.pageNumber-1)*e.query.pageSize+1)+"\n ")])]}}])}),e._v(" "),a("el-table-column",{attrs:{prop:"roleName",align:"center","show-overflow-tooltip":"",label:"角色名称"}}),e._v(" "),a("el-table-column",{attrs:{prop:"createDate",align:"center","show-overflow-tooltip":"",label:"创建时间"}}),e._v(" "),a("el-table-column",{attrs:{align:"center","show-overflow-tooltip":"",label:"角色状态"},scopedSlots:e._u([{key:"default",fn:function(t){return[a("span",[0===t.row.roleStatus?a("span",[a("el-switch",{attrs:{disabled:""},model:{value:e.value1,callback:function(t){e.value1=t},expression:"value1"}})],1):e._e(),e._v(" "),1===t.row.roleStatus?a("span",[a("el-switch",{attrs:{disabled:""},model:{value:e.value2,callback:function(t){e.value2=t},expression:"value2"}})],1):e._e()])]}}])}),e._v(" "),a("el-table-column",{attrs:{align:"center","show-overflow-tooltip":"",label:"角色关联人"},scopedSlots:e._u([{key:"default",fn:function(t){return[t.row.userCount>0?a("el-link",{attrs:{type:"primary"},on:{click:function(a){return e.editClick(t.row)}}},[e._v(e._s(t.row.userCount))]):a("span",[e._v("0")])]}}])}),e._v(" "),a("el-table-column",{attrs:{align:"center","show-overflow-tooltip":"",label:"备注"},scopedSlots:e._u([{key:"default",fn:function(t){return[e._v("\n "+e._s(t.row.remark||"-")+"\n ")]}}])}),e._v(" "),a("el-table-column",{attrs:{align:"center","show-overflow-tooltip":"",label:"操作人"},scopedSlots:e._u([{key:"default",fn:function(t){return[e._v("\n "+e._s(t.row.updateName||"-")+"\n ")]}}])}),e._v(" "),a("el-table-column",{attrs:{align:"center","show-overflow-tooltip":"",label:"操作时间"},scopedSlots:e._u([{key:"default",fn:function(t){return[e._v("\n "+e._s(t.row.updateDate||"-")+"\n ")]}}])}),e._v(" "),a("el-table-column",{attrs:{label:"操作",align:"center"},scopedSlots:e._u([{key:"default",fn:function(t){return[a("el-button",{attrs:{type:"text"},on:{click:function(a){return e.copyRow(t.row,0)}}},[e._v("复制角色")]),e._v(" "),"企业创建人"!=t.row.roleName?a("el-button",{attrs:{type:"text"},on:{click:function(a){return e.editRow(t.row,0)}}},[e._v("编辑")]):e._e(),e._v(" "),"企业创建人"===t.row.roleName?a("el-button",{attrs:{type:"text"},on:{click:function(a){return e.editRow(t.row,1)}}},[e._v("查看")]):e._e(),e._v(" "),"企业创建人"!=t.row.roleName?a("el-button",{attrs:{type:"text"},on:{click:function(a){return e.deleteRow(t.row)}}},[e._v("删除")]):e._e()]}}])})],1)],1),e._v(" "),e.addNewRole?a("el-dialog",{staticClass:"dialogHead",attrs:{"before-close":e.handleClose,title:e.title,"show-close":!0,"close-on-press-escape":!1,"close-on-click-modal":!1,visible:e.addNewRole,width:"45%",height:"300px"},on:{"update:visible":function(t){e.addNewRole=t}}},[a("add-role",{ref:"roleRef",attrs:{roleData:e.addRoleData},on:{submitForm:e.submitForm,canceAdd:e.handleClose}})],1):e._e(),e._v(" "),a("editRole",{ref:"editrole",attrs:{show:e.showEdit},on:{close:e.editClose,get:e.getlistData}})],1),e._v(" "),a("div",{staticClass:"pagination"},[a("el-pagination",{attrs:{"current-page":e.query.pageNumber,"page-sizes":[10,20,30,100],"page-size":e.query.pageSize,layout:"total, sizes, prev, pager, next, jumper",total:e.pageTotal},on:{"update:currentPage":function(t){return e.$set(e.query,"pageNumber",t)},"update:current-page":function(t){return e.$set(e.query,"pageNumber",t)},"size-change":e.handleSizeChange,"current-change":e.handleCurrentChange}})],1)])},r=[],n=(a("a450"),a("67d5")),l=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"addRole"},[a("div",{staticClass:"form"},[a("el-form",{ref:"form",attrs:{"label-position":"left",rules:e.rules,model:e.form,"label-width":"100px"}},[a("el-form-item",{staticClass:"formItem",attrs:{label:"角色名称:",prop:"roleName"}},[a("el-input",{staticClass:"formItemInput",attrs:{type:"text",placeholder:"角色名称",disabled:"view"===e.roleData.type},model:{value:e.form.roleName,callback:function(t){e.$set(e.form,"roleName","string"===typeof t?t.trim():t)},expression:"form.roleName"}})],1),e._v(" "),a("el-form-item",{staticClass:"formItem",attrs:{label:"角色状态:",prop:"roleStatus"}},[a("el-switch",{attrs:{disabled:"view"===e.roleData.type},model:{value:e.form.roleStatus,callback:function(t){e.$set(e.form,"roleStatus",t)},expression:"form.roleStatus"}})],1),e._v(" "),a("el-form-item",{staticClass:"formItem",attrs:{label:"备注:",prop:"roleRemake"}},[a("el-input",{attrs:{type:"textarea",disabled:"view"===e.roleData.type},model:{value:e.form.remark,callback:function(t){e.$set(e.form,"remark",t)},expression:"form.remark"}})],1)],1),e._v(" "),a("div",{staticClass:"tabTree"},[a("ul",e._l(e.treeMenu,(function(t){return a("li",{key:t.id,class:{active:e.treeActiveId===t.id},on:{click:function(a){return e.handleMenuClick(t.id)}}},[e._v("\n "+e._s(t.text)+"\n ")])})),0),e._v(" "),"view"===e.roleData.type?a("div",{staticClass:"tree"},[a("el-tree",{ref:"conpamyMenu",attrs:{data:e.treeData[e.treeActiveId],props:e.defaultProps}})],1):e._e(),e._v(" "),"add"===e.roleData.type||"edit"===e.roleData.type?a("div",{staticClass:"tree"},[e.treeData[e.treeActiveId].length?a("el-checkbox",{on:{change:e.handleCheckAllChange},model:{value:e.treeCheckAll[e.treeActiveId],callback:function(t){e.$set(e.treeCheckAll,e.treeActiveId,t)},expression:"treeCheckAll[treeActiveId]"}},[e._v("全选")]):e._e(),e._v(" "),a("el-tree",{ref:"organizationData",attrs:{data:e.treeData[e.treeActiveId],"show-checkbox":"","node-key":"id","default-checked-keys":e.defaultCheckedData[e.treeActiveId],props:e.defaultProps},on:{check:e.checkInfo}})],1):e._e(),e._v(" "),a("div",{staticClass:"btnStys"},["add"===e.roleData.type||"edit"===e.roleData.type?a("el-button",{directives:[{name:"points",rawName:"v-points",value:500,expression:"500"}],attrs:{type:"primary"},on:{click:function(t){return e.submitForm("form")}}},[e._v("提交")]):e._e(),e._v(" "),a("el-button",{directives:[{name:"points",rawName:"v-points",value:500,expression:"500"}],on:{click:e.canceAdd}},[e._v("取消")])],1)])],1)])},s=[],i=(a("ac67"),a("32ea"),a("c5cb"),a("2843"),a("a7e5"),a("e8b2")),c=(a("0c84"),a("b5aa"),a("3ef1")),d=(a("1bc7"),a("5821")),u=a("06fa");function f(e,t){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),a.push.apply(a,o)}return a}function h(e){for(var t=1;t<arguments.length;t++){var a=null!=arguments[t]?arguments[t]:{};t%2?f(Object(a),!0).forEach((function(t){Object(d["a"])(e,t,a[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(a)):f(Object(a)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(a,t))}))}return e}var p={props:["roleData"],data:function(){return{rules:{roleName:[{required:!0,message:"请填写角色名称",trigger:"change"}],roleStatus:[{required:!0,message:"请选择角色状态",trigger:"change"}]},form:{roleStatus:!0,roleName:"",remark:"",roleType:2,adClientId:1,organizationRoleRelAddReqDTO:[],roleMenuRelAddReqDTO:[]},treeMenu:[{id:0,text:"企业-角色菜单分配"},{id:1,text:"项目-角色权限分配"},{id:2,text:"项目-角色菜单分配"}],treeData:{0:[],1:[],2:[]},defaultCheckedData:{0:[],1:[],2:[]},selectedData:{0:[],1:[],2:[]},treeCheckAll:{0:!1,1:!1,2:!1},defaultProps:{children:"menuChildren",label:"menuName"},treeActiveId:0,contrastData:[],paramProp:{0:{menuName:"menuName",menuId:"id",adClientId:1},1:{orgId:"id",orgName:"name",adClientId:2}},defaultMenuIds:[343,344,345,9,10,324,325,326,327,328,329]}},methods:{assignment:function(e){JSON.parse(JSON.stringify(h({},e))),this.form=h({},e),"copy"==this.form.newType&&(this.form.roleName=""),console.log(this.form,"form"),0===e.roleStatus?this.form.roleStatus=!0:this.form.roleStatus=!1},isLeafNode:function(e,t,a){var o=!0,r=function(e,t,a){for(var n=0;n<e.length;n++){var l=e[n];if(l.id===a){o=!(l[t]&&l[t].length);break}l[t]&&r(l[t],t,a)}};return r(e,t,a),o},setSelectedNode:function(e,t,a){var o=this,r=1===t?"orgId":"menuId",n=1===t?"childs":"menuChildren";a.forEach((function(a){var l=a[r];o.isLeafNode(e[t],n,l)&&a.checkeds&&o.defaultCheckedData[t].push(l)}))},getEditSelectedData:function(){var e=Object(c["a"])(regeneratorRuntime.mark((function e(t,a){var o,r,l=this;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return Object.assign(this.defaultCheckedData,{0:[],1:[],2:[]}),Object.assign(this.selectedData,{0:[],1:[],2:[]}),o=[Object(n["e"])({roleId:t.id,adClientId:1}),Object(n["d"])({adClientId:1,roleId:t.id}),Object(n["e"])({roleId:t.id,adClientId:2})],e.next=1,Promise.all(o);case 1:r=e.sent,3===r.length&&r.forEach((function(e,t){if(0===e.code){var o=e.data;l.setSelectedNode(a,t,o),o.forEach((function(e){l.selectedData[t].push(e)}))}}));case 2:case"end":return e.stop()}}),e,this)})));function t(t,a){return e.apply(this,arguments)}return t}(),submitForm:function(e){var t=this,a=this;"企业创建人"!==this.form.roleName?(this.form.organizationRoleRelAddReqDTO=[],this.form.roleMenuRelAddReqDTO=[],this.$refs[e].validate((function(e){if(!e)return!1;if(0!=a.defaultCheckedData[1].length)if(0!=a.defaultCheckedData[2].length){a.form.roleStatus=!1===a.form.roleStatus?1:0,a.form.organizationRoleRelAddReqDTO=a.selectedData["1"],a.form.roleMenuRelAddReqDTO=[].concat(Object(i["a"])(a.selectedData["0"]),Object(i["a"])(a.selectedData["2"])),a.form.adOrgId=JSON.parse(window.localStorage.getItem("companyInfo")).osId;var o=a.form;o.type=a.roleData.type,t.$emit("submitForm",o)}else a.$message({showClose:!0,message:"请对项目角色菜单进行分配!",type:"error"});else a.$message({showClose:!0,message:"请对角色项目权限进行分配",type:"error"})}))):this.$message({showClose:!0,message:"企业创建人已存在",type:"error"})},canceAdd:function(){this.$emit("canceAdd",!1)},checkInfo:function(e,t){var a=t.checkedNodes,o=t.halfCheckedNodes,r=a.filter((function(e){return!e.pid||-1===a.findIndex((function(t){return e.pid===t.id}))}));this.getSelectedData(r),this.getSelectedData(o,!0)},handleCheckAllChange:function(e){this.treeCheckAll[this.treeActiveId]?(this.$refs.organizationData.setCheckedNodes(this.treeData[this.treeActiveId]),this.getSelectedData(this.treeData[this.treeActiveId])):(this.$refs.organizationData.setCheckedKeys([]),this.selectedData[this.treeActiveId]=[])},getSelectedData:function(e){var t=this,a=arguments.length>1&&void 0!==arguments[1]&&arguments[1];a||(this.selectedData[this.treeActiveId]=[],this.defaultCheckedData[this.treeActiveId]=[]);var o=1===this.treeActiveId?1:0,r="id",n=0===o?"menuId":"orgId",l=function(e){e.forEach((function(e,s){var i=t.defaultProps,c=e[i.children],d=t.paramProp[o],u={};for(var f in d)if(Object.hasOwnProperty.call(d,f)){var h=d[f];u[f]=e[h],"adClientId"===f&&(u.adClientId=0===t.treeActiveId?1:2,u.checked=!a,t.form&&t.form.id&&(u.roleId=t.form.id,u.roleName=t.form.roleName))}u[n]=e[r],a||t.defaultCheckedData[t.treeActiveId].push(e.id),t.selectedData[t.treeActiveId].push(u),c&&c.length&&!a&&l(c)}))};l(e)},getInitTreeData:function(){var e=Object(c["a"])(regeneratorRuntime.mark((function e(){var t,a;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return t=[Object(u["a"])({appIdType:1}),Object(n["f"])({id:JSON.parse(window.localStorage.getItem("companyInfo")).osId}),Object(u["a"])({appIdType:2})],e.next=1,Promise.all(t);case 1:return a=e.sent,e.abrupt("return",a);case 2:case"end":return e.stop()}}),e)})));function t(){return e.apply(this,arguments)}return t}(),handleMenuClick:function(e){var t=this,a=this.roleData,o=a.type;a.val;if(e!==this.treeActiveId&&(this.treeActiveId=e,1!==e?(this.defaultProps.children="menuChildren",this.defaultProps.label="menuName"):(this.defaultProps.children="childs",this.defaultProps.label="name"),"add"===o))if(0===e){if(0===this.selectedData["0"].length){var r=[343,344,345];this.defaultCheckedData["0"]=r,this.$nextTick((function(){t.$refs.organizationData.setCheckedKeys(r),t.setTreeSelectRes()})),this.$forceUpdate()}}else if(2===e&&0===this.selectedData["2"].length){var n=[9,10,324,325,326,327,328,329];this.defaultCheckedData["2"]=n,this.$nextTick((function(){t.$refs.organizationData.setCheckedKeys(n),t.setTreeSelectRes()})),this.$forceUpdate()}},setTreeSelectRes:function(){var e=this.$refs.organizationData.getCheckedNodes();if(0===this.treeActiveId||2===this.treeActiveId){var t=[];e.map((function(e){t.push({adClientId:e.adClientId,checked:!0,menuId:e.id,menuName:e.menuName})}));var a=this.selectedData[this.treeActiveId],o=[];0===a.length?this.selectedData[this.treeActiveId]=t:(o=[].concat(t,Object(i["a"])(a)),console.log(Array.from(new Set(o))),this.selectedData[this.treeActiveId]=o)}}},mounted:function(){var e=this.roleData,t=e.type,a=e.val,o=e.newType,r=this;this.getInitTreeData().then((function(e){var n=[];if(3===e.length)if(e.forEach((function(e,t){0===e.code&&n.push(e.data)})),"edit"===t||"view"===t)r.assignment(a,o),r.getEditSelectedData(a,n).then((function(e){r.treeData=[].concat(n)}));else{r.treeData=[].concat(n);var l=[343,344,345];r.defaultCheckedData["0"]=l,r.$nextTick((function(){r.$refs.organizationData.setCheckedKeys(l),r.setTreeSelectRes()})),r.$forceUpdate()}}))}},m=p,v=(a("bb6d"),a("829d")),g=Object(v["a"])(m,l,s,!1,null,"c9563678",null),b=g.exports,y=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",[a("el-dialog",{attrs:{title:"编辑角色关联人","before-close":e.handleClose,"close-on-press-escape":!1,"close-on-click-modal":!1,visible:e.show,width:"80%",height:"300px"},on:{"update:visible":function(t){e.show=t}}},[a("el-form",{ref:"searchForm",staticClass:"demo-form-inline",attrs:{inline:!0,model:e.searchForm}},[a("el-form-item",{attrs:{prop:"name"}},[a("el-input",{attrs:{placeholder:"姓名",clearable:""},model:{value:e.searchForm.name,callback:function(t){e.$set(e.searchForm,"name",t)},expression:"searchForm.name"}})],1),e._v(" "),a("el-form-item",{attrs:{prop:"phoneNumber"}},[a("el-input",{attrs:{placeholder:"手机号",clearable:""},model:{value:e.searchForm.phoneNumber,callback:function(t){e.$set(e.searchForm,"phoneNumber",t)},expression:"searchForm.phoneNumber"}})],1),e._v(" "),a("el-form-item",{attrs:{prop:"osId"}},[a("el-select",{attrs:{clearable:"",filterable:"",placeholder:"部门"},model:{value:e.searchForm.osId,callback:function(t){e.$set(e.searchForm,"osId",t)},expression:"searchForm.osId"}},e._l(e.projectList,(function(e){return a("el-option",{key:e.id,attrs:{label:e.name,value:e.id}})})),1)],1),e._v(" "),a("el-form-item",{attrs:{prop:"onJobState"}},[a("el-select",{attrs:{clearable:"",placeholder:"在职状态"},model:{value:e.searchForm.onJobState,callback:function(t){e.$set(e.searchForm,"onJobState",t)},expression:"searchForm.onJobState"}},[a("el-option",{attrs:{label:"在职",value:1}}),e._v(" "),a("el-option",{attrs:{label:"离职",value:2}})],1)],1),e._v(" "),a("el-form-item",{attrs:{prop:"isStop"}},[a("el-select",{attrs:{clearable:"",placeholder:"账号状态"},model:{value:e.searchForm.isStop,callback:function(t){e.$set(e.searchForm,"isStop",t)},expression:"searchForm.isStop"}},[a("el-option",{attrs:{label:"正常",value:1}}),e._v(" "),a("el-option",{attrs:{label:"暂停",value:0}})],1)],1),e._v(" "),a("el-form-item",[a("el-button",{attrs:{type:"primary"},on:{click:e.searchClick}},[e._v("查询")]),e._v(" "),a("el-button",{on:{click:function(t){return e.reset("searchForm")}}},[e._v("重置")])],1)],1),e._v(" "),a("div",{staticStyle:{"margin-bottom":"15px"}},[a("el-button",{attrs:{size:"mini",type:"danger"},on:{click:e.deleteAll}},[e._v("批量删除")])],1),e._v(" "),a("el-table",{directives:[{name:"loading",rawName:"v-loading",value:e.listLoading,expression:"listLoading"}],attrs:{data:e.listTable,"header-cell-style":e.headClass,border:""},on:{"selection-change":e.handleSelectionChange}},[a("el-table-column",{attrs:{type:"selection",align:"center",width:"50"}}),e._v(" "),a("el-table-column",{attrs:{prop:"roleName",align:"center","show-overflow-tooltip":"",label:"姓名"},scopedSlots:e._u([{key:"default",fn:function(t){return[e._v(e._s(t.row.name||"-"))]}}])}),e._v(" "),a("el-table-column",{attrs:{prop:"roleName",align:"center","show-overflow-tooltip":"",label:"性别"},scopedSlots:e._u([{key:"default",fn:function(t){return[e._v(e._s(1==t.row.sex?"男":2==t.row.sex?"女":"未知"))]}}])}),e._v(" "),a("el-table-column",{attrs:{prop:"roleName",align:"center","show-overflow-tooltip":"",label:"手机号"},scopedSlots:e._u([{key:"default",fn:function(t){return[e._v(e._s(t.row.phoneNumber||"-"))]}}])}),e._v(" "),a("el-table-column",{attrs:{prop:"roleName",align:"center","show-overflow-tooltip":"",label:"部门"},scopedSlots:e._u([{key:"default",fn:function(t){return[e._v(e._s(t.row.departmentName||"-"))]}}])}),e._v(" "),a("el-table-column",{attrs:{prop:"roleName",align:"center","show-overflow-tooltip":"",label:"岗位"},scopedSlots:e._u([{key:"default",fn:function(t){return[e._v(e._s(t.row.postName||"-"))]}}])}),e._v(" "),a("el-table-column",{attrs:{prop:"roleName",align:"center","show-overflow-tooltip":"",label:"在职状态"},scopedSlots:e._u([{key:"default",fn:function(t){return[1===t.row.onJobState?a("el-tag",{attrs:{type:"success",size:"mini"}},[e._v("在职")]):e._e(),e._v(" "),2===t.row.onJobState?a("el-tag",{attrs:{type:"info",size:"mini"}},[e._v("离职")]):e._e()]}}])}),e._v(" "),a("el-table-column",{attrs:{prop:"roleName",align:"center","show-overflow-tooltip":"",label:"账号状态"},scopedSlots:e._u([{key:"default",fn:function(t){return[0===t.row.isStop?a("el-tag",{attrs:{type:"info",size:"mini"}},[e._v("暂停")]):a("el-tag",{attrs:{type:"success",size:"mini"}},[e._v("正常")])]}}])}),e._v(" "),a("el-table-column",{attrs:{prop:"roleName",align:"center","show-overflow-tooltip":"",label:"操作"},scopedSlots:e._u([{key:"default",fn:function(t){return[a("el-button",{attrs:{type:"text"},on:{click:function(a){return e.deleteMember(t.row)}}},[e._v("删除")])]}}])})],1),e._v(" "),a("div",{staticClass:"paginations"},[a("el-pagination",{attrs:{background:"","current-page":e.searchForm.pageNumber,"page-sizes":[10,20,30,100],"page-size":e.searchForm.pageSize,layout:"total, sizes, prev, pager, next, jumper",total:e.pageTotal},on:{"update:currentPage":function(t){return e.$set(e.searchForm,"pageNumber",t)},"update:current-page":function(t){return e.$set(e.searchForm,"pageNumber",t)},"size-change":e.handleSizeChange,"current-change":e.handleCurrentChange}})],1)],1)],1)},w=[],_={props:{show:{typeof:Boolean,default:!1}},data:function(){return{pageTotal:0,searchForm:{pageSize:10,pageNumber:1,name:"",phoneNumber:"",osId:"",onJobState:"",isStop:""},roleInfo:{},projectList:[],listLoading:!1,listTable:[],selectList:[]}},mounted:function(){this.getProjectInfo()},methods:{getData:function(e){console.log(e),this.roleInfo=e,this.getList()},getList:function(){var e=this;this.listLoading=!0,this.searchForm.roleId=this.roleInfo.id,Object(n["h"])(this.searchForm).then((function(t){0==t.code&&t.data?(e.listTable=t.data.records,e.pageTotal=t.data.rowsCount,e.listLoading=!1):e.listLoading=!1})).catch((function(t){e.listLoading=!1}))},handleSizeChange:function(e){this.searchForm.pageSize=e,this.getList()},handleCurrentChange:function(e){this.searchForm.pageNumber=e,this.getList()},getProjectInfo:function(){var e=this,t=JSON.parse(window.localStorage.getItem("companyInfo")).osId;Object(n["j"])({id:t,attribute:1}).then((function(t){0===t.code&&t.data?e.projectList=t.data:e.projectList=[]}))},searchClick:function(){this.getList()},reset:function(e){this.$refs[e].resetFields(),this.getList()},handleSelectionChange:function(e){console.log(e),this.selectList=e},deleteMember:function(e){var t=this;this.$confirm("删除后该员工原先所关联的菜单都会自动解除,可能会影响正常使用,是否确认删除?","提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then((function(){var a=[e.id];t.delPost(a)}))},deleteAll:function(){if(this.selectList.length>0){var e=[];this.selectList.forEach((function(t){e.push(t.id)})),this.delPost(e)}else this.$message("请选择要删除的员工!")},delPost:function(e){var t=this,a={roleId:this.roleInfo.id,userIds:e};Object(n["a"])(a).then((function(e){0==e.code&&(t.$message({message:"删除成功",type:"success"}),t.getList(),t.$emit("get"))}))},handleClose:function(){this.$refs["searchForm"].resetFields(),this.$emit("close")},headClass:function(){return"text-align:center;background:#FAFAFA;"}}},k=_,C=(a("b8fd"),Object(v["a"])(k,y,w,!1,null,"e7500956",null)),I=C.exports,S={name:"roleManageList",components:{addRole:b,editRole:I},data:function(){return{pageTotal:0,listLoading:!1,addNewRole:!1,type:"",title:"新增角色",value1:!0,value2:!1,roleStatusArr:[{value:0,label:"启用"},{value:1,label:"禁用"}],listTable:[],query:{pageNumber:1,pageSize:10,roleName:"",roleStatus:""},addRoleData:{type:"add"},showEdit:!1}},created:function(){this.headClass()},mounted:function(){this.getlistData()},methods:{copyRow:function(e,t){this.title="新增角色信息",this.addNewRole=!0,this.addRoleData.type=0===t?"edit":"view",e.newType="copy",this.$set(this.addRoleData,"val",e)},submitForm:function(e){e.type&&"edit"===e.type?"copy"===e.newType?this.createRoleInfo(e):this.updataMenuInfo(e):this.createRoleInfo(e)},updataMenuInfo:function(e){var t=this,a=JSON.parse(window.localStorage.getItem("memberInfor"));e.updateName=a.name,Object(n["k"])(e).then((function(e){0==e.code&&(t.$message({message:"更新成功",type:"success"}),t.getlistData())})),this.addNewRole=!1},createRoleInfo:function(e){var t=this;Object(n["b"])(e).then((function(e){0==e.code&&(t.$message({message:"新增成功",type:"success"}),t.getlistData())})),this.addNewRole=!1},deleteRow:function(e){var t=this,a={id:e.id};this.$confirm("确定删除该数据吗?","提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"info",center:!0}).then((function(){Object(n["c"])(a).then((function(e){0==e.code&&(t.$message({message:"删除成功",type:"success"}),t.getlistData())}))}))},addRoleManageClick:function(){this.title="新增角色",this.addNewRole=!0,this.addRoleData.type="add"},editRow:function(e,t){e.newType=null,this.title="编辑角色信息",this.addNewRole=!0,this.addRoleData.type=0===t?"edit":"view",this.$set(this.addRoleData,"val",e)},handleSizeChange:function(e){this.query.pageSize=e,this.getlistData()},handleCurrentChange:function(e){this.query.pageNumber=e,this.getlistData()},getlistData:function(){var e=this;this.listLoading=!0,this.query.adClientId=1,this.query.adOrgId=JSON.parse(window.localStorage.getItem("companyInfo")).osId,Object(n["i"])(this.query).then((function(t){0==t.code&&(e.listTable=t.data.records,e.pageTotal=t.data.rowsCount)})),this.listLoading=!1},handleClose:function(){this.addNewRole=!1},onSearch:function(){this.query.pageNumber=1,this.getlistData()},resetForm:function(e){this.taskDate="",this.$refs[e].resetFields(),this.getlistData()},editClick:function(e){this.showEdit=!0,this.$nextTick((function(){this.$refs.editrole.getData(e)}))},editClose:function(){this.showEdit=!1},headClass:function(){return"text-align:center;background:#FAFAFA;"}}},D=S,N=(a("8873"),Object(v["a"])(D,o,r,!1,null,"79ed2b26",null));t["default"]=N.exports},b8fd:function(e,t,a){"use strict";a("3a22")},bb6d:function(e,t,a){"use strict";a("9179b")}}]);