| 1 |
- "use strict";const e=require("../../common/vendor.js"),t=require("../../common/assets.js"),a=require("../../api/student.js"),u={__name:"resume_view",setup(u){const i=e.ref({name:"",mobile:"",email:"",gender:"",genderLabel:"",idCardNumber:"",avatarUrl:"",schoolName:"",education:"",educationLabel:"",availabilityLabel:"",jobType:"",jobTypeLabel:"",availability:"",jobIntention:"",educationList:[],experienceList:[],projectList:[]}),n=e.ref(!0),l={1:"初中及以下",2:"高中/中专",3:"大专",4:"本科",5:"硕士",6:"博士"},o={1:"全职",2:"实习",3:"兼职"},r={0:"男",1:"女",2:"未知"},c=e.computed((()=>{if(i.value.educationList&&i.value.educationList.length>0){const e={"初中及以下":1,"高中":2,"中专":2,"大专":3,"本科":4,"硕士":5,"博士":6};let t=i.value.educationList[0],a=e[t.education]||0;for(const u of i.value.educationList){const i=e[u.education]||0;i>a&&(a=i,t=u)}return(t.education||"")+(t.educationType?" · "+t.educationType:"")}if(i.value.educationLabel)return i.value.educationLabel;const e=i.value.education;return e&&"0"!==e&&0!==e?l[e]||(/^\d+$/.test(String(e))?"":e):""})),v=e.computed((()=>{if(i.value.jobTypeLabel)return i.value.jobTypeLabel;const e=i.value.jobType;return e?o[e]||e:""})),s=e.computed((()=>i.value.availabilityLabel||i.value.availability||"")),d=e.computed((()=>{if(i.value.genderLabel)return i.value.genderLabel;const e=(e=>{if(null==e||""===e)return"";const t=String(e).trim().toUpperCase();return"M"===t?"0":"F"===t?"1":t})(i.value.gender);return e?r[e]||e:""})),m=e.computed((()=>{if(!i.value.jobIntention)return[];const e=i.value.jobIntention.split(",").filter((e=>e.trim())),t={1:"审计",2:"咨询",3:"税务",4:"财务",5:"评估"};return e.map((e=>t[e.trim()]||e.trim()))})),p=e.computed((()=>{if(!i.value.idCardNumber||i.value.idCardNumber.length<14)return"";return`${i.value.idCardNumber.substring(6,10)}-${i.value.idCardNumber.substring(10,12)}-${i.value.idCardNumber.substring(12,14)}`})),g=e.computed((()=>{if(!i.value.experienceList||0===i.value.experienceList.length)return 0;let e=0;return i.value.experienceList.forEach((t=>{if(t.startTime&&t.endTime){const a=new Date(t.startTime),u="至今"===t.endTime?new Date:new Date(t.endTime),i=12*(u.getFullYear()-a.getFullYear())+(u.getMonth()-a.getMonth());e+=i}})),Math.floor(e/12)})),h=e.computed((()=>i.value.gender||p.value||c.value||i.value.schoolName)),L=(e,t)=>{if(!e)return"";const a=e=>{if(!e)return"";if("至今"===e)return"至今";const t=new Date(e);return`${t.getFullYear()}.${String(t.getMonth()+1).padStart(2,"0")}`};return`${a(e)} - ${a(t)||"至今"}`},b=()=>{e.index.navigateTo({url:"/pages/profile/profile?editMode=1"})},f=async()=>{const t=e.index.getStorageSync("userInfo");if(!t||!t.studentId)return e.index.showToast({title:"请先登录",icon:"none"}),void setTimeout((()=>{e.index.reLaunch({url:"/pages/login/login"})}),1500);try{n.value=!0;const u=await a.getStudent(t.studentId);u&&u.data?i.value={...i.value,...u.data,educationList:u.data.educationList||[],experienceList:u.data.experienceList||[],projectList:u.data.projectList||[]}:e.index.showToast({title:"获取简历数据失败",icon:"none"})}catch(u){console.error("获取简历数据异常",u),e.index.showToast({title:"网络异常,请重试",icon:"none"})}finally{n.value=!1,e.index.hideLoading()}};return e.onMounted((()=>{f()})),e.onShow((()=>{f()})),(a,u)=>{return e.e({a:n.value},n.value?{}:e.e({b:e.t(i.value.name||"加载中..."),c:v.value&&s.value},v.value&&s.value?{d:e.t(v.value),e:e.t(s.value)}:{},{f:g.value||i.value.education||i.value.schoolName},g.value||i.value.education||i.value.schoolName?e.e({g:g.value},g.value?{h:e.t(g.value)}:{},{i:g.value&&c.value},(g.value&&c.value,{}),{j:c.value},c.value?{k:e.t(c.value)}:{},{l:(g.value||c.value)&&i.value.schoolName},((g.value||c.value)&&i.value.schoolName,{}),{m:i.value.schoolName},i.value.schoolName?{n:e.t(i.value.schoolName)}:{}):{},{o:i.value.avatarUrl||"/static/images/hr_avatar.svg",p:i.value.mobile},i.value.mobile?{q:t._imports_0$13,r:e.t((o=i.value.mobile,!o||o.length<11?o:o.substring(0,3)+"****"+o.substring(7)))}:{},{s:i.value.email},i.value.email?{t:t._imports_1$4,v:e.t(i.value.email)}:{},{w:h.value},h.value?e.e({x:i.value.gender},i.value.gender?{y:e.t(d.value)}:{},{z:p.value},p.value?{A:e.t(p.value)}:{},{B:c.value},c.value?{C:e.t(c.value)}:{},{D:i.value.schoolName},i.value.schoolName?{E:e.t(i.value.schoolName)}:{}):{},{F:m.value.length>0},m.value.length>0?{G:e.f(m.value,((t,a,u)=>({a:e.t(t),b:a})))}:{},{H:i.value.experienceList&&i.value.experienceList.length>0},i.value.experienceList&&i.value.experienceList.length>0?{I:e.f(i.value.experienceList,((t,a,u)=>e.e({a:e.t(L(t.startTime,t.endTime)),b:e.t(1===t.isHidden?"***(已屏蔽)":t.company),c:e.t(t.jobTitle),d:1===t.isInternship},(t.isInternship,{}),{e:t.workContent},t.workContent?{f:e.t(t.workContent)}:{},{g:t.id||a})))}:{},{J:i.value.projectList&&i.value.projectList.length>0},i.value.projectList&&i.value.projectList.length>0?{K:e.f(i.value.projectList,((t,a,u)=>e.e({a:e.t(t.projectName),b:e.t(L(t.startTime,t.endTime)),c:t.role},t.role?{d:e.t(t.role)}:{},{e:t.description},t.description?{f:e.t(t.description)}:{},{g:t.achievement},t.achievement?{h:e.t(t.achievement)}:{},{i:t.id||a})))}:{},{L:i.value.educationList&&i.value.educationList.length>0},i.value.educationList&&i.value.educationList.length>0?{M:e.f(i.value.educationList,((t,a,u)=>{return e.e({a:e.t(t.school),b:e.t(L(t.startTime,t.endTime)),c:t.major},t.major?{d:e.t(t.major)}:{},{e:t.major&&(t.education||t.educationType)},(t.major&&(t.education||t.educationType),{}),{f:t.education},t.education?{g:e.t((i=t.education,l[i]||i||""))}:{},{h:t.education&&t.educationType},(t.education&&t.educationType,{}),{i:t.educationType},t.educationType?{j:e.t(t.educationType)}:{},{k:t.campusExperience},t.campusExperience?{l:e.t(t.campusExperience)}:{},{m:t.id||a});var i}))}:{}),{N:e.o(b)});var o}}},i=e._export_sfc(u,[["__scopeId","data-v-580803f3"]]);wx.createPage(i);
|