import{_ as a,b as o,aI as e,d as l,e as d,f as t,w as u,aP as s,aQ as n,i as p,aR as i,aS as r,H as c,aT as m,aU as f,o as h,h as F,j as g,N as _,O as b}from"./index-BkedNVDG.js";import{_ as U}from"./file-upload.DZUKRmgp.js";const k=""+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"),s),y=l(d("up-form-item"),n),V=_,B=p,v=l(d("up-loading-icon"),i),j=l(d("file-upload"),U),C=b,P=l(d("up-form"),r),E=l(d("up-button"),c),H=l(d("up-col"),m),I=l(d("up-row"),f);return h(),t(B,{class:"update-page"},{default:u((()=>[F(P,{model:x.updateForm,"label-width":100},{default:u((()=>[F(y,{label:"版本号"},{default:u((()=>[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:u((()=>[F(j,{"max-size":60,"suffix-path":"/file/uploadNewApk",onBefore:L.onUploadFileBefore,onSuccess:L.onUploadFileSuccess,onError:L.onUploadFileFail},{default:u((()=>[x.uploadLoading?(h(),t(B,{key:1,class:"upload-box"},{default:u((()=>[F(v)])),_:1})):(h(),t(B,{key:0,class:"upload-box"},{default:u((()=>[F(V,{src:k,class:"upload-icon",mode:"aspectFit"})])),_:1}))])),_:1},8,["onBefore","onSuccess","onError"])])),_:1}),F(y,{label:"更新内容"},{default:u((()=>[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(I,{justify:"around",style:{"margin-top":"10px"}},{default:u((()=>[F(H,{span:4},{default:u((()=>[F(E,{type:"primary",icon:"checkbox-mark",onClick:L.handleSubmit},{default:u((()=>[g("提交")])),_:1},8,["onClick"])])),_:1}),F(H,{span:4},{default:u((()=>[F(E,{icon:"arrow-left",onClick:L.handleBack},{default:u((()=>[g("返回")])),_:1},8,["onClick"])])),_:1})])),_:1})])),_:1})}],["__scopeId","data-v-26c75c9f"]]);export{w as default};
