const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["js/index228.js?v=1763625242172","js/index.vue_vue_type_script_setup_true_lang.js?v=1763625242172","js/vue.js?v=1763625242172","js/__commonjsHelpers__.js?v=1763625242172","js/naive.js?v=1763625242172","js/common.js?v=1763625242172","js/page_layout.js?v=1763625242172","js/public.js?v=1763625242172","css/public.css?v=1763625242172","css/page_layout.css?v=1763625242172","js/index.js?v=1763625242172","css/index110.css?v=1763625242172","js/index.vue_vue_type_script_setup_true_lang5.js?v=1763625242172","js/index.vue_vue_type_script_setup_true_lang6.js?v=1763625242172","css/index15.css?v=1763625242172","js/useModal3.js?v=1763625242172","css/index96.css?v=1763625242172"])))=>i.map(i=>d[i]);
import{bf as e,i as a,x as t,a as s}from"./page_layout.js?v=1763625242172";import{_ as i}from"./index.js?v=1763625242172";import{_ as n}from"./index.vue_vue_type_script_setup_true_lang5.js?v=1763625242172";import{e as l,c as o,f as r,h as d}from"./public.js?v=1763625242172";import{u as c}from"./useModal3.js?v=1763625242172";import{dj as p,dV as u,dS as _,aC as f}from"./naive.js?v=1763625242172";import{k as m,P as g,X as b,R as x,a2 as W,a3 as w,j as h,a4 as y,V as A,_ as j}from"./vue.js?v=1763625242172";const v=()=>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 v=j((()=>s((()=>import("./index228.js?v=1763625242172")),__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:()=>{P()}}),V=()=>{M.show=!0},{table:q,columns:C,setLoading:E}=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}})),P()}}]})]),P=async()=>{try{E(!0);const{message:a}=await e.post("/btwaf/get_reg_tions.json");t(a)&&(a.forEach(((e,a)=>{e.forEach((e=>{e.select=a}))})),q.data=a.reduce(((e,a)=>e.concat(a)),[]))}finally{E(!1)}};return P(),(e,a)=>{const t=f,s=d,l=n,o=i,r=_;return x(),W(r,{class:"p-16px"},{default:w((()=>[b(l,null,{toolsLeft:w((()=>[b(t,{type:"primary",onClick:V},{default:w((()=>[h(y(e.$t("Waf.Area.index_1")),1)])),_:1})])),table:w((()=>[b(s,{loading:A(q).loading,data:A(q).data,columns:A(C)},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(v)},null,8,["show","title","data","component"])])),_:1})}}}),V=Object.freeze(Object.defineProperty({__proto__:null,default:M},Symbol.toStringTag,{value:"Module"}));export{k as a,v as g,V as i};
