import{o as n,c as m,w as c,u as s,g as a,h as u,a as o,b as l,f as r,D as p,t as _,F as k,i as C}from"./app-BYcXwl4U.js";import{P as g}from"./app-Doj30F-n.js";import{i as v,c as P}from"./app-a6cKceqE.js";import{_ as f}from"./app-DwtlHtUX.js";import{T as V}from"./app-CrjU8lgK.js";import"./app-Ceh-tphd.js";import"./app-BHl80pFw.js";import"./app-BG60hdvp.js";function y(){v(this),this.isCheckingAll=!1,this.countSelectedProvinces=this.provinces.$count(function(t,e){return e.isChecked}),this.selectProvince=function(t){this.change()},this.deselectProvince=function(t){t.isChecked=!1,this.change()},this.checkAll=function(){let t=this;this.provinces.forEach(function(e){e.isChecked=t.isCheckingAll}),this.change()},this.change=function(){},this.submit=function(){let t=[];this.provinces.forEach(function(e){e.isChecked&&t.push(e)}),this.$NotifyPopup({code:200,data:{selectedProvinces:t}})}}const x={key:0},b={key:1},A={class:"ui table"},w={class:"h-10 relative"},B={class:"absolute right-1 top-1"},N={class:"grid grid-cols-4 gap-3.5"},$=o("div",{class:"clear"},null,-1),j={__name:"selectProvincesPopup",setup(t){const e=P(new y);return(E,h)=>(n(),m(g,null,{default:c(()=>[s(e).type=="allow"?(n(),a("header",x,"选择允许的省份")):u("",!0),s(e).type=="deny"?(n(),a("header",b,"选择封禁的省份")):u("",!0),o("form",null,[o("table",A,[o("tr",null,[o("td",null,[o("div",w,[o("div",B,[l(f,{modelValue:s(e).isCheckingAll,"onUpdate:modelValue":h[0]||(h[0]=i=>s(e).isCheckingAll=i),onChange:s(e).checkAll},{default:c(()=>[r("全选")]),_:1},8,["modelValue","onChange"])])]),o("div",N,[(n(!0),a(k,null,p(s(e).provinces,i=>(n(),a("div",null,[l(f,{modelValue:i.isChecked,"onUpdate:modelValue":d=>i.isChecked=d,onChange:d=>s(e).selectProvince(i)},{default:c(()=>[r(_(i.name),1)]),_:2},1032,["modelValue","onUpdate:modelValue","onChange"])]))),256))]),$])])]),l(V,{type:"button",onClick:C(s(e).submit,["prevent"])},{default:c(()=>[r("确定")]),_:1},8,["onClick"])])]),_:1}))}};export{j as default};
