import{_ as w}from"./index.vue_vue_type_script_setup_true_lang-D8O2mMsP.js?v=1773287522785";import{n as x,m as h}from"./index-BTglIPU2.js?v=1773287522785";import{u as L}from"./useLoading-CZ2gSAW7.js?v=1773287522785";import{u as k}from"./index-Cg6fMjw6.js?v=1773287522785";import{g as P,p as B}from"./planned-URJGV2nd.js?v=1773287522785";import{k as N,R,r as i,$ as S,Z as $,a0 as t,a9 as c,_ as E,S as s,X as O}from"./vue-core-DJjvd5ZC.js?v=1773287522785";import{a1 as V,a6 as A}from"./naive-ui--dJnpVcV.js?v=1773287522785";import"./prismjs-BZPoR7_J.js?v=1773287522785";const I={class:"p-20px"},J={class:"w-150px"},K=N({__name:"batch",props:{data:{}},setup(m,{expose:u}){const{t:r}=R(),_=m,{rows:p}=_.data,d=k(),a=i(null),n=i([]),{loading:f,setLoading:l}=L();(async()=>{try{l(!0);const{message:e}=await P();x(e)&&e.length>0?(n.value=e.map(o=>({label:o.name,value:o.id})),a.value=e[0].id):(a.value=null,n.value=[])}finally{l(!1)}})();const g=()=>{if(a.value===null)throw h.error(r("Crontab.Planned.index_28")),new Error(r("Crontab.Planned.index_28"));return{id:a.value,crontab_ids:JSON.stringify(p.map(e=>e.id))}};return u({onConfirm:async({hide:e})=>{await B(g()),d.setRefresh(!0),e()}}),(e,o)=>{const v=A,b=V,y=w;return S(),$("div",I,[t(y,null,{default:c(()=>[t(b,{label:e.$t("Crontab.Planned.index_27"),"show-feedback":!1},{default:c(()=>[E("div",J,[t(v,{value:s(a),"onUpdate:value":o[0]||(o[0]=C=>O(a)?a.value=C:null),loading:s(f),options:s(n)},null,8,["value","loading","options"])])]),_:1},8,["label"])]),_:1})])}}});export{K as default};
