| | |
| | | * @Author: Morpheus |
| | | * @Date: 2021-03-17 15:21:33 |
| | | * @Last Modified by: Morpheus |
| | | * @Last Modified time: 2021-03-18 11:24:28 |
| | | * @Last Modified time: 2021-03-19 10:58:01 |
| | | */ |
| | | <template> |
| | | <basic-container> |
| | |
| | | |
| | | <template slot-scope="{ row }" slot="jtype"> |
| | | <el-tag |
| | | >{{ row.jtype == "0" ? "否" : row.jtype == "1" ? "是" : "无" }} |
| | | >{{ |
| | | row.jtype == "0" |
| | | ? "未处理" |
| | | : row.jtype == "1" |
| | | ? "办结" |
| | | : row.jtype == "2" |
| | | ? "推送110" |
| | | : "派发保安" |
| | | }} |
| | | </el-tag> |
| | | </template> |
| | | <template slot-scope="{ row }" slot="cid"> |
| | |
| | | </avue-crud> |
| | | |
| | | <el-dialog |
| | | class="real-dialog" |
| | | title="警情核实" |
| | | :visible.sync="dialogTableVisible" |
| | | append-to-body="true" |
| | | :append-to-body="true" |
| | | :close-on-click-modal="false" |
| | | @close="innerVisibleVideo = false" |
| | | > |
| | | <el-dialog |
| | | class="old-video-dialog" |
| | | class="ss-video-dialog" |
| | | :modal="false" |
| | | width="100%" |
| | | title="视频通话" |
| | | :visible.sync="innerVisibleVideo" |
| | | :visible.sync="videoConversationReal" |
| | | :close-on-press-escape="false" |
| | | append-to-body |
| | | @opened="openRealVideoBox" |
| | | @close="closeRealVideoBox" |
| | | > |
| | | <video |
| | | src="" |
| | | id="video_conversation" |
| | | style="width: 100%; height: 100%; object-fit: fill" |
| | | controls |
| | | ></video> |
| | | </el-dialog> |
| | | |
| | | <el-dialog |
| | | class="ss-video-dialog" |
| | | :modal="false" |
| | | width="100%" |
| | | title="历史回放" |
| | | :visible.sync="oldVideoSatart" |
| | | :close-on-press-escape="false" |
| | | append-to-body |
| | | @opened="openOldVideoBox" |
| | | @close="closeOldVideoBox" |
| | | > |
| | | <video |
| | | src="" |
| | | src="/oldVideo/ft.mp4" |
| | | muted="muted" |
| | | autoplay="autoplay" |
| | | loop |
| | | id="old_video" |
| | | style="width: 100%; height: 100%; object-fit: fill" |
| | | controls |
| | |
| | | > |
| | | <el-row> |
| | | <el-col span="12"> |
| | | <audio src="" id="real_audio"></audio> |
| | | <el-form-item label="报警人"> |
| | | <el-input |
| | | disabled="true" |
| | |
| | | <el-row> |
| | | <el-col span="12"> |
| | | <el-form-item label="负责人"> |
| | | <el-input |
| | | disabled="true" |
| | | v-model="form.galarmPeople" |
| | | autocomplete="off" |
| | | ></el-input> |
| | | <el-select |
| | | v-model="peopleName" |
| | | placeholder="请选择" |
| | | @change="peopleOrPhone" |
| | | style="width: 100%" |
| | | > |
| | | <el-option |
| | | v-for="item in peopleList" |
| | | :key="item.value" |
| | | :label="item.label" |
| | | :value="item.label" |
| | | > |
| | | </el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col span="12"> |
| | | <el-form-item label="负责人电话"> |
| | | <el-input |
| | | disabled="true" |
| | | v-model="form.phoneNumber" |
| | | v-model="peoplePhone" |
| | | autocomplete="off" |
| | | style="width: calc(100% - 110px)" |
| | | ></el-input> |
| | |
| | | </el-col> |
| | | <el-col span="12"> |
| | | <el-form-item label="监控视频"> |
| | | <el-button type="success" @click.stop="queryOldVideo(form)" |
| | | <el-button |
| | | :class="{ active: isActive }" |
| | | type="success" |
| | | @click.stop=" |
| | | (videoConversationReal = !videoConversationReal), |
| | | (oldVideoSatart = fasle), |
| | | aKeyToCall(form) |
| | | " |
| | | >视频通话 |
| | | </el-button> |
| | | <el-button type="primary" @click.stop="queryOldVideo(form)" |
| | | <el-button |
| | | type="primary" |
| | | @click.stop=" |
| | | (oldVideoSatart = true), (videoConversationReal = false) |
| | | " |
| | | >查看历史 |
| | | </el-button> |
| | | </el-form-item> |
| | |
| | | @click.stop="aKeyToCall($event, form)" |
| | | >查看视频 |
| | | </el-button> --> |
| | | <el-button type="success" @click.stop="revoke(form)" |
| | | <el-button type="success" @click.stop="updateJtyep(form, 1, '办结')" |
| | | >办结 |
| | | </el-button> |
| | | |
| | |
| | | src="/img/police-num.png" |
| | | style="margin-top: -20px; height: 80px; vertical-align: middle" |
| | | alt="" |
| | | @click.stop="updateJtyep(form, 2, '推送110')" |
| | | /> |
| | | |
| | | <el-button type="primary" @click.stop="generate(form)" |
| | | <el-button type="primary" @click.stop="updateJtyep(form, 3, '派送保安')" |
| | | >派送保安 |
| | | </el-button> |
| | | </el-form-item> |
| | |
| | | hls: "", |
| | | videoSource: "", |
| | | dialogTableVisible: false, |
| | | innerVisibleVideo: false, |
| | | videoConversationReal: false, |
| | | oldVideoSatart: false, |
| | | activeClass: 3, |
| | | form: {}, |
| | | query: {}, |
| | |
| | | prop: "deviceNumber", |
| | | }, |
| | | { |
| | | label: "生成警单", |
| | | label: "警情状态", |
| | | searchSpan: 3, |
| | | width: 96, |
| | | search: true, |
| | | searchSpan: 2, |
| | | slot: true, |
| | | searchPlaceholder: " ", |
| | | searchPlaceholder: "请选择", |
| | | prop: "jtype", |
| | | type: "select", |
| | | className: "jtypeClass", |
| | | dicData: [ |
| | | { |
| | | label: "否", |
| | | label: "未处理", |
| | | value: "0", |
| | | }, |
| | | { |
| | | label: "是", |
| | | label: "办结", |
| | | value: "1", |
| | | }, |
| | | { |
| | | label: "推送110", |
| | | value: "2", |
| | | }, |
| | | { |
| | | label: "派发保安", |
| | | value: "3", |
| | | }, |
| | | ], |
| | | }, |
| | |
| | | span: 3, |
| | | labelWidth: "0", |
| | | className: "cityClass3", |
| | | }, |
| | | { |
| | | label: "警情状态", |
| | | searchSpan: 3, |
| | | prop: "cid", |
| | | slot: true, |
| | | hide: true, |
| | | width: 100, |
| | | type: "select", |
| | | dicData: [ |
| | | { |
| | | label: "事件发生", |
| | | value: "1", |
| | | }, |
| | | { |
| | | label: "事件恢复", |
| | | value: "3", |
| | | }, |
| | | ], |
| | | }, |
| | | { |
| | | label: "接警人", |
| | |
| | | data: [], |
| | | isActive: false, |
| | | recorder: null, |
| | | peopleList: [], |
| | | peopleName: "", |
| | | peoplePhone: "", |
| | | }; |
| | | }, |
| | | computed: { |
| | |
| | | }); |
| | | }, |
| | | handleManage(row) { |
| | | console.log(row); |
| | | this.form = row; |
| | | this.peopleList = [ |
| | | { label: row.oneContacts, value: row.onePhone }, |
| | | { label: row.twoContacts, value: row.twoPhone }, |
| | | { label: row.threeContacts, value: row.threePhone }, |
| | | ]; |
| | | this.peopleName = row.oneContacts; |
| | | this.peoplePhone = row.onePhone; |
| | | this.dialogTableVisible = true; |
| | | }, |
| | | generate(row) { |
| | | updateJtyep(row, jtype, t) { |
| | | var that = this; |
| | | if (row.czTime == "" || row.czTime == null) { |
| | | this.$message({ |
| | | message: "请选择处置时间", |
| | | type: "warning", |
| | | }); |
| | | } else { |
| | | axios({ |
| | | url: "/api/blade-jfpts/jingdan/jingdan/submit", |
| | | method: "post", |
| | | data: { |
| | | rName: row.rname, |
| | | galarmPeople: row.galarmPeople, |
| | | phoneNumber: row.phoneNumber, |
| | | place: row.place, |
| | | alarmPeople: row.alarmPeople, |
| | | content: row.content, |
| | | galarmTime: row.alarmTime, |
| | | waringType: row.waringType, |
| | | deviceNumber: row.deviceNumber, |
| | | type: "0", |
| | | handleP: null, |
| | | handleTime: null, |
| | | handName: null, |
| | | level: row.level, |
| | | coordinate: null, |
| | | jd: row.jd, |
| | | wd: row.wd, |
| | | district: row.district, |
| | | city: row.city, |
| | | province: row.province, |
| | | czTime: row.czTime, |
| | | jjTime: row.jjTime, |
| | | bz: row.bz, |
| | | }, |
| | | }) |
| | | .then(function (response) { |
| | | that.$message({ |
| | | message: "生成警单成功", |
| | | type: "success", |
| | | }); |
| | | |
| | | that.updateJtyep(row); |
| | | that.dialogTableVisible = false; |
| | | var arr = []; |
| | | that.$store.state.tags.tagList.forEach((item) => { |
| | | if (item.label != "警情分发处置") { |
| | | arr.push(item); |
| | | } |
| | | }); |
| | | that.$store.state.tags.tagList = arr; |
| | | |
| | | row.type = 0; |
| | | row.id = response.data.data; |
| | | that.$router.push({ path: "/distribution/index", query: row }); |
| | | }) |
| | | .catch(function (error) { |
| | | that.dialogTableVisible = false; |
| | | }); |
| | | } |
| | | }, |
| | | revoke(row) { |
| | | var that = this; |
| | | |
| | | axios |
| | | .post( |
| | | "/api/blade-jfpts/operation/save", |
| | | "/api/blade-jfpts/alarm/alarm/updateJtype", |
| | | {}, |
| | | { |
| | | params: { |
| | | snumber: "001", |
| | | sname: "李四", |
| | | jid: "1", |
| | | zc: "办结", |
| | | jid: row.id, |
| | | jtype: jtype, |
| | | rid: row.alarmId, |
| | | bz: row.bz, |
| | | snumber: row.alarmPeople, |
| | | sname: row.alarmId, |
| | | zc: t, |
| | | zctime: that.getDate().current, |
| | | }, |
| | | } |
| | | ) |
| | | .then((res) => { |
| | | console.log(res); |
| | | .then(function () { |
| | | that.onLoad(that.page, that.query); |
| | | }); |
| | | |
| | | // axios({ |
| | | // url: "/api/blade-jfpts/alarm/alarm/deletejj?id=" + row.id, |
| | | // method: "post", |
| | | // }).then(function () { |
| | | // that.dialogTableVisible = false; |
| | | // that.onLoad(that.page, that.query); |
| | | // }); |
| | | }, |
| | | updateJtyep(row) { |
| | | var that = this; |
| | | axios({ |
| | | url: |
| | | "/api/blade-jfpts/alarm/alarm/updateJtype?id=" + |
| | | row.id + |
| | | "&czTime=" + |
| | | row.czTime + |
| | | "&bz=" + |
| | | row.bz, |
| | | method: "post", |
| | | }).then(function () { |
| | | that.onLoad(that.page, that.query); |
| | | }); |
| | | }, |
| | | |
| | | beginTimeOrEndTime(time) { |
| | | var beginTime = new Date(time); |
| | | |
| | |
| | | end: endY + endM + endD + endH + endm + ends, |
| | | }; |
| | | }, |
| | | queryOldVideo(data) { |
| | | // 视频通话打开关闭事件 |
| | | openRealVideoBox() { |
| | | var that = this; |
| | | var newAxios = axios.create({ |
| | | baseURL: "https://web.byisf.com:18000", |
| | | withCredentials: false, |
| | |
| | | }, |
| | | }); |
| | | |
| | | var time = this.beginTimeOrEndTime(data.alarmTime); |
| | | |
| | | //this.form.serialNumber |
| | | newAxios |
| | | .post( |
| | | "/api_control", |
| | |
| | | .then((res) => { |
| | | newAxios |
| | | .get( |
| | | `https://web.byisf.com:18000/GetPlayUrl?deviceCode=${data.serialNumber}&chl=${data.channelNumber}` |
| | | `https://web.byisf.com:18000/GetPlayUrl?deviceCode=001231663A45&chl=${this.form.channelNumber}` |
| | | ) |
| | | .then((result) => { |
| | | this.innerVisibleVideo = true; |
| | | |
| | | this.videoSource = result.data.data.m3u8; |
| | | |
| | | if (Hls.isSupported()) { |
| | | var dom = document.getElementById("video_conversation"); |
| | | |
| | | // if (dom.volume) dom.volume = 1.0; |
| | | |
| | | this.hls = new Hls(); |
| | | |
| | | var m3u8Url = decodeURIComponent(this.videoSource); |
| | | |
| | | this.hls.loadSource(m3u8Url); |
| | | |
| | | this.hls.attachMedia(dom); |
| | | |
| | | this.hls.on(Hls.Events.MANIFEST_PARSED, function () { |
| | | dom.play(); |
| | | }); |
| | | } |
| | | }); |
| | | |
| | | // newAxios |
| | |
| | | // ) |
| | | // .then(result => { |
| | | |
| | | // this.innerVisibleVideo = true; |
| | | // this.videoConversationReal = true; |
| | | |
| | | // this.videoSource = result.data.data.m3u8; |
| | | |
| | | // }); |
| | | }); |
| | | }, |
| | | openOldVideoBox() { |
| | | if (Hls.isSupported()) { |
| | | var dom = document.getElementById("old_video"); |
| | | |
| | | // if (dom.volume) dom.volume = 1.0; |
| | | |
| | | this.hls = new Hls(); |
| | | |
| | | var m3u8Url = decodeURIComponent(this.videoSource); |
| | | |
| | | this.hls.loadSource(m3u8Url); |
| | | |
| | | this.hls.attachMedia(dom); |
| | | |
| | | this.hls.on(Hls.Events.MANIFEST_PARSED, function () { |
| | | dom.play(); |
| | | }); |
| | | } |
| | | }, |
| | | closeOldVideoBox() { |
| | | var dom = document.getElementById("old_video"); |
| | | closeRealVideoBox() { |
| | | var dom = document.getElementById("video_conversation"); |
| | | |
| | | if (dom.getAttribute("src") != "") { |
| | | dom.pause(); |
| | |
| | | this.hls.destroy(); |
| | | } |
| | | }, |
| | | |
| | | // 历史视频打开关闭事件 |
| | | openOldVideoBox() { |
| | | var dom = document.getElementById("old_video"); |
| | | dom.currentTime = 0; |
| | | dom.play(); |
| | | }, |
| | | |
| | | closeOldVideoBox() { |
| | | var dom = document.getElementById("old_video"); |
| | | dom.pause(); |
| | | }, |
| | | |
| | | aKeyToCall(e, form) { |
| | | var newCallAxios = axios.create({ |
| | | baseURL: "https://web.byisf.com:18000", |
| | |
| | | |
| | | // 一键呼叫相关函数 |
| | | if (this.isActive == true) { |
| | | alert(1); |
| | | this.isActive = false; |
| | | |
| | | newCallAxios |
| | |
| | | var fileOfBlob = new File([newbolb], new Date().getTime() + ".pcm"); |
| | | formData.append("file", fileOfBlob); |
| | | |
| | | document |
| | | .getElementById("real_audio") |
| | | .setAttribute("src", URL.createObjectURL(blob)); |
| | | // var dom = document.getElementById("real_audio"); |
| | | // console.log(dom); |
| | | // dom.setAttribute("src", URL.createObjectURL(blob)); |
| | | |
| | | this.recorder.play(); |
| | | // this.recorder.play(); |
| | | |
| | | newCallAxios |
| | | .post(`/api_control`, blob, { |
| | |
| | | param: { |
| | | PktType: "Talk", |
| | | accessToken: result.data.data.accessToken, |
| | | deviceCode: form.channelNumber, |
| | | // deviceCode: form.channelNumber, |
| | | deviceCode: "001231663A45", |
| | | }, |
| | | }, |
| | | }) |
| | | .then((result) => {}); |
| | | }); |
| | | } else { |
| | | alert(2); |
| | | this.isActive = true; |
| | | |
| | | Recorder.getPermission().then(() => { |
| | |
| | | }); |
| | | } |
| | | }, |
| | | peopleOrPhone(e) { |
| | | this.peopleList.forEach((item) => { |
| | | if (item.label == e) { |
| | | this.peoplePhone = item.value; |
| | | } |
| | | }); |
| | | }, |
| | | }, |
| | | }; |
| | | </script> |
| | | |
| | | <style> |
| | | .el-card__body .jtypeClass { |
| | | width: 10%; |
| | | } |
| | | |
| | | .el-card__body .waringTypeClass { |
| | | width: 12%; |
| | | } |