南昌市物联网技防平台-前端
shuishen
2021-04-10 f1f6113730d402721454784715467fb48109d843
录音有问题,去除下
1 files modified
39 ■■■■■ changed files
src/views/realTimePolice/real.vue 39 ●●●●● patch | view | raw | blame | history
src/views/realTimePolice/real.vue
@@ -2,7 +2,7 @@
 * @Author: Morpheus
 * @Date: 2021-03-17 15:21:33
 * @Last Modified by: Morpheus
 * @Last Modified time: 2021-04-10 17:28:09
 * @Last Modified time: 2021-04-10 17:33:38
 */
<template>
  <basic-container>
@@ -479,7 +479,6 @@
            format: "yyyy-MM-dd",
            valueFormat: "yyyy-MM-dd",
            searchRange: true,
            searchValue:[this.getStartTime(),this.getEndTime()],
            searchSpan: 5,
            hide: true,
            addDisplay: false,
@@ -818,16 +817,6 @@
    },
    refreshChange() {
      this.onLoad(this.page, this.query);
    },
    getStartTime(){
      if (this.$route.query.startTime != undefined && this.$route.query.startTime != null && this.$route.query.startTime != "" ) {
        return this.$route.query.startTime
      }
    },
    getEndTime(){
      if (this.$route.query.endTime != undefined && this.$route.query.endTime != null && this.$route.query.endTime != "" ) {
        return this.$route.query.endTime
      }
    },
    onLoad(page, params = {}) {
      const { releaseTimeRange } = this.query;
@@ -1373,37 +1362,13 @@
        )
        .then((result) => {
          var formData = new FormData();
          // that.recorder.downloadWAV("新文件");
          var blob = that.recorder.getPCMBlob(); //获取pcm格式音频数据
          //此处获取到blob对象后需要设置fileName满足当前项目上传需求,其它项目可直接传把blob作为file塞入formData
          var newbolb = new Blob([blob], { type: "audio/pcm" });
          var fileOfBlob = new File([newbolb], new Date().getTime() + ".pcm");
          var formDataWav = new FormData();
          var wavBlob = that.recorder.getWAVBlob();
          var newbolbWav = new Blob([wavBlob], { type: "audio/wav" });
          var fileOfBlobWav = new File(
            [newbolbWav],
            new Date().getTime() + ".wav"
          );
          formData.append("file", fileOfBlob);
          formDataWav.append("file", fileOfBlobWav);
          console.log(wavBlob, formDataWav, formData, "录音");
          axios({
            method: "post",
            url: `/api/blade-jfpts/xlfeedback/xlfeedback/put-objecty`,
            params: {
              jid: that.form.id,
              file: formDataWav,
            },
          }).then((resdata) => {
            console.log(resdata);
          });
          newCallAxios
            .post(`/api_control`, blob, {
              params: {