var E=Object.defineProperty;var D=Object.getOwnPropertySymbols;var I=Object.prototype.hasOwnProperty,J=Object.prototype.propertyIsEnumerable;var x=(s,o,e)=>o in s?E(s,o,{enumerable:!0,configurable:!0,writable:!0,value:e}):s[o]=e,Y=(s,o)=>{for(var e in o||(o={}))I.call(o,e)&&x(s,e,o[e]);if(D)for(var e of D(o))J.call(o,e)&&x(s,e,o[e]);return s};var k=(s,o,e)=>new Promise((i,c)=>{var N=d=>{try{_(e.next(d))}catch(j){c(j)}},f=d=>{try{_(e.throw(d))}catch(j){c(j)}},_=d=>d.done?i(d.value):Promise.resolve(d.value).then(N,f);_((e=e.apply(s,o)).next())});import{_ as U,d as z,b as A,r as y,N as K,P as $,f as p,g as q,K as F,m as r,i as S,l,p as P}from"./index.9fabe127.js";import{l as G}from"./renewalProjectCapitalDeclare.73501f56.js";const M={class:"flex"},H={class:"flex justify-center"},Q=z({name:"relatedProjectDialog"}),W=Object.assign(Q,{props:{visible:{type:Boolean,default:!1,required:!0},data:Object,column:{type:Array,default:()=>[{type:"selection",reserveSelection:!0,width:"55",fixed:"left"},{label:"\u9879\u76EE\u540D\u79F0",prop:"projectName",key:"projectName"},{label:"\u9884\u7B97\u5E74\u5EA6",prop:"projectYear",key:"projectYear",width:80}]}},emits:["close","getProjectList"],setup(s,{emit:o}){const e=s,i=A({projectName:void 0,projectYear:void 0}),c=y(),N=y(0),f=y([]),_=(...a)=>k(this,[...a],function*(u=c.value.pageParams){var n;const t=yield G(Y(Y({},u),i));f.value=t.data.records,N.value=t.data.total,C.value=JSON.parse(JSON.stringify(b.value)),(n=C.value)!=null&&n.length&&f.value&&f.value.forEach(v=>{C.value.map(m=>m.id).includes(v.id)&&!c.value.getSelectRows().map(m=>m.id).includes(v.id)&&c.value.toggleRowSelect(v,!0)})}),d=()=>{c.value.pageParams.pageNumber=1,_()},j=()=>{i.projectName=void 0,i.projectYear=void 0,c.value.pageParams.pageNumber=1,c.value.pageParams.pageSize=10,_()},b=y([]),C=y([]),V=u=>{const a=u.map(t=>t.id);f.value.forEach(t=>{a.includes(t.id)?b.value.push(t):b.value=b.value.filter(n=>n.id!==t.id)})},R=()=>k(this,null,function*(){const u={},a=b.value.reduce((t,n)=>(u[n.id]||(u[n.id]=t.push(n)),t),[]);h("getProjectList",a),h("close",!0)}),h=o;return K(()=>e.visible,u=>k(this,null,function*(){var a;u?(yield $(),(a=e.data)!=null&&a.length&&(b.value=e.data.map(t=>({id:t.baseProjId,projectName:t.baseProjName,projectYear:t.baseProjSetYear}))),j()):c.value.tableRef.clearSelection()})),(u,a)=>{const t=p("el-input"),n=p("el-form-item"),v=p("el-col"),w=p("el-date-picker"),m=p("el-button"),L=p("el-row"),B=p("el-form"),O=p("table-list"),T=p("el-dialog");return q(),F(T,{"model-value":s.visible,title:"\u9009\u62E9\u9879\u76EE",width:840,onClose:a[3]||(a[3]=g=>h("close"))},{footer:r(()=>[S("div",H,[l(m,{type:"primary",onClick:R},{default:r(()=>[P("\u786E\u5B9A")]),_:1}),l(m,{onClick:a[2]||(a[2]=g=>h("close"))},{default:r(()=>[P("\u53D6\u6D88")]),_:1})])]),default:r(()=>[l(B,{model:i,"label-suffix":":",size:"small"},{default:r(()=>[l(L,{gutter:16},{default:r(()=>[l(v,{span:8},{default:r(()=>[l(n,{label:"\u9879\u76EE\u540D\u79F0"},{default:r(()=>[l(t,{modelValue:i.projectName,"onUpdate:modelValue":a[0]||(a[0]=g=>i.projectName=g),placeholder:"\u8BF7\u8F93\u5165"},null,8,["modelValue"])]),_:1})]),_:1}),l(v,{span:8},{default:r(()=>[l(n,{label:"\u9879\u76EE\u9884\u7B97\u5E74\u5EA6",prop:"projectYear"},{default:r(()=>[l(w,{modelValue:i.projectYear,"onUpdate:modelValue":a[1]||(a[1]=g=>i.projectYear=g),type:"year","value-format":"YYYY",placeholder:"\u8BF7\u9009\u62E9",style:{width:"100%"}},null,8,["modelValue"])]),_:1})]),_:1}),l(v,{span:8},{default:r(()=>[l(n,{class:"btn"},{default:r(()=>[S("div",M,[l(m,{type:"primary",onClick:d},{default:r(()=>[P("\u641C\u7D22")]),_:1}),l(m,{onClick:j},{default:r(()=>[P("\u91CD\u7F6E")]),_:1})])]),_:1})]),_:1})]),_:1})]),_:1},8,["model"]),l(O,{ref_key:"tableListRef",ref:c,column:s.column,data:f.value,total:N.value,"row-key":"id",onSelectionChange:V,onGetTableData:_},null,8,["column","data","total"])]),_:1},8,["model-value"])}}}),te=U(W,[["__file","/Users/chenlixin/Documents/work/NDKJ/MyProject/ls-project-v2.0/src/pages/projectCollection/projectCollectionEnter/components/relatedProjectDialog.vue"]]);export{te as default};
