You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

2 lines
4.2KB

  1. import{h as E,i as L,f as O,c as A,b as J,e as M}from"./uploadAction.2e6282f1.js";import{d as P,D as W,r as D,o as z,c as r,e as u,I as d,i as e,h as a,f as b,F as h,J as V,j as m,t as g,k as G,u as p,g as H}from"./index.7e23eab2.js";const K={class:"el-upload__tip"},Q=P({name:"reviewCommentsDialog"}),Z=Object.assign(Q,{props:{templateData:Object},setup(w,{expose:F}){const x=W.dictStore.uploadUrl,y=w,k=D(),l=D({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(n=>{c(n)})};return z(async()=>{l.value.templates=y.templateData.templates.map(c=>({optionSerialNo:void 0,otherAdvice:"",questionSerialNo:c.serialNo})),l.value.templateId=y.templateData.templateId}),F({validForm:R,form:l}),(c,n)=>{const j=r("el-checkbox"),q=r("el-checkbox-group"),_=r("el-radio"),N=r("el-radio-group"),i=r("el-form-item"),U=r("el-input"),f=r("el-col"),B=r("el-button"),$=r("el-upload"),I=r("el-row"),T=r("el-form");return u(),d(T,{ref_key:"formRef",ref:k,model:l.value,rules:C,"label-width":"auto","label-suffix":":","label-position":"top",class:"reviewForm"},{default:e(()=>[a(I,null,{default:e(()=>{var S;return[(S=l.value.templates)!=null&&S.length?(u(!0),b(h,{key:0},V(w.templateData.templates,(t,s)=>(u(),d(f,{key:s,span:24},{default:e(()=>[a(i,{label:t.title,prop:`templates[${s}].optionSerialNo`,rules:[{required:!0,message:"\u8BF7\u9009\u62E9"}]},{default:e(()=>[t.optionType===2?(u(),d(q,{key:0,modelValue:l.value.templates[s].optionSerialNo,"onUpdate:modelValue":o=>l.value.templates[s].optionSerialNo=o},{default:e(()=>[(u(!0),b(h,null,V(t.options,(o,v)=>(u(),d(j,{key:v,label:o.serialNo},{default:e(()=>[m(g(o.option),1)]),_:2},1032,["label"]))),128))]),_:2},1032,["modelValue","onUpdate:modelValue"])):(u(),d(N,{key:1,modelValue:l.value.templates[s].optionSerialNo,"onUpdate:modelValue":o=>l.value.templates[s].optionSerialNo=o,class:"myWrap"},{default:e(()=>[(u(!0),b(h,null,V(t.options,(o,v)=>(u(),d(_,{key:v,label:o.serialNo},{default:e(()=>[m(g(o.option),1)]),_:2},1032,["label"]))),128))]),_:2},1032,["modelValue","onUpdate:modelValue"]))]),_:2},1032,["label","prop"]),a(i,{prop:`templates[${s}].otherAdvice`},{default:e(()=>[a(U,{modelValue:l.value.templates[s].otherAdvice,"onUpdate:modelValue":o=>l.value.templates[s].otherAdvice=o,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)):G("",!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":n[0]||(n[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":n[1]||(n[1]=t=>l.value.attachments=t),class:"w-full",action:p(x),"on-success":t=>p(E)(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(J)},{tip:e(()=>[H("div",K,"\u652F\u6301"+g(p(M))+"\u6587\u4EF6",1)]),default:e(()=>[a(B,{type:"primary",class:"mr-4"},{default:e(()=>[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":n[2]||(n[2]=t=>l.value.reviewResult=t),class:"ml-4"},{default:e(()=>[a(_,{label:1},{default:e(()=>[m("\u8BC4\u5BA1\u901A\u8FC7")]),_:1}),a(_,{label:2},{default:e(()=>[m("\u901A\u8FC7\u9700\u8C03\u6574")]),_:1}),a(_,{label:3},{default:e(()=>[m("\u4FEE\u6539\u65B9\u6848\u540E\u91CD\u65B0\u8BC4\u5BA1")]),_:1})]),_:1},8,["modelValue"])]),_:1})]),_:1})]}),_:1})]),_:1},8,["model"])}}});export{Z as default};