import{_ as S}from"./index.vue_vue_type_script_setup_true_lang-D8O2mMsP.js?v=1773287522785";import{n as b,m as x}from"./index-BTglIPU2.js?v=1773287522785";import{u as j}from"./useLoading-CZ2gSAW7.js?v=1773287522785";import{$ as k,a0 as C}from"./index.vue_vue_type_script_setup_true_lang-D182bQZ0.js?v=1773287522785";import{k as L,R as $,r as p,$ as B,Z as H,a0 as a,a9 as m,_ as N,S as n,X as R}from"./vue-core-DJjvd5ZC.js?v=1773287522785";import{a1 as T,a6 as E}from"./naive-ui--dJnpVcV.js?v=1773287522785";import"./prismjs-BZPoR7_J.js?v=1773287522785";import"./useTableColumns-DDeyYvje.js?v=1773287522785";import"./index-S15tYq5l.js?v=1773287522785";import"./copy-D-wIKr0q.js?v=1773287522785";import"./index-DIKmrNCq.js?v=1773287522785";import"./index.vue_vue_type_script_setup_true_lang-DeTfbeeM.js?v=1773287522785";import"./index-Cg6fMjw6.js?v=1773287522785";import"./useTableData-BmkIKQ_R.js?v=1773287522785";const O={class:"p-20px"},V={class:"w-150px"},ee=L({__name:"batch",props:{data:{}},setup(_,{expose:c}){const u=_,{t:i}=$(),{siteType:r,ids:d,onRefresh:f}=u.data,t=p(null),s=p([]),{loading:g,setLoading:l}=j();(async()=>{try{l(!0);const{message:e}=await k({project_type:r});b(e)&&e.length>0?(s.value=e.map(o=>({label:o.name,value:o.id})),t.value=e[0].id):(t.value=null,s.value=[])}finally{l(!1)}})();const v=()=>{if(t.value===null)throw x.error(i("Site.PHP.add_site_46")),new Error(i("Site.PHP.add_site_46"));return{id:t.value,site_ids:JSON.stringify(d),project_type:r}};return c({onConfirm:async({hide:e})=>{await C(v()),f(),e()}}),(e,o)=>{const y=E,P=T,h=S;return B(),H("div",O,[a(h,null,{default:m(()=>[a(P,{label:e.$t("Site.PHP.add_site_22"),"show-feedback":!1},{default:m(()=>[N("div",V,[a(y,{value:n(t),"onUpdate:value":o[0]||(o[0]=w=>R(t)?t.value=w:null),loading:n(g),options:n(s)},null,8,["value","loading","options"])])]),_:1},8,["label"])]),_:1})])}}});export{ee as default};
