import{_ as e}from"./index.vue_vue_type_script_setup_true_lang.js?v=1763625242172";import{x as a}from"./page_layout.js?v=1763625242172";import{a as s}from"./public.js?v=1763625242172";import{i as l,r as t}from"./tools2.js?v=1763625242172";import{aC as o,aZ as i,dV as r,dP as n}from"./naive.js?v=1763625242172";import{k as p,P as u,r as c,e as m,R as _,S as f,X as d,a3 as v,U as x,V as g,j,a4 as k}from"./vue.js?v=1763625242172";import"./common.js?v=1763625242172";import"./__commonjsHelpers__.js?v=1763625242172";import"./rules.js?v=1763625242172";const b={class:"p-20px pt-24px pb-8px"},h={class:"w-260px"},w=p({__name:"clear",setup(p,{expose:w}){const{t:y}=u(),B=c(null),C=m({site:[]}),W={site:{trigger:["change"],validator:()=>0!==C.site.length||new Error(y("Waf.Block.index_27"))}},P=c([]),$=()=>{C.site=P.value.map((e=>e.value))},N=()=>{C.site=[]};return(async()=>{const{message:e}=await l();a(e)&&(P.value=e.map((e=>({label:e.siteName,value:e.siteName}))))})(),w({onConfirm:async()=>{var e;return await(null==(e=B.value)?void 0:e.validate()),s({title:y("Waf.Block.index_28"),content:y("Waf.Block.index_29"),onConfirm:async()=>{const e=C.site.length===P.value.length;await t({safe_logs:0,site_all:e?1:0,site_logs:C.site})}}),!1}}),(a,s)=>{const l=o,t=i,p=r,u=n,c=e;return _(),f("div",b,[d(c,{ref_key:"formRef",ref:B,model:g(C),rules:W},{default:v((()=>[d(u,{label:a.$t("Waf.Block.index_25"),path:"site"},{default:v((()=>[x("div",h,[d(p,{value:g(C).site,"onUpdate:value":s[0]||(s[0]=e=>g(C).site=e),options:g(P),multiple:!0,filterable:!0,"max-tag-count":"responsive",placeholder:a.$t("Waf.Block.index_27")},{header:v((()=>[d(t,{class:"w-full"},{default:v((()=>[d(l,{class:"flex-1",onClick:$},{default:v((()=>[j(k(a.$t("Public.All")),1)])),_:1}),d(l,{class:"flex-1",onClick:N},{default:v((()=>[j(k(a.$t("Public.Btn.Cancel")),1)])),_:1})])),_:1})])),_:1},8,["value","options","placeholder"])])])),_:1},8,["label"])])),_:1},8,["model"])])}}});export{w as default};
