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