var U=Object.defineProperty,q=Object.defineProperties;var z=Object.getOwnPropertyDescriptors;var D=Object.getOwnPropertySymbols;var G=Object.prototype.hasOwnProperty,K=Object.prototype.propertyIsEnumerable;var V=(s,l,a)=>l in s?U(s,l,{enumerable:!0,configurable:!0,writable:!0,value:a}):s[l]=a,k=(s,l)=>{for(var a in l||(l={}))G.call(l,a)&&V(s,a,l[a]);if(D)for(var a of D(l))K.call(l,a)&&V(s,a,l[a]);return s},x=(s,l)=>q(s,z(l));var P=(s,l,a)=>new Promise((O,b)=>{var j=f=>{try{c(a.next(f))}catch(i){b(i)}},p=f=>{try{c(a.throw(f))}catch(i){b(i)}},c=f=>f.done?O(f.value):Promise.resolve(f.value).then(j,p);c((a=a.apply(s,l)).next())});import{_ as Y,d as $,H as F,u as H,b as M,r as N,N as W,f as _,g as Q,K as X,m as d,i as S,l as n,p as h,a5 as L}from"./index.9fabe127.js";import{p as Z}from"./evaluationPlan.fa509821.js";const ee={class:"search mb-16"},ae={class:"dialog-footer"},te=$({name:"planProjectDialog"}),le=Object.assign(te,{props:{visible:{type:Boolean,default:!1,required:!0},data:{type:Array,default:void 0},params:{type:Object,default:()=>({})},templateTypeListData:{type:Array,default:void 0}},emits:["close","getProjectData"],setup(s,{emit:l}){const{projectTypeOptions:a}=F.dictStore.globalDicts||{},O=H(),b=s,j=l,p=M({projectName:void 0,buildOrgName:void 0}),c=N(),f=[{type:"selection",reserveSelection:!0,width:"55"},{label:"\u9879\u76EE\u540D\u79F0",key:"projectName",prop:"projectName",minWidth:"200",showOverflowTooltip:!0},{label:"\u9884\u7B97\u5E74\u5EA6",key:"projectYear",prop:"projectYear",width:80},{label:"\u9879\u76EE\u91D1\u989D",key:"declareAmount",prop:"declareAmount"},{label:"\u7533\u62A5\u5355\u4F4D",key:"buildOrgName",prop:"buildOrgName"},{label:"\u9879\u76EE\u7C7B\u578B",key:"projectType",prop:"projectType",render:r=>L("span",a[r.projectType]||"-"),width:80},{label:"\u6A21\u677F\u7C7B\u578B",key:"templateType",prop:"templateType",render:r=>{var e,t;return L("span",((t=(e=b.templateTypeListData)==null?void 0:e.find(o=>o.id===r.templateType))==null?void 0:t.name)||"-")}}],i=N([]),T=N(0),y=(...t)=>P(this,[...t],function*(r=(e=>(e=c.value)==null?void 0:e.pageParams)()){const o=yield Z(x(k(k({},r),p),{appraisalId:O.query.appraisalId}));i.value=o.data.records,T.value=o.data.total,p.projectName&&(i.value=i.value.filter(u=>u.projectName.indexOf(p.projectName)!==-1)),p.buildOrgName&&(i.value=i.value.filter(u=>u.buildOrgName.indexOf(p.buildOrgName)!==-1));const m=JSON.parse(JSON.stringify(g.value))||[];m!=null&&m.length&&i.value&&i.value.forEach(u=>{(m==null?void 0:m.map(C=>C.projectCode)).includes(u.projectCode)&&c.value.toggleRowSelect(u,!0)})}),A=()=>{c.value.pageParams.pageNumber=1,y()},B=()=>{p.projectName=void 0,p.buildOrgName=void 0,c.value.pageParams.pageNumber=1,c.value.pageParams.pageSize=10,y()},g=N([]),I=r=>{const e=r==null?void 0:r.map(t=>t.projectCode);i.value.forEach(t=>{e.includes(t.projectCode)?g.value.push(t):g.value=g.value.filter(o=>o.projectCode!==t.projectCode)})},R=()=>{const r={},e=g.value.reduce((t,o)=>(r[o.projectCode]||(r[o.projectCode]=t.push(o)),t),[]);j("getProjectData",e)};return W(()=>b.visible,r=>P(this,null,function*(){var e,t;r&&((e=b.data)!=null&&e.length&&(g.value=(t=b.data)==null?void 0:t.map(o=>o),console.log(g.value)),y())})),(r,e)=>{const t=_("el-input"),o=_("el-form-item"),m=_("el-col"),u=_("el-button"),w=_("el-row"),C=_("el-form"),E=_("table-list"),J=_("el-dialog");return Q(),X(J,{"model-value":s.visible,title:"\u6DFB\u52A0\u9879\u76EE",width:"70%","destroy-on-close":"",onClose:e[3]||(e[3]=v=>j("close"))},{footer:d(()=>[S("span",ae,[n(u,{onClick:e[2]||(e[2]=v=>j("close"))},{default:d(()=>[h("\u5173\u95ED")]),_:1}),n(u,{type:"primary",onClick:R},{default:d(()=>[h(" \u786E\u5B9A ")]),_:1})])]),default:d(()=>[S("div",ee,[n(C,{"label-suffix":":",model:p,size:"small"},{default:d(()=>[n(w,{gutter:16},{default:d(()=>[n(m,{span:8},{default:d(()=>[n(o,{label:"\u9879\u76EE\u540D\u79F0"},{default:d(()=>[n(t,{modelValue:p.projectName,"onUpdate:modelValue":e[0]||(e[0]=v=>p.projectName=v),placeholder:"\u8BF7\u8F93\u5165"},null,8,["modelValue"])]),_:1})]),_:1}),n(m,{span:8},{default:d(()=>[n(o,{label:"\u7533\u62A5\u5355\u4F4D"},{default:d(()=>[n(t,{modelValue:p.buildOrgName,"onUpdate:modelValue":e[1]||(e[1]=v=>p.buildOrgName=v),placeholder:"\u8BF7\u8F93\u5165"},null,8,["modelValue"])]),_:1})]),_:1}),n(m,{span:8},{default:d(()=>[n(o,{class:"btn"},{default:d(()=>[n(u,{type:"primary",onClick:A},{default:d(()=>[h("\u67E5\u8BE2")]),_:1}),n(u,{onClick:B},{default:d(()=>[h("\u91CD\u7F6E")]),_:1})]),_:1})]),_:1})]),_:1})]),_:1},8,["model"])]),n(E,{ref_key:"tableListRef",ref:c,column:f,data:i.value,"row-key":"projectCode",total:T.value,onSelectionChange:I,onGetTableData:y},null,8,["data","total"])]),_:1},8,["model-value"])}}}),se=Y(le,[["__file","/Users/chenlixin/Documents/work/NDKJ/MyProject/ls-project-v2.0/src/pages/performanceEvaluation/evaluationPlan/projectGroup/components/planProjectDialog.vue"]]);export{se as default};
