南昌市物联网技防平台-前端
shuishen
2021-03-19 2cddcc5f2e4ce21526980d9e9d7c7972ba51fcb8
逻辑处理部分
1 files modified
77 ■■■■ changed files
src/views/realTimePolice/real.vue 77 ●●●● 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-03-19 15:21:40
 * @Last Modified time: 2021-03-19 16:56:35
 */
<template>
  <basic-container>
@@ -797,12 +797,18 @@
        ...params,
      };
      console.log(this.$router.query, 111)
      console.log(this.$router.query, 111);
      params = {
        alarmType:this.$router.query.alarmType
      if (
        this.$router.query &&
        this.$router.query != null &&
        this.$router.query != ""
      ) {
        params = {
          alarmType: this.$router.query.alarmType,
        };
      }
      if (releaseTimeRange) {
        values = {
          ...params,
@@ -1163,7 +1169,6 @@
          //     });
        });
    },
    closeRealVideoBox() {
      var dom = document.getElementById("video_conversation");
@@ -1197,9 +1202,9 @@
        },
      });
      var that = this;
      setInterval(() => {
        // 一键呼叫相关函数
        Recorder.getPermission().then(() => {
      Recorder.getPermission().then(() => {
        setInterval(() => {
          // 一键呼叫相关函数
          that.recorder.start().then(() => {
            // 开始录音
            newCallAxios
@@ -1213,37 +1218,39 @@
                }
              )
              .then((result) => {
                var formData = new FormData();
                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"
                );
                formData.append("file", fileOfBlob);
                setTimeout(() => {
                  var formData = new FormData();
                  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"
                  );
                  formData.append("file", fileOfBlob);
                // var dom = document.getElementById("real_audio");
                // dom.setAttribute("src", URL.createObjectURL(blob));
                  // var dom = document.getElementById("real_audio");
                  // dom.setAttribute("src", URL.createObjectURL(blob));
                // this.recorder.play();
                  // this.recorder.play();
                newCallAxios
                  .post(`/api_control`, blob, {
                    params: {
                      param: {
                        PktType: "Talk",
                        accessToken: result.data.data.accessToken,
                        // deviceCode: form.channelNumber,
                        deviceCode: "001231663A45",
                  newCallAxios
                    .post(`/api_control`, blob, {
                      params: {
                        param: {
                          PktType: "Talk",
                          accessToken: result.data.data.accessToken,
                          // deviceCode: form.channelNumber,
                          deviceCode: "001231663A45",
                        },
                      },
                    },
                  })
                  .then((result) => {});
                    })
                    .then((result) => {});
                }, 10000);
              });
          });
        });
      }, 5000);
        }, 5000);
      });
    },
    aKeyToCall111(e, form) {
@@ -1300,7 +1307,7 @@
              });
          });
        });
        // 一键呼叫相关函数
      }, 200000);
    },