From d05d4980a61531f81857609c707cce53eb9e4edf Mon Sep 17 00:00:00 2001
From: shuishen <1109946754@qq.com>
Date: Fri, 19 Mar 2021 14:04:00 +0800
Subject: [PATCH] 弹框和追踪更改
---
src/views/realTimePolice/real.vue | 161 ++++++++++++++++++++++++++++++++++++++---------------
src/views/policeTracking/policeTracking.vue | 2
2 files changed, 115 insertions(+), 48 deletions(-)
diff --git a/src/views/policeTracking/policeTracking.vue b/src/views/policeTracking/policeTracking.vue
index 214317e..66648aa 100644
--- a/src/views/policeTracking/policeTracking.vue
+++ b/src/views/policeTracking/policeTracking.vue
@@ -490,7 +490,7 @@
},
getReceivingAlarm() {
- axios.get(`/api/blade-jfpts/operation/list?jid=3`).then((res) => {
+ axios.get(`/api/blade-jfpts/operation/list?jid=${this.form.id}`).then((res) => {
this.receivingList = res.data.data.records;
});
},
diff --git a/src/views/realTimePolice/real.vue b/src/views/realTimePolice/real.vue
index 602c1ae..3be796d 100644
--- a/src/views/realTimePolice/real.vue
+++ b/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 11:31:46
+ * @Last Modified time: 2021-03-19 11:53:17
*/
<template>
<basic-container>
@@ -348,7 +348,9 @@
@click.stop="aKeyToCall($event, form)"
>查看视频
</el-button> -->
- <el-button type="success" @click.stop="updateJtyep(form, 1, '办结')"
+ <el-button
+ type="success"
+ @click.stop="updateJtyep(form, 1, '办结')"
>办结
</el-button>
@@ -359,7 +361,9 @@
@click.stop="updateJtyep(form, 2, '推送110')"
/>
- <el-button type="primary" @click.stop="updateJtyep(form, 3, '派送保安')"
+ <el-button
+ type="primary"
+ @click.stop="updateJtyep(form, 3, '派送保安')"
>派送保安
</el-button>
</el-form-item>
@@ -1185,54 +1189,117 @@
"Content-Type": "application/json;",
},
});
-
- // 一键呼叫相关函数
- if (this.isActive == true) {
- this.isActive = false;
- newCallAxios
- .post(
- `/api_control`,
- {},
- {
- params: {
- param: { PktType: "GetAccessToken" },
- },
- }
- )
- .then((result) => {
- var formData = new FormData();
- 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);
-
- // 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: "001231663A45",
- },
- },
- })
- .then((result) => {});
- });
- } else {
- this.isActive = true;
+ var that = this;
+ setInterval(() => {
+ // 一键呼叫相关函数
Recorder.getPermission().then(() => {
- this.recorder.start().then(() => {
+ that.recorder.start().then(() => {
// 开始录音
+ 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, {
+ params: {
+ param: {
+ PktType: "Talk",
+ accessToken: result.data.data.accessToken,
+ // deviceCode: form.channelNumber,
+ deviceCode: "001231663A45",
+ },
+ },
+ })
+ .then((result) => {});
+ });
});
});
- }
+ }, 5000);
+ },
+
+ aKeyToCall111(e, form) {
+ var newCallAxios = axios.create({
+ baseURL: "https://web.byisf.com:18000",
+ withCredentials: false,
+ headers: {
+ "Content-Type": "application/json;",
+ },
+ });
+
+ setInterval(() => {
+ // 一键呼叫相关函数
+ if (this.isActive == true) {
+ this.isActive = false;
+ newCallAxios
+ .post(
+ `/api_control`,
+ {},
+ {
+ params: {
+ param: { PktType: "GetAccessToken" },
+ },
+ }
+ )
+ .then((result) => {
+ var formData = new FormData();
+ 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);
+
+ // 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: "001231663A45",
+ },
+ },
+ })
+ .then((result) => {});
+ });
+ } else {
+ this.isActive = true;
+ Recorder.getPermission().then(() => {
+ this.recorder.start().then(() => {
+ // 开始录音
+ });
+ });
+ }
+ }, 5000);
},
peopleOrPhone(e) {
this.peopleList.forEach((item) => {
--
Gitblit v1.9.3