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
3.0KB

  1. var B=Object.defineProperty;var x=Object.getOwnPropertySymbols;var D=Object.prototype.hasOwnProperty,L=Object.prototype.propertyIsEnumerable;var C=(t,l,e)=>l in t?B(t,l,{enumerable:!0,configurable:!0,writable:!0,value:e}):t[l]=e,j=(t,l)=>{for(var e in l||(l={}))D.call(l,e)&&C(t,e,l[e]);if(x)for(var e of x(l))L.call(l,e)&&C(t,e,l[e]);return t};var b=(t,l,e)=>new Promise((g,d)=>{var _=n=>{try{p(e.next(n))}catch(s){d(s)}},a=n=>{try{p(e.throw(n))}catch(s){d(s)}},p=n=>n.done?g(n.value):Promise.resolve(n.value).then(_,a);p((e=e.apply(t,l)).next())});import{d as N,D as O,r as h,L as S,c as u,e as U,I as V,i,h as c,j as w,u as f,x as q}from"./index.3fb2f955.js";import{j as R,h as T,i as E,b as J,f as z,c as k,g as A}from"./uploadAction.60e17da5.js";import{r as G}from"./unitSelfEvaluation.c662280c.js";const H=N({name:"upLoadPlanDialog"}),X=Object.assign(H,{props:{visible:{type:Boolean,default:!1,required:!0},data:Object},emits:["close"],setup(t,{emit:l}){const e=O.dictStore.uploadUrl,{proxy:g}=q(),d=t,_=l,a=h({rectifyPlanFile:[]}),p=h(),n=s=>b(this,null,function*(){!s||(yield s.validate(o=>b(this,null,function*(){var m,y,v,F;if(o){if(!((m=a.value.rectifyPlanFile)!=null&&m[0].response))return;const P={appraisalId:(y=d.data)==null?void 0:y.appraisalId,projectCode:(v=d.data)==null?void 0:v.projectCode,reportFile:((F=a.value.rectifyPlanFile)==null?void 0:F.length)&&JSON.stringify(A(a.value.rectifyPlanFile))||void 0};yield G(j({},P)),g.$message.success("\u63D0\u4EA4\u6210\u529F\uFF01"),_("close",!0)}})))});return S(()=>d.visible,s=>b(this,null,function*(){s&&(a.value.rectifyPlanFile=[])})),(s,o)=>{const m=u("el-button"),y=u("el-upload"),v=u("el-form-item"),F=u("el-col"),P=u("el-row"),$=u("el-form"),I=u("el-dialog");return U(),V(I,{"model-value":t.visible,title:"\u4E0A\u4F20\u6574\u6539\u8BA1\u5212",width:"600px","destroy-on-close":"",onClose:o[3]||(o[3]=r=>_("close"))},{footer:i(()=>[c(m,{type:"primary",onClick:o[1]||(o[1]=r=>n(p.value))},{default:i(()=>[w(" \u63D0\u4EA4 ")]),_:1}),c(m,{onClick:o[2]||(o[2]=r=>_("close"))},{default:i(()=>[w(" \u5173\u95ED ")]),_:1})]),default:i(()=>[c($,{ref_key:"formRef",ref:p,model:a.value,"label-width":"120px","label-suffix":":"},{default:i(()=>[c(P,null,{default:i(()=>[c(F,{span:24},{default:i(()=>[c(v,{label:"\u6574\u6539\u8BA1\u5212",prop:"rectifyPlanFile",rules:[{required:!0,message:"\u8BF7\u4E0A\u4F20\u6587\u4EF6",trigger:"blur"}]},{default:i(()=>[c(y,{"file-list":a.value.rectifyPlanFile,"onUpdate:fileList":o[0]||(o[0]=r=>a.value.rectifyPlanFile=r),class:"w-full",action:f(e),limit:1,"on-exceed":f(R),"on-success":r=>f(T)(r,a.value.rectifyPlanFile,!0),"on-error":f(E),"on-preview":f(J),"before-upload":r=>f(z)(r,{types:f(k)}),accept:f(k).map(r=>`.${r}`).join(",")},{default:i(()=>[c(m,{type:"primary"},{default:i(()=>[w("\u4E0A\u4F20\u9644\u4EF6")]),_:1})]),_:1},8,["file-list","action","on-exceed","on-success","on-error","on-preview","before-upload","accept"])]),_:1})]),_:1})]),_:1})]),_:1},8,["model"])]),_:1},8,["model-value"])}}});export{X as default};