(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-4e18df68"],{"09fd":function(t,a,e){},2955:function(t,a,e){"use strict";e.r(a);var s=function(){var t=this,a=t._self._c;return a("el-row",{attrs:{gutter:20}},[a("el-col",{attrs:{span:18}},[a("el-card",{staticClass:"box-card"},[a("div",{staticClass:"flex justify-between",attrs:{slot:"header"},slot:"header"},[a("span",[t._v(t._s(t.$t("staffDetailInfo.title")))]),a("el-button",{staticStyle:{float:"right",padding:"3px 0"},attrs:{type:"text"},on:{click:t.goBack}},[t._v(" "+t._s(t.$t("common.back"))+" ")])],1),a("div",{staticClass:"card-content"},[a("el-row",[a("el-col",{attrs:{span:4}},[a("el-image",{staticClass:"border-radius",staticStyle:{width:"120px",height:"140px"},attrs:{src:t.staffDetailInfo.photo,fit:"cover"},on:{error:t.errorLoadImg}})],1),a("el-col",{attrs:{span:20}},[a("el-form",{staticClass:"text-left",attrs:{model:t.staffDetailInfo,"label-width":"120px"}},[a("el-row",[a("el-col",{attrs:{span:8}},[a("el-form-item",{attrs:{label:t.$t("staffDetailInfo.staffId")}},[a("span",[t._v(t._s(t.staffDetailInfo.staffId))])])],1),a("el-col",{attrs:{span:8}},[a("el-form-item",{attrs:{label:t.$t("staffDetailInfo.userName")}},[a("span",[t._v(t._s(t.staffDetailInfo.userName))])])],1),a("el-col",{attrs:{span:8}},[a("el-form-item",{attrs:{label:t.$t("staffDetailInfo.email")}},[a("span",[t._v(t._s(t.staffDetailInfo.email))])])],1)],1),a("el-row",[a("el-col",{attrs:{span:8}},[a("el-form-item",{attrs:{label:t.$t("staffDetailInfo.tel")}},[a("span",[t._v(t._s(t.staffDetailInfo.tel))])])],1),a("el-col",{attrs:{span:8}},[a("el-form-item",{attrs:{label:t.$t("staffDetailInfo.sex")}},[a("span",[t._v(t._s("0"==t.staffDetailInfo.sex?t.$t("staffDetailInfo.male"):t.$t("staffDetailInfo.female")))])])],1),a("el-col",{attrs:{span:8}},[a("el-form-item",{attrs:{label:t.$t("staffDetailInfo.address")}},[a("span",[t._v(t._s(t.staffDetailInfo.address))])])],1)],1)],1)],1)],1)],1)]),a("el-card",{staticClass:"box-card margin-top"},[a("div",{staticClass:"flex justify-between",attrs:{slot:"header"},slot:"header"},[a("span",[t._v(t._s(t.$t("staffDetailInfo.relatedOrg")))])]),a("div",{staticClass:"card-content text-left"},t._l(t.staffDetailInfo.orgs,(function(e,s){return a("el-row",{key:s},[a("el-col",{attrs:{span:12}},[t._v(t._s(t.$t("staffDetailInfo.org"))+":"+t._s(e.orgName))])],1)})),1)]),a("el-card",{staticClass:"box-card margin-top"},[a("div",{staticClass:"flex justify-between",attrs:{slot:"header"},slot:"header"},[a("span",[t._v(t._s(t.$t("staffDetailInfo.relatedRoleAndShop")))])]),a("div",{staticClass:"card-content text-left"},t._l(t.staffDetailInfo.roles,(function(e,s){return a("el-row",{key:s},[a("el-col",{attrs:{span:24}},[e.roleShopDtoList.length>0?a("p",[t._v(" "+t._s(e.roleName)+" ( "),t._l(e.roleShopDtoList,(function(s,f){return a("span",{key:f},[t._v(" "+t._s(s.shopName)+" "+t._s(f===e.roleShopDtoList.length-1?" ":" 、 ")+" ")])})),t._v(" ) ")],2):t._e()])],1)})),1)])],1),a("el-col",{attrs:{span:6}},[a("el-card",{staticClass:"box-card"},[a("div",{staticClass:"flex justify-between",attrs:{slot:"header"},slot:"header"},[a("span",[t._v(t._s(t.$t("staffDetailInfo.staffPrivilege")))])]),a("div",{staticClass:"card-content text-left"},[a("el-tree",{attrs:{data:t.privilegeTreeData,props:t.defaultProps,"node-key":"id","default-expand-all":"","expand-on-click-node":!1}})],1)])],1)],1)},f=[],l=e("b775");function o(t){return new Promise((a,e)=>{Object(l["a"])({url:"/query.staff.infos",method:"get",params:t}).then(t=>{const e=t.data;a(e)}).catch(t=>{e(t)})})}function r(t){return new Promise((a,e)=>{Object(l["a"])({url:"/user.listStaffOrgs",method:"get",params:t}).then(t=>{const e=t.data;a(e)}).catch(t=>{e(t)})})}function i(t){return new Promise((a,e)=>{Object(l["a"])({url:"/user.listStaffRoles",method:"get",params:t}).then(t=>{const e=t.data;a(e)}).catch(t=>{e(t)})})}function n(t){return new Promise((a,e)=>{Object(l["a"])({url:"/privilege.queryStaffPrivileges",method:"get",params:t}).then(t=>{const e=t.data;a(e)}).catch(t=>{e(t)})})}var d={name:"StaffDetail",data(){return{staffDetailInfo:{staffId:"",userName:"",email:"",tel:"",sex:"",address:"",photo:"",privileges:[],orgs:[],communitys:[],roles:[]},privilegeTreeData:[],defaultProps:{children:"children",label:"text"}}},created(){this.initData()},methods:{initData(){const t=this.$route.query.staffId;t?(this.staffDetailInfo.staffId=t,this.loadStaffDetail(),this.loadStaffOrgs(),this.loadStaffRoles(),this.loadStaffPrivileges()):this.$message.error(this.$t("staffDetailInfo.staffIdRequired"))},async loadStaffDetail(){try{const t={page:1,row:1,staffId:this.staffDetailInfo.staffId},a=await o(t);a.data&&a.data.length>0&&(Object.assign(this.staffDetailInfo,a.data[0]),this.staffDetailInfo.photo=a.data[0].faceUrl||"/img/noPhoto.jpg")}catch(t){console.error("获取员工详情失败:",t)}},async loadStaffOrgs(){try{const t={page:1,row:1,staffId:this.staffDetailInfo.staffId},a=await r(t);this.staffDetailInfo.orgs=a.data||[]}catch(t){console.error("获取员工组织失败:",t)}},async loadStaffRoles(){try{const t={page:1,row:9999,staffId:this.staffDetailInfo.staffId},a=await i(t);this.staffDetailInfo.roles=a.data||[]}catch(t){console.error("获取员工角色失败:",t)}},async loadStaffPrivileges(){try{const t={staffId:this.staffDetailInfo.staffId},a=await n(t);this.staffDetailInfo.privileges=a.datas||[],this.privilegeTreeData=this.buildTreeData(a.datas)}catch(t){console.error("获取员工权限失败:",t)}},buildTreeData(t){const a=[],e=new Map;t.forEach(t=>{if(!e.has(t.gId)){const s={id:"g_"+t.gId,gId:t.gId,text:t.gName,children:[]};e.set(t.gId,s),a.push(s)}});const s=new Map;return t.forEach(t=>{const a=e.get(t.gId);if(a&&!s.has(t.mId)){const e={id:"m_"+t.mId,mId:t.mId,text:t.mName,children:[]};s.set(t.mId,e),a.children.push(e)}}),t.forEach(t=>{const a=s.get(t.mId);a&&a.children.push({id:"p_"+t.pId,pId:t.pId,text:t.pName})}),a},errorLoadImg(){this.staffDetailInfo.photo="/img/noPhoto.jpg"},goBack(){this.$router.go(-1)}}},c=d,h=(e("6964"),e("2877")),p=Object(h["a"])(c,s,f,!1,null,"4df7d3c6",null);a["default"]=p.exports},6964:function(t,a,e){"use strict";e("09fd")}}]); //# sourceMappingURL=chunk-4e18df68.ff80a590.js.map