var A=Object.defineProperty,E=Object.defineProperties;var C=Object.getOwnPropertyDescriptors;var S=Object.getOwnPropertySymbols;var R=Object.prototype.hasOwnProperty,F=Object.prototype.propertyIsEnumerable;var g=(o,a,e)=>a in o?A(o,a,{enumerable:!0,configurable:!0,writable:!0,value:e}):o[a]=e,x=(o,a)=>{for(var e in a||(a={}))R.call(a,e)&&g(o,e,a[e]);if(S)for(var e of S(a))F.call(a,e)&&g(o,e,a[e]);return o},D=(o,a)=>E(o,C(a));var L=(o,a,e)=>new Promise((h,v)=>{var c=r=>{try{w(e.next(r))}catch(s){v(s)}},y=r=>{try{w(e.throw(r))}catch(s){v(s)}},w=r=>r.done?h(r.value):Promise.resolve(r.value).then(c,y);w((e=e.apply(o,a)).next())});import{_ as O,d as M,u as J,b as K,r as T,o as P,f as V,a8 as q,w as G,g as f,K as H,m as N,h as m,t as B,G as j,i as U,L as z,l as Q}from"./index.9fabe127.js";import{t as W}from"./unitSelfEvaluation.ac3ab285.js";import{A as X}from"./index.15f81060.js";const Y={key:0},Z={key:1},$={key:1},ee=M({name:"sureScore"}),ae=Object.assign(ee,{props:{appraisalInfoList:{type:Array,default:()=>[]}},setup(o){const a=o,e=J(),h=K([{label:"\u4E00\u7EA7\u6307\u6807",key:"oneName",prop:"oneName"},{label:"\u4E8C\u7EA7\u6307\u6807",key:"twoName",prop:"twoName"},{label:"\u4E09\u7EA7\u6307\u6807",key:"name",prop:"name"},{label:"\u6307\u6807\u7EC6\u5219",key:"indexDetail",prop:"indexDetail"},{label:"\u8BC4\u5206\u7EC6\u5219",key:"gradeDetail",prop:"gradeDetail"},{label:"\u4F50\u8BC1\u6750\u6599",key:"supportMaterial",prop:"supportMaterial"},{label:"\u6307\u6807\u5206\u503C",key:"indexScore",prop:"indexScore",width:85},{label:"\u590D\u6838\u5F97\u5206",key:"selfScore",slot:"selfScore",width:85},{label:"\u590D\u6838\u8BF4\u660E",key:"selfBasis",slot:"selfBasis",width:200}]),v=({row:s,column:n,rowIndex:p,columnIndex:d})=>{if(d===0)return s.isFirstOne?{rowspan:s.oneRows,colspan:1}:{rowspan:0,colspan:0};if(d===1)return s.isFirstTwo?{rowspan:s.twoRows,colspan:1}:{rowspan:0,colspan:0}},c=T([]),y=T(!1),w=()=>L(this,null,function*(){y.value=!0,c.value=[];const s=yield W(e.query.projectCode),n=r(s.data.templateDetails),p=r(s.data.additionalIndexDetails);c.value=[...n,...p],a.appraisalInfoList.forEach((d,t)=>{c.value[t].appraisalType4List=d}),console.log(c.value),y.value=!1}),r=s=>{const n=[];return s.forEach((p,d)=>{let t=0;p.children.forEach((l,k)=>{let u=0;l.children.forEach((i,se)=>{var b;n.push(D(x({oneId:p.templateId,oneName:p.name,twoId:l.templateId,twoName:l.name,isFirstOne:t===0,isFirstTwo:u===0,appraisalType1List:((b=i.selfAppraisalScoreInfo)==null?void 0:b.filter(_=>_.appraisalType===1))||[],appraisalType2List:i.reAppraisalScoreInfo&&Object.values(i.reAppraisalScoreInfo).reduce((_,I)=>_.concat(I,[]))||[],appraisalType3List:i.verifyScoreInfo&&Object.values(i.verifyScoreInfo).reduce((_,I)=>_.concat(I,[]))||[],oneRows:t,twoRows:u},i),{threeId:i.templateId})),t++,u++}),n.forEach(i=>{i.twoId===l.templateId&&(i.twoRows=u)})}),n.forEach(l=>{l.oneId===p.templateId&&(l.oneRows=t)})}),n};return P(()=>{w()}),(s,n)=>{const p=V("table-list"),d=q("loading");return G((f(),H(p,{stripe:!1,border:!0,pagination:!1,data:c.value,"span-method":v,column:h},{selfScore:N(({scope:t})=>[t.row.appraisalType4List?(f(),m("div",Y,B(t.row.appraisalType4List.score),1)):(f(),m("span",Z,"-"))]),selfBasis:N(({scope:t})=>{var l;return[t.row.appraisalType4List?(f(),m(j,{key:0},[U("p",null,B(t.row.appraisalType4List.appraisalBasis||"-"),1),(f(!0),m(j,null,z(((l=t.row.appraisalType4List)==null?void 0:l.appraisalBasisAppendix)&&JSON.parse(t.row.appraisalType4List.appraisalBasisAppendix),(k,u)=>(f(),m("p",{key:u,class:"mb-4"},[Q(X,{"file-name":k.originalFileName,"file-id":k.id},null,8,["file-name","file-id"])]))),128))],64)):(f(),m("span",$,"-"))]}),_:1},8,["data","column"])),[[d,y.value]])}}}),ie=O(ae,[["__file","/Users/chenlixin/Documents/work/NDKJ/MyProject/ls-project-v2.0/src/pages/performanceEvaluation/reformCheck/reformCheckProjectList/reformCheckHandle/components/sureScore.vue"]]);export{ie as default};
