南昌市物联网技防平台-前端
shuishen
2021-03-20 06a1b82e3656be1ef9573e1abb9977457cb4a6d8
logo修改,部分字段显示调整
1 files renamed
2 files modified
1 files added
157 ■■■■■ changed files
public/img/1.png patch | view | raw | blame | history
public/img/ydlg.png patch | view | raw | blame | history
public/img/ydly.png patch | view | raw | blame | history
src/views/realTimePolice/real.vue 157 ●●●●● patch | view | raw | blame | history
public/img/1.png

public/img/ydlg.png

public/img/ydly.png
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 18:47:03
 * @Last Modified time: 2021-03-20 09:46:40
 */
<template>
  <basic-container>
@@ -63,9 +63,7 @@
      <template slot-scope="{ row }" slot="jtype">
        <el-tag
          >{{
            row.jtype == "0"
              ? "未处理"
              : "已处理"
            row.jtype == "0" ? "未处理" : row.jtype == "1" ? "处理中" : "已处理"
          }}
        </el-tag>
      </template>
@@ -101,7 +99,7 @@
          >核实
        </el-button>
        <el-button
          v-if="row.jtype == 1 || row.jtype == 2 || row.jtype == 3"
          v-if="row.jtype != 0 && row.jtype != ''"
          icon="el-icon-s-order"
          :size="size"
          :type="type"
@@ -483,16 +481,26 @@
              },
            ],
          },
          // {
          //   label: "报警内容",
          //   prop: "content",
          // },
          {
            label: "报警内容",
            prop: "content",
            label: "主要负责人",
            prop: "oneContacts",
            width: 90,
          },
          {
            label: "负责人电话",
            prop: "onePhone",
            width: 96,
          },
          {
            label: "报警人",
            prop: "galarmPeople",
          },
          {
            label: "联系电话",
            label: "报警人电话",
            prop: "phoneNumber",
            width: 130,
          },
@@ -523,9 +531,13 @@
                value: "0",
              },
              {
                label: "已处理",
                label: "处理中",
                value: "1",
              }
              },
              {
                label: "已处理",
                value: "2",
              },
            ],
          },
          {
@@ -652,6 +664,8 @@
      peopleList: [],
      peopleName: "",
      peoplePhone: "",
      aKeyToCallFlag: false,
      aKeyToCallTime: null,
    };
  },
  computed: {
@@ -821,10 +835,9 @@
      this.loading = true;
      getList(page.currentPage, page.pageSize, values).then((res) => {
        const data = res.data.data;
        console.log(data.records);
        data.records.forEach(item => {
          item.waringType == "紧急求救" ? item.waringType = "一键求助" : '';
        })
        data.records.forEach((item) => {
          item.waringType == "紧急求救" ? (item.waringType = "一键求助") : "";
        });
        this.page.total = data.total;
        data.records.sort((a, b) => {
@@ -832,7 +845,7 @@
        });
        this.data = data.records;
        this.loading = false;
        this.selectionClear();
      });
@@ -1187,7 +1200,6 @@
      dom.currentTime = 0;
      dom.play();
    },
    closeOldVideoBox() {
      var dom = document.getElementById("old_video");
      dom.pause();
@@ -1202,62 +1214,67 @@
        },
      });
      var that = this;
      Recorder.getPermission().then(() => {
        // 一键呼叫相关函数
        setInterval(() => {
          that.recorder.start().then(
            () => {
              // 开始录音
              setTimeout(() => {
                newCallAxios
                  .post(
                    `/api_control`,
                    {},
                    {
                      params: {
                        param: { PktType: "GetAccessToken" },
                      },
                    }
                  )
                  .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);
                    // var dom = document.getElementById("real_audio");
                    // dom.setAttribute("src", URL.createObjectURL(blob));
                    // this.recorder.play();
                    newCallAxios
                      .post(`/api_control`, blob, {
      if (this.aKeyToCallFlag == false) {
        this.aKeyToCallFlag = true;
        Recorder.getPermission().then(() => {
          // 一键呼叫相关函数
          that.aKeyToCallTime = setInterval(() => {
            that.recorder.start().then(
              () => {
                // 开始录音
                setTimeout(() => {
                  newCallAxios
                    .post(
                      `/api_control`,
                      {},
                      {
                        params: {
                          param: {
                            PktType: "Talk",
                            accessToken: result.data.data.accessToken,
                            // deviceCode: form.channelNumber,
                            deviceCode: "001241945990",
                          },
                          param: { PktType: "GetAccessToken" },
                        },
                      })
                      .then((result) => {});
                  });
              }, 5000);
            },
            (error) => {
              // 出错了
              console.log(`${error.name} : ${error.message}`);
            }
          );
        }, 6000);
      });
                      }
                    )
                    .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);
                      // var dom = document.getElementById("real_audio");
                      // dom.setAttribute("src", URL.createObjectURL(blob));
                      // this.recorder.play();
                      newCallAxios
                        .post(`/api_control`, blob, {
                          params: {
                            param: {
                              PktType: "Talk",
                              accessToken: result.data.data.accessToken,
                              // deviceCode: form.channelNumber,
                              deviceCode: "001241945990",
                            },
                          },
                        })
                        .then((result) => {});
                    });
                }, 5000);
              },
              (error) => {
                // 出错了
                console.log(`${error.name} : ${error.message}`);
              }
            );
          }, 6000);
        });
      } else {
        this.aKeyToCallFlag = false;
        window.clearInterval(that.aKeyToCallTime)
      }
    },
    aKeyToCall111(e, form) {