|
@@ -1,9 +1,9 @@
|
|
|
<template>
|
|
|
- <div class="fs-30 px-2 centerd">
|
|
|
- <div class="mb-2">
|
|
|
+ <div class="fs-12 p-2">
|
|
|
+ <div>
|
|
|
{{ stateData[state1].msg }}
|
|
|
</div>
|
|
|
- <div class="mt-2 text-view1 pl-2" v-if="state1 == 3">
|
|
|
+ <div class="mt-1 text-view1 pl-2" v-if="state1 == 3">
|
|
|
<el-progress :percentage="percent" class="w-100" color="#67c23a"></el-progress>
|
|
|
</div>
|
|
|
</div>
|
|
@@ -17,12 +17,13 @@ export default {
|
|
|
data() {
|
|
|
return {
|
|
|
webURL: '',
|
|
|
- stateData: [{ code: 0, msg: '正在检查更新...' },
|
|
|
+ stateData: [{ code: 0, msg: '正在查询更新...' },
|
|
|
{ code: 1, msg: '更新出错,请重启软件' },
|
|
|
{ code: 2, msg: '无更新可用' },
|
|
|
{ code: 3, msg: '发现有新版本,正在下载' },
|
|
|
{ code: 4, msg: '下载完成,重启更新' },
|
|
|
- { code: 5, msg: '未设置更新地址' }],
|
|
|
+ { code: 5, msg: '未设置更新地址' }
|
|
|
+ ],
|
|
|
state1: 0,
|
|
|
percent: 0,
|
|
|
}
|
|
@@ -33,28 +34,28 @@ export default {
|
|
|
this.webURL = locationpath.webURL || '';
|
|
|
this.get1()
|
|
|
this.get2()
|
|
|
- this.sendurl()
|
|
|
+ this.sendurl(this.webURL)
|
|
|
// console.log(this.$router)
|
|
|
},
|
|
|
methods: {
|
|
|
...mapActions({
|
|
|
getlocationpath: 'user/getlocationpath',
|
|
|
}),
|
|
|
- sendurl(){
|
|
|
- // console.log(111,this.webURL)
|
|
|
- ipcRenderer.send('sendurl',{url:this.webURL})
|
|
|
+ sendurl(url){
|
|
|
+ ipcRenderer.send('sendurl',{url})
|
|
|
},
|
|
|
get1() {
|
|
|
let t = this
|
|
|
ipcRenderer.on('state1', (event, data) => {
|
|
|
t.state1 = data
|
|
|
+ // console.log(59, data, t.state1)
|
|
|
})
|
|
|
},
|
|
|
get2() {
|
|
|
let t = this
|
|
|
ipcRenderer.on('downloadProgress', (event, data) => {
|
|
|
t.percent = (data.percent).toFixed(1);
|
|
|
- // console.log(t.percent)
|
|
|
+ console.log(t.percent)
|
|
|
if (data.percent >= 100) {
|
|
|
t.state1 = 4;
|
|
|
}
|