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