import{u as S}from"./api.C8DTb_jV.js";import{E as i,S as N}from"./index.CL7yl-Wb.js";import{a as h,r as p,_ as U,aj as r,J as m,o as d,K as o,S as l,M as g,c as j,R as I,a9 as M,b as O,P as y}from"./vue.D1BjjNmv.js";import{_ as R}from"./_plugin-vue_export-helper.DlAUqK2U.js";const q={class:"dialog-footer"},F=h({__name:"index",props:{crudExpose:{type:Object,required:!0}},setup(V,{expose:x}){const w=V,u=p(!1),c=p(!1),f=p([]),e=U({operationType:"status",status:void 0,tags:[]}),k=p([{value:"优质候选人",label:"优质候选人"},{value:"有经验",label:"有经验"},{value:"应届毕业生",label:"应届毕业生"},{value:"技能熟练",label:"技能熟练"}]),T=s=>{if(!s||s.length===0){i.warning("请至少选择一条记录");return}f.value=s,u.value=!0,e.operationType="status",e.status=void 0,e.tags=[]},C=async()=>{if(e.operationType==="tags"&&(!e.tags||e.tags.length===0)){i.warning("请至少选择一个标签");return}try{c.value=!0;const s=f.value.map(t=>t.id);e.operationType==="status"&&(await S({application_ids:s,new_status:e.status,tenant_id:N.get("tenant_id")}),i.success("批量更新状态成功")),u.value=!1,w.crudExpose.doRefresh()}catch(s){console.error("批量操作失败:",s),i.error("操作失败，请重试")}finally{c.value=!1}};return x({open:T}),(s,t)=>{const n=r("el-option"),_=r("el-select"),v=r("el-form-item"),B=r("el-form"),b=r("el-button"),E=r("el-dialog");return d(),m(E,{modelValue:u.value,"onUpdate:modelValue":t[3]||(t[3]=a=>u.value=a),title:"批量操作",width:"500px","close-on-click-modal":!1,"close-on-press-escape":!1},{footer:o(()=>[O("span",q,[l(b,{onClick:t[2]||(t[2]=a=>u.value=!1)},{default:o(()=>t[4]||(t[4]=[y("取消")])),_:1}),l(b,{type:"primary",onClick:C,loading:c.value},{default:o(()=>t[5]||(t[5]=[y("确定")])),_:1},8,["loading"])])]),default:o(()=>[l(B,{model:e,"label-width":"100px"},{default:o(()=>[e.operationType==="status"?(d(),m(v,{key:0,label:"状态"},{default:o(()=>[l(_,{modelValue:e.status,"onUpdate:modelValue":t[0]||(t[0]=a=>e.status=a),placeholder:"请选择状态",style:{width:"100%"}},{default:o(()=>[l(n,{label:"待处理",value:0}),l(n,{label:"已通知面试",value:1}),l(n,{label:"已面试",value:2}),l(n,{label:"已录用",value:3}),l(n,{label:"已拒绝",value:4})]),_:1},8,["modelValue"])]),_:1})):g("",!0),e.operationType==="tags"?(d(),m(v,{key:1,label:"标签"},{default:o(()=>[l(_,{modelValue:e.tags,"onUpdate:modelValue":t[1]||(t[1]=a=>e.tags=a),multiple:"",filterable:"","allow-create":"","default-first-option":"",placeholder:"请选择或创建标签",style:{width:"100%"}},{default:o(()=>[(d(!0),j(I,null,M(k.value,a=>(d(),m(n,{key:a.value,label:a.label,value:a.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1})):g("",!0)]),_:1},8,["model"])]),_:1},8,["modelValue"])}}}),$=R(F,[["__scopeId","data-v-c13d1c00"]]);export{$ as default};
