From b63a89a0a83dfddab0d714bb9aad90114ab9d514 Mon Sep 17 00:00:00 2001
From: 648540858 <648540858@qq.com>
Date: 星期五, 18 八月 2023 14:06:39 +0800
Subject: [PATCH] 修复发流参数错误
---
web_src/src/components/dialog/recordDownload.vue | 38 +++++++++++++++++++++-----------------
1 files changed, 21 insertions(+), 17 deletions(-)
diff --git a/web_src/src/components/dialog/recordDownload.vue b/web_src/src/components/dialog/recordDownload.vue
index b0b8fea..c90cf13 100644
--- a/web_src/src/components/dialog/recordDownload.vue
+++ b/web_src/src/components/dialog/recordDownload.vue
@@ -6,18 +6,6 @@
<el-progress :percentage="percentage"></el-progress>
</el-col>
<el-col :span="6" >
-<!-- <el-dropdown size="mini" title="鎾斁鍊嶉��" style="margin-left: 1px;" @command="gbScale">-->
-<!-- <el-button-group>-->
-<!-- <el-button size="mini" style="width: 100%">-->
-<!-- {{scale}}鍊嶉�� <i class="el-icon-arrow-down el-icon--right"></i>-->
-<!-- </el-button>-->
-<!-- </el-button-group>-->
-<!-- <el-dropdown-menu slot="dropdown">-->
-<!-- <el-dropdown-item command="1">1鍊嶉��</el-dropdown-item>-->
-<!-- <el-dropdown-item command="2">2鍊嶉��</el-dropdown-item>-->
-<!-- <el-dropdown-item command="4">4鍊嶉��</el-dropdown-item>-->
-<!-- </el-dropdown-menu>-->
-<!-- </el-dropdown>-->
<el-button icon="el-icon-download" v-if="percentage < 100" size="mini" title="鐐瑰嚮涓嬭浇鍙皢浠ョ紦瀛橀儴鍒嗕笅杞藉埌鏈湴" @click="download()">鍋滄缂撳瓨骞朵笅杞�</el-button>
</el-col>
</el-row>
@@ -51,6 +39,7 @@
taskId: null,
getProgressRun: false,
getProgressForFileRun: false,
+ timer: null
};
},
@@ -66,7 +55,7 @@
this.percentage = 0.0;
this.getProgressTimer()
},
- getProgressTimer(){
+ getProgressTimer: function (){
if (!this.getProgressRun) {
return;
}
@@ -93,15 +82,27 @@
this.percentage = (parseFloat(res.data.data.progress)*100).toFixed(1);
}
if (callback)callback();
+ }else {
+ this.$message({
+ showClose: true,
+ message: res.data.msg,
+ type: "error",
+ });
+ this.close();
}
}).catch((e) =>{
-
+ console.log(e)
});
},
close: function (){
- if (this.streamInfo.progress < 100) {
+ if (this.streamInfo.progress < 1) {
this.stopDownloadRecord();
+ }
+
+ if (this.timer !== null) {
+ window.clearTimeout(this.timer);
+ this.timer = null;
}
this.showDialog=false;
this.getProgressRun = false;
@@ -160,7 +161,7 @@
}
setTimeout( ()=>{
if (!this.showDialog) return;
- this.getProgressForFile(this.getProgressForFileTimer())
+ this.getProgressForFile(this.getProgressForFileTimer)
}, 1000)
},
getProgressForFile: function (callback){
@@ -178,9 +179,12 @@
if (res.data.code === 0) {
if (res.data.data.length === 0){
this.percentage = 0
+ // 寰�寰�鍦ㄥ娆¤姹傚悗锛堝疄楠屼簲鍒嗛挓鐨勮棰戞槸涓夋璇锋眰锛夛紝鎵嶄細杩斿洖鏁版嵁锛岀涓�娆¤姹傞�氬父鏄繑鍥炵┖鏁扮粍
+ if (callback)callback()
return
}
- this.percentage = parseFloat(res.data.data.percentage)*100
+ // res.data.data搴旀槸鏁扮粍绫诲瀷
+ this.percentage = parseFloat(res.data.data[0].percentage)*100
if (res.data.data[0].percentage === '1') {
this.getProgressForFileRun = false;
window.open(res.data.data[0].downloadFile)
--
Gitblit v1.8.0