|
- import{f as F}from"./evaluationPlan-d9bddf0a.js";import{E as L,a as E,r as i,B as P,b as o,a3 as U,c as K,L as R,h as m,e as g,f as r,i as V,j as z,w as J,k as Y,$ as w}from"./index-dd5fae99.js";const q={class:"max-h-[500px] overflow-y-auto"},G={class:"dialog-footer"},W=Y({name:"projectListDialog"}),te=Object.assign(W,{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(v,{emit:C}){const{projectTypeOptions:k}=L.dictStore.globalDicts||{},c=v,f=C,s=E({projectName:void 0,buildOrg:void 0,projectKind:"1"}),u=i(),y=i(0),T=[{type:"selection",reserveSelection:!0,width:"55"},{label:"项目名称",key:"projectName",prop:"projectName",minWidth:"200",showOverflowTooltip:!0},{label:"预算年度",key:"projectYear",prop:"projectYear",width:80},{label:"项目金额",key:"declareAmount",prop:"declareAmount"},{label:"申报单位",key:"buildOrgName",prop:"buildOrgName"},{label:"项目类型",key:"projectType",prop:"projectType",render:t=>w("span",k[t.projectType]||"-"),width:80},{label:"模板类型",key:"templateType",prop:"templateType",render:t=>{var e,a;return w("span",((a=(e=c.templateTypeListData)==null?void 0:e.find(l=>l.id===t.templateType))==null?void 0:a.name)||"-")}}],d=i([]),b=i(!1),_=async()=>{b.value=!0;const t=await F({...s,...c.params});y.value=t.data.total,d.value=t.data||[];const e=JSON.parse(JSON.stringify(n.value))||[];e!=null&&e.length&&d.value&&d.value.forEach(a=>{e.map(j=>j.projectId).includes(a.projectId)&&u.value.toggleRowSelect(a,!0)}),b.value=!1},x=t=>!(t.selfAppraisalScoreTime&&t.selfAppraisalTotalScore),D=()=>{_()},H=()=>{s.projectName=void 0,s.buildOrg=void 0,u.value.pageParams.pageNumber=1,u.value.pageParams.pageSize=10,_()},n=i([]),I=t=>{const e=t.map(a=>a.projectId);d.value.forEach(a=>{e.includes(a.projectId)?n.value.push(a):n.value=n.value.filter(l=>l.projectId!==a.projectId)})},O=async()=>{const t={},e=n.value.reduce((a,l)=>(t[l.projectId]||(t[l.projectId]=a.push(l)),a),[]);f("getProjectData",e)};return P(()=>c.visible,async t=>{var e;t&&((e=c.data)!=null&&e.length?n.value=c.data.map(a=>({...a})):n.value=[],_())}),(t,e)=>{const a=o("el-input"),l=o("el-form-item"),j=o("el-col"),N=o("el-button"),M=o("el-row"),Q=o("el-form"),h=o("el-tab-pane"),S=o("el-tabs"),B=o("table-list"),$=o("el-dialog"),A=U("loading");return K(),R($,{"model-value":v.visible,title:"添加项目",width:"70%","destroy-on-close":"",onClose:e[4]||(e[4]=p=>f("close"))},{footer:m(()=>[g("span",G,[r(N,{onClick:e[3]||(e[3]=p=>f("close"))},{default:m(()=>e[7]||(e[7]=[V("关闭")])),_:1}),r(N,{type:"primary",onClick:O},{default:m(()=>e[8]||(e[8]=[V(" 确定 ")])),_:1})])]),default:m(()=>[z("",!0),r(S,{modelValue:s.projectKind,"onUpdate:modelValue":e[2]||(e[2]=p=>s.projectKind=p),onTabChange:D},{default:m(()=>[r(h,{label:"申报项目",name:"1"}),r(h,{label:"历史归集项目",name:"2"}),r(h,{label:"运维项目",name:"3"})]),_:1},8,["modelValue"]),g("div",q,[J(r(B,{ref_key:"tableListRef",ref:u,column:T,data:d.value,total:y.value,selectable:x,"row-key":"projectId",pagination:!1,onSelectionChange:I,onGetTableData:_},null,8,["data","total"]),[[A,b.value]])])]),_:1},8,["model-value"])}}});export{te as default};
|