|
1 |
- import{d as O,y as D,x as R,r,o as $,c as d,e as _,f as k,g as y,h as s,i,G as j,k as w,u as V,j as x,F as h,q as A}from"./index.13afb401.js";import G from"./reviewComments.1eecd94c.js";import M from"./memberOpinion.c2f2be0c.js";import{t as z}from"./reviewTemplateConfig.cadd3490.js";import{s as E,a as L,t as P}from"./expertReview.4138da87.js";import"./uploadAction.d6d53fa7.js";import"./index.47dddef0.js";const U={class:"footerPage"},H={class:"footer"},J=O({name:"fillReviewComments"}),ae=Object.assign(J,{setup(K){const{proxy:T}=A(),g=D(),l=R(),C=r(),S=async()=>{const n=await z({templateType:l.query.reviewType,regionCode:l.query.regionCode});C.value=n.data,I.value=!0},I=r(!1),c=r(!1),u=r(),B=()=>{u.value.validForm(async n=>{var e;if(n){c.value=!0;const a={meetingId:l.query.meetingId,projectId:l.query.projectId,projectCode:l.query.projectCode,...u.value.form,reviewTemplateOptions:u.value.form.templates.map(t=>({...t,optionSerialNo:Array.isArray(t.optionSerialNo)?t.optionSerialNo.map(m=>m):[t.optionSerialNo]})),attachFileId:((e=u.value.form.attachments)==null?void 0:e.length)&&u.value.form.attachments[0].response.data.id||void 0,isFinal:l.query.type*1===2,templates:void 0,attachments:void 0};try{await E(a),T.$message.success("\u63D0\u4EA4\u6210\u529F"),c.value=!1,g.go(-2)}catch{c.value=!1}}})},f=r(!1),N=r([]),q=r([]),F=async()=>{const n=await L({projectId:l.query.projectId,meetingId:l.query.meetingId}),e=await P({templateIds:n.data.map(a=>a.templateId).join(",")});N.value=e.data,q.value=n.data&&n.data.map(a=>({...a,reviewTemplateOptions:a.reviewTemplateOptions&&a.reviewTemplateOptions.map(t=>{var v,p;const m=N.value.find(o=>a.templateId===o.templateId).templates;return{...t,title:(v=m.find(o=>o.serialNo===t.questionSerialNo))==null?void 0:v.title,optionsValue:(p=m.find(o=>o.serialNo===t.questionSerialNo))==null?void 0:p.options.filter(o=>t.optionSerialNo.includes(o.serialNo)).map(o=>o.option).join("\u3001")}})||[]}))||[],f.value=!0};return $(()=>{S()}),(n,e)=>{const a=d("el-col"),t=d("svg-icon"),m=d("el-row"),v=d("el-card"),p=d("el-button"),o=d("el-drawer");return _(),k(h,null,[y("div",U,[s(v,{class:"w-full",shadow:"never"},{default:i(()=>[s(m,{gutter:16},{default:i(()=>[s(a,{span:14},{default:i(()=>[I.value?(_(),j(G,{key:0,ref_key:"reviewCommentsRef",ref:u,"template-data":C.value},null,8,["template-data"])):w("",!0)]),_:1}),V(l).query.type*1===2?(_(),j(a,{key:0,span:10},{default:i(()=>[f.value?w("",!0):(_(),k("div",{key:0,class:"viewBtn",onClick:F},[s(t,{name:"eye"}),e[2]||(e[2]=y("span",null,"\u67E5\u770B\u8BC4\u5BA1\u610F\u89C1",-1))]))]),_:1})):w("",!0)]),_:1})]),_:1}),y("div",H,[s(p,{type:"primary",loading:c.value,onClick:B},{default:i(()=>e[3]||(e[3]=[x("\u63D0\u4EA4")])),_:1},8,["loading"]),s(p,{onClick:e[0]||(e[0]=b=>V(g).go(-1))},{default:i(()=>e[4]||(e[4]=[x("\u5173\u95ED")])),_:1})])]),s(o,{modelValue:f.value,"onUpdate:modelValue":e[1]||(e[1]=b=>f.value=b),title:"\u7EC4\u5458\u610F\u89C1",style:{position:"absolute"},direction:"rtl",size:"40%",modal:!1,"append-to-body":!1,"modal-class":"myDrawerModal"},{default:i(()=>[s(M,{"member-opinions":q.value},null,8,["member-opinions"])]),_:1},8,["modelValue"])],64)}}});export{ae as default};
|