|
- import{g as N}from"./reviewMeeting-39e99ddc.js";import{E as C,r as c,a as D,B as O,b as f,c as S,L,h as s,f as y,i as v,t as x,u as A,k as B,C as P}from"./index-dd5fae99.js";const E=B({name:"driverDialog"}),I=Object.assign(E,{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:w}){const{projectTypeOptions:T}=C.dictStore.globalDicts||{},r=g,u=w,m=c(),b=c(0),h=D([{type:"selection",width:"50"},{label:"项目名称",key:"projectName",prop:"projectName",minWidth:"150",showOverflowTooltip:!0},{label:"申报单位",key:"buildOrg",prop:"buildOrg",minWidth:"120",showOverflowTooltip:!0},{label:"项目类型",slot:"projectTypeName",prop:"projectTypeName",width:"100"},{label:"申报金额",key:"declaredAmount",prop:"declaredAmount",width:"100"},{label:"预算年度",key:"projectYear",prop:"projectYear",width:"80"}]),i=c([]),j=async(o=(e=>(e=m.value)==null?void 0:e.pageParams)())=>{const t=await N({meetingType:r.meetingType,...o});b.value=t.data.total,i.value=t.data.records||[],await P();const a=JSON.parse(JSON.stringify(l.value))||[];a!=null&&a.length&&i.value&&i.value.forEach(n=>{a.map(p=>p.id*1).includes(n.id)&&m.value.toggleRowSelect(n,!0)})},l=c([]),k=o=>{const e=o.map(t=>t.id);i.value.forEach(t=>{e.includes(t.id)?l.value.push(t):l.value=l.value.filter(a=>a.id!==t.id)})},_=()=>{const o={},e=l.value.reduce((t,a)=>(o[a.id]||(o[a.id]=t.push(a)),t),[]);u("getProjectData",e)};return O(()=>r.visible,async o=>{var e;o&&((e=r.data)!=null&&e.length&&(l.value=r.data.map(t=>t)),j())}),(o,e)=>{const t=f("table-list"),a=f("el-button"),n=f("el-dialog");return S(),L(n,{"model-value":g.visible,title:"添加项目",width:"840px","destroy-on-close":"",onClose:e[1]||(e[1]=d=>u("close"))},{footer:s(()=>[y(a,{type:"primary",size:"small",onClick:_},{default:s(()=>e[2]||(e[2]=[v(" 确定 ")])),_:1}),y(a,{size:"small",onClick:e[0]||(e[0]=d=>u("close"))},{default:s(()=>e[3]||(e[3]=[v(" 关闭 ")])),_:1})]),default:s(()=>[y(t,{ref_key:"tableListRef",ref:m,column:h,data:i.value,total:b.value,"row-key":"id",onSelectionChange:k,onGetTableData:j},{projectTypeName:s(({scope:d})=>{var p;return[v(x(A(T)[(p=d.row)==null?void 0:p.projectType]),1)]}),_:1},8,["column","data","total"])]),_:1},8,["model-value"])}}});export{I as default};
|