|
- import{h as V,i as $,c as N,f as P}from"./uploadAction-3962500e.js";import{E as U,r as d,B as j,b as s,c as q,L as I,h as l,f as t,i as p,u as i,e as L,k as R,s as S}from"./index-dd5fae99.js";import{c as D}from"./annualPlanStore-7a8e5db4.js";const E=R({name:"importProjectDialog"}),A=Object.assign(E,{props:{visible:{type:Boolean,default:!1,required:!0}},emits:["close"],setup(m,{emit:c}){const{proxy:v}=S(),_=U.dictStore.uploadUrl,x=m,r=c,f=d(),n=d({}),b={file:[{required:!0,message:"请上传文件",trigger:"blur"}]},w=async a=>{a&&await a.validate(async e=>{e&&(await D(n.value.file),v.$message.success("提交成功!"),r("close",!0))})};return j(()=>x.visible,async a=>{a?console.log(a):f.value.resetFields()}),(a,e)=>{const u=s("el-button"),y=s("el-upload"),g=s("el-form-item"),C=s("el-col"),k=s("el-row"),B=s("el-form"),F=s("el-dialog");return q(),I(F,{"model-value":m.visible,title:"导入",width:"600px","destroy-on-close":"",onClose:e[3]||(e[3]=o=>r("close"))},{footer:l(()=>[t(u,{type:"primary",onClick:e[1]||(e[1]=o=>w(f.value))},{default:l(()=>e[6]||(e[6]=[p(" 提交 ")])),_:1}),t(u,{onClick:e[2]||(e[2]=o=>r("close"))},{default:l(()=>e[7]||(e[7]=[p(" 关闭 ")])),_:1})]),default:l(()=>[t(B,{ref_key:"formRef",ref:f,model:n.value,rules:b,"label-width":"120px","label-suffix":":"},{default:l(()=>[t(k,null,{default:l(()=>[t(C,{span:24},{default:l(()=>[t(g,{label:"导入文件",prop:"file"},{default:l(()=>[t(y,{"file-list":n.value.file,"onUpdate:fileList":e[0]||(e[0]=o=>n.value.file=o),class:"w-full",action:i(_),limit:1,"on-success":o=>i(V)(o,n.value.file,!0),"on-error":i($),"on-preview":i(N),"before-upload":o=>i(P)(o,{types:["application/vnd.ms-excel","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"]}),accept:"application/vnd.ms-excel,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"},{tip:l(()=>e[5]||(e[5]=[L("div",{class:"el-upload__tip"},"支持.xlsx、.xls",-1)])),default:l(()=>[t(u,{type:"primary"},{default:l(()=>e[4]||(e[4]=[p("上传附件")])),_:1})]),_:1},8,["file-list","action","on-success","on-error","on-preview","before-upload"])]),_:1})]),_:1})]),_:1})]),_:1},8,["model"])]),_:1},8,["model-value"])}}});export{A as default};
|