← Back
Editing: batch.js
import{_ as a}from"./index.vue_vue_type_script_setup_true_lang.js?v=1753755607904";import{b0 as e,w as s,m as n}from"./page_layout.js?v=1753755607904";import{c as l}from"./public.js?v=1753755607904";import{g as o,o as t}from"./planned.js?v=1753755607904";import{k as r,P as i,r as u,U as p,X as d,Q as m,a2 as _,V as c,W as v,ah as f}from"./vue.js?v=1753755607904";import{cC as b,cG as g}from"./naive.js?v=1753755607904";import"./common.js?v=1753755607904";import"./__commonjsHelpers__.js?v=1753755607904";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:E,setLoading:G}=l();(async()=>{try{G(!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{G(!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=g,l=b,o=a;return d(),p("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(E),options:v(U)},null,8,["value","loading","options"])])])),_:1},8,["label"])])),_:1})])}}});export{x as default};
Save File
Cancel