648540858
2023-12-05 ad36354ef46a31f24b2583263f575d6736c0ad28
web_src/src/components/dialog/recordDownload.vue
old mode 100644 new mode 100755
@@ -6,7 +6,7 @@
        <el-progress :percentage="percentage"></el-progress>
      </el-col>
      <el-col :span="6" >
        <el-button icon="el-icon-download" v-if="percentage < 100" size="mini" title="点击下载可将以缓存部分下载到本地" @click="download()">停止缓存并下载</el-button>
        <el-button icon="el-icon-download" v-if="downloadFile" size="mini" title="点击下载" @click="downloadFileClientEvent()">下载</el-button>
      </el-col>
    </el-row>
  </el-dialog>
@@ -26,7 +26,7 @@
    },
    data() {
        return {
          title: "四倍速下载中...",
          title: "下载中...",
          deviceId: "",
          channelId: "",
          app: "",
@@ -39,7 +39,8 @@
          taskId: null,
          getProgressRun: false,
          getProgressForFileRun: false,
          timer: null
          timer: null,
          downloadFile: null,
        };
    },
@@ -135,10 +136,11 @@
        getFileDownload: function (){
          this.$axios({
            method: 'get',
            url:`/record_proxy/${this.mediaServerId}/api/record/file/download/task/add`,
            url:`/api/cloud/record/task/add`,
            params: {
              app: this.app,
              stream: this.stream,
              mediaServerId: this.mediaServerId,
              startTime: null,
              endTime: null,
            }
@@ -167,10 +169,9 @@
        getProgressForFile: function (callback){
          this.$axios({
            method: 'get',
            url:`/record_proxy/${this.mediaServerId}/api/record/file/download/task/list`,
            url:`/api/cloud/record/task/list`,
            params: {
              app: this.app,
              stream: this.stream,
              mediaServerId: this.mediaServerId,
              taskId: this.taskId,
              isEnd: true,
            }
@@ -187,8 +188,9 @@
                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)
                   this.close();
                   this.downloadFile = res.data.data[0].downloadFile
                   this.title = "文件处理完成,点击按扭下载"
                   // window.open(res.data.data[0].downloadFile)
                 }else {
                   if (callback)callback()
                 }
@@ -196,7 +198,10 @@
          }).catch(function (error) {
            console.log(error);
          });
        }
        },
      downloadFileClientEvent: function (){
        window.open(this.downloadFile )
      }
    },
    destroyed() {
      window.removeEventListener('beforeunload', this.stopDownloadRecord)