import{J as d,j as S,S as f,s as j}from"./index.CL7yl-Wb.js";import{a as J,r as c,_ as N,aj as l,J as q,o as E,K as s,S as t,b as M,P as _}from"./vue.D1BjjNmv.js";const R={class:"dialog-footer"},$=J({__name:"BatchStatusDialog",props:{crudExpose:{type:Object,required:!0}},emits:["success"],setup(v,{expose:b,emit:g}){const x=v,n=c(!1),i=c(!1),p=c([]),a=N({status:""}),V=g,y=o=>{p.value=o,n.value=!0,a.status=""},k=async()=>{if(!a.status){d("请选择状态");return}i.value=!0;try{const o=await S.post("https://backend.qicai321.com/api/system/talent_pool/batch-update-status/",{ids:p.value.map(e=>e.id),status:a.status,tenant_id:f.get("tenant_id")},{headers:{authorization:"JWT "+f.get("token")}});o.data.code===2e3?(j("状态修改成功"),n.value=!1,V("success"),x.crudExpose.doRefresh()):d(o.data.message||"操作失败")}catch(o){console.error("批量修改状态失败:",o),d("操作失败")}finally{i.value=!1}};return b({open:y}),(o,e)=>{const u=l("el-option"),w=l("el-select"),C=l("el-form-item"),h=l("el-form"),m=l("el-button"),B=l("el-dialog");return E(),q(B,{modelValue:n.value,"onUpdate:modelValue":e[2]||(e[2]=r=>n.value=r),title:"批量修改状态",width:"500px","close-on-click-modal":!1,"close-on-press-escape":!1},{footer:s(()=>[M("span",R,[t(m,{onClick:e[1]||(e[1]=r=>n.value=!1)},{default:s(()=>e[3]||(e[3]=[_("取消")])),_:1}),t(m,{type:"primary",onClick:k,loading:i.value},{default:s(()=>e[4]||(e[4]=[_(" 确认 ")])),_:1},8,["loading"])])]),default:s(()=>[t(h,{model:a,"label-width":"100px"},{default:s(()=>[t(C,{label:"选择状态"},{default:s(()=>[t(w,{modelValue:a.status,"onUpdate:modelValue":e[0]||(e[0]=r=>a.status=r),placeholder:"请选择状态",style:{width:"100%"}},{default:s(()=>[t(u,{label:"试用期",value:"1"}),t(u,{label:"考察期",value:"2"}),t(u,{label:"在职",value:"3"}),t(u,{label:"已离职",value:"4"}),t(u,{label:"转入在外人才库",value:"6"})]),_:1},8,["modelValue"])]),_:1})]),_:1},8,["model"])]),_:1},8,["modelValue"])}}});export{$ as _};
