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.4KB

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