Nelze vybrat více než 25 témat Téma musí začínat písmenem nebo číslem, může obsahovat pomlčky („-“) a může být dlouhé až 35 znaků.

2 řádky
4.0KB

  1. import{p as A}from"./evaluationPlan.400efb67.js";import{d as I,B as R,x as J,b as q,r as g,J as z,c as d,e as E,G,i as o,g as C,h as l,j as v,Z as O}from"./index.149277cd.js";const U={class:"search mb-16"},Y={class:"dialog-footer"},$=I({name:"planProjectDialog"}),Z=Object.assign($,{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(y,{emit:k}){const{projectTypeOptions:T}=R.dictStore.globalDicts||{},w=J(),f=y,_=k,n=q({projectName:void 0,buildOrgName:void 0}),i=g(),h=[{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=>O("span",T[r.projectType]||"-"),width:80},{label:"\u6A21\u677F\u7C7B\u578B",key:"templateType",prop:"templateType",render:r=>{var e,t;return O("span",((t=(e=f.templateTypeListData)==null?void 0:e.find(a=>a.id===r.templateType))==null?void 0:t.name)||"-")}}],p=g([]),N=g(0),b=async(r=(e=>(e=i.value)==null?void 0:e.pageParams)())=>{const t=await A({...r,...n,appraisalId:w.query.appraisalId});p.value=t.data.records,N.value=t.data.total,n.projectName&&(p.value=p.value.filter(s=>s.projectName.indexOf(n.projectName)!==-1)),n.buildOrgName&&(p.value=p.value.filter(s=>s.buildOrgName.indexOf(n.buildOrgName)!==-1));const a=JSON.parse(JSON.stringify(u.value))||[];a!=null&&a.length&&p.value&&p.value.forEach(s=>{a.map(j=>j.projectCode).includes(s.projectCode)&&i.value.toggleRowSelect(s,!0)})},D=()=>{i.value.pageParams.pageNumber=1,b()},V=()=>{n.projectName=void 0,n.buildOrgName=void 0,i.value.pageParams.pageNumber=1,i.value.pageParams.pageSize=10,b()},u=g([]),P=r=>{const e=r.map(t=>t.projectCode);p.value.forEach(t=>{e.includes(t.projectCode)?u.value.push(t):u.value=u.value.filter(a=>a.projectCode!==t.projectCode)})},S=()=>{const r={},e=u.value.reduce((t,a)=>(r[a.projectCode]||(r[a.projectCode]=t.push(a)),t),[]);_("getProjectData",e)};return z(()=>f.visible,async r=>{var e;r&&((e=f.data)!=null&&e.length&&(u.value=f.data.map(t=>t),console.log(u.value)),b())}),(r,e)=>{const t=d("el-input"),a=d("el-form-item"),s=d("el-col"),m=d("el-button"),j=d("el-row"),x=d("el-form"),B=d("table-list"),L=d("el-dialog");return E(),G(L,{"model-value":y.visible,title:"\u6DFB\u52A0\u9879\u76EE",width:"70%","destroy-on-close":"",onClose:e[3]||(e[3]=c=>_("close"))},{footer:o(()=>[C("span",Y,[l(m,{onClick:e[2]||(e[2]=c=>_("close"))},{default:o(()=>e[6]||(e[6]=[v("\u5173\u95ED")])),_:1}),l(m,{type:"primary",onClick:S},{default:o(()=>e[7]||(e[7]=[v(" \u786E\u5B9A ")])),_:1})])]),default:o(()=>[C("div",U,[l(x,{"label-suffix":":",model:n,size:"small"},{default:o(()=>[l(j,{gutter:16},{default:o(()=>[l(s,{span:8},{default:o(()=>[l(a,{label:"\u9879\u76EE\u540D\u79F0"},{default:o(()=>[l(t,{modelValue:n.projectName,"onUpdate:modelValue":e[0]||(e[0]=c=>n.projectName=c),placeholder:"\u8BF7\u8F93\u5165"},null,8,["modelValue"])]),_:1})]),_:1}),l(s,{span:8},{default:o(()=>[l(a,{label:"\u7533\u62A5\u5355\u4F4D"},{default:o(()=>[l(t,{modelValue:n.buildOrgName,"onUpdate:modelValue":e[1]||(e[1]=c=>n.buildOrgName=c),placeholder:"\u8BF7\u8F93\u5165"},null,8,["modelValue"])]),_:1})]),_:1}),l(s,{span:8},{default:o(()=>[l(a,{class:"btn"},{default:o(()=>[l(m,{type:"primary",onClick:D},{default:o(()=>e[4]||(e[4]=[v("\u67E5\u8BE2")])),_:1}),l(m,{onClick:V},{default:o(()=>e[5]||(e[5]=[v("\u91CD\u7F6E")])),_:1})]),_:1})]),_:1})]),_:1})]),_:1},8,["model"])]),l(B,{ref_key:"tableListRef",ref:i,column:h,data:p.value,"row-key":"projectCode",total:N.value,onSelectionChange:P,onGetTableData:b},null,8,["data","total"])]),_:1},8,["model-value"])}}});export{Z as default};