import{u as T}from"./useTable-34acff72-1782572373740v=1.0.0.js";import{u as M}from"./useSelection-ba27a2e2-1782572373740v=1.0.0.js";import{g as J}from"./base-f440e6a9-1782572373740v=1.0.0.js";import{u as O,_ as j}from"./index-f6f689f9-1782572373740v=1.0.0.js";import{y as q,c as S,h as I,r as v,m as G,al as i,z as K,I as Q,J as o,R as d,u as t,B as y,P as W,O as F,k as X}from"./vendor-866bb149-1782572373740v=1.0.0.js";import"./notData-cef8761e-1782572373740v=1.0.0.js";import"./eleVendor-48a7d3b8-1782572373740v=1.0.0.js";const Y={class:"selected-list"},$={class:"left"},ee=q({__name:"ApplyUnitSelectDialog",props:{visible:{type:Boolean,default:!1},title:{default:"\u62A5\u540D\u5355\u4F4D"},loading:{type:Boolean,default:!1},value:{default:()=>({})},selectedIds:{default:()=>[]}},emits:["update:visible","update:value","submit","update:loading","update:selectedIds"],setup(x,{emit:D}){const s=x,f=D,m=S({get:()=>s.visible,set:a=>{f("update:visible",a)}});I(m,a=>{a&&h()}),O();const z=v([{prop:"collegeName",label:"\u540D\u79F0",search:{el:"input",placeholder:"\u8BF7\u8F93\u5165\u540D\u79F0"}}]),P=v([{prop:"checkbox",label:"\u9009\u62E9",type:"selection",width:50,fixed:"left"},{type:"index",label:"\u5E8F\u53F7",width:70,fixed:"left"},{label:"\u540D\u79F0",prop:"collegeName"}]),{isSelected:te,selectedList:c,selectedListIds:le,selectionChange:k}=M("collegeId"),B=S(()=>{var l,n;let a=(l=c.value)==null?void 0:l.map(u=>u.collegeId);return((n=Array.from(new Set(s.selectedIds.concat(a))))==null?void 0:n.length)||0}),r=v(),{tableData:_,pageable:p,baseParam:L,searchParam:R,totalParam:ae,pageParam:oe,handleSizeChange:w,handleCurrentChange:A,getTableList:h,search:H,reset:V,loading:U}=T(J);I([()=>s.selectedIds,()=>_.value],()=>{var e;s.selectedIds,c.value,(e=r.value)==null||e.element.getSelectionRows(),r.value;const a=c.value.map(l=>l.collegeId);_.value.forEach(l=>{var n,u;s.selectedIds.includes(l.collegeId)||a.includes(l.collegeId)?(n=r.value)==null||n.element.toggleRowSelection(l,!0):(u=r.value)==null||u.element.toggleRowSelection(l,!1)})},{immediate:!0,deep:!0});const b=()=>{f("update:visible",!1)},Z=()=>{c.value;let a=c.value.map(e=>e.collegeId);f("update:selectedIds",a),b()};return G(()=>{L.value.status=1,h()}),(a,e)=>{const l=i("HZSearchForm"),n=i("HZProTable"),u=i("el-pagination"),E=i("HZPageLayout"),C=i("el-button"),N=i("el-dialog");return K(),Q(N,{modelValue:t(m),"onUpdate:modelValue":e[2]||(e[2]=g=>X(m)?m.value=g:null),width:"1000px",title:s.title,"before-close":b},{default:o(()=>[d(E,{isCard:!1},{searchForm:o(()=>[d(l,{"search-param":t(R),columns:t(z),search:t(H),reset:t(V),searchCol:3},null,8,["search-param","columns","search","reset"])]),pagination:o(()=>[y("div",Y,[y("div",$,"\u5DF2\u9009\u62E9\uFF1A"+W(t(B))+"\u6761",1),d(u,{"current-page":t(p).page,"onUpdate:currentPage":e[0]||(e[0]=g=>t(p).page=g),"page-size":t(p).size,"onUpdate:pageSize":e[1]||(e[1]=g=>t(p).size=g),"page-sizes":[10,20,50,100],background:"",layout:"total, sizes, prev, pager, next",total:t(p).count,onSizeChange:t(w),onCurrentChange:t(A)},null,8,["current-page","page-size","total","onSizeChange","onCurrentChange"])])]),default:o(()=>[d(n,{columns:t(P),data:t(_),isFlex:!1,loading:t(U),showColSet:!1,"row-key":"collegeId",ref_key:"tableRef",ref:r,onSelectionChange:t(k)},{tableHeader:o(()=>e[3]||(e[3]=[])),toolButton:o(()=>e[4]||(e[4]=[])),_:1},8,["columns","data","loading","onSelectionChange"])]),_:1})]),footer:o(()=>[d(C,{onClick:b},{default:o(()=>e[5]||(e[5]=[F("\u53D6\u6D88",-1)])),_:1,__:[5]}),d(C,{type:"primary",onClick:Z,loading:s.loading},{default:o(()=>e[6]||(e[6]=[F("\u786E\u5B9A",-1)])),_:1,__:[6]},8,["loading"])]),_:1},8,["modelValue","title"])}}});const pe=j(ee,[["__scopeId","data-v-90d8a881"]]);export{pe as default};
