import{_ as s,i as e,s as a,a as t,b as o,o as n,c,f as r,e as d,w as l,h as p,t as i,p as u,k as h}from"./index-4c6e30ca.js";const f={data:()=>({status:0,progress:"",percentNumber:0}),mounted(){this.init()},methods:{init(){e.removeAllListeners(a.appUpdater),e.on(a.appUpdater,((s,e)=>{e=JSON.parse(e),this.status=e.status,3==e.status?(this.progress=e.desc,this.percentNumber=e.percentNumber):this.$message.info(e.desc)}))},checkForUpdater(){e.invoke(t.checkForUpdater).then((s=>{console.log(s)}))},download(){1===this.status?e.invoke(t.downloadApp).then((s=>{console.log(s)})):this.$message.info("没有可用版本")}}},k=s=>(u("data-v-88c3fe69"),s=s(),h(),s),m={id:"app-demo-window"},v=k((()=>r("div",{class:"one-block-1"},[r("span",null," 1. 自动更新 ")],-1))),b={class:"one-block-2"},g=k((()=>r("div",{class:"one-block-1"},[r("span",null," 2. 下载进度 ")],-1))),_={class:"one-block-2"};const w=s(f,[["render",function(s,e,a,t,u,h){const f=o("a-button"),k=o("a-space"),w=o("a-progress");return n(),c("div",m,[v,r("div",b,[d(k,null,{default:l((()=>[d(f,{onClick:e[0]||(e[0]=s=>h.checkForUpdater())},{default:l((()=>[p("检查更新")])),_:1}),d(f,{onClick:e[1]||(e[1]=s=>h.download())},{default:l((()=>[p("下载并安装")])),_:1})])),_:1})]),g,r("div",_,[d(w,{percent:u.percentNumber,status:"active"},null,8,["percent"]),d(k,null,{default:l((()=>[p(i(u.progress),1)])),_:1})])])}],["__scopeId","data-v-88c3fe69"]]);export{w as default};
