import{K as y,q as N}from"./index.17037962789732.js";import{u as V,J as S}from"./system.1703796278973.js";import"./index.170379627897329.js";import"./index.170379627897315.js";import"./index.170379627897330.js";import{T as u,L as j,o as m}from"./comm.1703796278973.js";import{c as B}from"./plugin.17037962789733.js";import{d as _,k as c,o as C,c as F,a as f,z as v,b as I,t as L,u as s,G as U,H as z}from"./vue.1703796278973.js";import{_ as k}from"./_plugin-vue_export-helper.1703796278973.js";import"./index.17037962789733.js";import"./dayjs.min.1703796278973.js";import"./isArray.1703796278973.js";import"./editor.api.1703796278973.js";import"./preload-helper.1703796278973.js";import"./monaco.contribution.1703796278973.js";import"./index.170379627897332.js";import"./index.170379627897333.js";import"./index.170379627897334.js";import"./default.1703796278973.js";import"./permission.1703796278973.js";import"./consts.1703796278973.js";import"./404.1703796278973.js";const J=l=>(U("data-v-e62fbbd4"),l=l(),z(),l),K=J(()=>v("span",{class:"upload-tip"},"格式要求：{文件名}.jar/{文件名}.zip",-1)),T=_({name:"FileUpload"}),w=_({...T,props:{modelValue:{type:String,default:()=>""},disabled:{type:Boolean,default:!1},fileName:{type:String,default:void 0}},emits:["update:modelValue","change"],setup(l,{emit:p}){var d;const i=l;(d=V().$state.configInfo.paths)==null||d["base-path"];const h=c(i.modelValue),n=c(i.fileName?[{name:i.fileName}]:[]),o=c(!1),b=()=>{n.value=[],p("update:modelValue",""),p("change",{})},g=(a,r)=>{n.value=r;const e=a.name.split("."),t=["jar","zip"].includes(e[e.length-1]);return t||(m("请上传.jar,.zip格式的文件","error"),o.value=!1),t},x=async a=>{var r;if(o.value=!0,a.file.status==="done"){o.value=!1;const e=(r=a.file.response)==null?void 0:r.result,t=e.accessUrl;m("上传成功！","success"),h.value=t,p("update:modelValue",e.version),p("change",e)}else a.file.error?(S.error({message:"系统提示",description:"系统未知错误，请反馈给管理员"}),o.value=!1):a.file.response&&(o.value=!1)};return(a,r)=>{const e=y,t=N;return C(),F(t,{name:"file",accept:".jar",action:s(B),headers:{[s(u)]:s(j).get(s(u))},onChange:x,class:"upload-box","before-upload":g,disabled:s(o),maxCount:1,fileList:s(n),onRemove:b},{default:f(()=>[v("div",null,[I(e,null,{default:f(()=>[L("上传文件")]),_:1}),K])]),_:1},8,["action","headers","disabled","fileList"])}}});const re=k(w,[["__scopeId","data-v-e62fbbd4"]]);export{re as default};
