import{d as E,D as L,b as B,r as b,L as M,c as d,e as P,I as U,i,g as w,h as o,j as g,a0 as k}from"./index.ce13ff81.js";import{a as R,b as z}from"./evaluationPlan.30d181aa.js";const J={class:"search mb-16"},$={class:"dialog-footer"},q=E({name:"applicationListDialog"}),W=Object.assign(q,{props:{visible:{type:Boolean,default:!1,required:!0},data:{type:Array,default:void 0},params:{type:Object,default:()=>({})}},emits:["close","getAppData"],setup(h,{emit:O}){const{digitalModifySystem:S}=L.dictStore.globalDicts||{},u=h,v=O,n=B({projectName:void 0,buildOrg:void 0}),r=b(),N=b(0),C=[{type:"selection",reserveSelection:!0,width:"55"},{label:"\u5E94\u7528\u540D\u79F0",key:"relatedExistsApplication",prop:"relatedExistsApplication",showOverflowTooltip:!0,width:150,render:l=>k("span",l.relatedExistsApplication||l.applicationName)},{label:"\u7533\u62A5\u5355\u4F4D",key:"buildOrgName",prop:"buildOrgName",minWidth:"120",showOverflowTooltip:!0},{label:"\u5E94\u7528\u7C7B\u578B",key:"applicationType",prop:"applicationType",width:"150"},{label:"\u5E94\u7528\u9886\u57DF",key:"digitalModification",prop:"digitalModification",width:"140",render:l=>{var e,a;return k("span",(a=(e=l.digitalModification)==null?void 0:e.split(","))==null?void 0:a.map(t=>S[t]).join("\uFF0C"))}},{label:"\u53D1\u5E03\u7AEF",key:"publishSide",prop:"publishSide",width:"80"}],c=b([]),_=async(l=(e=>(e=r.value)==null?void 0:e.pageParams)())=>{const a=await R({...l,...n,...u.params});N.value=a.data.total,c.value=a.data.records||[];const t=JSON.parse(JSON.stringify(p.value));t!=null&&t.length&&c.value&&c.value.forEach(s=>{t.map(y=>y.id).includes(s.id)&&r.value.toggleRowSelect(s,!0)})},D=()=>{r.value.pageParams.pageNumber=1,_()},V=()=>{n.projectName=void 0,n.buildOrg=void 0,r.value.pageParams.pageNumber=1,r.value.pageParams.pageSize=10,_()},p=b([]),A=l=>{p.value=l;const e=l.map(a=>a.id);c.value.forEach(a=>{e.includes(a.id)?p.value.push(a):p.value=p.value.filter(t=>t.id!==a.id)})},j=async()=>{const l={},e=p.value.reduce((t,s)=>(l[s.id]||(l[s.id]=t.push(s)),t),[]),a=e.map(t=>t.id);await z({applicationIds:a,appraisalId:u.params.appraisalId}),v("getAppData",e)};return M(()=>u.visible,async l=>{var e;l&&((e=u.data)!=null&&e.length&&(p.value=u.data.map(a=>({...a,id:a.appId}))),_())}),(l,e)=>{const a=d("el-input"),t=d("el-form-item"),s=d("el-col"),m=d("el-button"),y=d("el-row"),I=d("el-form"),T=d("table-list"),x=d("el-dialog");return P(),U(x,{"model-value":h.visible,title:"\u6DFB\u52A0\u5E94\u7528",width:"70%","destroy-on-close":"",onClose:e[3]||(e[3]=f=>v("close"))},{footer:i(()=>[w("span",$,[o(m,{onClick:e[2]||(e[2]=f=>v("close"))},{default:i(()=>[g("\u5173\u95ED")]),_:1}),o(m,{type:"primary",onClick:j},{default:i(()=>[g(" \u786E\u5B9A ")]),_:1})])]),default:i(()=>[w("div",J,[o(I,{"label-suffix":":",model:n,size:"small"},{default:i(()=>[o(y,{gutter:16},{default:i(()=>[o(s,{span:8},{default:i(()=>[o(t,{label:"\u5E94\u7528\u540D\u79F0"},{default:i(()=>[o(a,{modelValue:n.applicationName,"onUpdate:modelValue":e[0]||(e[0]=f=>n.applicationName=f),placeholder:"\u8BF7\u8F93\u5165"},null,8,["modelValue"])]),_:1})]),_:1}),o(s,{span:8},{default:i(()=>[o(t,{label:"\u7533\u62A5\u5355\u4F4D"},{default:i(()=>[o(a,{modelValue:n.buildUnitName,"onUpdate:modelValue":e[1]||(e[1]=f=>n.buildUnitName=f),placeholder:"\u8BF7\u8F93\u5165"},null,8,["modelValue"])]),_:1})]),_:1}),o(s,{span:8},{default:i(()=>[o(t,{class:"btn"},{default:i(()=>[o(m,{type:"primary",onClick:D},{default:i(()=>[g("\u67E5\u8BE2")]),_:1}),o(m,{onClick:V},{default:i(()=>[g("\u91CD\u7F6E")]),_:1})]),_:1})]),_:1})]),_:1})]),_:1},8,["model"])]),o(T,{ref_key:"tableListRef",ref:r,column:C,data:c.value,total:N.value,"row-key":"id",onSelectionChange:A,onGetTableData:_},null,8,["data","total"])]),_:1},8,["model-value"])}}});export{W as default};