import{g as e,O as t,S as s,aH as a,a7 as o,ag as i,aI as l,n as r,ac as n,u as c,aJ as u,d as p,a as m,K as d,q as f,c as g,w as y,A as h,i as b,o as _,t as v,v as x,x as S,H as k}from"./index-DL8B2Mxu.js";import{_ as P}from"./u-avatar.oTnux-Fl.js";import{r as C}from"./uni-app.es.BSVEa1f2.js";import{_ as I}from"./u-icon.CLOPtL2B.js";import{_ as N,a as w}from"./u-cell-group.CfkIpmNS.js";import{I as O}from"./mixin.BEoZVr8j.js";import{_ as U}from"./_plugin-vue_export-helper.BCo6x5W8.js";const j=U({mixins:[O],data:()=>({titleStyle:{color:"#303133"},avatarSrc:"",baseInfo:{},loading:!1}),computed:{baseURL(){return this.define.comUploadUrl},baseURL2(){return this.define.baseURL},token:()=>e("token"),report(){return this.define.report}},onLoad(){t().getSocket||s.initSocket()},onShow(){a().then((e=>{this.baseInfo=e.data||{},this.avatarSrc=this.baseURL2+this.baseInfo.avatar,this.loading=!0}))},methods:{chooseAvatar(){o({count:1,sizeType:["original","compressed"],success:e=>{if(!new RegExp("image/*").test(e.tempFiles[0].type))return this.$u.toast("请上传图片");let t=e.tempFilePaths[0];i({url:this.baseURL+"userAvatar",filePath:t,name:"file",header:{Authorization:this.token},success:e=>{let t=JSON.parse(e.data);200===t.code?l(t.data.name).then((e=>{this.$u.toast("头像更换成功"),this.avatarSrc=this.baseURL2+t.data.url})):this.$u.toast(t.msg)},fail:e=>{this.$u.toast("头像更换失败")}})}})},openPage(e,t){if(!e)return;r({url:t?e+"?majorType="+t:e})},personalPage(e){e&&r({url:e+"?baseInfo="+encodeURIComponent(JSON.stringify(this.baseInfo))})},isJSON(e){try{var t=JSON.parse(e);return!("object"!=typeof t||!t)}catch(s){return!1}},logout(){n({title:"提示",content:"确定退出当前账号吗？",success:e=>{if(e.confirm){c().logout().then((()=>{u(),p({url:"/pages/login/index"})})),this.removeAccount()}}})},removeAccount(){let t=e("rememberAccount");t.remember||(t.account="",t.password="",t.remember=!1,m("rememberAccount",t))},scanCode(){d({success:e=>{let t="";if(this.isJSON(e.result.trim())){const s=JSON.parse(e.result.trim());if("ADP"===s.t){let e={isPreview:1,moduleId:s.id,previewType:s.previewType};t="/pages/apply/dynamicModel/index?config="+this.jnpf.base64.encode(JSON.stringify(e))}if("DFD"===s.t&&(t="/pages/apply/dynamicModel/scanForm?config="+JSON.stringify(s)),"WFP"===s.t&&(t="/pages/workFlow/scanForm/index?config="+JSON.stringify(s)),"report"===s.t){let e=`${this.report}/preview.html?id=${s.id}&token=${this.token}&page=1&from=menu`;t="/pages/apply/externalLink/index?url="+encodeURIComponent(e)+"&fullName= "+s.fullName}"portal"===s.t&&(t="/pages/portal/scanPortal/index?id="+s.id),"login"===s.t&&(t="/pages/login/scanLogin?id="+s.id)}else t="/pages/my/scanResult/index?result="+e.result;r({url:t,fail:e=>{this.$u.toast("暂无此页面")}})}})}}},[["render",function(e,t,s,a,o,i){const l=C(f("u-avatar"),P),r=b,n=C(f("u-icon"),I),c=k,u=C(f("u-cell-item"),N),p=C(f("u-cell-group"),w);return o.loading?(_(),g(r,{key:0,class:"my-v"},{default:y((()=>[v(r,{class:"u-flex user-box u-p-l-20 u-p-r-10 u-p-b-20"},{default:y((()=>[v(r,{class:"u-m-r-10"},{default:y((()=>[v(l,{size:"140",onClick:i.chooseAvatar,src:o.avatarSrc},null,8,["onClick","src"])])),_:1}),v(r,{class:"u-flex-1 f-right",onClick:t[0]||(t[0]=e=>i.personalPage("/pages/my/personalData/index"))},{default:y((()=>[v(r,{class:"u-font-18 u-m-l-16"},{default:y((()=>[x(S(o.baseInfo.realName),1)])),_:1}),v(r,{class:"u-m-l-10 u-p-10"},{default:y((()=>[v(n,{name:"arrow-right",color:"#969799",size:"28"})])),_:1})])),_:1})])),_:1}),v(r,{class:"u-m-t-20"},{default:y((()=>[v(r,{class:"",style:{"background-color":"#fff"}},{default:y((()=>[v(p,{style:{padding:"0 20rpx"},border:!1},{default:y((()=>[v(u,{title:"我的组织",onClick:t[1]||(t[1]=e=>i.openPage("/pages/my/business/index","Organize")),"title-style":o.titleStyle},{icon:y((()=>[v(c,{class:"icon-ym icon-ym-zuzhi u-m-r-16 u-font-36",style:{color:"#303133"}})])),_:1},8,["title-style"]),v(u,{title:" 我的岗位",onClick:t[2]||(t[2]=e=>i.openPage("/pages/my/business/index","Position")),"title-style":o.titleStyle},{icon:y((()=>[v(c,{class:"icon-ym icon-ym-position1 u-m-r-16 u-font-36",style:{color:"#303133"}})])),_:1},8,["title-style"]),v(u,{title:"我的下属",onClick:t[3]||(t[3]=e=>i.openPage("/pages/my/subordinate/index")),"title-style":o.titleStyle},{icon:y((()=>[v(c,{class:"icon-ym icon-ym-generator-section u-m-r-16 u-font-36",style:{color:"#303133"}})])),_:1},8,["title-style"]),v(u,{title:"设置",onClick:t[4]||(t[4]=e=>i.openPage("/pages/my/settings/index")),"title-style":o.titleStyle,"border-bottom":!1},{icon:y((()=>[v(c,{class:"icon-ym icon-ym-shezhi u-m-r-16 u-font-36",style:{color:"#303133"}})])),_:1},8,["title-style"])])),_:1})])),_:1})])),_:1}),v(r,{class:"u-p-t-20"},{default:y((()=>[v(r,{class:"logout-cell","hover-class":"u-cell-hover",onClick:i.logout},{default:y((()=>[x("退出登录")])),_:1},8,["onClick"])])),_:1})])),_:1})):h("",!0)}],["__scopeId","data-v-2182e576"]]);export{j as default};
