import{d as h,D as k,r as y,L as B,c as r,e as N,I as R,i as e,h as t,j as f,u as n,g as V,x as $}from"./index.5bb861d3.js";import{j as D,h as I,i as L,b as O,f as S,g as U}from"./uploadAction.60610a95.js";import{u as q}from"./inquirySheetManage.7abf5210.js";const P=V("div",{class:"el-upload__tip"},"\u652F\u6301.png\u3001.jpg\u3001.jpeg\u3001.pdf",-1),E=h({name:"upLoadReplayDialog"}),A=Object.assign(E,{props:{visible:{type:Boolean,default:!1,required:!0},data:Object},emits:["close"],setup(c,{emit:g}){const v=k.dictStore.uploadUrl,{proxy:b}=$(),m=c,d=g,a=y({replyForm:[]}),_=y(),F=async i=>{!i||await i.validate(async o=>{var s,p;if(o){const u={formId:(s=m.data)==null?void 0:s.id,replyForm:((p=a.value.replyForm)==null?void 0:p.length)&&JSON.stringify(U(a.value.replyForm))||void 0};await q({...u}),b.$message.success("\u63D0\u4EA4\u6210\u529F\uFF01"),d("close",!0)}})};return B(()=>m.visible,async i=>{i&&(a.value.replyForm=[])}),(i,o)=>{const s=r("el-button"),p=r("el-upload"),u=r("el-form-item"),w=r("el-col"),x=r("el-row"),j=r("el-form"),C=r("el-dialog");return N(),R(C,{"model-value":c.visible,title:"\u4E0A\u4F20\u56DE\u590D\u5355",width:"600px","destroy-on-close":"",onClose:o[3]||(o[3]=l=>d("close"))},{footer:e(()=>[t(s,{type:"primary",onClick:o[1]||(o[1]=l=>F(_.value))},{default:e(()=>[f(" \u63D0\u4EA4 ")]),_:1}),t(s,{onClick:o[2]||(o[2]=l=>d("close"))},{default:e(()=>[f(" \u5173\u95ED ")]),_:1})]),default:e(()=>[t(j,{ref_key:"formRef",ref:_,model:a.value,"label-width":"120px","label-suffix":":"},{default:e(()=>[t(x,null,{default:e(()=>[t(w,{span:24},{default:e(()=>[t(u,{label:"\u56DE\u590D\u5355",prop:"replyForm",rules:[{required:!0,message:"\u8BF7\u4E0A\u4F20\u6587\u4EF6",trigger:"blur"}]},{default:e(()=>[t(p,{"file-list":a.value.replyForm,"onUpdate:fileList":o[0]||(o[0]=l=>a.value.replyForm=l),class:"w-full",action:n(v),limit:1,"on-exceed":n(D),"on-success":l=>n(I)(l,a.value.replyForm,!0),"on-error":n(L),"on-preview":n(O),"before-upload":l=>n(S)(l,{types:["pdf","png","jpeg","jpg"]}),accept:".pdf,.png,.jpeg"},{tip:e(()=>[P]),default:e(()=>[t(s,{type:"primary"},{default:e(()=>[f("\u4E0A\u4F20\u9644\u4EF6")]),_:1})]),_:1},8,["file-list","action","on-exceed","on-success","on-error","on-preview","before-upload"])]),_:1})]),_:1})]),_:1})]),_:1},8,["model"])]),_:1},8,["model-value"])}}});export{A as default};
