import{_ as a,s as o,aI as e,f as l,h as d,i as t,w as s,aP as u,aQ as n,j as p,aR as i,aS as r,J as c,aT as m,aU as f,o as h,k as F,l as g,P as _,Q as k}from"./index-mnxZbLx5.js";import{_ as U}from"./file-upload.DSKIEU6U.js";const b=""+new URL("upload-icon-DMqiP0gl.png",import.meta.url).href;const w=a({data:()=>({updateForm:{version:null,downloadUrl:"",updateLog:""},uploadLoading:!1}),created(){},mounted(){},methods:{onUploadFileBefore(a){this.uploadLoading=!0,console.log(a,"文件上传前")},onUploadFileSuccess(a,e){console.log(a),200===e.code&&(this.uploadLoading=!1,this.updateForm.downloadUrl=e.data,o({title:"apk上传成功！",icon:"none"}))},onUploadFileFail(a,o){console.log(a,o,"文件上传失败")},async handleSubmit(){if(this.updateForm.downloadUrl){const a=await this.$http({url:"/appVersion",method:"POST",data:this.updateForm});200===a.code&&o({title:"提交成功！",icon:"success"}),console.log(a)}else o({title:"请检查输入内容",icon:"error"})},handleBack(){this.updateForm.downloadUrl=null,this.updateForm.updateLog=null,this.updateForm.version=null,e()}}},[["render",function(a,o,e,w,x,L){const S=l(d("up-input"),u),y=l(d("up-form-item"),n),V=_,B=p,v=l(d("up-loading-icon"),i),j=l(d("file-upload"),U),C=k,P=l(d("up-form"),r),I=l(d("up-button"),c),E=l(d("up-col"),m),Q=l(d("up-row"),f);return h(),t(B,{class:"update-page"},{default:s((()=>[F(P,{model:x.updateForm,"label-width":100},{default:s((()=>[F(y,{label:"版本号"},{default:s((()=>[F(S,{modelValue:x.updateForm.version,"onUpdate:modelValue":o[0]||(o[0]=a=>x.updateForm.version=a),placeholder:"请输入版本号,格式:3.2.9",border:"bottom",clearable:""},null,8,["modelValue"])])),_:1}),F(y,{label:"上传apk"},{default:s((()=>[F(j,{"max-size":60,formats:"apk","suffix-path":"/file/uploadNewApk",onBefore:L.onUploadFileBefore,onSuccess:L.onUploadFileSuccess,onError:L.onUploadFileFail},{default:s((()=>[x.uploadLoading?(h(),t(B,{key:1,class:"upload-box"},{default:s((()=>[F(v)])),_:1})):(h(),t(B,{key:0,class:"upload-box"},{default:s((()=>[F(V,{src:b,class:"upload-icon",mode:"aspectFit"})])),_:1}))])),_:1},8,["onBefore","onSuccess","onError"])])),_:1}),F(y,{label:"更新内容"},{default:s((()=>[F(C,{modelValue:x.updateForm.updateLog,"onUpdate:modelValue":o[1]||(o[1]=a=>x.updateForm.updateLog=a),class:"update-textarea",placeholder:"请输入更新内容，每行限制13个字符","auto-height":""},null,8,["modelValue"])])),_:1})])),_:1},8,["model"]),F(Q,{justify:"around",style:{"margin-top":"10px"}},{default:s((()=>[F(E,{span:4},{default:s((()=>[F(I,{type:"primary",icon:"checkbox-mark",onClick:L.handleSubmit},{default:s((()=>[g("提交")])),_:1},8,["onClick"])])),_:1}),F(E,{span:4},{default:s((()=>[F(I,{icon:"arrow-left",onClick:L.handleBack},{default:s((()=>[g("返回")])),_:1},8,["onClick"])])),_:1})])),_:1})])),_:1})}],["__scopeId","data-v-5fe7f40f"]]);export{w as default};
