南昌市物联网技防平台-前端
shuishen
2021-03-19 b69ca83a6f4eacc6afa0ac5b23514e6a520b79ea
部分逻辑修改
3 files modified
78 ■■■■■ changed files
src/page/index/logo.vue 16 ●●●● patch | view | raw | blame | history
src/views/realTimePolice/real.vue 58 ●●●● patch | view | raw | blame | history
vue.config.js 4 ●●●● patch | view | raw | blame | history
src/page/index/logo.vue
@@ -365,9 +365,18 @@
          url: "/api/blade-jfpts/alarm/alarm/selecttx?id=" + that.deviceId,
          method: "post",
        }).then(function (response) {
          var userId = JSON.parse(window.localStorage.getItem('物联网安保云服务平台-userInfo')).content.user_id;
          if (response.data.data.length > 0 && response.data.data[0].waringType == "一键求助" && response.data.data[0].alarmId != userId) {
          var userId = JSON.parse(
            window.localStorage.getItem("物联网安保云服务平台-userInfo")
          ).content.user_id;
          if (response.data.data.length > 0) {
            that.deviceId = response.data.data[0].id;
            console.log(userId, response.data.data[0].alarmId);
            if (
              response.data.data[0].waringType == "紧急求救" &&
              response.data.data[0].alarmId == userId
            ) {
              response.data.data[0].waringType == "一键求助";
            that.form = response.data.data[0];
            that.peopleList = [
              { label: that.form.oneContacts, value: that.form.onePhone },
@@ -381,12 +390,15 @@
            that.$refs.realAudio.src = "./realVideo/audio.mp3";
            that.$refs.realAudio.play();
          }
          }
        });
      }, 5000);
    },
    closeDialog() {
      //关闭窗口回调,关闭警报
      this.$refs.realAudio.pause();
     this.videoConversationReal = false;
      this.oldVideoSatart = false;
    },
    updateJtyep(row, jtype, t) {
      var that = this;
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 16:56:35
 * @Last Modified time: 2021-03-19 18:47:03
 */
<template>
  <basic-container>
@@ -65,11 +65,7 @@
          >{{
            row.jtype == "0"
              ? "未处理"
              : row.jtype == "1"
              ? "办结"
              : row.jtype == "2"
              ? "推送110"
              : "派发保安"
              : "已处理"
          }}
        </el-tag>
      </template>
@@ -367,12 +363,12 @@
                src="/img/police-num.png"
                style="margin-top: -20px; height: 80px; vertical-align: middle"
                alt=""
                @click.stop="updateJtyep(form, 2, '推送110')"
                @click.stop="updateJtyep(form, 1, '推送110')"
              />
              <el-button
                type="primary"
                @click.stop="updateJtyep(form, 3, '派送保安')"
                @click.stop="updateJtyep(form, 1, '派送保安')"
                >派送保安
              </el-button>
            </el-form-item>
@@ -444,7 +440,7 @@
          {
            label: "警情类型",
            prop: "waringType",
            search: true,
            search: false,
            searchSpan: 3,
            width: 130,
            className: "waringTypeClass",
@@ -527,17 +523,9 @@
                value: "0",
              },
              {
                label: "办结",
                label: "已处理",
                value: "1",
              },
              {
                label: "推送110",
                value: "2",
              },
              {
                label: "派发保安",
                value: "3",
              },
              }
            ],
          },
          {
@@ -806,8 +794,6 @@
        ...params,
      };
      console.log(this.$router.query, 111);
      if (
        this.$router.query &&
        this.$router.query != null &&
@@ -835,6 +821,10 @@
      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 = "一键求助" : '';
        })
        this.page.total = data.total;
        data.records.sort((a, b) => {
@@ -842,6 +832,7 @@
        });
        this.data = data.records;
        this.loading = false;
        this.selectionClear();
      });
@@ -1128,7 +1119,7 @@
        .then((res) => {
          newAxios
            .get(
              `https://web.byisf.com:18000/GetPlayUrl?deviceCode=001231663A45&chl=${this.form.channelNumber}`
              `https://web.byisf.com:18000/GetPlayUrl?deviceCode=001241945990&chl=${this.form.channelNumber}`
            )
            .then((result) => {
              this.videoSource = result.data.data.m3u8;
@@ -1211,11 +1202,14 @@
        },
      });
      var that = this;
      Recorder.getPermission().then(() => {
        setInterval(() => {
          // 一键呼叫相关函数
          that.recorder.start().then(() => {
        setInterval(() => {
          that.recorder.start().then(
            () => {
            // 开始录音
              setTimeout(() => {
            newCallAxios
              .post(
                `/api_control`,
@@ -1227,7 +1221,6 @@
                }
              )
              .then((result) => {
                setTimeout(() => {
                  var formData = new FormData();
                  var blob = that.recorder.getPCMBlob(); //获取pcm格式音频数据
                  //此处获取到blob对象后需要设置fileName满足当前项目上传需求,其它项目可直接传把blob作为file塞入formData
@@ -1250,15 +1243,20 @@
                          PktType: "Talk",
                          accessToken: result.data.data.accessToken,
                          // deviceCode: form.channelNumber,
                          deviceCode: "001231663A45",
                            deviceCode: "001241945990",
                        },
                      },
                    })
                    .then((result) => {});
                }, 10000);
              });
          });
        }, 5000);
            },
            (error) => {
              // 出错了
              console.log(`${error.name} : ${error.message}`);
            }
          );
        }, 6000);
      });
    },
@@ -1308,7 +1306,7 @@
                        PktType: "Talk",
                        accessToken: result.data.data.accessToken,
                        // deviceCode: form.channelNumber,
                        deviceCode: "001231663A45",
                        deviceCode: "001241945990",
                      },
                    },
                  })
@@ -1330,7 +1328,7 @@
    PoliceTracking(row) {
      //警情追踪
      this.$router.push({path: "/policeTracking/track", query: row});
    }
    },
  },
};
</script>
vue.config.js
@@ -34,8 +34,8 @@
        proxy: {
            '/api': {
                //本地服务接口地址
                //target: 'http://192.168.3.39:82/',
                target: 'https://web.byisf.com:18001/api/',
                target: 'http://192.168.1.125:82/',
                // target: 'https://web.byisf.com:18001/api/',
                //远程演示服务地址,可用于直接启动项目
                //target: 'https://saber.bladex.vip/api',
                ws: true,