| | |
| | | </el-form> |
| | | </el-dialog> |
| | | |
| | | <el-drawer |
| | | title="电子地图" |
| | | append-to-body="true" |
| | | :visible.sync="showMap" |
| | | > |
| | | <iframe |
| | | :src="mapUrl" |
| | | frameborder="0" |
| | | 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> |
| | | </el-drawer> |
| | | </basic-container> |
| | | </template> |
| | |
| | | data() { |
| | | return { |
| | | showMap: false, |
| | | mapUrl:"https://s16s652780.51mypc.cn/jfpt/map/index.html", |
| | | mapUrl: "https://s16s652780.51mypc.cn/jfpt/map/index.html", |
| | | hls: "", |
| | | videoSource: "", |
| | | dialogTableVisible: false, |
| | |
| | | }, |
| | | handleMap() { |
| | | this.showMap = true; |
| | | this.mapUrl = "https://s16s652780.51mypc.cn/jfpt/map/index.html?openid=PatrolManagement" |
| | | this.mapUrl = |
| | | "https://s16s652780.51mypc.cn/jfpt/map/index.html?openid=PatrolManagement"; |
| | | }, |
| | | handleManage(row) { |
| | | this.form = row; |
| | |
| | | }; |
| | | }, |
| | | queryOldVideo(data) { |
| | | console.log(data); |
| | | var newAxios = axios.create({ |
| | | baseURL: "https://s16s652780.51mypc.cn", |
| | | withCredentials: false, |
| | |
| | | } |
| | | ) |
| | | .then(res => { |
| | | console.log(res.data.data.accessToken); |
| | | |
| | | newAxios |
| | | .get( |
| | | `/GetPlayUrl?deviceCode=${data.channelNumber}&chl=${data.serialNumber}` |
| | |
| | | |
| | | this.hls = new Hls(); |
| | | |
| | | console.log(this.videoSource, "19028321321r073"); |
| | | |
| | | var m3u8Url = decodeURIComponent(this.videoSource); |
| | | |
| | | console.log(m3u8Url); |
| | | |
| | | this.hls.loadSource(m3u8Url); |
| | | |
| | |
| | | } |
| | | }, |
| | | aKeyToCall(e, form) { |
| | | var newAxios = axios.create({ |
| | | var newCallAxios = axios.create({ |
| | | baseURL: "https://s16s652780.51mypc.cn", |
| | | withCredentials: false, |
| | | headers: { |
| | |
| | | if (this.isActive == true) { |
| | | this.isActive = false; |
| | | |
| | | newAxios |
| | | newCallAxios |
| | | .post( |
| | | `/api_control`, |
| | | {}, |
| | |
| | | } |
| | | ) |
| | | .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", |
| | |
| | | } |
| | | } |
| | | }) |
| | | .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(() => { |
| | | // 开始录音 |
| | | }); |
| | | }); |
| | | } |
| | | } |
| | | } |