crud.qsK-WzUO.js 8.6 KB

1
  1. import{D as k,U as C,A as E,G as z}from"./api.DjFj-TJ9.js";import{B as y,C as W,A as $,D as U,F as q,G as c,H as B,I as r,J as u,K as o}from"./index.CUrmXCFV.js";import{aH as S,S as e,av as d}from"./vue.D1BjjNmv.js";const I=function({crudExpose:T,context:i}){S();const _=async a=>(console.log(a),await z(a)),g=async({form:a,row:l})=>(a.id=l.id,await C(a)),w=async({row:a})=>await k(a.id),f=async({form:a})=>await E(a),v=async a=>{try{return(await $.get(`https://backend.qicai321.com/api/system/wechat/user/profile/get?user_id=${a}&tenant_id=1`)).data}catch(l){return console.error("获取用户信息失败:",l),null}},x=async a=>{const l=await v(a);if(!l||l.code!==2e3){y("获取用户信息失败");return}const{user_info:n,profile:t,educations:p,family_members:m,trainings:h,work_experiences:b}=l.data,s=document.createElement("div"),D=e(W,{title:"个人信息详情",width:"70%",modelValue:!0,"onUpdate:modelValue":R=>{R||(d(null,s),document.body.removeChild(s))},beforeClose:()=>{d(null,s),document.body.removeChild(s)}},{default:()=>e(q,{type:"border-card"},{default:()=>[e(c,{label:"基本信息"},{default:()=>e(B,{column:3,border:!0},{default:()=>[e(r,{label:"姓名"},{default:()=>(n==null?void 0:n.name)||"未填写"}),e(r,{label:"电话"},{default:()=>(n==null?void 0:n.phone)||"未填写"}),e(r,{label:"年龄"},{default:()=>(n==null?void 0:n.age)||"未填写"}),e(r,{label:"出生日期"},{default:()=>(n==null?void 0:n.birth_date)||"未填写"}),e(r,{label:"性别"},{default:()=>(n==null?void 0:n.gender_name)||"未知"}),e(r,{label:"身份证号"},{default:()=>(n==null?void 0:n.id_card)||"未填写"}),e(r,{label:"政治面貌"},{default:()=>(t==null?void 0:t.political_status)||"未填写"}),e(r,{label:"民族"},{default:()=>(t==null?void 0:t.ethnicity)||"未填写"}),e(r,{label:"身高"},{default:()=>t!=null&&t.height?`${t.height}cm`:"未填写"}),e(r,{label:"体重"},{default:()=>t!=null&&t.weight?`${t.weight}kg`:"未填写"}),e(r,{label:"籍贯"},{default:()=>(t==null?void 0:t.native_place)||"未填写"}),e(r,{label:"户口所在地"},{default:()=>(t==null?void 0:t.household_location)||"未填写"}),e(r,{label:"现居地址"},{default:()=>(t==null?void 0:t.current_address)||"未填写"}),e(r,{label:"婚姻状况"},{default:()=>(t==null?void 0:t.marital_status_name)||"未填写"}),e(r,{label:"是否有子女"},{default:()=>(t==null?void 0:t.has_children)!==void 0?t.has_children?"是":"否":"未填写"}),e(r,{label:"期望薪资"},{default:()=>(t==null?void 0:t.expected_salary)||"未填写"}),e(r,{label:"紧急联系人"},{default:()=>(t==null?void 0:t.emergency_contact)||"未填写"}),e(r,{label:"紧急联系电话"},{default:()=>(t==null?void 0:t.emergency_phone)||"未填写"}),e(r,{label:"特长"},{default:()=>(t==null?void 0:t.specialties)||"未填写"}),e(r,{label:"人生格言"},{default:()=>(t==null?void 0:t.life_motto)||"未填写"}),e(r,{label:"招聘来源"},{default:()=>(t==null?void 0:t.recruitment_source_name)||"未填写"}),e(r,{label:"招聘来源详情"},{default:()=>(t==null?void 0:t.recruitment_source_detail)||"未填写"})]})}),p&&p.length>0?e(c,{label:"教育经历"},{default:()=>e(u,{data:p,border:!0,stripe:!0},{default:()=>[e(o,{prop:"education_type_name",label:"学历类型"}),e(o,{prop:"degree_name",label:"学位"}),e(o,{prop:"school_name",label:"学校名称"}),e(o,{prop:"major",label:"专业"}),e(o,{prop:"start_date",label:"开始日期"}),e(o,{prop:"end_date",label:"结束日期"})]})}):null,m&&m.length>0?e(c,{label:"家庭成员"},{default:()=>e(u,{data:m,border:!0,stripe:!0},{default:()=>[e(o,{prop:"relation",label:"关系"}),e(o,{prop:"name",label:"姓名"}),e(o,{prop:"workplace",label:"工作单位"}),e(o,{prop:"position",label:"职位"}),e(o,{prop:"phone",label:"联系电话"})]})}):null,b&&b.length>0?e(c,{label:"工作经历"},{default:()=>e(u,{data:b,border:!0,stripe:!0},{default:()=>[e(o,{prop:"company_name",label:"公司名称"}),e(o,{prop:"department",label:"部门"}),e(o,{prop:"position",label:"职位"}),e(o,{prop:"start_date",label:"开始日期"}),e(o,{prop:"end_date",label:"结束日期"}),e(o,{prop:"monthly_salary",label:"月薪"}),e(o,{prop:"company_size",label:"公司规模"}),e(o,{prop:"supervisor_name",label:"主管姓名"}),e(o,{prop:"supervisor_phone",label:"主管电话"}),e(o,{prop:"resignation_reason",label:"离职原因"})]})}):null,h&&h.length>0?e(c,{label:"培训经历"},{default:()=>e(u,{data:h,border:!0,stripe:!0},{default:()=>[e(o,{prop:"training_name",label:"培训名称"}),e(o,{prop:"institution",label:"培训机构"}),e(o,{prop:"start_date",label:"开始日期"}),e(o,{prop:"end_date",label:"结束日期"}),e(o,{prop:"description",label:"描述"}),e(o,{prop:"certificate",label:"证书"})]})}):null].filter(Boolean)}),footer:()=>e(U,{onClick:()=>{d(null,s),document.body.removeChild(s)}},{default:()=>"关闭"})});document.body.appendChild(s),d(D,s)};return{crudOptions:{toolbar:{buttons:{search:{show:!1},refresh:{show:!1},compact:{show:!1},export:{text:"导出",type:"primary",size:"small",icon:"upload",circle:!1,display:!0},columns:{show:!1}}},request:{pageRequest:_,addRequest:f,editRequest:g,delRequest:w},actionbar:{buttons:{add:{show:!1},batchBindTags:{text:"批量绑定标签",type:"primary",show:!0,order:2,click:()=>{var l;const a=((l=i.selectedRows)==null?void 0:l.value)||[];if(!a||a.length===0){y("请先选择要操作的记录");return}i.openBatchTagsDialog(a)}},batchStatus:{text:"批量修改状态",type:"primary",show:!0,order:1,click:()=>{var l;const a=((l=i.selectedRows)==null?void 0:l.value)||[];if(!a||a.length===0){y("请先选择要操作的记录");return}i.openBatchStatusDialog(a)}}}},rowHandle:{fixed:"right",width:280,buttons:{view:{text:"查看报告",iconRight:"view",show:!0,type:"text",click:({row:a})=>{console.log(a);const n=`${window.location.origin}/#/JobApplication/report/report?id=${a.id}&tenant_id=1&application_id=${a.applicant}`;window.open(n,"_blank")}},profile:{text:"查看个人信息",iconRight:"User",type:"text",show:!0,order:1,click:({row:a})=>{x(a.id)}},edit:{text:"编辑",iconRight:"Edit",type:"text",show:!1},remove:{text:"删除",iconRight:"Delete",type:"text",show:!1}}},pagination:{show:!0},table:{selection:!0,onSelectionChange:a=>{i&&i.selectedRows&&(i.selectedRows.value=a)}},search:{show:!0,layout:"auto",buttons:{search:{size:"small"},reset:{size:"small"}},resetBtn:{show:!0,click:()=>{const a=document.querySelector(".el-tree");if(a){const l=a.querySelector(".is-current");l&&l.classList.remove("is-current")}}}},columns:{_selection:{title:"选择",form:{show:!1},column:{type:"selection",align:"center",width:50,fixed:"left",columnSetDisabled:!0}},id:{title:"ID",search:{show:!1,component:{placeholder:"请输入ID"}},type:"number",column:{width:80},form:{show:!1}},name:{title:"姓名",search:{show:!0,component:{placeholder:"请输入姓名"},size:"small",col:{span:3}},type:"input",column:{minWidth:100,formatter:({row:a})=>a.name||a.nikename||"未填写"}},phone:{title:"电话",search:{show:!0,component:{placeholder:"请输入电话"},size:"small",col:{span:3}},type:"input",column:{minWidth:120,formatter:({row:a})=>a.phone||"未填写"}},gender_name:{title:"性别",search:{show:!0,component:{name:"el-select",options:[{value:"男",label:"男"},{value:"女",label:"女"},{value:"未知",label:"未知"}]},size:"small",col:{span:3}},type:"input",column:{minWidth:80}},age:{title:"年龄",type:"number",column:{minWidth:80,formatter:({row:a})=>a.age||"未填写"}},"profile_summary.expected_salary":{title:"期望薪资",type:"number",column:{minWidth:100,formatter:({row:a})=>{var l;return(l=a.profile_summary)!=null&&l.expected_salary?`${a.profile_summary.expected_salary}元`:"未填写"}}},"application_summary.latest_position":{title:"岗位",search:{show:!0,component:{placeholder:"请输入职位"},size:"small",col:{span:3}},type:"input",column:{minWidth:120,formatter:({row:a})=>{var l;return((l=a.application_summary)==null?void 0:l.latest_position)||"未填写"}}},"application_summary.latest_status":{title:"状态",search:{show:!0,component:{name:"el-select",options:[{value:"待面试",label:"待面试"},{value:"已面试",label:"已面试"},{value:"已录用",label:"已录用"},{value:"已拒绝",label:"已拒绝"}]},size:"small",col:{span:3}},type:"input",column:{minWidth:100,formatter:({row:a})=>{var l;return((l=a.application_summary)==null?void 0:l.latest_status)||"未填写"}}},"application_summary.highest_score":{title:"面试得分",type:"input",column:{minWidth:100,formatter:({row:a})=>{var l;return((l=a.application_summary)==null?void 0:l.highest_score)||""}}},remark:{title:"备注",type:"textarea",column:{minWidth:100,formatter:({row:a})=>{var l;return((l=a.application_summary)==null?void 0:l.latest_status_name)||"未填写"}}}}}}};export{I as createCrudOptions};