import{_ as a}from"./index.vue_vue_type_script_setup_true_lang.js?v=1749179669910";import{cs as s,N as e,m as t}from"./page_layout.js?v=1749179669910";import{d as l}from"./public.js?v=1749179669910";import{c as o,b1 as i}from"./site.js?v=1749179669910";import{d as r,O as n,r as u,R as d,S as p,P as m,a1 as _,U as c,V as v,aj as f}from"./vue.js?v=1749179669910";import{cp as j,cj as g}from"./naive.js?v=1749179669910";import"./common.js?v=1749179669910";import"./__commonjsHelpers__.js?v=1749179669910";const b={class:"p-20px"},w={class:"w-150px"},P=r({__name:"batch",props:{data:{}},setup(r,{expose:P}){const{t:h}=n(),y=r,{rows:x}=y.data,H=s(),S=u(null),R=u([]),{loading:U,setLoading:k}=l();(async()=>{try{k(!0);const{message:a}=await o();e(a)&&a.length>0?(R.value=a.map((a=>({label:a.name,value:a.id}))),S.value=a[0].id):(S.value=null,R.value=[])}finally{k(!1)}})();return P({onConfirm:async({hide:a})=>{await i((()=>{if(null===S.value)throw t.error(h("Site.PHP.add_site_46")),new Error(h("Site.PHP.add_site_46"));return{id:S.value,site_ids:x.map((a=>a.id))}})()),H.setRefresh(!0),a()}}),(s,e)=>{const t=j,l=g,o=a;return d(),p("div",b,[m(o,null,{default:_((()=>[m(l,{label:s.$t("Site.PHP.add_site_22"),"show-feedback":!1},{default:_((()=>[c("div",w,[m(t,{value:v(S),"onUpdate:value":e[0]||(e[0]=a=>f(S)?S.value=a:null),loading:v(U),options:v(R)},null,8,["value","loading","options"])])])),_:1},8,["label"])])),_:1})])}}});export{P as default};
