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

  1. import{h as V,i as $,b as j,f as q}from"./uploadAction.b26326d4.js";import{d as N,B as P,r as m,J as U,c as s,e as I,G as R,i as l,h as t,j as p,u as i,g as S,q as D}from"./index.766d5891.js";import{c as G}from"./annualPlanStore.6e8999a3.js";const J=N({name:"importProjectDialog"}),z=Object.assign(J,{props:{visible:{type:Boolean,default:!1,required:!0}},emits:["close"],setup(d,{emit:c}){const{proxy:v}=D(),_=P.dictStore.uploadUrl,x=d,r=c,f=m(),n=m({}),b={file:[{required:!0,message:"\u8BF7\u4E0A\u4F20\u6587\u4EF6",trigger:"blur"}]},w=async a=>{!a||await a.validate(async e=>{e&&(await G(n.value.file),v.$message.success("\u63D0\u4EA4\u6210\u529F\uFF01"),r("close",!0))})};return U(()=>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 I(),R(F,{"model-value":d.visible,title:"\u5BFC\u5165",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(" \u63D0\u4EA4 ")])),_:1}),t(u,{onClick:e[2]||(e[2]=o=>r("close"))},{default:l(()=>e[7]||(e[7]=[p(" \u5173\u95ED ")])),_: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:"\u5BFC\u5165\u6587\u4EF6",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(j),"before-upload":o=>i(q)(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]=[S("div",{class:"el-upload__tip"},"\u652F\u6301.xlsx\u3001.xls",-1)])),default:l(()=>[t(u,{type:"primary"},{default:l(()=>e[4]||(e[4]=[p("\u4E0A\u4F20\u9644\u4EF6")])),_: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{z as default};