| | |
| | | :append-to-body="true" |
| | | :close-on-press-escape="false" |
| | | :close-on-click-modal="false" |
| | | @opened="videoConversationReal = true" |
| | | @opened="onDialogTableVisible" |
| | | @close="closeDialog" |
| | | > |
| | | <el-form |
| | |
| | | url: "/api/blade-jfpts/alarm/alarm/getLimit", |
| | | method: "get", |
| | | }).then(function (response) { |
| | | that.deviceId = response.data.data[0].id; |
| | | if (response.data.data.length > 0) { |
| | | that.deviceId = response.data.data[0].id; |
| | | } else { |
| | | that.deviceId = 0; |
| | | } |
| | | //获得最新ID,开启实时报警循环 |
| | | that.layerRealtime(); |
| | | }); |
| | |
| | | |
| | | if (response.data.data.length > 0) { |
| | | that.deviceId = response.data.data[0].id; |
| | | that.form = response.data.data[0]; |
| | | newAxios |
| | | .post( |
| | | "/api_control", |
| | | {}, |
| | | { |
| | | params: { |
| | | param: JSON.stringify({ PktType: "GetAccessToken" }), |
| | | }, |
| | | } |
| | | ) |
| | | .then((res) => { |
| | | newAxios |
| | | .get( |
| | | `https://web.byisf.com:18000/GetPlayUrl?deviceCode=${that.form.serialNumber}&chl=${that.form.channelNumber}` |
| | | ) |
| | | .then((result) => { |
| | | axios({ |
| | | method: "post", |
| | | url: `/api/blade-jfpts/rvideo/rVoids`, |
| | | params: { |
| | | url: result.data.data.flv, |
| | | }, |
| | | }).then((resdata) => {}); |
| | | }); |
| | | }); |
| | | 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 }, |
| | | { label: that.form.twoContacts, value: that.form.twoPhone }, |
| | |
| | | that.peopleName = that.form.oneContacts; |
| | | that.peoplePhone = that.form.onePhone; |
| | | that.dialogTableVisible = true; |
| | | // Recorder.getPermiRecorderssion().then(() => {}); |
| | | |
| | | newAxios |
| | | .post( |
| | | "/api_control", |
| | | {}, |
| | | { |
| | | params: { |
| | | param: JSON.stringify({ PktType: "GetAccessToken" }), |
| | | }, |
| | | } |
| | | ) |
| | | .then((res) => { |
| | | newAxios |
| | | .get( |
| | | `https://web.byisf.com:18000/GetPlayUrl?deviceCode=${that.form.serialNumber}&chl=${that.form.channelNumber}` |
| | | ) |
| | | .then((result) => { |
| | | axios({ |
| | | method: "post", |
| | | url: `/api/blade-jfpts/rvideo/rVoid`, |
| | | timeout: 600000, |
| | | params: { |
| | | sourcePath: result.data.data.flv, |
| | | jid: that.form.id, |
| | | }, |
| | | }).then((resdata) => { |
| | | }); |
| | | }); |
| | | }); |
| | | |
| | | that.ofX = null; |
| | | that.ofY = null; |
| | |
| | | this.videoConversationReal = false; |
| | | this.oldVideoSatart = false; |
| | | }, |
| | | |
| | | getDate() { |
| | | // 当前时间 |
| | | var timestamp = Date.parse(new Date()); |
| | |
| | | ) |
| | | .then(function () { |
| | | that.dialogTableVisible = false; |
| | | |
| | | axios({ |
| | | method: "post", |
| | | url: `/api/blade-jfpts/rvideo/stop`, |
| | | params: { |
| | | jid: row.id, |
| | | }, |
| | | }).then((resdata) => {}); |
| | | |
| | | that.$router.push({ |
| | | path: "/policeTracking/track", |
| | |
| | | }, |
| | | |
| | | aKeyToCall() { |
| | | this.isActive = true; |
| | | |
| | | var that = this; |
| | | if (this.recorder == null) { |
| | | this.recorder = new Recorder({ |
| | |
| | | // compiling: false,(0.x版本中生效,1.x增加中) // 是否边录边转换,默认是false |
| | | }); |
| | | } |
| | | this.isActive = true; |
| | | |
| | | // 一键呼叫相关函数 |
| | | that.recorder.start().then( |
| | |
| | | |
| | | // 序列号后期待修改 |
| | | aKeyStopCall() { |
| | | this.isActive = false; |
| | | |
| | | var newCallAxios = axios.create({ |
| | | baseURL: "https://web.byisf.com:18000", |
| | | withCredentials: false, |
| | |
| | | }, |
| | | }); |
| | | var that = this; |
| | | that.isActive = false; |
| | | |
| | | newCallAxios |
| | | .post( |
| | |
| | | .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"); |
| | |
| | | |
| | | //启动websocket |
| | | websocketStart() { |
| | | var that = this; |
| | | |
| | | if (!window.WebSocket) { |
| | | window.WebSocket = window.MozWebSocket; |
| | | } |
| | |
| | | window.socket.onopen = function (event) {}; |
| | | |
| | | window.socket.onclose = function (event) {}; |
| | | window.socket.error = function (event) { |
| | | //执行重连 |
| | | that.websocketStart(); |
| | | }; |
| | | } else { |
| | | console.log("WebSocket连接没有建立成功!!"); |
| | | } |
| | |
| | | |
| | | //开启心跳传送 |
| | | window.websockPing = setInterval(function () { |
| | | window.socket.send("ping"); |
| | | },10000); |
| | | |
| | | |
| | | }else{ |
| | | if (window.socket.readyState == WebSocket.OPEN) { |
| | | window.socket.send("ping"); |
| | | } else { |
| | | console.log("心跳停止,断开重连"); |
| | | //断开连接,重连 |
| | | window.clearTimeout(window.websockPing); |
| | | //执行重连 |
| | | that.websocketStart(); |
| | | } |
| | | }, 10000); |
| | | } else { |
| | | console.log("WebSocket连接没有建立成功!!"); |
| | | //执行重连 |
| | | this.websocketStart(); |
| | | that.websocketStart(); |
| | | } |
| | | }, 3000); |
| | | }, |
| | | |
| | | |
| | | |
| | | onDialogTableVisible() { |
| | | Recorder.getPermission().then(() => {}); |
| | | this.videoConversationReal = true; |
| | | }, |
| | | }, |
| | | }; |