Skip to content

Commit c5914e5

Browse files
committed
update: 更新进度条
1 parent e44d742 commit c5914e5

File tree

1 file changed

+11
-7
lines changed

1 file changed

+11
-7
lines changed

admin/src/views/api_excel/index.vue

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -55,13 +55,13 @@
5555
</template>
5656
</el-table-column>
5757

58-
<el-table-column label="进度条" width="1" align="center" display="none">
58+
<el-table-column label="进度条" width="100" align="center" display="none">
5959
<template slot-scope="scope">
6060
<div v-if="scope.row.state === 0">
6161
<el-progress :text-inside="true" :stroke-width="18" :percentage="0"/>
6262
</div>
6363
<div v-else-if="scope.row.state === 1">
64-
<el-progress :text-inside="true" :stroke-width="18" :percentage="1"/>
64+
<el-progress :text-inside="true" :stroke-width="18" :percentage="scope.row.rate"/>
6565
</div>
6666
<div v-else-if="scope.row.state === 2">
6767
<el-progress :text-inside="true" :stroke-width="18" :percentage="100" status="success"/>
@@ -228,18 +228,20 @@ export default {
228228
// console.log(rs)
229229
},
230230
onerror() { // 连接建立失败重连
231-
this.initWebSocket()
231+
// this.initWebSocket()
232232
},
233233
onmessage(e) { // 数据接收
234234
console.log(e.data)
235-
const redata = JSON.parse(e.data)
236-
console.log(redata)
235+
const data = JSON.parse(e.data)
236+
this.list[2].rate = parseInt(data.data.rate)
237+
console.log(this.list[2].rate)
238+
console.log(data)
237239
},
238240
send(Data) {
239241
this.websock.send(Data)
240242
},
241-
close(e) { // 关闭
242-
console.log('断开连接', e)
243+
close() { // 关闭
244+
console.log('断开连接')
243245
},
244246
download(index, row) {
245247
window.location.href = this.url + row.finish_url
@@ -252,6 +254,8 @@ export default {
252254
this.listLoading = false
253255
this.total = response.data.total
254256
this.url = response.data.appUrl
257+
258+
this.initWebSocket(8)
255259
})
256260
},
257261
handleEdit(index, row) {

0 commit comments

Comments
 (0)