var J=Object.defineProperty,U=Object.defineProperties;var q=Object.getOwnPropertyDescriptors;var D=Object.getOwnPropertySymbols;var G=Object.prototype.hasOwnProperty,Y=Object.prototype.propertyIsEnumerable;var V=(s,o,a)=>o in s?J(s,o,{enumerable:!0,configurable:!0,writable:!0,value:a}):s[o]=a,C=(s,o)=>{for(var a in o||(o={}))G.call(o,a)&&V(s,a,o[a]);if(D)for(var a of D(o))Y.call(o,a)&&V(s,a,o[a]);return s},x=(s,o)=>U(s,q(o));var P=(s,o,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,o)).next())});import{_ as $,d as F,D as K,z as M,b as W,r as N,L as H,c as _,e as Q,I as X,j as d,g as S,i as n,k as h,a3 as L}from"./index.2939355b.js";import{p as Z}from"./evaluationPlan.4167cb46.js";const ee={class:"search mb-16"},ae={class:"dialog-footer"},te=F({name:"planProjectDialog"}),oe=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:o}){const{projectTypeOptions:a}=K.dictStore.globalDicts||{},O=M(),b=s,j=o,p=W({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(l=>l.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 l=yield Z(x(C(C({},r),p),{appraisalId:O.query.appraisalId}));i.value=l.data.records,T.value=l.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(k=>k.projectCode)).includes(u.projectCode)&&c.value.toggleRowSelect(u,!0)})}),I=()=>{c.value.pageParams.pageNumber=1,y()},A=()=>{p.projectName=void 0,p.buildOrgName=void 0,c.value.pageParams.pageNumber=1,c.value.pageParams.pageSize=10,y()},g=N([]),B=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(l=>l.projectCode!==t.projectCode)})},R=()=>{const r={},e=g.value.reduce((t,l)=>(r[l.projectCode]||(r[l.projectCode]=t.push(l)),t),[]);j("getProjectData",e)};return H(()=>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(l=>l),console.log(g.value)),y())})),(r,e)=>{const t=_("el-input"),l=_("el-form-item"),m=_("el-col"),u=_("el-button"),w=_("el-row"),k=_("el-form"),z=_("table-list"),E=_("el-dialog");return Q(),X(E,{"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(k,{"label-suffix":":",model:p,size:"small"},{default:d(()=>[n(w,{gutter:16},{default:d(()=>[n(m,{span:8},{default:d(()=>[n(l,{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(l,{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(l,{class:"btn"},{default:d(()=>[n(u,{type:"primary",onClick:I},{default:d(()=>[h("\u67E5\u8BE2")]),_:1}),n(u,{onClick:A},{default:d(()=>[h("\u91CD\u7F6E")]),_:1})]),_:1})]),_:1})]),_:1})]),_:1},8,["model"])]),n(z,{ref_key:"tableListRef",ref:c,column:f,data:i.value,"row-key":"projectCode",total:T.value,onSelectionChange:B,onGetTableData:y},null,8,["data","total"])]),_:1},8,["model-value"])}}}),se=$(oe,[["__file","/Users/chenlixin/Documents/work/NDKJ/MyProject/ls-project-v2.0/src/pages/performanceEvaluation/evaluationPlan/projectGroup/components/planProjectDialog.vue"]]);export{se as default};
