| | |
| | | :append-to-body="true" |
| | | :close-on-press-escape="false" |
| | | :close-on-click-modal="false" |
| | | @opened="videoConversationReal = true" |
| | | @close="closeDialog" |
| | | > |
| | | <el-form |
| | |
| | | </el-row> |
| | | <el-row> |
| | | <el-col span="12"> |
| | | <el-form-item label="警情类别"> |
| | | <el-form-item label="警情类型"> |
| | | <el-input |
| | | disabled="true" |
| | | v-model="form.waringType" |
| | |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col span="12"> |
| | | <el-form-item label="接警时间"> |
| | | <el-form-item label="报警内容"> |
| | | <el-input |
| | | disabled="true" |
| | | v-model="form.jjTime" |
| | | v-model="form.content" |
| | | autocomplete="off" |
| | | ></el-input> |
| | | </el-form-item> |
| | |
| | | <el-col span="12"> |
| | | <el-form-item label="监控视频"> |
| | | <el-button |
| | | :class="{ active: isActive }" |
| | | type="success" |
| | | @click.stop=" |
| | | (videoConversationReal = true), (oldVideoSatart = fasle) |
| | | (videoConversationReal = true), (oldVideoSatart = false) |
| | | " |
| | | @mousedown.native="aKeyToCall" |
| | | @mouseup.native="aKeyStopCall" |
| | | >视频通话 |
| | | </el-button> |
| | | <el-button |
| | |
| | | </el-col> |
| | | </el-row> |
| | | <el-row> |
| | | <el-col span="12"> |
| | | <el-form-item label="报警内容"> |
| | | <el-input |
| | | disabled="true" |
| | | v-model="form.content" |
| | | autocomplete="off" |
| | | ></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col span="12"> |
| | | <el-form-item label="备注"> |
| | | <el-input v-model="form.bz" autocomplete="off"></el-input> |
| | |
| | | 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> |
| | |
| | | import { mapGetters } from "vuex"; |
| | | import axios from "axios"; |
| | | import Hls from "hls.js"; |
| | | import Recorder from "js-audio-recorder"; |
| | | |
| | | export default { |
| | | name: "logo", |
| | |
| | | }, |
| | | ], |
| | | }, |
| | | isActive: false, |
| | | recorder: null, |
| | | peopleList: [], |
| | | peopleName: "", |
| | | peoplePhone: "", |
| | |
| | | }, |
| | | created() { |
| | | this.getData(); |
| | | Recorder.getPermiRecorderssion().then(() => {}); |
| | | this.recorder = new Recorder({ |
| | | sampleBits: 16, // 采样位数,支持 8 或 16,默认是16 |
| | | sampleRate: 8000, // 采样率,支持 11025、16000、22050、24000、44100、48000,根据浏览器默认值,我的chrome是48000 |
| | | numChannels: 1, // 声道,支持 1 或 2, 默认是1 |
| | | // compiling: false,(0.x版本中生效,1.x增加中) // 是否边录边转换,默认是false |
| | | }); |
| | | }, |
| | | computed: { |
| | | ...mapGetters(["website", "keyCollapse"]), |
| | |
| | | response.data.data[0].waringType == "紧急求救" && |
| | | response.data.data[0].alarmId == userId |
| | | ) { |
| | | response.data.data[0].waringType == "一键求助"; |
| | | response.data.data[0].waringType = "一键求助"; |
| | | that.form = response.data.data[0]; |
| | | that.peopleList = [ |
| | | { label: that.form.oneContacts, value: that.form.onePhone }, |
| | |
| | | that.peopleName = that.form.oneContacts; |
| | | that.peoplePhone = that.form.onePhone; |
| | | that.dialogTableVisible = true; |
| | | that.videoConversationReal = true; |
| | | that.$refs.realAudio.src = "./realVideo/audio.mp3"; |
| | | that.$refs.realAudio.play(); |
| | | } |
| | |
| | | closeDialog() { |
| | | //关闭窗口回调,关闭警报 |
| | | this.$refs.realAudio.pause(); |
| | | this.videoConversationReal = false; |
| | | this.videoConversationReal = false; |
| | | this.oldVideoSatart = false; |
| | | }, |
| | | getDate() { |
| | | // 当前时间 |
| | | var timestamp = Date.parse(new Date()); |
| | | var serverDate = new Date(timestamp); |
| | | |
| | | // 本周周一的时间 |
| | | var mondayTime = |
| | | timestamp - (serverDate.getDay() - 1) * 24 * 60 * 60 * 1000; |
| | | var mondayData = new Date(mondayTime); |
| | | //年 |
| | | var mondayY = mondayData.getFullYear(); |
| | | //月 |
| | | var mondayM = |
| | | mondayData.getMonth() + 1 < 10 |
| | | ? "0" + (mondayData.getMonth() + 1) |
| | | : mondayData.getMonth() + 1; |
| | | //日 |
| | | var mondayD = |
| | | mondayData.getDate() < 10 |
| | | ? "0" + mondayData.getDate() |
| | | : mondayData.getDate(); |
| | | // 当前时间 |
| | | var currentData = new Date(timestamp); |
| | | //年 |
| | | var currentY = currentData.getFullYear(); |
| | | //月 |
| | | var currentM = |
| | | currentData.getMonth() + 1 < 10 |
| | | ? "0" + (currentData.getMonth() + 1) |
| | | : currentData.getMonth() + 1; |
| | | //日 |
| | | var currentD = |
| | | currentData.getDate() < 10 |
| | | ? "0" + currentData.getDate() |
| | | : currentData.getDate(); |
| | | //时 |
| | | var currenH = |
| | | currentData.getHours() < 10 |
| | | ? "0" + currentData.getHours() |
| | | : currentData.getHours(); |
| | | //分 |
| | | var currenM = |
| | | currentData.getMinutes() < 10 |
| | | ? "0" + currentData.getMinutes() |
| | | : currentData.getMinutes(); |
| | | //秒 |
| | | var currenS = |
| | | currentData.getSeconds() < 10 |
| | | ? "0" + currentData.getSeconds() |
| | | : currentData.getSeconds(); |
| | | |
| | | return { |
| | | day: { |
| | | beginTime: currentY + "-" + currentM + "-" + currentD + " 00:00:00", |
| | | endTime: |
| | | currentY + |
| | | "-" + |
| | | currentM + |
| | | "-" + |
| | | currentD + |
| | | " " + |
| | | currenH + |
| | | ":" + |
| | | currenM + |
| | | ":00", |
| | | }, |
| | | week: { |
| | | beginTime: mondayY + "-" + mondayM + "-" + mondayD + " 00:00:00", |
| | | endTime: |
| | | currentY + |
| | | "-" + |
| | | currentM + |
| | | "-" + |
| | | currentD + |
| | | " " + |
| | | currenH + |
| | | ":" + |
| | | currenM + |
| | | ":00", |
| | | }, |
| | | month: { |
| | | beginTime: mondayY + "-" + mondayM + "-01 00:00:00", |
| | | endTime: |
| | | currentY + |
| | | "-" + |
| | | currentM + |
| | | "-" + |
| | | currentD + |
| | | " " + |
| | | currenH + |
| | | ":" + |
| | | currenM + |
| | | ":00", |
| | | }, |
| | | current: |
| | | currentY + |
| | | "-" + |
| | | currentM + |
| | | "-" + |
| | | currentD + |
| | | " " + |
| | | currenH + |
| | | ":" + |
| | | currenM + |
| | | ":" + |
| | | currenS, |
| | | }; |
| | | }, |
| | | updateJtyep(row, jtype, t) { |
| | | var that = this; |
| | | |
| | | axios |
| | | .post( |
| | | "/api/blade-jfpts/alarm/alarm/updateJtype", |
| | |
| | | jtype: jtype, |
| | | rid: row.alarmId, |
| | | bz: row.bz, |
| | | snumber: row.alarmPeople, |
| | | sname: row.alarmId, |
| | | snumber: row.alarmId, |
| | | sname: row.alarmPeople, |
| | | zc: t, |
| | | zctime: that.getDate().current, |
| | | }, |
| | | } |
| | | ) |
| | | .then(function () { |
| | | that.onLoad(that.page, that.query); |
| | | that.dialogTableVisible = false; |
| | | }); |
| | | }, |
| | | beginTimeOrEndTime(time) { |
| | |
| | | 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); |
| | |
| | | }); |
| | | } |
| | | }); |
| | | |
| | | // newAxios |
| | | // .post( |
| | | // "/api_control", |
| | | // {}, |
| | | // { |
| | | // params: { |
| | | // param: JSON.stringify({ |
| | | // PktType: "RemotePlayback", |
| | | // accessToken: res.data.data.accessToken, |
| | | // deviceCode: "001231409472", |
| | | // startTime: "20210130150000", |
| | | // endTime: "20210130160000", |
| | | // chl: data.serialNumber |
| | | // }) |
| | | // } |
| | | // } |
| | | // ) |
| | | // .then(result => { |
| | | |
| | | // this.videoConversationReal = true; |
| | | |
| | | // this.videoSource = result.data.data.m3u8; |
| | | |
| | | // }); |
| | | }); |
| | | }, |
| | | |
| | |
| | | dom.pause(); |
| | | }, |
| | | |
| | | aKeyToCall() { |
| | | var that = this; |
| | | if (this.recorder == null) { |
| | | this.recorder = new Recorder({ |
| | | sampleBits: 16, // 采样位数,支持 8 或 16,默认是16 |
| | | sampleRate: 8000, // 采样率,支持 11025、16000、22050、24000、44100、48000,根据浏览器默认值,我的chrome是48000 |
| | | numChannels: 1, // 声道,支持 1 或 2, 默认是1 |
| | | // compiling: false,(0.x版本中生效,1.x增加中) // 是否边录边转换,默认是false |
| | | }); |
| | | } |
| | | this.isActive = true; |
| | | |
| | | // 一键呼叫相关函数 |
| | | that.recorder.start().then( |
| | | () => { |
| | | // 开始录音 |
| | | console.log(111); |
| | | }, |
| | | (error) => { |
| | | // 出错了 |
| | | console.log(`${error.name} : ${error.message}`); |
| | | } |
| | | ); |
| | | }, |
| | | |
| | | // 序列号后期待修改 |
| | | aKeyStopCall() { |
| | | var newCallAxios = axios.create({ |
| | | baseURL: "https://web.byisf.com:18000", |
| | | withCredentials: false, |
| | | headers: { |
| | | "Content-Type": "application/json;", |
| | | }, |
| | | }); |
| | | var that = this; |
| | | that.isActive = false; |
| | | |
| | | 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); |
| | | newCallAxios |
| | | .post(`/api_control`, blob, { |
| | | params: { |
| | | param: { |
| | | PktType: "Talk", |
| | | accessToken: result.data.data.accessToken, |
| | | // deviceCode: form.channelNumber, |
| | | deviceCode: "001241945990", |
| | | }, |
| | | }, |
| | | }) |
| | | .then(() => { |
| | | that.recorder.destroy().then(function () { |
| | | that.recorder = null; |
| | | }); |
| | | }); |
| | | }); |
| | | }, |
| | | |
| | | peopleOrPhone(e) { |
| | | this.peopleList.forEach((item) => { |
| | | if (item.label == e) { |
| | |
| | | > |
| | | <el-row> |
| | | <el-col span="12"> |
| | | <el-form-item label="报警人姓名"> |
| | | <el-form-item label="报警人"> |
| | | <el-input |
| | | disabled="true" |
| | | v-model="form.galarmPeople" |
| | |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col span="12"> |
| | | <el-form-item label="联系方式"> |
| | | <el-form-item label="报警人电话"> |
| | | <el-input |
| | | disabled="true" |
| | | v-model="form.phoneNumber" |
| | |
| | | </el-row> |
| | | <el-row> |
| | | <el-col span="12"> |
| | | <el-form-item label="负责人"> |
| | | <el-input |
| | | disabled="true" |
| | | v-model="form.oneContacts" |
| | | autocomplete="off" |
| | | ></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col span="12"> |
| | | <el-form-item label="负责人电话"> |
| | | <el-input |
| | | disabled="true" |
| | | v-model="form.onePhone" |
| | | autocomplete="off" |
| | | ></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row> |
| | | <el-col span="12"> |
| | | <el-form-item label="省份" class="cityClassParams"> |
| | | <avue-form :option="itemOption" v-model="form"></avue-form> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col span="12"> |
| | | <el-form-item label="事发地址"> |
| | | <el-input |
| | | disabled="true" |
| | |
| | | ></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | |
| | | </el-row> |
| | | <el-row> |
| | | <el-col span="12"> |
| | | <el-form-item label="警情类型"> |
| | | <el-input |
| | | disabled="true" |
| | | v-model="form.waringType" |
| | | autocomplete="off" |
| | | ></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col span="12"> |
| | | <el-form-item label="设备编号"> |
| | | <el-input |
| | |
| | | </el-row> |
| | | <el-row> |
| | | <el-col span="12"> |
| | | <el-form-item label="报警时间"> |
| | | <el-form-item label="接警人"> |
| | | <el-input |
| | | disabled="true" |
| | | v-model="form.galarmTime" |
| | | v-model="form.alarmPeople" |
| | | autocomplete="off" |
| | | ></el-input> |
| | | </el-form-item> |
| | |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | |
| | | <el-row> |
| | | <el-col span="12"> |
| | | <el-form-item label="处置时间"> |
| | | <el-form-item label="报警时间"> |
| | | <el-input |
| | | disabled="true" |
| | | v-model="form.czTime" |
| | | v-model="form.alarmTime" |
| | | autocomplete="off" |
| | | ></el-input> |
| | | </el-form-item> |
| | |
| | | v-model="form.bz" |
| | | autocomplete="off" |
| | | ></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | |
| | | <el-row> |
| | | <el-col span="12"> |
| | | <el-form-item label="警情类型"> |
| | | <el-input |
| | | disabled="true" |
| | | v-model="form.waringType" |
| | | autocomplete="off" |
| | | ></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col span="12"> |
| | | <el-form-item label="省份" class="cityClassParams"> |
| | | <avue-form :option="itemOption" v-model="form"></avue-form> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | |
| | | }, |
| | | |
| | | getReceivingAlarm() { |
| | | axios.get(`/api/blade-jfpts/operation/list?jid=${this.form.id}`).then((res) => { |
| | | this.receivingList = res.data.data.records; |
| | | }); |
| | | axios |
| | | .get(`/api/blade-jfpts/operation/list?jid=${this.form.id}`) |
| | | .then((res) => { |
| | | this.receivingList = res.data.data.records; |
| | | }); |
| | | }, |
| | | }, |
| | | }; |
| | |
| | | * @Author: Morpheus |
| | | * @Date: 2021-03-17 15:21:33 |
| | | * @Last Modified by: Morpheus |
| | | * @Last Modified time: 2021-03-20 11:38:56 |
| | | * @Last Modified time: 2021-03-20 16:47:06 |
| | | */ |
| | | <template> |
| | | <basic-container> |
| | |
| | | :visible.sync="dialogTableVisible" |
| | | :append-to-body="true" |
| | | :close-on-click-modal="false" |
| | | @opened="videoConversationReal = true" |
| | | @close="(videoConversationReal = false), (oldVideoSatart = false)" |
| | | > |
| | | <el-dialog |
| | |
| | | > |
| | | <video |
| | | src="" |
| | | id="video_conversation" |
| | | id="real_video_conversation" |
| | | style="width: 100%; height: 100%; object-fit: fill" |
| | | controls |
| | | ></video> |
| | |
| | | muted="muted" |
| | | autoplay="autoplay" |
| | | loop |
| | | id="old_video" |
| | | id="real_old_video" |
| | | style="width: 100%; height: 100%; object-fit: fill" |
| | | controls |
| | | ></video> |
| | |
| | | </el-row> |
| | | <el-row> |
| | | <el-col span="12"> |
| | | <el-form-item label="警情类别"> |
| | | <el-form-item label="警情类型"> |
| | | <el-input |
| | | disabled="true" |
| | | v-model="form.waringType" |
| | |
| | | ></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col span="12"> |
| | | <!-- <el-col span="12"> |
| | | <el-form-item label="接警时间"> |
| | | <el-input |
| | | disabled="true" |
| | | v-model="form.jjTime" |
| | | autocomplete="off" |
| | | ></el-input> |
| | | </el-form-item> |
| | | </el-col> --> |
| | | <el-col span="12"> |
| | | <el-form-item label="报警内容"> |
| | | <el-input |
| | | disabled="true" |
| | | v-model="form.content" |
| | | autocomplete="off" |
| | | ></el-input> |
| | | </el-form-item> |
| | |
| | | :class="{ active: isActive }" |
| | | type="success" |
| | | @click.stop=" |
| | | (videoConversationReal = !videoConversationReal), |
| | | (oldVideoSatart = false), |
| | | aKeyToCall(form) |
| | | (videoConversationReal = true), (oldVideoSatart = false) |
| | | " |
| | | @mousedown.native="aKeyToCall" |
| | | @mouseup.native="aKeyStopCall" |
| | | >视频通话 |
| | | </el-button> |
| | | <el-button |
| | |
| | | </el-row> |
| | | |
| | | <el-row> |
| | | <el-col span="12"> |
| | | <el-form-item label="报警内容"> |
| | | <el-input |
| | | disabled="true" |
| | | v-model="form.content" |
| | | autocomplete="off" |
| | | ></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col span="12"> |
| | | <el-form-item label="备注"> |
| | | <el-input v-model="form.bz" autocomplete="off"></el-input> |
| | |
| | | }, |
| | | ], |
| | | }, |
| | | // { |
| | | // label: "报警内容", |
| | | // prop: "content", |
| | | // }, |
| | | { |
| | | label: "主要负责人", |
| | | prop: "oneContacts", |
| | |
| | | peopleList: [], |
| | | peopleName: "", |
| | | peoplePhone: "", |
| | | aKeyToCallFlag: false, |
| | | aKeyToCallTime: null, |
| | | }; |
| | | }, |
| | | computed: { |
| | |
| | | }, |
| | | created() { |
| | | this.dateTime = this.getDate(); |
| | | Recorder.getPermission().then(() => {}); |
| | | |
| | | this.recorder = new Recorder({ |
| | | sampleBits: 16, // 采样位数,支持 8 或 16,默认是16 |
| | |
| | | this.$router.query != null && |
| | | this.$router.query != "" |
| | | ) { |
| | | params = { |
| | | alarmType: this.$router.query.alarmType, |
| | | }; |
| | | if (this.$router.query.status) { |
| | | this.activeClass = this.$router.query.status; |
| | | this.page.currentPage = 1; |
| | | if (this.$router.query.status == 0) { |
| | | params = { |
| | | waringType: this.$router.query.waringType, |
| | | beginTime: this.dateTime.day.beginTime, |
| | | endTime: this.dateTime.day.endTime, |
| | | }; |
| | | } else if (this.$router.query.status == 1) { |
| | | params = { |
| | | waringType: this.$router.query.waringType, |
| | | beginTime: this.dateTime.week.beginTime, |
| | | endTime: this.dateTime.week.endTime, |
| | | }; |
| | | } else if (this.$router.query.status == 2) { |
| | | params = { |
| | | waringType: this.$router.query.waringType, |
| | | beginTime: this.dateTime.month.beginTime, |
| | | endTime: this.dateTime.month.endTime, |
| | | }; |
| | | } |
| | | } else { |
| | | params = { |
| | | waringType: this.$router.query.waringType, |
| | | }; |
| | | } |
| | | } |
| | | |
| | | if (releaseTimeRange) { |
| | |
| | | this.onLoad(this.page, params); |
| | | }, |
| | | rowStyle({ row, column, rowIndex }) { |
| | | if (row.jtype == "1") { |
| | | if (row.jtype == "0") { |
| | | return { |
| | | color: "#ff2727", |
| | | }; |
| | | } else if (row.jtype == "1") { |
| | | return { |
| | | color: "#15a2fe", |
| | | }; |
| | | } else { |
| | | return { |
| | | color: "#ff2727", |
| | | color: "#000000", |
| | | }; |
| | | } |
| | | }, |
| | |
| | | this.peopleName = row.oneContacts; |
| | | this.peoplePhone = row.onePhone; |
| | | this.dialogTableVisible = true; |
| | | this.videoConversationReal = true; |
| | | }, |
| | | updateJtyep(row, jtype, t) { |
| | | var that = this; |
| | |
| | | jtype: jtype, |
| | | rid: row.alarmId, |
| | | bz: row.bz, |
| | | snumber: row.alarmPeople, |
| | | sname: row.alarmId, |
| | | snumber: row.alarmId, |
| | | sname: row.alarmPeople, |
| | | zc: t, |
| | | zctime: that.getDate().current, |
| | | }, |
| | |
| | | ) |
| | | .then(function () { |
| | | that.onLoad(that.page, that.query); |
| | | that.videoConversationReal = false; |
| | | that.oldVideoSatart = false; |
| | | that.dialogTableVisible = false; |
| | | }); |
| | | }, |
| | | beginTimeOrEndTime(time) { |
| | |
| | | }, |
| | | // 视频通话打开关闭事件 |
| | | openRealVideoBox() { |
| | | var that = this; |
| | | var newAxios = axios.create({ |
| | | baseURL: "https://web.byisf.com:18000", |
| | | withCredentials: false, |
| | |
| | | this.videoSource = result.data.data.m3u8; |
| | | |
| | | if (Hls.isSupported()) { |
| | | var dom = document.getElementById("video_conversation"); |
| | | |
| | | // if (dom.volume) dom.volume = 1.0; |
| | | var dom = document.getElementById("real_video_conversation"); |
| | | |
| | | this.hls = new Hls(); |
| | | |
| | |
| | | }); |
| | | } |
| | | }); |
| | | |
| | | // newAxios |
| | | // .post( |
| | | // "/api_control", |
| | | // {}, |
| | | // { |
| | | // params: { |
| | | // param: JSON.stringify({ |
| | | // PktType: "RemotePlayback", |
| | | // accessToken: res.data.data.accessToken, |
| | | // deviceCode: "001231409472", |
| | | // startTime: "20210130150000", |
| | | // endTime: "20210130160000", |
| | | // chl: data.serialNumber |
| | | // }) |
| | | // } |
| | | // } |
| | | // ) |
| | | // .then(result => { |
| | | |
| | | // this.videoConversationReal = true; |
| | | |
| | | // this.videoSource = result.data.data.m3u8; |
| | | |
| | | // }); |
| | | }); |
| | | }, |
| | | closeRealVideoBox() { |
| | | var dom = document.getElementById("video_conversation"); |
| | | var dom = document.getElementById("real_video_conversation"); |
| | | |
| | | if (dom.getAttribute("src") != "") { |
| | | dom.pause(); |
| | |
| | | |
| | | // 历史视频打开关闭事件 |
| | | openOldVideoBox() { |
| | | var dom = document.getElementById("old_video"); |
| | | var dom = document.getElementById("real_old_video"); |
| | | dom.currentTime = 0; |
| | | dom.play(); |
| | | }, |
| | | closeOldVideoBox() { |
| | | var dom = document.getElementById("old_video"); |
| | | var dom = document.getElementById("real_old_video"); |
| | | dom.pause(); |
| | | }, |
| | | |
| | | aKeyToCall(e, form) { |
| | | aKeyToCall() { |
| | | var that = this; |
| | | if (this.recorder == null) { |
| | | this.recorder = new Recorder({ |
| | | sampleBits: 16, // 采样位数,支持 8 或 16,默认是16 |
| | | sampleRate: 8000, // 采样率,支持 11025、16000、22050、24000、44100、48000,根据浏览器默认值,我的chrome是48000 |
| | | numChannels: 1, // 声道,支持 1 或 2, 默认是1 |
| | | // compiling: false,(0.x版本中生效,1.x增加中) // 是否边录边转换,默认是false |
| | | }); |
| | | } |
| | | this.isActive = true; |
| | | |
| | | // 一键呼叫相关函数 |
| | | that.recorder.start().then( |
| | | () => { |
| | | // 开始录音 |
| | | }, |
| | | (error) => { |
| | | // 出错了 |
| | | console.log(`${error.name} : ${error.message}`); |
| | | } |
| | | ); |
| | | }, |
| | | |
| | | // 序列号后期待修改 |
| | | aKeyStopCall() { |
| | | var newCallAxios = axios.create({ |
| | | baseURL: "https://web.byisf.com:18000", |
| | | withCredentials: false, |
| | |
| | | }, |
| | | }); |
| | | var that = this; |
| | | that.isActive = false; |
| | | |
| | | if (that.recorder == null) { |
| | | that.recorder = new Recorder({ |
| | | sampleBits: 16, // 采样位数,支持 8 或 16,默认是16 |
| | | sampleRate: 8000, // 采样率,支持 11025、16000、22050、24000、44100、48000,根据浏览器默认值,我的chrome是48000 |
| | | numChannels: 1, // 声道,支持 1 或 2, 默认是1 |
| | | // compiling: false,(0.x版本中生效,1.x增加中) // 是否边录边转换,默认是false |
| | | }); |
| | | } |
| | | |
| | | if (this.aKeyToCallFlag == false) { |
| | | this.aKeyToCallFlag = true; |
| | | videoPhone(); |
| | | Recorder.getPermission().then(() => { |
| | | // 一键呼叫相关函数 |
| | | that.aKeyToCallTime = setInterval(() => { |
| | | that.recorder.start().then( |
| | | () => { |
| | | // 开始录音 |
| | | setTimeout(() => { |
| | | 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: "001241945990", |
| | | }, |
| | | }, |
| | | }) |
| | | .then((result) => {}); |
| | | }); |
| | | }, 5000); |
| | | }, |
| | | (error) => { |
| | | // 出错了 |
| | | console.log(`${error.name} : ${error.message}`); |
| | | } |
| | | ); |
| | | }, 6000); |
| | | }); |
| | | } else { |
| | | this.aKeyToCallFlag = false; |
| | | |
| | | that.recorder.destroy().then(function () { |
| | | that.recorder = null; |
| | | }); |
| | | window.clearInterval(that.aKeyToCallTime); |
| | | } |
| | | |
| | | function videoPhone() { |
| | | that.recorder.start().then( |
| | | () => { |
| | | // 开始录音 |
| | | setTimeout(() => { |
| | | 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: "001241945990", |
| | | }, |
| | | }, |
| | | }) |
| | | .then((result) => {}); |
| | | }); |
| | | }, 5000); |
| | | }, |
| | | (error) => { |
| | | // 出错了 |
| | | console.log(`${error.name} : ${error.message}`); |
| | | newCallAxios |
| | | .post( |
| | | `/api_control`, |
| | | {}, |
| | | { |
| | | params: { |
| | | param: { PktType: "GetAccessToken" }, |
| | | }, |
| | | } |
| | | ); |
| | | } |
| | | }, |
| | | |
| | | aKeyToCall111(e, form) { |
| | | var newCallAxios = axios.create({ |
| | | baseURL: "https://web.byisf.com:18000", |
| | | withCredentials: false, |
| | | headers: { |
| | | "Content-Type": "application/json;", |
| | | }, |
| | | }); |
| | | |
| | | setInterval(() => { |
| | | Recorder.getPermission().then(() => { |
| | | this.recorder.start().then(() => { |
| | | // 开始录音 |
| | | 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: "001241945990", |
| | | }, |
| | | }, |
| | | }) |
| | | .then((result) => {}); |
| | | ) |
| | | .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); |
| | | newCallAxios |
| | | .post(`/api_control`, blob, { |
| | | params: { |
| | | param: { |
| | | PktType: "Talk", |
| | | accessToken: result.data.data.accessToken, |
| | | // deviceCode: form.channelNumber, |
| | | deviceCode: "001241945990", |
| | | }, |
| | | }, |
| | | }) |
| | | .then(() => { |
| | | that.recorder.destroy().then(function () { |
| | | that.recorder = null; |
| | | }); |
| | | }); |
| | | }); |
| | | }); |
| | | |
| | | // 一键呼叫相关函数 |
| | | }, 200000); |
| | | }, |
| | | |
| | | peopleOrPhone(e) { |
| | | this.peopleList.forEach((item) => { |
| | | if (item.label == e) { |
| | |
| | | <template> |
| | | <basic-container> |
| | | <avue-crud :option="option" |
| | | :table-loading="loading" |
| | | :data="data" |
| | | :page.sync="page" |
| | | ref="crud" |
| | | @row-del="rowDel" |
| | | v-model="form" |
| | | :permission="permissionList" |
| | | @row-update="rowUpdate" |
| | | @row-save="rowSave" |
| | | :before-open="beforeOpen" |
| | | :row-style="rowStyle" |
| | | @search-change="searchChange" |
| | | @search-reset="searchReset" |
| | | @selection-change="selectionChange" |
| | | @current-change="currentChange" |
| | | @size-change="sizeChange" |
| | | @refresh-change="refreshChange" |
| | | @on-load="onLoad"> |
| | | |
| | | <template slot-scope="{row}" slot="jtype"> |
| | | <el-tag>{{row.jtype=='0'?'否':row.jtype=='1'?'是':'无'}}</el-tag> |
| | | <avue-crud |
| | | :option="option" |
| | | :table-loading="loading" |
| | | :data="data" |
| | | :page.sync="page" |
| | | ref="crud" |
| | | @row-del="rowDel" |
| | | v-model="form" |
| | | :permission="permissionList" |
| | | @row-update="rowUpdate" |
| | | @row-save="rowSave" |
| | | :before-open="beforeOpen" |
| | | :row-style="rowStyle" |
| | | @search-change="searchChange" |
| | | @search-reset="searchReset" |
| | | @selection-change="selectionChange" |
| | | @current-change="currentChange" |
| | | @size-change="sizeChange" |
| | | @refresh-change="refreshChange" |
| | | @on-load="onLoad" |
| | | > |
| | | <template slot-scope="{ row }" slot="jtype"> |
| | | <el-tag>{{ |
| | | row.jtype == "0" ? "未处理" : row.jtype == "1" ? "处理中" : "已处理" |
| | | }}</el-tag> |
| | | </template> |
| | | |
| | | <template slot-scope="{ row }" slot="cid"> |
| | | <el-tag>{{ |
| | | row.cid == "1" ? "事件发生" : row.cid == "3" ? "是" : "事件恢复" |
| | | <el-tag |
| | | >{{ |
| | | row.cid == "1" ? "事件发生" : row.cid == "3" ? "是" : "事件恢复" |
| | | }} |
| | | </el-tag> |
| | | </template> |
| | | |
| | | <template slot-scope="{ type, size, row }" slot="menu"> |
| | | |
| | | <el-button |
| | | icon="el-icon-video-camera-solid" |
| | | :size="size" |
| | | :type="type" |
| | | @click.stop="handleStart(row)" |
| | | >视频回放 |
| | | >视频回放 |
| | | </el-button> |
| | | |
| | | </template> |
| | | |
| | | </avue-crud> |
| | | <el-drawer |
| | | title="我是标题" |
| | | append-to-body=true |
| | | :visible.sync="qwe" |
| | | :direction="direction"> |
| | | <iframe src="http://www.baidu.com" frameborder="0" width="100%" height="600px"></iframe> |
| | | </el-drawer> |
| | | title="我是标题" |
| | | append-to-body="true" |
| | | :visible.sync="qwe" |
| | | :direction="direction" |
| | | > |
| | | <iframe |
| | | src="http://www.baidu.com" |
| | | frameborder="0" |
| | | width="100%" |
| | | height="600px" |
| | | ></iframe> |
| | | </el-drawer> |
| | | </basic-container> |
| | | </template> |
| | | |
| | | <script> |
| | | import {getList, remove, update, add, getclient} from "@/api/real/real"; |
| | | import {mapGetters} from "vuex"; |
| | | import { getList, remove, update, add, getclient } from "@/api/real/real"; |
| | | import { mapGetters } from "vuex"; |
| | | |
| | | export default { |
| | | data() { |
| | | return { |
| | | qwe:false, |
| | | direction: 'rtl', |
| | | form: {}, |
| | | query: {}, |
| | | dateTime: [], |
| | | historyId: this.$route.params.historyId, |
| | | loading: true, |
| | | page: { |
| | | pageSize: 10, |
| | | currentPage: 1, |
| | | total: 0 |
| | | }, |
| | | selectionList: [], |
| | | option: { |
| | | height: 'auto', |
| | | indexLabel: '序号', |
| | | calcHeight: 30, |
| | | menuWidth:160, |
| | | size: "mini", |
| | | labelWidth: '100', |
| | | dialogWidth: 950, |
| | | tip: false, |
| | | searchShow: true, |
| | | searchMenuSpan: 3, |
| | | border: true, |
| | | index: true, |
| | | viewBtn: true, |
| | | selection: true, |
| | | dialogClickModal: false, |
| | | column: [ |
| | | { |
| | | label: "警情类型", |
| | | prop: "waringType", |
| | | search: true, |
| | | searchSpan: 3, |
| | | width: 130, |
| | | className: "waringTypeClass", |
| | | searchPlaceholder: "请选择", |
| | | type: "select", |
| | | props: { |
| | | label: "dictValue", |
| | | value: "dictValue" |
| | | }, |
| | | //cascaderItem: ["city", "district"], |
| | | dicUrl: "/api/blade-system/dict-biz/child-list?parentId=1356523651644043266", |
| | | export default { |
| | | data() { |
| | | return { |
| | | qwe: false, |
| | | direction: "rtl", |
| | | form: {}, |
| | | query: {}, |
| | | dateTime: [], |
| | | historyId: this.$route.params.historyId, |
| | | loading: true, |
| | | page: { |
| | | pageSize: 10, |
| | | currentPage: 1, |
| | | total: 0, |
| | | }, |
| | | selectionList: [], |
| | | option: { |
| | | height: "auto", |
| | | indexLabel: "序号", |
| | | calcHeight: 30, |
| | | menuWidth: 160, |
| | | size: "mini", |
| | | labelWidth: "100", |
| | | dialogWidth: 950, |
| | | tip: false, |
| | | searchShow: true, |
| | | searchMenuSpan: 3, |
| | | border: true, |
| | | index: true, |
| | | viewBtn: true, |
| | | selection: true, |
| | | dialogClickModal: false, |
| | | column: [ |
| | | { |
| | | label: "警情类型", |
| | | prop: "waringType", |
| | | search: false, |
| | | searchSpan: 3, |
| | | width: 130, |
| | | className: "waringTypeClass", |
| | | searchPlaceholder: "请选择", |
| | | type: "select", |
| | | props: { |
| | | label: "dictValue", |
| | | value: "dictValue", |
| | | }, |
| | | { |
| | | label: "报警时间", |
| | | type: "datetime", |
| | | width:130, |
| | | format: "yyyy-MM-dd HH:mm:ss", |
| | | valueFormat: "yyyy-MM-dd HH:mm:ss", |
| | | prop: "alarmTime", |
| | | }, |
| | | { |
| | | label: "报警时间", |
| | | prop: "releaseTimeRange", |
| | | type: "datetime", |
| | | format: "yyyy-MM-dd HH:mm:ss", |
| | | valueFormat: "yyyy-MM-dd HH:mm:ss", |
| | | searchRange: true, |
| | | searchSpan: 5, |
| | | hide: true, |
| | | addDisplay: false, |
| | | editDisplay: false, |
| | | viewDisplay: false, |
| | | search: true, |
| | | rules: [{ |
| | | //cascaderItem: ["city", "district"], |
| | | dicUrl: |
| | | "/api/blade-system/dict-biz/child-list?parentId=1356523651644043266", |
| | | }, |
| | | { |
| | | label: "报警时间", |
| | | type: "datetime", |
| | | width: 130, |
| | | format: "yyyy-MM-dd HH:mm:ss", |
| | | valueFormat: "yyyy-MM-dd HH:mm:ss", |
| | | prop: "alarmTime", |
| | | }, |
| | | { |
| | | label: "报警时间", |
| | | prop: "releaseTimeRange", |
| | | type: "datetime", |
| | | format: "yyyy-MM-dd HH:mm:ss", |
| | | valueFormat: "yyyy-MM-dd HH:mm:ss", |
| | | searchRange: true, |
| | | searchSpan: 5, |
| | | hide: true, |
| | | addDisplay: false, |
| | | editDisplay: false, |
| | | viewDisplay: false, |
| | | search: true, |
| | | rules: [ |
| | | { |
| | | required: true, |
| | | message: "请输入时间", |
| | | trigger: "blur" |
| | | }] |
| | | }, |
| | | { |
| | | label: "报警内容", |
| | | prop: "content", |
| | | }, { |
| | | label: "报警人", |
| | | prop: "galarmPeople", |
| | | }, { |
| | | label: "联系电话", |
| | | prop: "phoneNumber", |
| | | width:130, |
| | | }, { |
| | | label: "事发地址", |
| | | width:200, |
| | | prop: "place", |
| | | }, { |
| | | label: "设备编号", |
| | | width:130, |
| | | addDisabled:true, |
| | | prop: "deviceNumber", |
| | | value:this.historyId, |
| | | }, { |
| | | label: "生成警单", |
| | | search: true, |
| | | searchSpan: 3, |
| | | slot: true, |
| | | searchPlaceholder: "", |
| | | prop: "jtype", |
| | | type: "select", |
| | | dicData: [ |
| | | { |
| | | label: "否", |
| | | value: '0' |
| | | }, |
| | | { |
| | | label: "是", |
| | | value: '1' |
| | | } |
| | | ], |
| | | }, { |
| | | label: '行政区', |
| | | prop: 'province', |
| | | placeholder:"行政区", |
| | | type: 'select', |
| | | props: { |
| | | label: 'name', |
| | | value: 'code' |
| | | trigger: "blur", |
| | | }, |
| | | cascaderItem: ['city', 'district'], |
| | | dicUrl: '/api/blade-system/region/select', |
| | | span: 6, |
| | | className: 'cityClass1' |
| | | }, |
| | | { |
| | | label: '地市', |
| | | prop: 'city', |
| | | type: 'select', |
| | | searchPlaceholder: "地市", |
| | | placeholder:"地市", |
| | | props: { |
| | | label: 'name', |
| | | value: 'code' |
| | | ], |
| | | }, |
| | | { |
| | | label: "报警内容", |
| | | prop: "content", |
| | | }, |
| | | { |
| | | label: "报警人", |
| | | prop: "galarmPeople", |
| | | }, |
| | | { |
| | | label: "联系电话", |
| | | prop: "phoneNumber", |
| | | width: 130, |
| | | }, |
| | | { |
| | | label: "事发地址", |
| | | width: 200, |
| | | prop: "place", |
| | | }, |
| | | { |
| | | label: "设备编号", |
| | | width: 130, |
| | | addDisabled: true, |
| | | prop: "deviceNumber", |
| | | value: this.historyId, |
| | | }, |
| | | { |
| | | label: "警情状态", |
| | | search: true, |
| | | searchSpan: 3, |
| | | slot: true, |
| | | searchPlaceholder: "", |
| | | prop: "jtype", |
| | | type: "select", |
| | | dicData: [ |
| | | { |
| | | label: "未处理", |
| | | value: "0", |
| | | }, |
| | | dicUrl: '/api/blade-system/region/select?code={{key}}', |
| | | span: 3, |
| | | labelWidth: '0', |
| | | className: 'cityClass2' |
| | | }, |
| | | { |
| | | label: '区县', |
| | | searchSpan: 2, |
| | | searchLabelWidth: 1, |
| | | searchPlaceholder: "区县", |
| | | placeholder:"区县", |
| | | prop: 'district', |
| | | type: 'select', |
| | | props: { |
| | | label: 'name', |
| | | value: 'code' |
| | | { |
| | | label: "处理中", |
| | | value: "1", |
| | | }, |
| | | dicUrl: '/api/blade-system/region/select?code={{key}}', |
| | | span: 3, |
| | | labelWidth: '0', |
| | | className: 'cityClass3' |
| | | { |
| | | label: "已处理", |
| | | value: "2", |
| | | }, |
| | | ], |
| | | }, |
| | | { |
| | | label: "行政区", |
| | | prop: "province", |
| | | placeholder: "行政区", |
| | | type: "select", |
| | | props: { |
| | | label: "name", |
| | | value: "code", |
| | | }, |
| | | { |
| | | label: "警情状态", |
| | | searchSpan: 3, |
| | | prop: "cid", |
| | | width: 100, |
| | | hide: true, |
| | | slot: true, |
| | | type: "select", |
| | | dicData: [ |
| | | { |
| | | label: "事件发生", |
| | | value: '1' |
| | | }, |
| | | { |
| | | label: "事件恢复", |
| | | value: '3' |
| | | } |
| | | ], |
| | | }, { |
| | | label: "接警人", |
| | | prop: "alarmPeople", |
| | | }, { |
| | | label: "接警时间", |
| | | type: "datetime", |
| | | format: "yyyy-MM-dd HH:mm:ss", |
| | | valueFormat: "yyyy-MM-dd HH:mm:ss", |
| | | width:130, |
| | | prop: "jjTime", |
| | | } |
| | | ] |
| | | }, |
| | | data: [] |
| | | cascaderItem: ["city", "district"], |
| | | dicUrl: "/api/blade-system/region/select", |
| | | span: 6, |
| | | className: "cityClass1", |
| | | }, |
| | | { |
| | | label: "地市", |
| | | prop: "city", |
| | | type: "select", |
| | | searchPlaceholder: "地市", |
| | | placeholder: "地市", |
| | | props: { |
| | | label: "name", |
| | | value: "code", |
| | | }, |
| | | dicUrl: "/api/blade-system/region/select?code={{key}}", |
| | | span: 3, |
| | | labelWidth: "0", |
| | | className: "cityClass2", |
| | | }, |
| | | { |
| | | label: "区县", |
| | | searchSpan: 2, |
| | | searchLabelWidth: 1, |
| | | searchPlaceholder: "区县", |
| | | placeholder: "区县", |
| | | prop: "district", |
| | | type: "select", |
| | | props: { |
| | | label: "name", |
| | | value: "code", |
| | | }, |
| | | dicUrl: "/api/blade-system/region/select?code={{key}}", |
| | | span: 3, |
| | | labelWidth: "0", |
| | | className: "cityClass3", |
| | | }, |
| | | { |
| | | label: "警情状态", |
| | | searchSpan: 3, |
| | | prop: "cid", |
| | | width: 100, |
| | | hide: true, |
| | | slot: true, |
| | | type: "select", |
| | | dicData: [ |
| | | { |
| | | label: "事件发生", |
| | | value: "1", |
| | | }, |
| | | { |
| | | label: "事件恢复", |
| | | value: "3", |
| | | }, |
| | | ], |
| | | }, |
| | | { |
| | | label: "接警人", |
| | | prop: "alarmPeople", |
| | | }, |
| | | { |
| | | label: "接警时间", |
| | | type: "datetime", |
| | | format: "yyyy-MM-dd HH:mm:ss", |
| | | valueFormat: "yyyy-MM-dd HH:mm:ss", |
| | | width: 130, |
| | | prop: "jjTime", |
| | | }, |
| | | ], |
| | | }, |
| | | data: [], |
| | | }; |
| | | }, |
| | | computed: { |
| | | ...mapGetters(["permission", "flowRoutes"]), |
| | | permissionList() { |
| | | return { |
| | | addBtn: this.vaildData(null, false), |
| | | viewBtn: this.vaildData(this.permission.real_view, false), |
| | | delBtn: this.vaildData(null, false), |
| | | editBtn: this.vaildData(null, false), |
| | | }; |
| | | }, |
| | | computed: { |
| | | ...mapGetters(["permission", "flowRoutes"]), |
| | | permissionList() { |
| | | return { |
| | | addBtn: this.vaildData(null, false), |
| | | viewBtn: this.vaildData(this.permission.real_view, false), |
| | | delBtn: this.vaildData(null, false), |
| | | editBtn: this.vaildData(null, false) |
| | | }; |
| | | }, |
| | | ids() { |
| | | let ids = []; |
| | | this.selectionList.forEach(ele => { |
| | | ids.push(ele.id); |
| | | ids() { |
| | | let ids = []; |
| | | this.selectionList.forEach((ele) => { |
| | | ids.push(ele.id); |
| | | }); |
| | | return ids.join(","); |
| | | }, |
| | | }, |
| | | created() { |
| | | this.dateTime = this.getDate(); |
| | | }, |
| | | methods: { |
| | | rowSave(row, done, loading) { |
| | | add(row).then( |
| | | () => { |
| | | this.onLoad(this.page); |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!", |
| | | }); |
| | | done(); |
| | | }, |
| | | (error) => { |
| | | window.console.log(error); |
| | | loading(); |
| | | } |
| | | ); |
| | | }, |
| | | rowUpdate(row, index, done, loading) { |
| | | row.coordinate = ""; |
| | | update(row).then( |
| | | () => { |
| | | this.onLoad(this.page); |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!", |
| | | }); |
| | | done(); |
| | | }, |
| | | (error) => { |
| | | window.console.log(error); |
| | | loading(); |
| | | } |
| | | ); |
| | | }, |
| | | rowDel(row) { |
| | | this.$confirm("确定将选择数据删除?", { |
| | | confirmButtonText: "确定", |
| | | cancelButtonText: "取消", |
| | | type: "warning", |
| | | }) |
| | | .then(() => { |
| | | return remove(row.id); |
| | | }) |
| | | .then(() => { |
| | | this.onLoad(this.page); |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!", |
| | | }); |
| | | }); |
| | | return ids.join(","); |
| | | }, |
| | | searchReset() { |
| | | this.query = {}; |
| | | this.onLoad(this.page); |
| | | }, |
| | | searchChange(params, done) { |
| | | this.query = params; |
| | | this.page.currentPage = 1; |
| | | this.onLoad(this.page, params); |
| | | done(); |
| | | }, |
| | | selectionChange(list) { |
| | | this.selectionList = list; |
| | | }, |
| | | selectionClear() { |
| | | this.selectionList = []; |
| | | this.$refs.crud.toggleSelection(); |
| | | }, |
| | | handleDelete() { |
| | | if (this.selectionList.length === 0) { |
| | | this.$message.warning("请选择至少一条数据"); |
| | | return; |
| | | } |
| | | }, |
| | | created() { |
| | | this.dateTime = this.getDate(); |
| | | }, |
| | | methods: { |
| | | rowSave(row, done, loading) { |
| | | add(row).then(() => { |
| | | this.$confirm("确定将选择数据删除?", { |
| | | confirmButtonText: "确定", |
| | | cancelButtonText: "取消", |
| | | type: "warning", |
| | | }) |
| | | .then(() => { |
| | | return remove(this.ids); |
| | | }) |
| | | .then(() => { |
| | | this.onLoad(this.page); |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!" |
| | | |
| | | message: "操作成功!", |
| | | }); |
| | | done(); |
| | | }, error => { |
| | | window.console.log(error); |
| | | loading(); |
| | | this.$refs.crud.toggleSelection(); |
| | | }); |
| | | }, |
| | | rowUpdate(row, index, done, loading) { |
| | | row.coordinate = ""; |
| | | update(row).then(() => { |
| | | this.onLoad(this.page); |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!" |
| | | }); |
| | | done(); |
| | | }, error => { |
| | | window.console.log(error); |
| | | loading(); |
| | | }, |
| | | beforeOpen(done, type) { |
| | | if (["edit", "view"].includes(type)) { |
| | | getclient(this.form.id).then((res) => { |
| | | this.form = res.data.data; |
| | | }); |
| | | }, |
| | | rowDel(row) { |
| | | this.$confirm("确定将选择数据删除?", { |
| | | confirmButtonText: "确定", |
| | | cancelButtonText: "取消", |
| | | type: "warning" |
| | | }) |
| | | .then(() => { |
| | | return remove(row.id); |
| | | }) |
| | | .then(() => { |
| | | this.onLoad(this.page); |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!" |
| | | }); |
| | | }); |
| | | }, |
| | | searchReset() { |
| | | this.query = {}; |
| | | this.onLoad(this.page); |
| | | }, |
| | | searchChange(params, done) { |
| | | this.query = params; |
| | | this.page.currentPage = 1; |
| | | this.onLoad(this.page, params); |
| | | done(); |
| | | }, |
| | | selectionChange(list) { |
| | | this.selectionList = list; |
| | | }, |
| | | selectionClear() { |
| | | this.selectionList = []; |
| | | this.$refs.crud.toggleSelection(); |
| | | }, |
| | | handleDelete() { |
| | | if (this.selectionList.length === 0) { |
| | | this.$message.warning("请选择至少一条数据"); |
| | | return; |
| | | } |
| | | this.$confirm("确定将选择数据删除?", { |
| | | confirmButtonText: "确定", |
| | | cancelButtonText: "取消", |
| | | type: "warning" |
| | | }) |
| | | .then(() => { |
| | | return remove(this.ids); |
| | | }) |
| | | .then(() => { |
| | | this.onLoad(this.page); |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!" |
| | | }); |
| | | this.$refs.crud.toggleSelection(); |
| | | }); |
| | | }, |
| | | beforeOpen(done, type) { |
| | | if (["edit", "view"].includes(type)) { |
| | | getclient(this.form.id).then(res => { |
| | | this.form = res.data.data; |
| | | }); |
| | | } |
| | | done(); |
| | | }, |
| | | currentChange(currentPage) { |
| | | this.page.currentPage = currentPage; |
| | | }, |
| | | sizeChange(pageSize) { |
| | | this.page.pageSize = pageSize; |
| | | }, |
| | | refreshChange() { |
| | | this.onLoad(this.page, this.query); |
| | | }, |
| | | onLoad(page, params = {}) { |
| | | params.deviceNumber = this.historyId; |
| | | const {releaseTimeRange} = this.query; |
| | | let values = { |
| | | } |
| | | done(); |
| | | }, |
| | | currentChange(currentPage) { |
| | | this.page.currentPage = currentPage; |
| | | }, |
| | | sizeChange(pageSize) { |
| | | this.page.pageSize = pageSize; |
| | | }, |
| | | refreshChange() { |
| | | this.onLoad(this.page, this.query); |
| | | }, |
| | | onLoad(page, params = {}) { |
| | | params.deviceNumber = this.historyId; |
| | | const { releaseTimeRange } = this.query; |
| | | let values = { |
| | | ...params, |
| | | }; |
| | | if (releaseTimeRange) { |
| | | values = { |
| | | ...params, |
| | | beginTime: releaseTimeRange[0], |
| | | endTime: releaseTimeRange[1], |
| | | ...this.query, |
| | | }; |
| | | if (releaseTimeRange) { |
| | | values = { |
| | | ...params, |
| | | beginTime: releaseTimeRange[0], |
| | | endTime: releaseTimeRange[1], |
| | | ...this.query |
| | | }; |
| | | values.releaseTimeRange = null; |
| | | } |
| | | this.loading = true; |
| | | getList(page.currentPage, page.pageSize, values).then(res => { |
| | | const data = res.data.data; |
| | | this.page.total = data.total; |
| | | this.data = data.records; |
| | | this.loading = false; |
| | | this.selectionClear(); |
| | | }); |
| | | }, |
| | | getDate() { |
| | | // 当前时间 |
| | | var timestamp = Date.parse(new Date()); |
| | | var serverDate = new Date(timestamp); |
| | | |
| | | // 本周周一的时间 |
| | | var mondayTime = timestamp - ((serverDate.getDay() - 1) * 24 * 60 * 60 * 1000) |
| | | var mondayData = new Date(mondayTime); |
| | | //年 |
| | | var mondayY = mondayData.getFullYear(); |
| | | //月 |
| | | var mondayM = (mondayData.getMonth() + 1 < 10 ? '0' + (mondayData.getMonth() + 1) : mondayData.getMonth() + 1); |
| | | //日 |
| | | var mondayD = mondayData.getDate() < 10 ? '0' + mondayData.getDate() : mondayData.getDate(); |
| | | // 当前时间 |
| | | var currentData = new Date(timestamp); |
| | | //年 |
| | | var currentY = currentData.getFullYear(); |
| | | //月 |
| | | var currentM = (currentData.getMonth() + 1 < 10 ? '0' + (currentData.getMonth() + 1) : currentData.getMonth() + 1); |
| | | //日 |
| | | var currentD = currentData.getDate() < 10 ? '0' + currentData.getDate() : currentData.getDate(); |
| | | //时 |
| | | var currenH = currentData.getHours() < 10 ? '0' + currentData.getHours() : currentData.getHours(); |
| | | //分 |
| | | var currenM = currentData.getMinutes() < 10 ? '0' + currentData.getMinutes() : currentData.getMinutes(); |
| | | |
| | | return { |
| | | week: { |
| | | beginTime: mondayY + '-' + mondayM + '-' + mondayD + ' 00:00:00', |
| | | endTime: currentY + '-' + currentM + '-' + currentD + ' ' + currenH + ':' + currenM + ':00', |
| | | }, |
| | | month: { |
| | | beginTime: mondayY + '-' + mondayM + '-01 00:00:00', |
| | | endTime: currentY + '-' + currentM + '-' + currentD + ' ' + currenH + ':' + currenM + ':00', |
| | | } |
| | | } |
| | | |
| | | }, |
| | | getBZdata() { |
| | | var params = { |
| | | beginTime: this.dateTime.week.beginTime, |
| | | endTime: this.dateTime.week.endTime |
| | | }; |
| | | this.query = params; |
| | | this.page.currentPage = 1; |
| | | this.onLoad(this.page, params); |
| | | }, |
| | | getBYdata() { |
| | | var params = { |
| | | beginTime: this.dateTime.month.beginTime, |
| | | endTime: this.dateTime.month.endTime |
| | | }; |
| | | this.query = params; |
| | | this.page.currentPage = 1; |
| | | this.onLoad(this.page, params); |
| | | }, |
| | | getQBdata() { |
| | | var params = {}; |
| | | this.query = params; |
| | | this.page.currentPage = 1; |
| | | this.onLoad(this.page, params); |
| | | }, |
| | | rowStyle({row, column, rowIndex}) { |
| | | if (row.jtype == "1") { |
| | | return { |
| | | color: "#15a2fe" |
| | | }; |
| | | } else { |
| | | return { |
| | | color: "#ff2727" |
| | | }; |
| | | } |
| | | }, |
| | | handleStart(row) { |
| | | var arr = []; |
| | | this.$store.state.tags.tagList.forEach(item => { |
| | | if (item.label != "视频") { |
| | | arr.push(item); |
| | | } |
| | | }); |
| | | this.$store.state.tags.tagList = arr; |
| | | this.$router.push({ |
| | | path: `/real/video/`,query:row |
| | | }); |
| | | }, |
| | | handleAdd11(){ |
| | | this.qwe=true; |
| | | values.releaseTimeRange = null; |
| | | } |
| | | } |
| | | }; |
| | | this.loading = true; |
| | | getList(page.currentPage, page.pageSize, values).then((res) => { |
| | | const data = res.data.data; |
| | | data.records.forEach((item) => |
| | | item.waringType == "紧急求救" ? (item.waringType = "一键求助") : "" |
| | | ); |
| | | this.page.total = data.total; |
| | | this.data = data.records; |
| | | this.loading = false; |
| | | this.selectionClear(); |
| | | }); |
| | | }, |
| | | getDate() { |
| | | // 当前时间 |
| | | var timestamp = Date.parse(new Date()); |
| | | var serverDate = new Date(timestamp); |
| | | |
| | | // 本周周一的时间 |
| | | var mondayTime = |
| | | timestamp - (serverDate.getDay() - 1) * 24 * 60 * 60 * 1000; |
| | | var mondayData = new Date(mondayTime); |
| | | //年 |
| | | var mondayY = mondayData.getFullYear(); |
| | | //月 |
| | | var mondayM = |
| | | mondayData.getMonth() + 1 < 10 |
| | | ? "0" + (mondayData.getMonth() + 1) |
| | | : mondayData.getMonth() + 1; |
| | | //日 |
| | | var mondayD = |
| | | mondayData.getDate() < 10 |
| | | ? "0" + mondayData.getDate() |
| | | : mondayData.getDate(); |
| | | // 当前时间 |
| | | var currentData = new Date(timestamp); |
| | | //年 |
| | | var currentY = currentData.getFullYear(); |
| | | //月 |
| | | var currentM = |
| | | currentData.getMonth() + 1 < 10 |
| | | ? "0" + (currentData.getMonth() + 1) |
| | | : currentData.getMonth() + 1; |
| | | //日 |
| | | var currentD = |
| | | currentData.getDate() < 10 |
| | | ? "0" + currentData.getDate() |
| | | : currentData.getDate(); |
| | | //时 |
| | | var currenH = |
| | | currentData.getHours() < 10 |
| | | ? "0" + currentData.getHours() |
| | | : currentData.getHours(); |
| | | //分 |
| | | var currenM = |
| | | currentData.getMinutes() < 10 |
| | | ? "0" + currentData.getMinutes() |
| | | : currentData.getMinutes(); |
| | | |
| | | return { |
| | | week: { |
| | | beginTime: mondayY + "-" + mondayM + "-" + mondayD + " 00:00:00", |
| | | endTime: |
| | | currentY + |
| | | "-" + |
| | | currentM + |
| | | "-" + |
| | | currentD + |
| | | " " + |
| | | currenH + |
| | | ":" + |
| | | currenM + |
| | | ":00", |
| | | }, |
| | | month: { |
| | | beginTime: mondayY + "-" + mondayM + "-01 00:00:00", |
| | | endTime: |
| | | currentY + |
| | | "-" + |
| | | currentM + |
| | | "-" + |
| | | currentD + |
| | | " " + |
| | | currenH + |
| | | ":" + |
| | | currenM + |
| | | ":00", |
| | | }, |
| | | }; |
| | | }, |
| | | getBZdata() { |
| | | var params = { |
| | | beginTime: this.dateTime.week.beginTime, |
| | | endTime: this.dateTime.week.endTime, |
| | | }; |
| | | this.query = params; |
| | | this.page.currentPage = 1; |
| | | this.onLoad(this.page, params); |
| | | }, |
| | | getBYdata() { |
| | | var params = { |
| | | beginTime: this.dateTime.month.beginTime, |
| | | endTime: this.dateTime.month.endTime, |
| | | }; |
| | | this.query = params; |
| | | this.page.currentPage = 1; |
| | | this.onLoad(this.page, params); |
| | | }, |
| | | getQBdata() { |
| | | var params = {}; |
| | | this.query = params; |
| | | this.page.currentPage = 1; |
| | | this.onLoad(this.page, params); |
| | | }, |
| | | rowStyle({ row, column, rowIndex }) { |
| | | if (row.jtype == "0") { |
| | | return { |
| | | color: "#ff2727", |
| | | }; |
| | | } else if (row.jtype == "1") { |
| | | return { |
| | | color: "#15a2fe", |
| | | }; |
| | | } else { |
| | | return { |
| | | color: "#000000", |
| | | }; |
| | | } |
| | | }, |
| | | handleStart(row) { |
| | | var arr = []; |
| | | this.$store.state.tags.tagList.forEach((item) => { |
| | | if (item.label != "视频") { |
| | | arr.push(item); |
| | | } |
| | | }); |
| | | this.$store.state.tags.tagList = arr; |
| | | this.$router.push({ |
| | | path: `/real/video/`, |
| | | query: row, |
| | | }); |
| | | }, |
| | | handleAdd11() { |
| | | this.qwe = true; |
| | | }, |
| | | }, |
| | | }; |
| | | </script> |
| | | |
| | | <style> |
| | | |
| | | |
| | | </style> |