From 8c372e643f381f0bf17b976eddf694d9cf7aef33 Mon Sep 17 00:00:00 2001
From: shuishen <1109946754@qq.com>
Date: Sat, 20 Mar 2021 16:48:18 +0800
Subject: [PATCH] 弹框内容更改,视频对讲方式更改,部分逻辑微调整
---
src/views/realTimePolice/real.vue | 368 ++++--------
src/views/realTimePolice/realHistory.vue | 971 ++++++++++++++++++----------------
src/views/policeTracking/policeTracking.vue | 75 +-
src/page/index/logo.vue | 255 +++++++-
4 files changed, 892 insertions(+), 777 deletions(-)
diff --git a/src/page/index/logo.vue b/src/page/index/logo.vue
index ffeda76..25f6b93 100644
--- a/src/page/index/logo.vue
+++ b/src/page/index/logo.vue
@@ -20,6 +20,7 @@
:append-to-body="true"
:close-on-press-escape="false"
:close-on-click-modal="false"
+ @opened="videoConversationReal = true"
@close="closeDialog"
>
<el-form
@@ -109,7 +110,7 @@
</el-row>
<el-row>
<el-col span="12">
- <el-form-item label="警情类别">
+ <el-form-item label="警情类型">
<el-input
disabled="true"
v-model="form.waringType"
@@ -138,10 +139,10 @@
</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>
@@ -160,10 +161,13 @@
<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
@@ -177,15 +181,6 @@
</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>
@@ -209,12 +204,12 @@
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>
@@ -271,6 +266,7 @@
import { mapGetters } from "vuex";
import axios from "axios";
import Hls from "hls.js";
+import Recorder from "js-audio-recorder";
export default {
name: "logo",
@@ -332,6 +328,8 @@
},
],
},
+ isActive: false,
+ recorder: null,
peopleList: [],
peopleName: "",
peoplePhone: "",
@@ -339,6 +337,13 @@
},
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"]),
@@ -376,7 +381,7 @@
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 },
@@ -386,7 +391,6 @@
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();
}
@@ -397,12 +401,119 @@
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",
@@ -413,15 +524,15 @@
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) {
@@ -515,8 +626,6 @@
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);
@@ -530,31 +639,6 @@
});
}
});
-
- // 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;
-
- // });
});
},
@@ -582,6 +666,79 @@
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) {
diff --git a/src/views/policeTracking/policeTracking.vue b/src/views/policeTracking/policeTracking.vue
index 66648aa..65d2faf 100644
--- a/src/views/policeTracking/policeTracking.vue
+++ b/src/views/policeTracking/policeTracking.vue
@@ -39,7 +39,7 @@
>
<el-row>
<el-col span="12">
- <el-form-item label="报警人姓名">
+ <el-form-item label="报警人">
<el-input
disabled="true"
v-model="form.galarmPeople"
@@ -48,7 +48,7 @@
</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"
@@ -59,6 +59,31 @@
</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"
@@ -67,7 +92,17 @@
></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
@@ -80,10 +115,10 @@
</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>
@@ -98,13 +133,12 @@
</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>
@@ -116,23 +150,6 @@
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>
@@ -490,9 +507,11 @@
},
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;
+ });
},
},
};
diff --git a/src/views/realTimePolice/real.vue b/src/views/realTimePolice/real.vue
index 6daca88..dccb28a 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-20 11:38:56
+ * @Last Modified time: 2021-03-20 16:47:06
*/
<template>
<basic-container>
@@ -129,6 +129,7 @@
:visible.sync="dialogTableVisible"
:append-to-body="true"
:close-on-click-modal="false"
+ @opened="videoConversationReal = true"
@close="(videoConversationReal = false), (oldVideoSatart = false)"
>
<el-dialog
@@ -144,7 +145,7 @@
>
<video
src=""
- id="video_conversation"
+ id="real_video_conversation"
style="width: 100%; height: 100%; object-fit: fill"
controls
></video>
@@ -166,7 +167,7 @@
muted="muted"
autoplay="autoplay"
loop
- id="old_video"
+ id="real_old_video"
style="width: 100%; height: 100%; object-fit: fill"
controls
></video>
@@ -260,7 +261,7 @@
</el-row>
<el-row>
<el-col span="12">
- <el-form-item label="警情类别">
+ <el-form-item label="警情类型">
<el-input
disabled="true"
v-model="form.waringType"
@@ -288,11 +289,20 @@
></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>
@@ -315,10 +325,10 @@
: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
@@ -333,15 +343,6 @@
</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>
@@ -488,10 +489,6 @@
},
],
},
- // {
- // label: "报警内容",
- // prop: "content",
- // },
{
label: "主要负责人",
prop: "oneContacts",
@@ -671,8 +668,6 @@
peopleList: [],
peopleName: "",
peoplePhone: "",
- aKeyToCallFlag: false,
- aKeyToCallTime: null,
};
},
computed: {
@@ -695,6 +690,7 @@
},
created() {
this.dateTime = this.getDate();
+ Recorder.getPermission().then(() => {});
this.recorder = new Recorder({
sampleBits: 16, // 采样位数,支持 8 或 16,默认是16
@@ -820,9 +816,33 @@
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) {
@@ -1003,13 +1023,17 @@
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",
};
}
},
@@ -1054,7 +1078,6 @@
this.peopleName = row.oneContacts;
this.peoplePhone = row.onePhone;
this.dialogTableVisible = true;
- this.videoConversationReal = true;
},
updateJtyep(row, jtype, t) {
var that = this;
@@ -1069,8 +1092,8 @@
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,
},
@@ -1078,8 +1101,7 @@
)
.then(function () {
that.onLoad(that.page, that.query);
- that.videoConversationReal = false;
- that.oldVideoSatart = false;
+ that.dialogTableVisible = false;
});
},
beginTimeOrEndTime(time) {
@@ -1143,7 +1165,6 @@
},
// 视频通话打开关闭事件
openRealVideoBox() {
- var that = this;
var newAxios = axios.create({
baseURL: "https://web.byisf.com:18000",
withCredentials: false,
@@ -1172,9 +1193,7 @@
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();
@@ -1189,35 +1208,10 @@
});
}
});
-
- // 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();
@@ -1230,16 +1224,41 @@
// 历史视频打开关闭事件
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,
@@ -1248,195 +1267,44 @@
},
});
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) {
diff --git a/src/views/realTimePolice/realHistory.vue b/src/views/realTimePolice/realHistory.vue
index 532b164..4b2e649 100644
--- a/src/views/realTimePolice/realHistory.vue
+++ b/src/views/realTimePolice/realHistory.vue
@@ -1,498 +1,569 @@
<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>
--
Gitblit v1.9.3