const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["js/index-6wB36Gdh.js?v=1773287522785","js/index.vue_vue_type_script_setup_true_lang-D8O2mMsP.js?v=1773287522785","js/vue-core-DJjvd5ZC.js?v=1773287522785","js/prismjs-BZPoR7_J.js?v=1773287522785","css/prismjs-D-3FhBe_.css?v=1773287522785","js/naive-ui--dJnpVcV.js?v=1773287522785","js/index-BTglIPU2.js?v=1773287522785","css/index-DEM1fxGq.css?v=1773287522785","js/useLoading-CZ2gSAW7.js?v=1773287522785","js/index.vue_vue_type_script_setup_true_lang-DgjjuUjT.js?v=1773287522785","js/index.vue_vue_type_script_setup_true_lang-B7YvCBmY.js?v=1773287522785","css/index-CVIzYRIt.css?v=1773287522785","js/index.vue_vue_type_script_setup_true_lang-BeO8Hyma.js?v=1773287522785","js/data-BVsViUMm.js?v=1773287522785","js/useTableColumns-DDeyYvje.js?v=1773287522785","js/index-S15tYq5l.js?v=1773287522785","js/copy-D-wIKr0q.js?v=1773287522785","js/index-DIKmrNCq.js?v=1773287522785","js/index.vue_vue_type_script_setup_true_lang-DeTfbeeM.js?v=1773287522785","js/index-Cg6fMjw6.js?v=1773287522785","js/useTableData-BmkIKQ_R.js?v=1773287522785","js/useModal-ClQf9xpZ.js?v=1773287522785","css/index-BsQqmDnM.css?v=1773287522785"])))=>i.map(i=>d[i]);
import{as as r,a3 as p,v as w,n as v,x as k,P as j}from"./index-BTglIPU2.js?v=1773287522785";import{_ as O}from"./index.vue_vue_type_script_setup_true_lang-DgjjuUjT.js?v=1773287522785";import{_ as $}from"./index.vue_vue_type_script_setup_true_lang-BeO8Hyma.js?v=1773287522785";import{u as C}from"./useTableColumns-DDeyYvje.js?v=1773287522785";import{u as L}from"./useTableData-BmkIKQ_R.js?v=1773287522785";import{u as M}from"./useModal-ClQf9xpZ.js?v=1773287522785";import{a8 as S,a6 as q,B,a2 as D}from"./naive-ui--dJnpVcV.js?v=1773287522785";import{k as P,R as V,a0 as i,$ as E,a8 as R,a9 as _,S as o,j as T,aa as z,a3 as U}from"./vue-core-DJjvd5ZC.js?v=1773287522785";const I=()=>r.post("/btwaf/get_reg_tions.json"),ee=()=>r.post("/plugin?action=a&name=btwaf&s=reg_domains"),te=s=>r.post("/plugin?action=a&name=btwaf&s=add_reg_tions",s,{requestOptions:{loading:p.global.t("Waf.Api.area_32"),successMessage:!0}}),N=s=>r.post("/plugin?action=a&name=btwaf&s=".concat(s.select===0?"del_reg_tions":"del_city"),{id:s.id},{requestOptions:{loading:p.global.t("Waf.Api.area_33"),successMessage:!0}}),m=s=>r.post("/plugin?action=a&name=btwaf&s=".concat(s.select===0?"edit_reg_tions":"edit_city"),{id:s.id,open:s.open,status:s.status},{requestOptions:{loading:p.global.t("Waf.Api.area_34"),successMessage:!0}}),F=P({__name:"index",setup(s){const g=U(()=>j(()=>import("./index-6wB36Gdh.js?v=1773287522785"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22]))),{t:a}=V(),l=w(a("Waf.Area.index_1"),{onRefresh:()=>{d()}}),b=()=>{l.show=!0},{table:c,columns:A,setLoading:f}=L([{key:"region",title:a("Waf.Area.index_2"),minWidth:300,render:e=>Object.entries(e.region).filter(([,t])=>t==1).map(([t])=>t).join(", ")},{key:"open",title:a("Waf.Area.index_3"),minWidth:80,render:(e,t)=>i(S,{value:e.open,size:"small",onUpdateValue:async n=>{await m({select:e.select,id:t,open:n,status:e.status}),e.open=n}},null)},{key:"status",title:a("Waf.Area.index_4"),width:"14%",render:(e,t)=>i("div",{class:"w-210px"},[i(q,{value:e.status,size:"small",options:[{label:a("Waf.Area.index_5"),value:200},{label:a("Waf.Area.index_6"),value:404},{label:a("Waf.Area.index_7"),value:403},{label:a("Waf.Area.index_8"),value:444},{label:a("Waf.Area.index_9"),value:502},{label:a("Waf.Area.index_10"),value:503}],onUpdateValue:async n=>{await m({select:e.select,id:t,open:e.open,status:n}),e.status=n}},null)])},{key:"site",title:a("Waf.Area.index_11"),minWidth:260,render:e=>Object.entries(e.site).filter(([,t])=>t==1).map(([t])=>t==="allsite"?a("Waf.Area.index_12"):t).join(", ")},{key:"types",title:a("Waf.Area.index_13"),minWidth:90,render:e=>e.types==="refuse"?a("Waf.Area.index_15"):a("Waf.Area.index_14")},C({width:120,options:(e,t)=>[{label:a("Waf.Area.index_16"),onClick:()=>{M({path:"/www/server/btwaf/html/".concat(e.reqfile)})}},{label:a("Public.Btn.Del"),onClick:async()=>{await N({select:e.select,id:t}),d()}}]})]),d=async()=>{try{f(!0);const{message:e}=await I();v(e)&&(e.forEach((t,n)=>{t.forEach(u=>{u.select=n})}),c.data=e.reduce((t,n)=>t.concat(n),[]))}finally{f(!1)}};return d(),(e,t)=>{const n=B,u=$,x=O,W=k,y=D;return E(),R(y,{class:"p-16px"},{default:_(()=>[i(x,null,{toolsLeft:_(()=>[i(n,{type:"primary",onClick:b},{default:_(()=>[T(z(e.$t("Waf.Area.index_1")),1)]),_:1})]),table:_(()=>[i(u,{loading:o(c).loading,data:o(c).data,columns:o(A)},null,8,["loading","data","columns"])]),_:1}),i(W,{show:o(l).show,"onUpdate:show":t[0]||(t[0]=h=>o(l).show=h),title:o(l).title,data:o(l).data,width:720,"min-height":454,footer:!0,component:o(g)},null,8,["show","title","data","component"])]),_:1})}}}),ae=Object.freeze(Object.defineProperty({__proto__:null,default:F},Symbol.toStringTag,{value:"Module"}));export{te as a,ee as g,ae as i};
