import{_ as a}from"./index.vue_vue_type_script_setup_true_lang.js?v=1764830988434";import{aK as e,x as s,m as n}from"./page_layout.js?v=1764830988434";import{d as l}from"./public.js?v=1764830988434";import{g as o,o as t}from"./planned.js?v=1764830988434";import{k as r,P as i,r as u,R as d,V as p,W as m,a3 as _,S as v,U as c,ak as f}from"./vue.js?v=1764830988434";import{dR as b,dV as g}from"./naive.js?v=1764830988434";import"./common.js?v=1764830988434";import"./__commonjsHelpers__.js?v=1764830988434";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:C}=h.data,P=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(C.map(a=>a.id))}})()),P.setRefresh(!0),a()}}),(e,s)=>{const n=g,l=b,o=a;return p(),d("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};
