import{_ as a,b as o,aI as e,d as l,e as d,f as t,w as s,b0 as u,b1 as n,i as p,b2 as i,b3 as r,H as c,b4 as m,b5 as f,o as h,h as F,j as b,N as g,O as _}from"./index-xwCzhlt-.js";import{_ as k}from"./file-upload.BXxH9VMH.js";const U=""+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 y=l(d("up-input"),u),S=l(d("up-form-item"),n),V=g,B=p,v=l(d("up-loading-icon"),i),j=l(d("file-upload"),k),C=_,I=l(d("up-form"),r),E=l(d("up-button"),c),N=l(d("up-col"),m),O=l(d("up-row"),f);return h(),t(B,{class:"update-page"},{default:s((()=>[F(I,{model:x.updateForm,"label-width":100},{default:s((()=>[F(S,{label:"版本号"},{default:s((()=>[F(y,{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(S,{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:U,class:"upload-icon",mode:"aspectFit"})])),_:1}))])),_:1},8,["onBefore","onSuccess","onError"])])),_:1}),F(S,{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(O,{justify:"around",style:{"margin-top":"10px"}},{default:s((()=>[F(N,{span:4},{default:s((()=>[F(E,{type:"primary",icon:"checkbox-mark",onClick:L.handleSubmit},{default:s((()=>[b("提交")])),_:1},8,["onClick"])])),_:1}),F(N,{span:4},{default:s((()=>[F(E,{icon:"arrow-left",onClick:L.handleBack},{default:s((()=>[b("返回")])),_:1},8,["onClick"])])),_:1})])),_:1})])),_:1})}],["__scopeId","data-v-5fe7f40f"]]);export{w as default};
