南昌市物联网技防平台-前端
jxdnsong
2021-02-03 c1a378042f93f92ed257f1d34650766eb2a11dd6
src/views/realTimePolice/real.vue
@@ -65,28 +65,28 @@
      <template slot-scope="{ type, size, row }" slot="menu">
        <el-button
          icon="el-icon-check"
          icon="el-icon-s-order"
          :size="size"
          :type="type"
          @click.stop="handleHistory(row)"
          >历史</el-button
        >
        <el-button
          icon="el-icon-check"
          icon="el-icon-video-camera-solid"
          :size="size"
          :type="type"
          @click.stop="handleStart(row)"
          >视频</el-button
        >
        <el-button
          icon="el-icon-check"
          icon="el-icon-edit"
          :size="size"
          :type="type"
          @click.stop="handleManage(row)"
          >处置</el-button
        >
        <el-button
          icon="el-icon-check"
          icon="el-icon-location-outline"
          :size="size"
          :type="type"
          @click.stop="handleMap(row)"
@@ -99,6 +99,7 @@
      title="警情处置"
      :visible.sync="dialogTableVisible"
      append-to-body="true"
      @close="innerVisibleVideo = false"
    >
      <el-dialog
        class="old-video-dialog"
@@ -108,7 +109,7 @@
        :visible.sync="innerVisibleVideo"
        :close-on-press-escape="false"
        append-to-body
        @opened="openOldVideoBox()"
        @opened="openOldVideoBox"
        @close="closeOldVideoBox"
      >
        <video
@@ -273,6 +274,7 @@
      </el-form>
    </el-dialog>
<<<<<<< HEAD
    <el-drawer
      title="电子地图"
      append-to-body="true"
@@ -285,6 +287,10 @@
        width="100%"
        height="100%"
      ></iframe>
=======
    <el-drawer title="电子地图" append-to-body="true" :visible.sync="showMap">
      <iframe :src="mapUrl" frameborder="0" width="100%" height="100%"></iframe>
>>>>>>> cb724c3b33fc850771b87c3c6feaa582addac56a
    </el-drawer>
  </basic-container>
</template>
@@ -303,6 +309,10 @@
  data() {
    return {
      showMap: false,
<<<<<<< HEAD
=======
      mapUrl: "https://s16s652780.51mypc.cn/jfpt/map/index.html",
>>>>>>> cb724c3b33fc850771b87c3c6feaa582addac56a
      hls: "",
      videoSource: "",
      dialogTableVisible: false,
@@ -322,7 +332,8 @@
        indexLabel: "序号",
        calcHeight: 30,
        labelWidth: "100",
        menuWidth: 300,
        size:"mini",
        menuWidth: 240,
        dialogWidth: 950,
        tip: false,
        searchShow: true,
@@ -330,7 +341,7 @@
        border: true,
        index: true,
        viewBtn: true,
        selection: true,
        selection: false,
        dialogClickModal: false,
        column: [
          {
@@ -425,12 +436,12 @@
            ]
          },
          {
            label: "行政区",
            label: "省份",
            prop: "province",
            search: true,
            searchSpan: 3,
            searchLabelWidth: 60,
            placeholder: "行政区",
            placeholder: "省份",
            type: "select",
            props: {
              label: "name",
@@ -489,7 +500,7 @@
    permissionList() {
      return {
        addBtn: this.vaildData(this.permission.real_add, false),
        viewBtn: this.vaildData(this.permission.real_view, false),
        viewBtn: this.vaildData(null, false),
        delBtn: this.vaildData(this.permission.real_delete, false),
        editBtn: this.vaildData(this.permission.real_edit, false)
      };
@@ -632,11 +643,21 @@
          ...this.query
        };
        values.releaseTimeRange = null;
      }else{
        values = {
          ...params,
          ...this.query
        };
      }
      this.loading = true;
      getList(page.currentPage, page.pageSize, values).then(res => {
        const data = res.data.data;
        this.page.total = data.total;
        data.records.sort((a,b)=>{
          return a.jtype - b.jtype;
        });
        this.data = data.records;
        this.loading = false;
        this.selectionClear();
@@ -750,7 +771,7 @@
        };
      } else {
        return {
          color: "#ff7627"
          color: "#ff2727"
        };
      }
    },
@@ -782,7 +803,7 @@
      } else {
        axios({
          url:
            "http://192.168.0.102:1888/api/blade-jfpts/jingdan/jingdan/submit",
            "https://s16s652780.51mypc.cn/api/blade-jfpts/jingdan/jingdan/submit",
          method: "post",
          data: {
            rName: row.rname,
@@ -824,7 +845,7 @@
      var that = this;
      axios({
        url:
          "http://192.168.0.102:1888/api/blade-jfpts/alarm/alarm/deletejj?id=" +
          "https://s16s652780.51mypc.cn/api/blade-jfpts/alarm/alarm/deletejj?id=" +
          row.id,
        method: "post"
      }).then(function() {
@@ -836,7 +857,7 @@
      var that = this;
      axios({
        url:
          "http://192.168.0.102:1888/api/blade-jfpts/alarm/alarm/updateJtype?id=" +
          "https://s16s652780.51mypc.cn/api/blade-jfpts/alarm/alarm/updateJtype?id=" +
          row.id +
          "&czTime=" +
          row.czTime +
@@ -908,7 +929,6 @@
      };
    },
    queryOldVideo(data) {
      console.log(data);
      var newAxios = axios.create({
        baseURL: "https://s16s652780.51mypc.cn",
        withCredentials: false,
@@ -930,8 +950,6 @@
          }
        )
        .then(res => {
          console.log(res.data.data.accessToken);
          newAxios
            .get(
              `/GetPlayUrl?deviceCode=${data.channelNumber}&chl=${data.serialNumber}`
@@ -976,11 +994,7 @@
        this.hls = new Hls();
        console.log(this.videoSource, "19028321321r073");
        var m3u8Url = decodeURIComponent(this.videoSource);
        console.log(m3u8Url);
        this.hls.loadSource(m3u8Url);
@@ -997,11 +1011,13 @@
      if (dom.getAttribute("src") != "") {
        dom.pause();
        dom.setAttribute("");
        dom.setAttribute("src", "");
        this.hls.destroy();
      }
    },
    aKeyToCall(e, form) {
      var newAxios = axios.create({
      var newCallAxios = axios.create({
        baseURL: "https://s16s652780.51mypc.cn",
        withCredentials: false,
        headers: {
@@ -1013,7 +1029,7 @@
      if (this.isActive == true) {
        this.isActive = false;
        newAxios
        newCallAxios
          .post(
            `/api_control`,
            {},
@@ -1024,18 +1040,29 @@
            }
          )
          .then(result => {
            console.log(result, 11111111);
            var formData = new FormData();
            var blob = this.recorder.getPCMBlob() //获取wav格式音频数据
            var blob = this.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);
            console.log(blob, newbolb, fileOfBlob, 99999);
            document
              .getElementById("real_audio")
              .setAttribute("src", URL.createObjectURL(blob));
            newAxios
              .post(`/api_control`, formData, {
            console.log(
              blob,
              newbolb,
              fileOfBlob,
              window.URL.createObjectURL(blob),
              99999
            );
            this.recorder.play();
            newCallAxios
              .post(`/api_control`, blob, {
                params: {
                  param: {
                    PktType: "Talk",
@@ -1044,46 +1071,16 @@
                  }
                }
              })
              .then(result => {
                console.log(result);
              });
              .then(result => {});
          });
      } else {
        this.isActive = true;
        Recorder.getPermission().then(
          () => {
            console.log("给权限了");
            this.recorder.start().then(
              () => {
                // 开始录音
                console.log("开始录音了");
              },
              error => {
                // 出错了
                console.log(`${error.name} : ${error.message}`);
              }
            );
          },
          error => {
            console.log(`${error.name} : ${error.message}`);
          }
        );
        var newAxios = axios.create({
          baseURL: "https://s16s652780.51mypc.cn",
          withCredentials: false,
          headers: {
            "Content-Type": "application/json;"
          }
        });
        newAxios
          .post(`/talk?deviceCode=${form.channelNumber}`, "12345")
          .then(result => {
            console.log(result);
        Recorder.getPermission().then(() => {
          this.recorder.start().then(() => {
            // 开始录音
          });
        });
      }
    }
  }