|
- import{h as I,i as L,f as O,c as A,b as G,e as H}from"./uploadAction.15178e83.js";import{d as M,B as P,r as F,o as W,c as s,e as n,G as d,i as e,h as a,f as b,F as V,H as g,j as m,t as w,k as z,u as p,g as J}from"./index.1cbb0c88.js";const K={class:"el-upload__tip"},Q=M({name:"reviewCommentsDialog"}),Z=Object.assign(Q,{props:{templateData:Object},setup(y,{expose:D}){const x=P.dictStore.uploadUrl,h=y,k=F(),l=F({templates:[],attachments:[]}),C={otherAdvice:[{required:!0,message:"\u8BF7\u8F93\u5165\u610F\u89C1",trigger:"blur"}],reviewResult:[{required:!0,message:"\u8BF7\u9009\u62E9\u8BC4\u5BA1\u7ED3\u679C",trigger:"blur"}]},R=c=>{k.value.validate(o=>{c(o)})};return W(async()=>{l.value.templates=h.templateData.templates.map(c=>({optionSerialNo:void 0,otherAdvice:"",questionSerialNo:c.serialNo})),l.value.templateId=h.templateData.templateId}),D({validForm:R,form:l}),(c,o)=>{const B=s("el-checkbox"),j=s("el-checkbox-group"),_=s("el-radio"),N=s("el-radio-group"),i=s("el-form-item"),U=s("el-input"),f=s("el-col"),q=s("el-button"),$=s("el-upload"),T=s("el-row"),E=s("el-form");return n(),d(E,{ref_key:"formRef",ref:k,model:l.value,rules:C,"label-width":"auto","label-suffix":":","label-position":"top",class:"reviewForm"},{default:e(()=>[a(T,null,{default:e(()=>{var S;return[(S=l.value.templates)!=null&&S.length?(n(!0),b(V,{key:0},g(y.templateData.templates,(t,u)=>(n(),d(f,{key:u,span:24},{default:e(()=>[a(i,{label:t.title,prop:`templates[${u}].optionSerialNo`,rules:[{required:!0,message:"\u8BF7\u9009\u62E9"}]},{default:e(()=>[t.optionType===2?(n(),d(j,{key:0,modelValue:l.value.templates[u].optionSerialNo,"onUpdate:modelValue":r=>l.value.templates[u].optionSerialNo=r},{default:e(()=>[(n(!0),b(V,null,g(t.options,(r,v)=>(n(),d(B,{key:v,label:r.serialNo},{default:e(()=>[m(w(r.option),1)]),_:2},1032,["label"]))),128))]),_:2},1032,["modelValue","onUpdate:modelValue"])):(n(),d(N,{key:1,modelValue:l.value.templates[u].optionSerialNo,"onUpdate:modelValue":r=>l.value.templates[u].optionSerialNo=r,class:"myWrap"},{default:e(()=>[(n(!0),b(V,null,g(t.options,(r,v)=>(n(),d(_,{key:v,label:r.serialNo},{default:e(()=>[m(w(r.option),1)]),_:2},1032,["label"]))),128))]),_:2},1032,["modelValue","onUpdate:modelValue"]))]),_:2},1032,["label","prop"]),a(i,{prop:`templates[${u}].otherAdvice`},{default:e(()=>[a(U,{modelValue:l.value.templates[u].otherAdvice,"onUpdate:modelValue":r=>l.value.templates[u].otherAdvice=r,rows:2,type:"textarea",placeholder:`\u8BF7\u8F93\u5165${t.title}\u7684\u5176\u4ED6\u610F\u89C1\u6216\u5EFA\u8BAE`},null,8,["modelValue","onUpdate:modelValue","placeholder"])]),_:2},1032,["prop"])]),_:2},1024))),128)):z("",!0),a(f,{span:24},{default:e(()=>[a(i,{label:"\u5176\u4ED6\u610F\u89C1\u6216\u5EFA\u8BAE",prop:"otherAdvice"},{default:e(()=>[a(U,{modelValue:l.value.otherAdvice,"onUpdate:modelValue":o[0]||(o[0]=t=>l.value.otherAdvice=t),rows:2,maxlength:"200",type:"textarea","show-word-limit":"",placeholder:"\u8BF7\u8F93\u5165\u5176\u4ED6\u610F\u89C1\u6216\u5EFA\u8BAE"},null,8,["modelValue"])]),_:1})]),_:1}),a(f,{span:24},{default:e(()=>[a(i,{label:"\u9644\u4EF6",prop:"attachments"},{default:e(()=>[a($,{"file-list":l.value.attachments,"onUpdate:fileList":o[1]||(o[1]=t=>l.value.attachments=t),class:"w-full",action:p(x),"on-success":t=>p(I)(t,l.value.attachments,!0),"on-error":p(L),"before-upload":t=>p(O)(t,{types:p(A)}),accept:p(A).map(t=>`.${t}`).join(","),limit:1,"on-preview":p(G)},{tip:e(()=>[J("div",K,"\u652F\u6301"+w(p(H))+"\u6587\u4EF6",1)]),default:e(()=>[a(q,{type:"primary",class:"mr-4"},{default:e(()=>o[3]||(o[3]=[m("\u4E0A\u4F20\u9644\u4EF6")])),_:1})]),_:1},8,["file-list","action","on-success","on-error","before-upload","accept","on-preview"])]),_:1})]),_:1}),a(f,{span:24,class:"result"},{default:e(()=>[a(i,{label:"\u8BC4\u5BA1\u7ED3\u679C",prop:"reviewResult",class:"mb-0"},{default:e(()=>[a(N,{modelValue:l.value.reviewResult,"onUpdate:modelValue":o[2]||(o[2]=t=>l.value.reviewResult=t),class:"ml-4"},{default:e(()=>[a(_,{label:1},{default:e(()=>o[4]||(o[4]=[m("\u8BC4\u5BA1\u901A\u8FC7")])),_:1}),a(_,{label:2},{default:e(()=>o[5]||(o[5]=[m("\u901A\u8FC7\u9700\u8C03\u6574")])),_:1}),a(_,{label:3},{default:e(()=>o[6]||(o[6]=[m("\u4FEE\u6539\u65B9\u6848\u540E\u91CD\u65B0\u8BC4\u5BA1")])),_:1})]),_:1},8,["modelValue"])]),_:1})]),_:1})]}),_:1})]),_:1},8,["model"])}}});export{Z as default};
|