const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["js/index220.js?v=1753954525509","js/index.vue_vue_type_script_setup_true_lang.js?v=1753954525509","js/naive.js?v=1753954525509","js/vue.js?v=1753954525509","js/__commonjsHelpers__.js?v=1753954525509","js/common.js?v=1753954525509","js/page_layout.js?v=1753954525509","js/public.js?v=1753954525509","css/public.css?v=1753954525509","css/page_layout.css?v=1753954525509","js/index.js?v=1753954525509","css/index99.css?v=1753954525509","js/index.vue_vue_type_script_setup_true_lang4.js?v=1753954525509","js/index.vue_vue_type_script_setup_true_lang7.js?v=1753954525509","css/index16.css?v=1753954525509","js/useModal3.js?v=1753954525509","css/index87.css?v=1753954525509"])))=>i.map(i=>d[i]);
import{v as e,i as a,w as t,a as s}from"./page_layout.js?v=1753954525509";import{_ as i}from"./index.js?v=1753954525509";import{_ as n}from"./index.vue_vue_type_script_setup_true_lang4.js?v=1753954525509";import{e as l,b as o,h as r,f as d}from"./public.js?v=1753954525509";import{u as c}from"./useModal3.js?v=1753954525509";import{c5 as p,cG as u,cD as _,ay as f}from"./naive.js?v=1753954525509";import{k as m,P as g,Q as b,U as w,a1 as x,a2 as W,j as y,a3 as h,X as A,_ as v}from"./vue.js?v=1753954525509";const j=()=>e.post("/plugin?action=a&name=btwaf&s=reg_domains"),k=t=>e.post("/plugin?action=a&name=btwaf&s=add_reg_tions",t,{requestOptions:{loading:a.global.t("Waf.Api.area_32"),successMessage:!0}}),O=t=>e.post("/plugin?action=a&name=btwaf&s=".concat(0===t.select?"edit_reg_tions":"edit_city"),{id:t.id,open:t.open,status:t.status},{requestOptions:{loading:a.global.t("Waf.Api.area_34"),successMessage:!0}}),M=m({__name:"index",setup(m){const j=v((()=>s((()=>import("./index220.js?v=1753954525509")),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16])))),{t:k}=g(),M=l(k("Waf.Area.index_1"),{onRefresh:()=>{z()}}),q=()=>{M.show=!0},{table:E,columns:P,setLoading:U}=o([{key:"region",title:k("Waf.Area.index_2"),minWidth:300,render:e=>Object.entries(e.region).filter((([,e])=>1==e)).map((([e])=>e)).join(", ")},{key:"open",title:k("Waf.Area.index_3"),minWidth:80,render:(e,a)=>b(p,{value:e.open,size:"small",onUpdateValue:async t=>{await O({select:e.select,id:a,open:t,status:e.status}),e.open=t}},null)},{key:"status",title:k("Waf.Area.index_4"),width:"14%",render:(e,a)=>b("div",{class:"w-210px"},[b(u,{value:e.status,size:"small",options:[{label:k("Waf.Area.index_5"),value:200},{label:k("Waf.Area.index_6"),value:404},{label:k("Waf.Area.index_7"),value:403},{label:k("Waf.Area.index_8"),value:444},{label:k("Waf.Area.index_9"),value:502},{label:k("Waf.Area.index_10"),value:503}],onUpdateValue:async t=>{await O({select:e.select,id:a,open:e.open,status:t}),e.status=t}},null)])},{key:"site",title:k("Waf.Area.index_11"),minWidth:260,render:e=>Object.entries(e.site).filter((([,e])=>1==e)).map((([e])=>"allsite"===e?k("Waf.Area.index_12"):e)).join(", ")},{key:"types",title:k("Waf.Area.index_13"),minWidth:90,render:e=>"refuse"===e.types?k("Waf.Area.index_15"):k("Waf.Area.index_14")},r({width:120,options:(t,s)=>[{label:k("Waf.Area.index_16"),onClick:()=>{c({path:"/www/server/btwaf/html/".concat(t.reqfile)})}},{label:k("Public.Btn.Del"),onClick:async()=>{var i;await(i={select:t.select,id:s},e.post("/plugin?action=a&name=btwaf&s=".concat(0===i.select?"del_reg_tions":"del_city"),{id:i.id},{requestOptions:{loading:a.global.t("Waf.Api.area_33"),successMessage:!0}})),z()}}]})]),z=async()=>{try{U(!0);const{message:a}=await e.post("/btwaf/get_reg_tions.json");t(a)&&(a.forEach(((e,a)=>{e.forEach((e=>{e.select=a}))})),E.data=a.reduce(((e,a)=>e.concat(a)),[]))}finally{U(!1)}};return z(),(e,a)=>{const t=f,s=d,l=n,o=i,r=_;return w(),x(r,{class:"p-16px"},{default:W((()=>[b(l,null,{toolsLeft:W((()=>[b(t,{type:"primary",onClick:q},{default:W((()=>[y(h(e.$t("Waf.Area.index_1")),1)])),_:1})])),table:W((()=>[b(s,{loading:A(E).loading,data:A(E).data,columns:A(P)},null,8,["loading","data","columns"])])),_:1}),b(o,{show:A(M).show,"onUpdate:show":a[0]||(a[0]=e=>A(M).show=e),title:A(M).title,data:A(M).data,width:720,"min-height":454,footer:!0,component:A(j)},null,8,["show","title","data","component"])])),_:1})}}}),q=Object.freeze(Object.defineProperty({__proto__:null,default:M},Symbol.toStringTag,{value:"Module"}));export{k as a,j as g,q as i};
