import{_ as a}from"./index.vue_vue_type_script_setup_true_lang.js?v=1753954525509";import{b0 as e,w as s,m as n}from"./page_layout.js?v=1753954525509";import{c as l}from"./public.js?v=1753954525509";import{g as o,o as t}from"./planned.js?v=1753954525509";import{k as r,P as i,r as u,U as p,V as d,Q as m,a2 as _,W as c,X as v,ah as f}from"./vue.js?v=1753954525509";import{cG as b,cA as g}from"./naive.js?v=1753954525509";import"./common.js?v=1753954525509";import"./__commonjsHelpers__.js?v=1753954525509";const j={class:"p-20px"},w={class:"w-150px"},x=r({__name:"batch",props:{data:{}},setup(r,{expose:x}){const{t:h}=i(),y=r,{rows:C}=y.data,P=e(),k=u(null),U=u([]),{loading:A,setLoading:E}=l();(async()=>{try{E(!0);const{message:a}=await o();s(a)&&a.length>0?(U.value=a.map((a=>({label:a.name,value:a.id}))),k.value=a[0].id):(k.value=null,U.value=[])}finally{E(!1)}})();return x({onConfirm:async({hide:a})=>{await t((()=>{if(null===k.value)throw n.error(h("Crontab.Planned.index_28")),new Error(h("Crontab.Planned.index_28"));return{id:k.value,crontab_ids:JSON.stringify(C.map((a=>a.id)))}})()),P.setRefresh(!0),a()}}),(e,s)=>{const n=b,l=g,o=a;return p(),d("div",j,[m(o,null,{default:_((()=>[m(l,{label:e.$t("Crontab.Planned.index_27"),"show-feedback":!1},{default:_((()=>[c("div",w,[m(n,{value:v(k),"onUpdate:value":s[0]||(s[0]=a=>f(k)?k.value=a:null),loading:v(A),options:v(U)},null,8,["value","loading","options"])])])),_:1},8,["label"])])),_:1})])}}});export{x as default};
