import{g as N}from"./reviewMeeting.73395d83.js";import{d as D,D as O,r as p,b as C,L as S,c as f,e as L,I as x,i as s,h as y,j as v,t as A,u as P,N as B}from"./index.5bb861d3.js";const I=D({name:"driverDialog"}),E=Object.assign(I,{props:{visible:{type:Boolean,default:!1,required:!0},data:{type:Array,default:void 0},meetingType:{type:String,default:"1"},dictionaryList:{type:Array,default:void 0}},emits:["close","getProjectData"],setup(g,{emit:_}){const{projectTypeOptions:j}=O.dictStore.globalDicts||{},r=g,u=_,m=p(),b=p(0),w=C([{type:"selection",width:"50"},{label:"\u9879\u76EE\u540D\u79F0",key:"projectName",prop:"projectName",minWidth:"150",showOverflowTooltip:!0},{label:"\u7533\u62A5\u5355\u4F4D",key:"buildOrg",prop:"buildOrg",minWidth:"120",showOverflowTooltip:!0},{label:"\u9879\u76EE\u7C7B\u578B",slot:"projectTypeName",prop:"projectTypeName",width:"100"},{label:"\u7533\u62A5\u91D1\u989D",key:"declaredAmount",prop:"declaredAmount",width:"100"},{label:"\u9884\u7B97\u5E74\u5EA6",key:"projectYear",prop:"projectYear",width:"80"}]),i=p([]),h=async(o=(t=>(t=m.value)==null?void 0:t.pageParams)())=>{const e=await N({meetingType:r.meetingType,...o});b.value=e.data.total,i.value=e.data.records||[],await B();const a=JSON.parse(JSON.stringify(l.value))||[];a!=null&&a.length&&i.value&&i.value.forEach(n=>{a.map(c=>c.id*1).includes(n.id)&&m.value.toggleRowSelect(n,!0)})},l=p([]),T=o=>{const t=o.map(e=>e.id);i.value.forEach(e=>{t.includes(e.id)?l.value.push(e):l.value=l.value.filter(a=>a.id!==e.id)})},k=()=>{const o={},t=l.value.reduce((e,a)=>(o[a.id]||(o[a.id]=e.push(a)),e),[]);u("getProjectData",t)};return S(()=>r.visible,async o=>{var t;o&&((t=r.data)!=null&&t.length&&(l.value=r.data.map(e=>e)),h())}),(o,t)=>{const e=f("table-list"),a=f("el-button"),n=f("el-dialog");return L(),x(n,{"model-value":g.visible,title:"\u6DFB\u52A0\u9879\u76EE",width:"840px","destroy-on-close":"",onClose:t[1]||(t[1]=d=>u("close"))},{footer:s(()=>[y(a,{type:"primary",size:"small",onClick:k},{default:s(()=>[v(" \u786E\u5B9A ")]),_:1}),y(a,{size:"small",onClick:t[0]||(t[0]=d=>u("close"))},{default:s(()=>[v(" \u5173\u95ED ")]),_:1})]),default:s(()=>[y(e,{ref_key:"tableListRef",ref:m,column:w,data:i.value,total:b.value,"row-key":"id",onSelectionChange:T,onGetTableData:h},{projectTypeName:s(({scope:d})=>{var c;return[v(A(P(j)[(c=d.row)==null?void 0:c.projectType]),1)]}),_:1},8,["column","data","total"])]),_:1},8,["model-value"])}}});export{E as default};
