mirror of
https://gitee.com/pan648540858/wvp-GB28181-pro.git
synced 2026-05-24 14:07:50 +08:00
[1078] 合并主线
This commit is contained in:
parent
465e03d15d
commit
537d86ca89
@ -0,0 +1,18 @@
|
|||||||
|
package com.genersoft.iot.vmp.jt1078.config;
|
||||||
|
|
||||||
|
import com.genersoft.iot.vmp.jt1078.bean.common.ConfigAttribute;
|
||||||
|
import lombok.Data;
|
||||||
|
import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||||
|
import org.springframework.core.annotation.Order;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
|
@Component
|
||||||
|
@Data
|
||||||
|
@ConfigurationProperties(prefix = "jt1078", ignoreInvalidFields = true)
|
||||||
|
@Order(3)
|
||||||
|
public class JT1078Config {
|
||||||
|
|
||||||
|
private Integer port;
|
||||||
|
|
||||||
|
private String password;
|
||||||
|
}
|
||||||
@ -3,6 +3,7 @@ package com.genersoft.iot.vmp.vmanager.bean;
|
|||||||
import com.genersoft.iot.vmp.common.VersionPo;
|
import com.genersoft.iot.vmp.common.VersionPo;
|
||||||
import com.genersoft.iot.vmp.conf.SipConfig;
|
import com.genersoft.iot.vmp.conf.SipConfig;
|
||||||
import com.genersoft.iot.vmp.conf.UserSetting;
|
import com.genersoft.iot.vmp.conf.UserSetting;
|
||||||
|
import com.genersoft.iot.vmp.jt1078.config.JT1078Config;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
@Data
|
@Data
|
||||||
@ -12,6 +13,7 @@ public class SystemConfigInfo {
|
|||||||
private SipConfig sip;
|
private SipConfig sip;
|
||||||
private UserSetting addOn;
|
private UserSetting addOn;
|
||||||
private VersionPo version;
|
private VersionPo version;
|
||||||
|
private JT1078Config jt1078Config;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -12,6 +12,7 @@ import com.genersoft.iot.vmp.conf.exception.ControllerException;
|
|||||||
import com.genersoft.iot.vmp.conf.security.JwtUtils;
|
import com.genersoft.iot.vmp.conf.security.JwtUtils;
|
||||||
import com.genersoft.iot.vmp.gb28181.service.IDeviceChannelService;
|
import com.genersoft.iot.vmp.gb28181.service.IDeviceChannelService;
|
||||||
import com.genersoft.iot.vmp.gb28181.service.IDeviceService;
|
import com.genersoft.iot.vmp.gb28181.service.IDeviceService;
|
||||||
|
import com.genersoft.iot.vmp.jt1078.config.JT1078Config;
|
||||||
import com.genersoft.iot.vmp.media.bean.MediaInfo;
|
import com.genersoft.iot.vmp.media.bean.MediaInfo;
|
||||||
import com.genersoft.iot.vmp.media.bean.MediaServer;
|
import com.genersoft.iot.vmp.media.bean.MediaServer;
|
||||||
import com.genersoft.iot.vmp.media.event.mediaServer.MediaServerChangeEvent;
|
import com.genersoft.iot.vmp.media.event.mediaServer.MediaServerChangeEvent;
|
||||||
@ -67,6 +68,9 @@ public class ServerController {
|
|||||||
@Autowired
|
@Autowired
|
||||||
private UserSetting userSetting;
|
private UserSetting userSetting;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private JT1078Config jt1078Config;
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private IDeviceService deviceService;
|
private IDeviceService deviceService;
|
||||||
|
|
||||||
@ -196,6 +200,7 @@ public class ServerController {
|
|||||||
systemConfigInfo.setSip(sipConfig);
|
systemConfigInfo.setSip(sipConfig);
|
||||||
systemConfigInfo.setAddOn(userSetting);
|
systemConfigInfo.setAddOn(userSetting);
|
||||||
systemConfigInfo.setServerPort(serverPort);
|
systemConfigInfo.setServerPort(serverPort);
|
||||||
|
systemConfigInfo.setJt1078Config(jt1078Config);
|
||||||
return systemConfigInfo;
|
return systemConfigInfo;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -95,24 +95,16 @@ export const constantRoutes = [
|
|||||||
component: () => import('@/views/device/channel/record'),
|
component: () => import('@/views/device/channel/record'),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: '/jtDevice',
|
path: '/jtDevice',
|
||||||
component: Layout,
|
name: 'JTDevice',
|
||||||
redirect: '/jtDevice',
|
component: () => import('@/views/jtDevice/index'),
|
||||||
onlyIndex: 0,
|
meta: { title: '部标设备', icon: 'jtDevice' }
|
||||||
children: [
|
},
|
||||||
{
|
{
|
||||||
path: '',
|
path: '/jtDevice/record/:phoneNumber/:channelId',
|
||||||
name: 'JTDevice',
|
name: 'JTDeviceRecord',
|
||||||
component: () => import('@/views/jtDevice/index'),
|
component: () => import('@/views/jtDevice/channel/record')
|
||||||
meta: { title: '部标设备', icon: 'jtDevice' }
|
},
|
||||||
},
|
|
||||||
{
|
|
||||||
path: '/jtDevice/record/:phoneNumber/:channelId',
|
|
||||||
name: 'JTDeviceRecord',
|
|
||||||
component: () => import('@/views/jtDevice/channel/record'),
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
path: '/push',
|
path: '/push',
|
||||||
name: 'PushList',
|
name: 'PushList',
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
<template>
|
<template>
|
||||||
<div id="device" class="app-container">
|
<div id="JTDevice" class="app-container">
|
||||||
<deviceList v-show="show === 'device'" @show-channel="showChannelList" @show-param="showParam" />
|
<deviceList v-show="show === 'device'" @show-channel="showChannelList" @show-param="showParam" />
|
||||||
<channelList v-if="show === 'channel'" :device-id="deviceId" @show-device="showDevice" />
|
<channelList v-if="show === 'channel'" :device-id="deviceId" @show-device="showDevice" />
|
||||||
<deviceParam v-if="show === 'param'" :phone-number="phoneNumber" @show-device="showDevice" />
|
<deviceParam v-if="show === 'param'" :phone-number="phoneNumber" @show-device="showDevice" />
|
||||||
@ -12,7 +12,7 @@ import channelList from './channel/index.vue'
|
|||||||
import deviceParam from './jtDeviceParam.vue'
|
import deviceParam from './jtDeviceParam.vue'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'Device',
|
name: 'JTDevice',
|
||||||
components: {
|
components: {
|
||||||
deviceList,
|
deviceList,
|
||||||
channelList,
|
channelList,
|
||||||
|
|||||||
@ -1,94 +0,0 @@
|
|||||||
<template>
|
|
||||||
<div id="channelList" style="width: 100%">
|
|
||||||
<div class="page-header">
|
|
||||||
<div class="page-title">
|
|
||||||
<el-button icon="el-icon-back" size="mini" style="font-size: 20px; color: #000;" type="text" @click="close" ></el-button>
|
|
||||||
<el-divider direction="vertical"></el-divider>
|
|
||||||
编辑推流信息
|
|
||||||
</div>
|
|
||||||
<div class="page-header-btn">
|
|
||||||
<div style="display: inline;">
|
|
||||||
<el-button icon="el-icon-close" size="mini" style="font-size: 20px; color: #000;" type="text" @click="close" ></el-button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<el-tabs tab-position="left">
|
|
||||||
<el-tab-pane label="推流信息编辑" style="background-color: #FFFFFF; padding: 1rem">
|
|
||||||
<el-form ref="form" :rules="rules" :model="jtChannel" label-width="240px" style="display: grid; grid-template-columns: 1fr 1fr 1fr ">
|
|
||||||
<el-form-item label="编号" prop="channelId">
|
|
||||||
<el-input v-model="jtChannel.channelId" clearable></el-input>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="名称" prop="name">
|
|
||||||
<el-input v-model="jtChannel.name" clearable></el-input>
|
|
||||||
</el-form-item>
|
|
||||||
</el-form>
|
|
||||||
<el-form style="text-align: right">
|
|
||||||
<el-form-item >
|
|
||||||
<el-button type="primary" @click="onSubmit">保存</el-button>
|
|
||||||
<el-button @click="close">取消</el-button>
|
|
||||||
</el-form-item>
|
|
||||||
</el-form>
|
|
||||||
</el-tab-pane>
|
|
||||||
<el-tab-pane label="国标通道配置" v-if="jtChannel.id">
|
|
||||||
<CommonChannelEdit ref="commonChannelEdit" :dataForm="jtChannel" :cancel="close"></CommonChannelEdit>
|
|
||||||
</el-tab-pane>
|
|
||||||
</el-tabs>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
import CommonChannelEdit from './common/CommonChannelEdit'
|
|
||||||
|
|
||||||
export default {
|
|
||||||
name: 'channelList',
|
|
||||||
props: [ 'jtChannel', 'closeEdit'],
|
|
||||||
components: {
|
|
||||||
CommonChannelEdit
|
|
||||||
},
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
version: 3,
|
|
||||||
rules: {
|
|
||||||
deviceId: [{ required: true, message: "请输入设备编号", trigger: "blur" }]
|
|
||||||
},
|
|
||||||
winHeight: window.innerHeight - 200,
|
|
||||||
isLoading: false,
|
|
||||||
loadSnap: {},
|
|
||||||
};
|
|
||||||
},
|
|
||||||
|
|
||||||
mounted() {},
|
|
||||||
methods: {
|
|
||||||
onSubmit: function () {
|
|
||||||
console.log(this.jtChannel)
|
|
||||||
let isEdit = typeof (this.jtChannel.id) !== "undefined"
|
|
||||||
this.$axios({
|
|
||||||
method: 'post',
|
|
||||||
url:`/api/jt1078/terminal/channel/${isEdit?'update':'add'}/`,
|
|
||||||
params: this.jtChannel
|
|
||||||
}).then((res) => {
|
|
||||||
console.log(res.data)
|
|
||||||
if (res.data.code === 0) {
|
|
||||||
this.$message({
|
|
||||||
showClose: true,
|
|
||||||
message: "保存成功",
|
|
||||||
type: "success",
|
|
||||||
});
|
|
||||||
this.jtChannel = res.data.data
|
|
||||||
}else {
|
|
||||||
this.$message({
|
|
||||||
showClose: true,
|
|
||||||
message: res.data.msg,
|
|
||||||
type: "error",
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}).catch(function (error) {
|
|
||||||
console.log(error);
|
|
||||||
});
|
|
||||||
},
|
|
||||||
close: function () {
|
|
||||||
this.closeEdit()
|
|
||||||
},
|
|
||||||
}
|
|
||||||
};
|
|
||||||
</script>
|
|
||||||
@ -1,326 +0,0 @@
|
|||||||
<template>
|
|
||||||
<div id="channelList" style="width: 100%">
|
|
||||||
<div v-if="!jtChannel">
|
|
||||||
<div class="page-header" >
|
|
||||||
<div class="page-title">
|
|
||||||
<el-button icon="el-icon-back" size="mini" style="font-size: 20px; color: #000;" type="text" @click="showDevice" ></el-button>
|
|
||||||
<el-divider direction="vertical"></el-divider>
|
|
||||||
通道列表
|
|
||||||
</div>
|
|
||||||
<div class="page-header-btn">
|
|
||||||
<div style="display: inline;">
|
|
||||||
搜索:
|
|
||||||
<el-input @input="search" style="margin-right: 1rem; width: auto;" size="mini" placeholder="关键字"
|
|
||||||
prefix-icon="el-icon-search" v-model="searchSrt" clearable></el-input>
|
|
||||||
<el-button icon="el-icon-plus" size="mini" style="margin-right: 1rem;" type="primary" @click="add">添加通道</el-button>
|
|
||||||
<el-button icon="el-icon-refresh-right" circle size="mini" @click="refresh()"></el-button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<el-container v-loading="isLoging" style="height: 82vh;">
|
|
||||||
<el-main style="padding: 5px;">
|
|
||||||
<el-table ref="channelListTable" :data="deviceChannelList" :height="winHeight" style="width: 100%"
|
|
||||||
header-row-class-name="table-header">
|
|
||||||
<el-table-column prop="channelId" label="通道编号" min-width="180">
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column prop="name" label="名称" min-width="180">
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column label="快照" min-width="100">
|
|
||||||
<template v-slot:default="scope">
|
|
||||||
<el-image
|
|
||||||
:src="getSnap(scope.row)"
|
|
||||||
:preview-src-list="getBigSnap(scope.row)"
|
|
||||||
@error="getSnapErrorEvent(scope.row.deviceId, scope.row.channelId)"
|
|
||||||
:fit="'contain'"
|
|
||||||
style="width: 60px">
|
|
||||||
<div slot="error" class="image-slot">
|
|
||||||
<i class="el-icon-picture-outline"></i>
|
|
||||||
</div>
|
|
||||||
</el-image>
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column label="开启音频" min-width="100">
|
|
||||||
<template slot-scope="scope">
|
|
||||||
<el-switch @change="updateChannel(scope.row)" v-model="scope.row.hasAudio" active-color="#409EFF">
|
|
||||||
</el-switch>
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column label="操作" min-width="340" fixed="right">
|
|
||||||
<template slot-scope="scope">
|
|
||||||
<el-button size="medium" v-bind:disabled="device == null || device.online === 0" icon="el-icon-video-play"
|
|
||||||
type="text" @click="sendDevicePush(scope.row)">播放
|
|
||||||
</el-button>
|
|
||||||
<el-button size="medium" v-bind:disabled="device == null || device.online === 0"
|
|
||||||
icon="el-icon-switch-button"
|
|
||||||
type="text" style="color: #f56c6c" v-if="!!scope.row.stream"
|
|
||||||
@click="stopDevicePush(scope.row)">停止
|
|
||||||
</el-button>
|
|
||||||
<el-divider direction="vertical"></el-divider>
|
|
||||||
<el-button
|
|
||||||
size="medium"
|
|
||||||
type="text"
|
|
||||||
icon="el-icon-edit"
|
|
||||||
@click="handleEdit(scope.row)"
|
|
||||||
>
|
|
||||||
编辑
|
|
||||||
</el-button>
|
|
||||||
<el-divider direction="vertical"></el-divider>
|
|
||||||
<el-dropdown @command="(command)=>{moreClick(command, scope.row)}">
|
|
||||||
<el-button size="medium" type="text" >
|
|
||||||
更多功能<i class="el-icon-arrow-down el-icon--right"></i>
|
|
||||||
</el-button>
|
|
||||||
<el-dropdown-menu slot="dropdown">
|
|
||||||
<el-dropdown-item command="records" v-bind:disabled="device == null || device.online === 0">
|
|
||||||
设备录像</el-dropdown-item>
|
|
||||||
<el-dropdown-item command="cloudRecords" v-bind:disabled="device == null || device.online === 0" >
|
|
||||||
云端录像</el-dropdown-item>
|
|
||||||
<!-- <el-dropdown-item command="shooting" v-bind:disabled="device == null || device.online === 0" >-->
|
|
||||||
<!-- 立即拍摄</el-dropdown-item>-->
|
|
||||||
</el-dropdown-menu>
|
|
||||||
</el-dropdown>
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
</el-table>
|
|
||||||
<el-pagination
|
|
||||||
style="float: right"
|
|
||||||
@size-change="handleSizeChange"
|
|
||||||
@current-change="currentChange"
|
|
||||||
:current-page="currentPage"
|
|
||||||
:page-size="count"
|
|
||||||
:page-sizes="[15, 25, 35, 50]"
|
|
||||||
layout="total, sizes, prev, pager, next"
|
|
||||||
:total="total">
|
|
||||||
</el-pagination>
|
|
||||||
</el-main>
|
|
||||||
</el-container>
|
|
||||||
</div>
|
|
||||||
<devicePlayer ref="devicePlayer"></devicePlayer>
|
|
||||||
<channelEdit v-if="jtChannel" ref="channelEdit" :jtChannel="jtChannel" :closeEdit="closeEdit"></channelEdit>
|
|
||||||
<!--设备列表-->
|
|
||||||
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
import devicePlayer from './dialog/jtDevicePlayer.vue'
|
|
||||||
import uiHeader from '../layout/UiHeader.vue'
|
|
||||||
import DeviceTree from "./common/DeviceTree";
|
|
||||||
import channelEdit from "./JTChannelEdit.vue";
|
|
||||||
import JTDeviceService from "./service/JTDeviceService";
|
|
||||||
|
|
||||||
export default {
|
|
||||||
name: 'channelList',
|
|
||||||
components: {
|
|
||||||
channelEdit,
|
|
||||||
devicePlayer,
|
|
||||||
uiHeader,
|
|
||||||
DeviceTree
|
|
||||||
},
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
deviceService: new JTDeviceService(),
|
|
||||||
device: null,
|
|
||||||
deviceId: this.$route.params.deviceId,
|
|
||||||
deviceChannelList: [],
|
|
||||||
updateLooper: 0, //数据刷新轮训标志
|
|
||||||
searchSrt: "",
|
|
||||||
channelType: "",
|
|
||||||
online: "",
|
|
||||||
winHeight: window.innerHeight - 200,
|
|
||||||
currentPage: 1,
|
|
||||||
count: 15,
|
|
||||||
total: 0,
|
|
||||||
beforeUrl: "/jtDeviceList",
|
|
||||||
isLoging: false,
|
|
||||||
loadSnap: {},
|
|
||||||
jtChannel: null,
|
|
||||||
};
|
|
||||||
},
|
|
||||||
|
|
||||||
mounted() {
|
|
||||||
this.initParam();
|
|
||||||
this.initData();
|
|
||||||
|
|
||||||
},
|
|
||||||
destroyed() {
|
|
||||||
this.$destroy('videojs');
|
|
||||||
clearTimeout(this.updateLooper);
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
initData: function () {
|
|
||||||
this.getDeviceChannelList();
|
|
||||||
},
|
|
||||||
initParam: function () {
|
|
||||||
this.deviceId = this.$route.params.deviceId;
|
|
||||||
this.currentPage = 1;
|
|
||||||
this.count = 15;
|
|
||||||
this.deviceService.getDevice(this.deviceId, (result) => {
|
|
||||||
if (result.code === 0) {
|
|
||||||
this.device = result.data;
|
|
||||||
}
|
|
||||||
}, (error) => {
|
|
||||||
console.log("获取设备信息失败")
|
|
||||||
console.error(error)
|
|
||||||
})
|
|
||||||
},
|
|
||||||
currentChange: function (val) {
|
|
||||||
this.currentPage = val;
|
|
||||||
this.initData();
|
|
||||||
},
|
|
||||||
handleSizeChange: function (val) {
|
|
||||||
this.count = val;
|
|
||||||
this.getDeviceChannelList();
|
|
||||||
},
|
|
||||||
getDeviceChannelList: function () {
|
|
||||||
if (typeof (this.deviceId) == "undefined") return;
|
|
||||||
this.deviceService.getAllChannel(this.currentPage, this.count, this.searchSrt, this.deviceId, (data)=>{
|
|
||||||
console.log(data)
|
|
||||||
if (data.code === 0) {
|
|
||||||
this.total = data.data.total;
|
|
||||||
this.deviceChannelList = data.data.list;
|
|
||||||
// 防止出现表格错位
|
|
||||||
this.$nextTick(() => {
|
|
||||||
this.$refs.channelListTable.doLayout();
|
|
||||||
})
|
|
||||||
}
|
|
||||||
})
|
|
||||||
},
|
|
||||||
|
|
||||||
//通知设备上传媒体流
|
|
||||||
sendDevicePush: function (itemData) {
|
|
||||||
this.isLoging = true;
|
|
||||||
let channelId = itemData.channelId;
|
|
||||||
console.log("通知设备推流1:" + this.device.phoneNumber + " : " + channelId);
|
|
||||||
this.$axios({
|
|
||||||
method: 'get',
|
|
||||||
url: '/api/jt1078/live/start',
|
|
||||||
params: {
|
|
||||||
phoneNumber: this.device.phoneNumber,
|
|
||||||
channelId: channelId,
|
|
||||||
type: 0,
|
|
||||||
}
|
|
||||||
}).then((res)=> {
|
|
||||||
this.isLoging = false;
|
|
||||||
if (res.data.code === 0) {
|
|
||||||
setTimeout(() => {
|
|
||||||
let snapId = this.device.phoneNumber + "_" + channelId;
|
|
||||||
this.loadSnap[this.device.phoneNumber + channelId] = 0;
|
|
||||||
this.getSnapErrorEvent(snapId)
|
|
||||||
}, 5000)
|
|
||||||
itemData.streamId = res.data.data.stream;
|
|
||||||
this.$refs.devicePlayer.openDialog("media", this.device.phoneNumber, channelId, {
|
|
||||||
streamInfo: res.data.data,
|
|
||||||
hasAudio: itemData.hasAudio
|
|
||||||
});
|
|
||||||
setTimeout(() => {
|
|
||||||
this.initData();
|
|
||||||
}, 1000)
|
|
||||||
|
|
||||||
} else {
|
|
||||||
this.$message.error(res.data.msg);
|
|
||||||
}
|
|
||||||
}).catch((e)=> {
|
|
||||||
console.error(e)
|
|
||||||
this.isLoging = false;
|
|
||||||
// that.$message.error("请求超时");
|
|
||||||
});
|
|
||||||
},
|
|
||||||
moreClick: function (command, itemData) {
|
|
||||||
if (command === "records") {
|
|
||||||
this.queryRecords(itemData)
|
|
||||||
}else if (command === "cloudRecords") {
|
|
||||||
this.queryCloudRecords(itemData)
|
|
||||||
}else {
|
|
||||||
this.$message.info("尚不支持");
|
|
||||||
}
|
|
||||||
},
|
|
||||||
queryRecords: function (itemData) {
|
|
||||||
this.$router.push(`/jtRecordDetail/${this.device.phoneNumber}/${itemData.channelId}`)
|
|
||||||
},
|
|
||||||
queryCloudRecords: function (itemData) {
|
|
||||||
let deviceId = this.deviceId;
|
|
||||||
let channelId = itemData.channelId;
|
|
||||||
|
|
||||||
this.$router.push(`/cloudRecordDetail/rtp/${deviceId}_${channelId}`)
|
|
||||||
},
|
|
||||||
stopDevicePush: function (itemData) {
|
|
||||||
this.$axios({
|
|
||||||
method: 'get',
|
|
||||||
url: '/api/jt1078/live/stop',
|
|
||||||
params: {
|
|
||||||
phoneNumber: this.device.phoneNumber,
|
|
||||||
channelId: itemData.channelId,
|
|
||||||
}
|
|
||||||
}).then((res)=> {
|
|
||||||
console.log(res)
|
|
||||||
if (res.data.code === 0) {
|
|
||||||
this.initData();
|
|
||||||
}else {
|
|
||||||
this.$message.error(res.data.msg);
|
|
||||||
}
|
|
||||||
}).catch(function (error) {
|
|
||||||
console.error(error)
|
|
||||||
});
|
|
||||||
},
|
|
||||||
getSnap: function (row) {
|
|
||||||
let baseUrl = window.baseUrl ? window.baseUrl : "";
|
|
||||||
return ((process.env.NODE_ENV === 'development') ? process.env.BASE_API : baseUrl) + '/api/device/query/snap/' + this.device.phoneNumber + '/' + row.channelId;
|
|
||||||
},
|
|
||||||
getBigSnap: function (row) {
|
|
||||||
return [this.getSnap(row)]
|
|
||||||
},
|
|
||||||
getSnapErrorEvent: function (deviceId, channelId) {
|
|
||||||
|
|
||||||
if (typeof (this.loadSnap[deviceId + channelId]) != "undefined") {
|
|
||||||
console.log("下载截图" + this.loadSnap[deviceId + channelId])
|
|
||||||
if (this.loadSnap[deviceId + channelId] > 5) {
|
|
||||||
delete this.loadSnap[deviceId + channelId];
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
setTimeout(() => {
|
|
||||||
let url = (process.env.NODE_ENV === 'development' ? "debug" : "") + '/api/device/query/snap/' + deviceId + '/' + channelId
|
|
||||||
this.loadSnap[deviceId + channelId]++
|
|
||||||
document.getElementById(deviceId + channelId).setAttribute("src", url + '?' + new Date().getTime())
|
|
||||||
}, 1000)
|
|
||||||
|
|
||||||
}
|
|
||||||
},
|
|
||||||
showDevice: function () {
|
|
||||||
this.$router.push(this.beforeUrl).then(() => {
|
|
||||||
this.initParam();
|
|
||||||
this.initData();
|
|
||||||
})
|
|
||||||
},
|
|
||||||
search: function () {
|
|
||||||
this.currentPage = 1;
|
|
||||||
this.total = 0;
|
|
||||||
this.initData();
|
|
||||||
},
|
|
||||||
updateChannel: function (row) {
|
|
||||||
this.$axios({
|
|
||||||
method: 'post',
|
|
||||||
url: `/api/jt1078/terminal/channel/update`,
|
|
||||||
params: row
|
|
||||||
}).then(function (res) {
|
|
||||||
console.log(JSON.stringify(res));
|
|
||||||
});
|
|
||||||
},
|
|
||||||
refresh: function () {
|
|
||||||
this.initData();
|
|
||||||
},
|
|
||||||
add: function () {
|
|
||||||
this.jtChannel = {
|
|
||||||
terminalDbId: this.deviceId
|
|
||||||
};
|
|
||||||
},
|
|
||||||
// 编辑
|
|
||||||
handleEdit(row) {
|
|
||||||
this.jtChannel = row;
|
|
||||||
},
|
|
||||||
// 编辑
|
|
||||||
closeEdit(row) {
|
|
||||||
this.jtChannel = null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
|
||||||
</script>
|
|
||||||
@ -1,289 +0,0 @@
|
|||||||
<template>
|
|
||||||
<div id="app" style="width: 100%">
|
|
||||||
<div class="page-header">
|
|
||||||
<div class="page-title">设备列表</div>
|
|
||||||
<div class="page-header-btn">
|
|
||||||
<el-button icon="el-icon-plus" size="mini" style="margin-right: 1rem;" type="primary" @click="add">接入新设备
|
|
||||||
</el-button>
|
|
||||||
<el-button icon="el-icon-refresh-right" circle size="mini" :loading="getListLoading"
|
|
||||||
@click="getList()"></el-button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<!--设备列表-->
|
|
||||||
<el-table :data="deviceList" style="width: 100%;font-size: 12px;" :height="winHeight"
|
|
||||||
header-row-class-name="table-header">
|
|
||||||
<el-table-column prop="phoneNumber" label="终端手机号" min-width="160">
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column prop="terminalId" label="终端ID" min-width="160">
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column prop="provinceText" label="省域" min-width="160">
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column prop="cityText" label="市县域" min-width="160">
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column prop="makerId" label="制造商" min-width="160">
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column prop="model" label="型号" min-width="160">
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column label="车牌颜色" min-width="160">
|
|
||||||
<template slot-scope="scope">
|
|
||||||
<div slot="reference" class="name-wrapper">
|
|
||||||
<span v-if="scope.row.plateColor === 1">蓝色</span>
|
|
||||||
<span v-else-if="scope.row.plateColor === 2">黄色</span>
|
|
||||||
<span v-else-if="scope.row.plateColor === 3">黑色</span>
|
|
||||||
<span v-else-if="scope.row.plateColor === 4">白色</span>
|
|
||||||
<span v-else-if="scope.row.plateColor === 5">绿色</span>
|
|
||||||
<span v-else-if="scope.row.plateColor === 91">农黄色</span>
|
|
||||||
<span v-else-if="scope.row.plateColor === 92">农绿色</span>
|
|
||||||
<span v-else-if="scope.row.plateColor === 93">黄绿色</span>
|
|
||||||
<span v-else-if="scope.row.plateColor === 94">渐变绿</span>
|
|
||||||
<span v-else>未上牌</span>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column prop="plateNo" label="车牌" min-width="160">
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column prop="registerTime" label="注册时间" min-width="160">
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column label="状态" min-width="160">
|
|
||||||
<template slot-scope="scope">
|
|
||||||
<div slot="reference" class="name-wrapper">
|
|
||||||
<el-tag size="medium" v-if="scope.row.status">在线</el-tag>
|
|
||||||
<el-tag size="medium" type="info" v-if="!scope.row.status">离线</el-tag>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column label="操作" min-width="340" fixed="right">
|
|
||||||
<template slot-scope="scope">
|
|
||||||
<el-divider direction="vertical"></el-divider>
|
|
||||||
<el-button type="text" size="medium" icon="el-icon-video-camera"
|
|
||||||
@click="showChannelList(scope.row)">通道
|
|
||||||
</el-button>
|
|
||||||
<el-divider direction="vertical"></el-divider>
|
|
||||||
<el-button size="medium" icon="el-icon-edit" type="text" @click="edit(scope.row)">编辑</el-button>
|
|
||||||
<el-divider direction="vertical"></el-divider>
|
|
||||||
<el-button size="medium" icon="el-icon-delete" type="text" @click="deleteDevice(scope.row)"
|
|
||||||
style="color: #f56c6c">删除
|
|
||||||
</el-button>
|
|
||||||
<el-divider direction="vertical"></el-divider>
|
|
||||||
<el-dropdown @command="(command)=>{moreClick(command, scope.row)}">
|
|
||||||
<el-button size="medium" type="text" >
|
|
||||||
更多功能<i class="el-icon-arrow-down el-icon--right"></i>
|
|
||||||
</el-button>
|
|
||||||
<el-dropdown-menu slot="dropdown">
|
|
||||||
<el-dropdown-item command="params" v-bind:disabled="!scope.row.status">
|
|
||||||
终端参数</el-dropdown-item>
|
|
||||||
<!-- <el-dropdown-item command="attribute" v-bind:disabled="!scope.row.status">-->
|
|
||||||
<!-- 终端属性</el-dropdown-item>-->
|
|
||||||
<el-dropdown-item command="connection" v-bind:disabled="!scope.row.status" >
|
|
||||||
终端连接</el-dropdown-item>
|
|
||||||
<!-- <el-dropdown-item command="linkDetection" v-bind:disabled="!scope.row.status" >-->
|
|
||||||
<!-- 链路检测</el-dropdown-item>-->
|
|
||||||
<!-- <el-dropdown-item command="position" v-bind:disabled="!scope.row.status" >-->
|
|
||||||
<!-- 位置信息</el-dropdown-item>-->
|
|
||||||
<!-- <el-dropdown-item command="textMsg" v-bind:disabled="!scope.row.status" >-->
|
|
||||||
<!-- 文本信息</el-dropdown-item>-->
|
|
||||||
<!-- <el-dropdown-item command="telephoneCallback" v-bind:disabled="!scope.row.status" >-->
|
|
||||||
<!-- 电话回拨</el-dropdown-item>-->
|
|
||||||
<!-- <el-dropdown-item command="setPhoneBook" v-bind:disabled="!scope.row.status" >-->
|
|
||||||
<!-- 设置电话本</el-dropdown-item>-->
|
|
||||||
<!-- <el-dropdown-item command="tempPositionTracking" v-bind:disabled="!scope.row.status" >-->
|
|
||||||
<!-- 临时跟踪</el-dropdown-item>-->
|
|
||||||
<!-- <el-dropdown-item command="reset" v-bind:disabled="!scope.row.status" >-->
|
|
||||||
<!-- 终端复位</el-dropdown-item>-->
|
|
||||||
<!-- <el-dropdown-item command="factoryReset" v-bind:disabled="!scope.row.status" >-->
|
|
||||||
<!-- 恢复出厂</el-dropdown-item>-->
|
|
||||||
<!-- <el-dropdown-item command="door" v-bind:disabled="!scope.row.status" >-->
|
|
||||||
<!-- 车门控制</el-dropdown-item>-->
|
|
||||||
<!-- <el-dropdown-item command="driverInfo" v-bind:disabled="!scope.row.status" >-->
|
|
||||||
<!-- 驾驶员信息</el-dropdown-item>-->
|
|
||||||
<!-- <el-dropdown-item command="mediaAttribute" v-bind:disabled="!scope.row.status" >-->
|
|
||||||
<!-- 音视频属性</el-dropdown-item>-->
|
|
||||||
</el-dropdown-menu>
|
|
||||||
</el-dropdown>
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
</el-table>
|
|
||||||
<el-pagination
|
|
||||||
style="float: right"
|
|
||||||
@size-change="handleSizeChange"
|
|
||||||
@current-change="currentChange"
|
|
||||||
:current-page="currentPage"
|
|
||||||
:page-size="count"
|
|
||||||
:page-sizes="[15, 25, 35, 50]"
|
|
||||||
layout="total, sizes, prev, pager, next"
|
|
||||||
:total="total">
|
|
||||||
</el-pagination>
|
|
||||||
<deviceEdit ref="deviceEdit"></deviceEdit>
|
|
||||||
<syncChannelProgress ref="syncChannelProgress"></syncChannelProgress>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
import uiHeader from '../layout/UiHeader.vue'
|
|
||||||
import deviceEdit from './dialog/jtDeviceEdit.vue'
|
|
||||||
import syncChannelProgress from './dialog/SyncChannelProgress.vue'
|
|
||||||
import JTDeviceService from "./service/JTDeviceService";
|
|
||||||
|
|
||||||
export default {
|
|
||||||
name: 'app',
|
|
||||||
components: {
|
|
||||||
uiHeader,
|
|
||||||
deviceEdit,
|
|
||||||
syncChannelProgress,
|
|
||||||
},
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
deviceService: new JTDeviceService(),
|
|
||||||
deviceList: [], //设备列表
|
|
||||||
updateLooper: 0, //数据刷新轮训标志
|
|
||||||
winHeight: window.innerHeight - 200,
|
|
||||||
currentPage: 1,
|
|
||||||
count: 15,
|
|
||||||
total: 0,
|
|
||||||
getListLoading: false,
|
|
||||||
};
|
|
||||||
},
|
|
||||||
mounted() {
|
|
||||||
this.initData();
|
|
||||||
this.updateLooper = setInterval(this.initData, 10000);
|
|
||||||
},
|
|
||||||
destroyed() {
|
|
||||||
this.$destroy('videojs');
|
|
||||||
clearTimeout(this.updateLooper);
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
initData: function () {
|
|
||||||
this.getList();
|
|
||||||
},
|
|
||||||
currentChange: function (val) {
|
|
||||||
this.currentPage = val;
|
|
||||||
this.getList();
|
|
||||||
},
|
|
||||||
handleSizeChange: function (val) {
|
|
||||||
this.count = val;
|
|
||||||
this.getList();
|
|
||||||
},
|
|
||||||
getList: function () {
|
|
||||||
this.getListLoading = true;
|
|
||||||
this.deviceService.getDeviceList(this.currentPage, this.count, (data) => {
|
|
||||||
if (data.code === 0) {
|
|
||||||
this.total = data.data.total;
|
|
||||||
this.deviceList = data.data.list;
|
|
||||||
}
|
|
||||||
this.getListLoading = false;
|
|
||||||
}, () => {
|
|
||||||
this.getListLoading = false;
|
|
||||||
}
|
|
||||||
)
|
|
||||||
},
|
|
||||||
deleteDevice: function (row) {
|
|
||||||
this.$confirm("确定删除此设备?", '提示', {
|
|
||||||
dangerouslyUseHTMLString: true,
|
|
||||||
confirmButtonText: '确定',
|
|
||||||
cancelButtonText: '取消',
|
|
||||||
center: true,
|
|
||||||
type: 'warning'
|
|
||||||
}).then(() => {
|
|
||||||
this.deviceService.deleteDevice(row.id, (data) => {
|
|
||||||
this.getList();
|
|
||||||
})
|
|
||||||
}).catch(() => {
|
|
||||||
|
|
||||||
});
|
|
||||||
},
|
|
||||||
edit: function (row) {
|
|
||||||
this.$refs.deviceEdit.openDialog(row, () => {
|
|
||||||
this.$refs.deviceEdit.close();
|
|
||||||
this.$message({
|
|
||||||
showClose: true,
|
|
||||||
message: "设备修改成功,通道字符集将在下次更新生效",
|
|
||||||
type: "success",
|
|
||||||
});
|
|
||||||
setTimeout(this.getList, 200)
|
|
||||||
|
|
||||||
})
|
|
||||||
},
|
|
||||||
showChannelList: function (row) {
|
|
||||||
this.$router.push(`/jtChannelList/${row.id}`);
|
|
||||||
},
|
|
||||||
add: function () {
|
|
||||||
this.$refs.deviceEdit.openDialog(null, () => {
|
|
||||||
this.$refs.deviceEdit.close();
|
|
||||||
this.$message({
|
|
||||||
showClose: true,
|
|
||||||
message: "添加成功",
|
|
||||||
type: "success",
|
|
||||||
});
|
|
||||||
setTimeout(this.getList, 200)
|
|
||||||
|
|
||||||
})
|
|
||||||
},
|
|
||||||
moreClick: function (command, itemData) {
|
|
||||||
if (command === "params") {
|
|
||||||
this.$router.push(`/jtDeviceParams/${itemData.phoneNumber}`);
|
|
||||||
}else if (command === "connection") {
|
|
||||||
// this.queryCloudRecords(itemData)
|
|
||||||
}else {
|
|
||||||
this.$message.info("尚不支持");
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
};
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style>
|
|
||||||
.videoList {
|
|
||||||
display: flex;
|
|
||||||
flex-wrap: wrap;
|
|
||||||
align-content: flex-start;
|
|
||||||
}
|
|
||||||
|
|
||||||
.video-item {
|
|
||||||
position: relative;
|
|
||||||
width: 15rem;
|
|
||||||
height: 10rem;
|
|
||||||
margin-right: 1rem;
|
|
||||||
background-color: #000000;
|
|
||||||
}
|
|
||||||
|
|
||||||
.video-item-img {
|
|
||||||
position: absolute;
|
|
||||||
top: 0;
|
|
||||||
bottom: 0;
|
|
||||||
left: 0;
|
|
||||||
right: 0;
|
|
||||||
margin: auto;
|
|
||||||
width: 100%;
|
|
||||||
height: 100%;
|
|
||||||
}
|
|
||||||
|
|
||||||
.video-item-img:after {
|
|
||||||
content: "";
|
|
||||||
display: inline-block;
|
|
||||||
position: absolute;
|
|
||||||
z-index: 2;
|
|
||||||
top: 0;
|
|
||||||
bottom: 0;
|
|
||||||
left: 0;
|
|
||||||
right: 0;
|
|
||||||
margin: auto;
|
|
||||||
width: 3rem;
|
|
||||||
height: 3rem;
|
|
||||||
background-image: url("../assets/loading.png");
|
|
||||||
background-size: cover;
|
|
||||||
background-color: #000000;
|
|
||||||
}
|
|
||||||
|
|
||||||
.video-item-title {
|
|
||||||
position: absolute;
|
|
||||||
bottom: 0;
|
|
||||||
color: #000000;
|
|
||||||
background-color: #ffffff;
|
|
||||||
line-height: 1.5rem;
|
|
||||||
padding: 0.3rem;
|
|
||||||
width: 14.4rem;
|
|
||||||
}
|
|
||||||
|
|
||||||
</style>
|
|
||||||
@ -1,354 +0,0 @@
|
|||||||
<template>
|
|
||||||
<div id="channelList" style="width: 100%">
|
|
||||||
<div class="page-header">
|
|
||||||
<div class="page-title">
|
|
||||||
<el-button icon="el-icon-back" size="mini" style="font-size: 20px; color: #000;" type="text" @click="showDevice" ></el-button>
|
|
||||||
<el-divider direction="vertical"></el-divider>
|
|
||||||
终端参数
|
|
||||||
</div>
|
|
||||||
<div class="page-header-btn">
|
|
||||||
<div style="display: inline;">
|
|
||||||
<el-button icon="el-icon-close" circle size="mini" @click="showDevice()"></el-button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<el-container v-loading="isLoading" style="height: 82vh; overflow: auto">
|
|
||||||
<el-main style="padding: 5px; background-color: #ffffff;">
|
|
||||||
<el-divider content-position="center">通讯参数</el-divider>
|
|
||||||
<el-form size="mini" ref="form" :rules="rules" :model="form" label-width="240px" style="display: grid; grid-template-columns: 1fr 1fr 1fr 1fr;">
|
|
||||||
<el-form-item label="心跳发送间隔(秒)" prop="keepaliveInterval">
|
|
||||||
<el-input v-model="form.keepaliveInterval" clearable></el-input>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="TCP消息应答超时(秒)" prop="tcpResponseTimeout">
|
|
||||||
<el-input v-model="form.tcpResponseTimeout" clearable></el-input>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="TCP消息重传次数" prop="tcpRetransmissionCount">
|
|
||||||
<el-input v-model="form.tcpRetransmissionCount" clearable></el-input>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="UDP消息应答超时时间(秒)" prop="udpResponseTimeout">
|
|
||||||
<el-input v-model="form.udpResponseTimeout" clearable></el-input>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="UDP消息重传次数" prop="udpRetransmissionCount">
|
|
||||||
<el-input v-model="form.udpRetransmissionCount" clearable></el-input>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="SMS 消息应答超时时间(秒)" prop="smsResponseTimeout">
|
|
||||||
<el-input v-model="form.smsResponseTimeout" clearable></el-input>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="SMS 消息重传次数" prop="smsRetransmissionCount">
|
|
||||||
<el-input v-model="form.smsRetransmissionCount" clearable></el-input>
|
|
||||||
</el-form-item>
|
|
||||||
</el-form>
|
|
||||||
<el-divider content-position="center">服务器参数</el-divider>
|
|
||||||
<el-form size="mini" ref="form" :rules="rules" :model="form" label-width="240px" style="display: grid; grid-template-columns: 1fr 1fr 1fr 1fr;">
|
|
||||||
<el-form-item label="APN(主)" prop="apnMaster">
|
|
||||||
<el-input v-model="form.apnMaster" clearable></el-input>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="无线通信拨号用户名(主)" prop="dialingUsernameMaster">
|
|
||||||
<el-input v-model="form.dialingUsernameMaster" clearable></el-input>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="无线通信拨号密码(主)" prop="dialingPasswordMaster">
|
|
||||||
<el-input v-model="form.dialingPasswordMaster" clearable></el-input>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="IP或域名(主)" prop="addressMaster">
|
|
||||||
<el-input v-model="form.addressMaster" clearable></el-input>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="APN(备)" prop="apnBackup">
|
|
||||||
<el-input v-model="form.apnBackup" clearable></el-input>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="无线通信拨号用户名(备)" prop="dialingUsernameBackup">
|
|
||||||
<el-input v-model="form.dialingUsernameBackup" clearable></el-input>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="无线通信拨号密码(备)" prop="dialingPasswordBackup">
|
|
||||||
<el-input v-model="form.dialingPasswordBackup" clearable></el-input>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="IP或域名(备)" prop="addressBackup">
|
|
||||||
<el-input v-model="form.addressBackup" clearable></el-input>
|
|
||||||
</el-form-item>
|
|
||||||
|
|
||||||
<el-form-item label="APN(从)" prop="apnBackup">
|
|
||||||
<el-input v-model="form.apnBackup" clearable></el-input>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="无线通信拨号用户名(从)" prop="dialingUsernameSlave">
|
|
||||||
<el-input v-model="form.dialingUsernameSlave" clearable></el-input>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="无线通信拨号密码(从)" prop="dialingPasswordSlave">
|
|
||||||
<el-input v-model="form.dialingPasswordSlave" clearable></el-input>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="IP或域名(从)" prop="addressSlave">
|
|
||||||
<el-input v-model="form.addressSlave" clearable></el-input>
|
|
||||||
</el-form-item>
|
|
||||||
|
|
||||||
<el-form-item label="IC卡认证服务器IP(主)" prop="addressIcMaster">
|
|
||||||
<el-input v-model="form.addressIcMaster" clearable></el-input>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="IC卡认证服务器IP(备)" prop="addressIcMaster">
|
|
||||||
<el-input v-model="form.addressIcBackup" clearable></el-input>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="IC卡认证服务器TCP端口" prop="tcpPortIcMaster">
|
|
||||||
<el-input v-model="form.tcpPortIcMaster" clearable></el-input>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="IC卡认证服务器UDP端口" prop="udpPortIcMaster">
|
|
||||||
<el-input v-model="form.udpPortIcMaster" clearable></el-input>
|
|
||||||
</el-form-item>
|
|
||||||
</el-form>
|
|
||||||
|
|
||||||
<el-divider content-position="center">位置汇报</el-divider>
|
|
||||||
<el-form size="mini" ref="form" :rules="rules" :model="form" label-width="240px" style="display: grid; grid-template-columns: 1fr 1fr 1fr 1fr;">
|
|
||||||
<el-form-item label="策略" prop="locationReportingStrategy">
|
|
||||||
<el-select v-model="form.locationReportingStrategy" style="float: left; width: 100%" >
|
|
||||||
<el-option label="定时汇报" :value="0">定时汇报</el-option>
|
|
||||||
<el-option label="定距汇报" :value="1"></el-option>
|
|
||||||
<el-option label="定时和定距汇报" :value="2"></el-option>
|
|
||||||
</el-select>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="方案" prop="locationReportingPlan">
|
|
||||||
<el-select v-model="form.locationReportingPlan" style="float: left; width: 100%" >
|
|
||||||
<el-option label="根据ACC状态" :value="0"></el-option>
|
|
||||||
<el-option label="登录状态和ACC状态" :value="1"></el-option>
|
|
||||||
</el-select>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="驾驶员未登录汇报时间间隔(秒)" prop="reportingIntervalOffline">
|
|
||||||
<el-input v-model="form.reportingIntervalOffline" clearable></el-input>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="休眠时汇报时间间隔(秒)" prop="reportingIntervalDormancy">
|
|
||||||
<el-input v-model="form.reportingIntervalDormancy" clearable></el-input>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="紧急报警时汇报时间间隔(秒)" prop="reportingIntervalEmergencyAlarm">
|
|
||||||
<el-input v-model="form.reportingIntervalEmergencyAlarm" clearable></el-input>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="缺省时间汇报间隔(秒)" prop="reportingIntervalDefault">
|
|
||||||
<el-input v-model="form.reportingIntervalDefault" clearable></el-input>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="缺省距离汇报间隔(米)" prop="reportingDistanceDefault">
|
|
||||||
<el-input v-model="form.reportingDistanceDefault" clearable></el-input>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="驾驶员未登录汇报距离间隔(米)" prop="reportingDistanceOffline">
|
|
||||||
<el-input v-model="form.reportingDistanceOffline" clearable></el-input>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="休眠时汇报距离间隔(米)" prop="reportingDistanceDormancy">
|
|
||||||
<el-input v-model="form.reportingDistanceDormancy" clearable></el-input>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="紧急报警时汇报距离间隔(米)" prop="reportingDistanceEmergencyAlarm">
|
|
||||||
<el-input v-model="form.reportingDistanceEmergencyAlarm" clearable></el-input>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="拐点补传角度(度,小于180)" prop="inflectionPointAngle">
|
|
||||||
<el-input v-model="form.inflectionPointAngle" clearable></el-input>
|
|
||||||
</el-form-item>
|
|
||||||
</el-form>
|
|
||||||
<el-divider content-position="center">电话号码</el-divider>
|
|
||||||
<el-form size="mini" ref="form" :rules="rules" :model="form" label-width="240px" style="display: grid; grid-template-columns: 1fr 1fr 1fr 1fr;">
|
|
||||||
<el-form-item label="监控平台电话号码" prop="platformPhoneNumber">
|
|
||||||
<el-input v-model="form.platformPhoneNumber" clearable></el-input>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="复位电话号码" prop="phoneNumberForFactoryReset">
|
|
||||||
<el-input v-model="form.phoneNumberForFactoryReset" clearable></el-input>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="监控平台SMS电话号码" prop="phoneNumberForSms">
|
|
||||||
<el-input v-model="form.phoneNumberForSms" clearable></el-input>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="接收终端SMS文本报警号码" prop="phoneNumberForReceiveTextAlarm">
|
|
||||||
<el-input v-model="form.phoneNumberForReceiveTextAlarm" clearable></el-input>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="终端电话接听策略" prop="locationReportingStrategy">
|
|
||||||
<el-select v-model="form.locationReportingStrategy" style="float: left; width: 100%" >
|
|
||||||
<el-option label="自动接听" :value="0">定时汇报</el-option>
|
|
||||||
<el-option label="ACC ON时自动接听 ,OFF时手动接听" :value="1"></el-option>
|
|
||||||
</el-select>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="每次最长通话时间(秒)" prop="longestCallTimeForPerSession">
|
|
||||||
<el-input v-model="form.longestCallTimeForPerSession" clearable></el-input>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="当月最长通话时间(秒)" prop="longestCallTimeInMonth">
|
|
||||||
<el-input v-model="form.longestCallTimeInMonth" clearable></el-input>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="监听电话号码" prop="phoneNumbersForListen">
|
|
||||||
<el-input v-model="form.phoneNumbersForListen" clearable></el-input>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="监管平台特权短信号码" prop="privilegedSMSNumber">
|
|
||||||
<el-input v-model="form.privilegedSMSNumber" clearable></el-input>
|
|
||||||
</el-form-item>
|
|
||||||
</el-form>
|
|
||||||
|
|
||||||
<el-divider content-position="center">报警参数</el-divider>
|
|
||||||
<el-form size="mini" ref="form" :rules="rules" :model="form" label-width="240px" style="display: grid; grid-template-columns: 1fr 1fr 1fr 1fr;">
|
|
||||||
<el-form-item label="报警屏蔽字(TODO)" prop="alarmMaskingWord">
|
|
||||||
<el-input v-model="form.alarmMaskingWord" clearable></el-input>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="报警发送文本 SMS 开关(TODO)" prop="alarmSendsTextSmsSwitch">
|
|
||||||
<el-input v-model="form.alarmSendsTextSmsSwitch" clearable></el-input>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="报警拍摄开关(TODO)" prop="alarmShootingSwitch">
|
|
||||||
<el-input v-model="form.alarmShootingSwitch" clearable></el-input>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="报警拍摄存储标志(TODO)" prop="alarmShootingStorageFlags">
|
|
||||||
<el-input v-model="form.alarmShootingStorageFlags" clearable></el-input>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="关键标志(TODO)" prop="KeySign">
|
|
||||||
<el-input v-model="form.KeySign" clearable></el-input>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="电子围栏半径(米)" prop="fenceRadius">
|
|
||||||
<el-input v-model="form.fenceRadius" clearable></el-input>
|
|
||||||
</el-form-item>
|
|
||||||
</el-form>
|
|
||||||
|
|
||||||
<el-divider content-position="center">行驶参数</el-divider>
|
|
||||||
<el-form size="mini" ref="form" :rules="rules" :model="form" label-width="240px" style="display: grid; grid-template-columns: 1fr 1fr 1fr 1fr;">
|
|
||||||
<el-form-item v-if="form.illegalDrivingPeriods" label="违规行驶时段-开始时间(HH:mm)" prop="illegalDrivingPeriods">
|
|
||||||
<el-input v-model="form.illegalDrivingPeriods.startTime" clearable></el-input>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item v-if="form.illegalDrivingPeriods" label="违规行驶时段-结束时间(HH:mm)" prop="illegalDrivingPeriods">
|
|
||||||
<el-input v-model="form.illegalDrivingPeriods.endTime" clearable></el-input>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="最高速度(千米每小时)" prop="topSpeed">
|
|
||||||
<el-input v-model="form.topSpeed" clearable></el-input>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="超速持续时间(秒)" prop="overSpeedDuration">
|
|
||||||
<el-input v-model="form.overSpeedDuration" clearable></el-input>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="连续驾驶时间门限(秒)" prop="continuousDrivingTimeThreshold">
|
|
||||||
<el-input v-model="form.continuousDrivingTimeThreshold" clearable></el-input>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="当天累计驾驶时间门限(秒)" prop="cumulativeDrivingTimeThresholdForTheDay">
|
|
||||||
<el-input v-model="form.cumulativeDrivingTimeThresholdForTheDay" clearable></el-input>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="最小休息时间(秒)" prop="minimumBreakTime">
|
|
||||||
<el-input v-model="form.minimumBreakTime" clearable></el-input>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="最长停车时间(秒)" prop="maximumParkingTime">
|
|
||||||
<el-input v-model="form.maximumParkingTime" clearable></el-input>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="超速预警差值(1/10 千米每小时)" prop="overSpeedWarningDifference">
|
|
||||||
<el-input v-model="form.overSpeedWarningDifference" clearable></el-input>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="疲劳驾驶预警差值(秒)" prop="drowsyDrivingWarningDifference">
|
|
||||||
<el-input v-model="form.drowsyDrivingWarningDifference" clearable></el-input>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="碰撞报警-碰撞时间(毫秒)" prop="collisionAlarmParamsCollisionAlarmTime">
|
|
||||||
<el-input v-model="form.collisionAlarmParams.collisionAlarmTime" clearable></el-input>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="碰撞报警-碰撞加速度(0.1g)" prop="collisionAlarmParamsCollisionAcceleration">
|
|
||||||
<el-input v-model="form.collisionAlarmParams.collisionAcceleration" clearable></el-input>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="侧翻报警参数-侧翻角度(度)" prop="rolloverAlarm">
|
|
||||||
<el-input v-model="form.rolloverAlarm" clearable></el-input>
|
|
||||||
</el-form-item>
|
|
||||||
</el-form>
|
|
||||||
|
|
||||||
<el-divider content-position="center">定时拍照控制</el-divider>
|
|
||||||
<el-form size="mini" ref="form" :rules="rules" :model="form" label-width="240px" style="display: grid; grid-template-columns: 1fr 1fr 1fr 1fr;">
|
|
||||||
<el-form-item label="定时拍照开关-通道1" prop="rolloverAlarm">
|
|
||||||
<el-switch v-model="form.cameraTimer.switchForChannel1" ></el-switch>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="定时拍照开关-通道2" prop="rolloverAlarm">
|
|
||||||
<el-switch v-model="form.cameraTimer.switchForChannel2" ></el-switch>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="定时拍照开关-通道3" prop="rolloverAlarm">
|
|
||||||
<el-switch v-model="form.cameraTimer.switchForChannel3" ></el-switch>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="定时拍照开关-通道4" prop="rolloverAlarm">
|
|
||||||
<el-switch v-model="form.cameraTimer.switchForChannel4" ></el-switch>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="定时拍照开关-通道5" prop="rolloverAlarm">
|
|
||||||
<el-switch v-model="form.cameraTimer.switchForChannel5" ></el-switch>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="定时拍照存储-通道1" prop="rolloverAlarm">
|
|
||||||
<el-switch v-model="form.cameraTimer.storageFlagsForChannel1" ></el-switch>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="定时拍照存储-通道2" prop="rolloverAlarm">
|
|
||||||
<el-switch v-model="form.cameraTimer.storageFlagsForChannel2" ></el-switch>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="定时拍照存储-通道3" prop="rolloverAlarm">
|
|
||||||
<el-switch v-model="form.cameraTimer.storageFlagsForChannel3" ></el-switch>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="定时拍照存储-通道4" prop="rolloverAlarm">
|
|
||||||
<el-switch v-model="form.cameraTimer.storageFlagsForChannel4" ></el-switch>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="定时拍照存储-通道5" prop="rolloverAlarm">
|
|
||||||
<el-switch v-model="form.cameraTimer.storageFlagsForChannel5" ></el-switch>
|
|
||||||
</el-form-item>
|
|
||||||
|
|
||||||
<el-form-item label="定时时间间隔" prop="timeInterval">
|
|
||||||
<el-input v-model="form.timeInterval" clearable></el-input>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="定时时间单位" prop="rolloverAlarm">
|
|
||||||
<el-switch v-model="form.cameraTimer.timeUnit" active-text="分" inactive-text="秒"></el-switch>
|
|
||||||
</el-form-item>
|
|
||||||
</el-form>
|
|
||||||
<div style="float: right;">
|
|
||||||
<el-button type="primary" @click="onSubmit" >确认</el-button>
|
|
||||||
<el-button @click="showDevice">取消</el-button>
|
|
||||||
</div>
|
|
||||||
</el-main>
|
|
||||||
</el-container>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
import devicePlayer from './dialog/jtDevicePlayer.vue'
|
|
||||||
import uiHeader from '../layout/UiHeader.vue'
|
|
||||||
import DeviceTree from "./common/DeviceTree";
|
|
||||||
import JTDeviceService from "./service/JTDeviceService";
|
|
||||||
|
|
||||||
export default {
|
|
||||||
name: 'channelList',
|
|
||||||
components: {
|
|
||||||
devicePlayer,
|
|
||||||
uiHeader,
|
|
||||||
DeviceTree
|
|
||||||
},
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
phoneNumber: this.$route.params.phoneNumber,
|
|
||||||
form: {
|
|
||||||
collisionAlarmParams: {},
|
|
||||||
illegalDrivingPeriods: {},
|
|
||||||
cameraTimer: {},
|
|
||||||
},
|
|
||||||
rules: {
|
|
||||||
deviceId: [{ required: true, message: "请输入设备编号", trigger: "blur" }]
|
|
||||||
},
|
|
||||||
winHeight: window.innerHeight - 200,
|
|
||||||
beforeUrl: "/jtDeviceList",
|
|
||||||
isLoading: false,
|
|
||||||
loadSnap: {},
|
|
||||||
};
|
|
||||||
},
|
|
||||||
|
|
||||||
mounted() {
|
|
||||||
this.initData();
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
initData: function () {
|
|
||||||
this.isLoading = true;
|
|
||||||
this.$axios({
|
|
||||||
method: 'get',
|
|
||||||
url: `/api/jt1078/config`,
|
|
||||||
params: {
|
|
||||||
phoneNumber: this.phoneNumber
|
|
||||||
}
|
|
||||||
}).then((res)=> {
|
|
||||||
this.isLoading = false;
|
|
||||||
console.log(res)
|
|
||||||
this.form = res.data.data;
|
|
||||||
}).cache((e)=>{
|
|
||||||
this.isLoading = false;
|
|
||||||
});
|
|
||||||
},
|
|
||||||
onSubmit: function () {
|
|
||||||
this.$axios({
|
|
||||||
method: 'post',
|
|
||||||
url: `/api/jt1078/set-config`,
|
|
||||||
data: {
|
|
||||||
phoneNumber: this.phoneNumber,
|
|
||||||
config: this.form
|
|
||||||
}
|
|
||||||
}).then(function (res) {
|
|
||||||
console.log(JSON.stringify(res));
|
|
||||||
});
|
|
||||||
},
|
|
||||||
showDevice: function () {
|
|
||||||
this.$router.push(this.beforeUrl)
|
|
||||||
},
|
|
||||||
}
|
|
||||||
};
|
|
||||||
</script>
|
|
||||||
@ -1,536 +0,0 @@
|
|||||||
<template>
|
|
||||||
<div style="width: 100%">
|
|
||||||
<div class="page-header" >
|
|
||||||
<div class="page-title">
|
|
||||||
<el-page-header @back="goBack" content="部标录像"></el-page-header>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<el-container>
|
|
||||||
<el-aside width="300px">
|
|
||||||
<div class="record-list-box-box">
|
|
||||||
<el-date-picker size="mini" v-model="chooseDate" type="date" value-format="yyyy-MM-dd" placeholder="日期" @change="dateChange()"></el-date-picker>
|
|
||||||
<div class="record-list-box" v-loading="recordsLoading" :style="recordListStyle">
|
|
||||||
<ul v-if="detailFiles.length >0" class="infinite-list record-list" >
|
|
||||||
<li v-for="item in detailFiles" class="infinite-list-item record-list-item" >
|
|
||||||
|
|
||||||
<el-tag v-if="chooseFile !== item" @click="checkedFile(item)">
|
|
||||||
<i class="el-icon-video-camera" ></i>
|
|
||||||
{{ moment(item.startTime).format('HH:mm:ss')}}-{{ moment(item.endTime).format('HH:mm:ss')}}
|
|
||||||
</el-tag>
|
|
||||||
<el-tag v-if="chooseFile === item" type="danger" >
|
|
||||||
<i class="el-icon-video-camera" ></i>
|
|
||||||
{{ moment(item.startTime).format('HH:mm:ss')}}-{{ moment(item.endTime).format('HH:mm:ss')}}
|
|
||||||
</el-tag>
|
|
||||||
<i style="color: #409EFF;margin-left: 5px;" class="el-icon-download" @click="downloadRecord(item)" ></i>
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</div>
|
|
||||||
<div size="mini" v-if="detailFiles.length ==0" class="record-list-no-val" >暂无数据</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</el-aside>
|
|
||||||
<el-main style="padding-bottom: 10px;">
|
|
||||||
<div class="playBox" :style="playerStyle">
|
|
||||||
<player ref="recordVideoPlayer"
|
|
||||||
:videoUrl="videoUrl"
|
|
||||||
:error="videoError"
|
|
||||||
:message="videoError"
|
|
||||||
:hasAudio="hasAudio"
|
|
||||||
style="max-height: 100%"
|
|
||||||
fluent autoplay live ></player>
|
|
||||||
</div>
|
|
||||||
<div class="player-option-box">
|
|
||||||
<div>
|
|
||||||
<el-button-group >
|
|
||||||
<el-time-picker
|
|
||||||
size="mini"
|
|
||||||
is-range
|
|
||||||
align="left"
|
|
||||||
v-model="timeRange"
|
|
||||||
value-format="yyyy-MM-dd HH:mm:ss"
|
|
||||||
range-separator="至"
|
|
||||||
start-placeholder="开始时间"
|
|
||||||
end-placeholder="结束时间"
|
|
||||||
@change="timePickerChange"
|
|
||||||
placeholder="选择时间范围">
|
|
||||||
</el-time-picker>
|
|
||||||
</el-button-group>
|
|
||||||
|
|
||||||
<el-button-group >
|
|
||||||
<el-button size="mini" class="iconfont icon-zanting" title="开始" @click="control(0, 0)"></el-button>
|
|
||||||
<el-button size="mini" class="iconfont icon-kaishi" title="暂停" @click="control(1, 0)"></el-button>
|
|
||||||
<el-button size="mini" class="iconfont icon-stop" title="结束" @click="control(2, 0)"></el-button>
|
|
||||||
<el-dropdown size="mini" title="播放倍速" @command="scale">
|
|
||||||
<el-button size="mini">
|
|
||||||
快进/快退 <i class="el-icon-arrow-down el-icon--right"></i>
|
|
||||||
</el-button>
|
|
||||||
<el-dropdown-menu slot="dropdown">
|
|
||||||
<el-dropdown-item :command="[3, 1]">正常快进</el-dropdown-item>
|
|
||||||
<el-dropdown-item :command="[3, 2]">2倍速快进</el-dropdown-item>
|
|
||||||
<el-dropdown-item :command="[3, 4]">4倍速快进</el-dropdown-item>
|
|
||||||
<el-dropdown-item :command="[3, 8]">8倍速快进</el-dropdown-item>
|
|
||||||
<el-dropdown-item :command="[3, 16]">16倍速快进</el-dropdown-item>
|
|
||||||
<el-dropdown-item :command="[4, 1]">正常快退</el-dropdown-item>
|
|
||||||
<el-dropdown-item :command="[4, 2]">2倍速快退</el-dropdown-item>
|
|
||||||
<el-dropdown-item :command="[4, 4]">4倍速快退</el-dropdown-item>
|
|
||||||
<el-dropdown-item :command="[4, 8]">8倍速快退</el-dropdown-item>
|
|
||||||
<el-dropdown-item :command="[4, 16]">16倍速快退</el-dropdown-item>
|
|
||||||
</el-dropdown-menu>
|
|
||||||
</el-dropdown>
|
|
||||||
<el-button size="mini" class="iconfont icon-xiazai1" title="下载选定录像" @click="downloadRecord()"></el-button>
|
|
||||||
<el-button v-if="sliderMIn === 0 && sliderMax === 86400" size="mini" class="iconfont icon-slider" title="放大滑块" @click="setSliderFit()"></el-button>
|
|
||||||
<el-button v-if="sliderMIn !== 0 || sliderMax !== 86400" size="mini" class="iconfont icon-slider-right" title="恢复滑块" @click="setSliderFit()"></el-button>
|
|
||||||
</el-button-group>
|
|
||||||
</div>
|
|
||||||
<el-slider
|
|
||||||
class="playtime-slider"
|
|
||||||
v-model="playTime"
|
|
||||||
id="playtimeSlider"
|
|
||||||
:disabled="detailFiles.length === 0"
|
|
||||||
:min="sliderMIn"
|
|
||||||
:max="sliderMax"
|
|
||||||
:range="true"
|
|
||||||
:format-tooltip="playTimeFormat"
|
|
||||||
@change="playTimeChange"
|
|
||||||
:marks="playTimeSliderMarks">
|
|
||||||
</el-slider>
|
|
||||||
<div class="slider-val-box">
|
|
||||||
<div class="slider-val" v-for="item of detailFiles" :style="'width:' + getDataWidth(item) + '%; left:' + getDataLeft(item) + '%'"></div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</el-main>
|
|
||||||
</el-container>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
|
|
||||||
<script>
|
|
||||||
import uiHeader from '../layout/UiHeader.vue'
|
|
||||||
import player from './common/jessibuca.vue'
|
|
||||||
import moment from 'moment'
|
|
||||||
import JTDeviceService from "./service/JTDeviceService";
|
|
||||||
export default {
|
|
||||||
name: 'app',
|
|
||||||
components: {
|
|
||||||
uiHeader, player
|
|
||||||
},
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
phoneNumber: this.$route.params.phoneNumber,
|
|
||||||
channelId: this.$route.params.channelId,
|
|
||||||
deviceService: new JTDeviceService(),
|
|
||||||
recordsLoading: false,
|
|
||||||
streamId: "",
|
|
||||||
hasAudio: false,
|
|
||||||
detailFiles: [],
|
|
||||||
chooseDate: null,
|
|
||||||
videoUrl: null,
|
|
||||||
chooseFile: null,
|
|
||||||
streamInfo: null,
|
|
||||||
app: null,
|
|
||||||
mediaServerId: null,
|
|
||||||
ssrc: null,
|
|
||||||
|
|
||||||
sliderMIn: 0,
|
|
||||||
sliderMax: 86400,
|
|
||||||
autoPlay: true,
|
|
||||||
taskUpdate: null,
|
|
||||||
tabVal: "running",
|
|
||||||
recordListStyle: {
|
|
||||||
height: this.winHeight + "px",
|
|
||||||
overflow: "auto",
|
|
||||||
margin: "10px auto 10px auto"
|
|
||||||
},
|
|
||||||
playerStyle: {
|
|
||||||
"margin": "0 auto 20px auto",
|
|
||||||
"height": this.winHeight + "px",
|
|
||||||
},
|
|
||||||
winHeight: window.innerHeight - 240,
|
|
||||||
playTime: null,
|
|
||||||
timeRange: null,
|
|
||||||
startTime: null,
|
|
||||||
endTime: null,
|
|
||||||
playTimeSliderMarks: {
|
|
||||||
0: "00:00",
|
|
||||||
3600: "01:00",
|
|
||||||
7200: "02:00",
|
|
||||||
10800: "03:00",
|
|
||||||
14400: "04:00",
|
|
||||||
18000: "05:00",
|
|
||||||
21600: "06:00",
|
|
||||||
25200: "07:00",
|
|
||||||
28800: "08:00",
|
|
||||||
32400: "09:00",
|
|
||||||
36000: "10:00",
|
|
||||||
39600: "11:00",
|
|
||||||
43200: "12:00",
|
|
||||||
46800: "13:00",
|
|
||||||
50400: "14:00",
|
|
||||||
54000: "15:00",
|
|
||||||
57600: "16:00",
|
|
||||||
61200: "17:00",
|
|
||||||
64800: "18:00",
|
|
||||||
68400: "19:00",
|
|
||||||
72000: "20:00",
|
|
||||||
75600: "21:00",
|
|
||||||
79200: "22:00",
|
|
||||||
82800: "23:00",
|
|
||||||
86400: "24:00",
|
|
||||||
},
|
|
||||||
};
|
|
||||||
},
|
|
||||||
computed: {
|
|
||||||
|
|
||||||
},
|
|
||||||
mounted() {
|
|
||||||
this.recordListStyle.height = this.winHeight + "px";
|
|
||||||
this.playerStyle["height"] = this.winHeight + "px";
|
|
||||||
this.chooseDate = moment().format('YYYY-MM-DD')
|
|
||||||
this.dateChange();
|
|
||||||
window.addEventListener('beforeunload', this.stopPlayRecord)
|
|
||||||
},
|
|
||||||
destroyed() {
|
|
||||||
this.$destroy('recordVideoPlayer');
|
|
||||||
window.removeEventListener('beforeunload', this.stopPlayRecord)
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
dateChange(){
|
|
||||||
if (!this.chooseDate) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
this.setTime(this.chooseDate + " 00:00:00", this.chooseDate + " 23:59:59");
|
|
||||||
this.recordsLoading = true;
|
|
||||||
this.detailFiles = [];
|
|
||||||
this.$axios({
|
|
||||||
method: 'get',
|
|
||||||
url: '/api/jt1078/record/list',
|
|
||||||
params: {
|
|
||||||
phoneNumber: this.phoneNumber,
|
|
||||||
channelId: this.channelId,
|
|
||||||
startTime: this.startTime,
|
|
||||||
endTime: this.endTime,
|
|
||||||
}
|
|
||||||
}).then((res)=>{
|
|
||||||
this.recordsLoading = false;
|
|
||||||
if(res.data.code === 0) {
|
|
||||||
// 处理时间信息
|
|
||||||
this.detailFiles = res.data.data;
|
|
||||||
}else {
|
|
||||||
this.$message({
|
|
||||||
showClose: true,
|
|
||||||
message: res.data.msg,
|
|
||||||
type: "error",
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
}).catch((e)=> {
|
|
||||||
this.recordsLoading = false;
|
|
||||||
// that.videoHistory.searchHistoryResult = falsificationData.recordData;
|
|
||||||
});
|
|
||||||
},
|
|
||||||
moment: function (v) {
|
|
||||||
return moment(v)
|
|
||||||
},
|
|
||||||
setTime: function (startTime, endTime){
|
|
||||||
this.startTime = startTime;
|
|
||||||
this.endTime = endTime;
|
|
||||||
let start = (new Date(this.startTime).getTime() - new Date(this.chooseDate + " 00:00:00").getTime())/1000;
|
|
||||||
let end = (new Date(this.endTime).getTime() - new Date(this.chooseDate + " 00:00:00").getTime())/1000;
|
|
||||||
console.log(start)
|
|
||||||
console.log(end)
|
|
||||||
this.playTime = [start, end];
|
|
||||||
this.timeRange = [startTime, endTime];
|
|
||||||
},
|
|
||||||
videoError: function (e) {
|
|
||||||
console.log("播放器错误:" + JSON.stringify(e));
|
|
||||||
},
|
|
||||||
checkedFile(file){
|
|
||||||
this.chooseFile = file;
|
|
||||||
this.setTime(file.startTime, file.endTime);
|
|
||||||
// 开始回放
|
|
||||||
this.playRecord()
|
|
||||||
},
|
|
||||||
playRecord: function () {
|
|
||||||
|
|
||||||
if (this.streamId !== "") {
|
|
||||||
this.stopPlayRecord(()=> {
|
|
||||||
this.streamId = "";
|
|
||||||
this.playRecord();
|
|
||||||
})
|
|
||||||
} else {
|
|
||||||
this.$axios({
|
|
||||||
method: 'get',
|
|
||||||
url: '/api/jt1078/playback/start/',
|
|
||||||
params: {
|
|
||||||
phoneNumber: this.phoneNumber,
|
|
||||||
channelId: this.channelId,
|
|
||||||
startTime: this.startTime,
|
|
||||||
endTime: this.endTime,
|
|
||||||
type: 0,
|
|
||||||
rate: 0,
|
|
||||||
playbackType: 0,
|
|
||||||
playbackSpeed: 0
|
|
||||||
}
|
|
||||||
}).then((res)=> {
|
|
||||||
if (res.data.code === 0) {
|
|
||||||
this.streamInfo = res.data.data;
|
|
||||||
this.app = this.streamInfo.app;
|
|
||||||
this.streamId = this.streamInfo.stream;
|
|
||||||
this.mediaServerId = this.streamInfo.mediaServerId;
|
|
||||||
this.ssrc = this.streamInfo.ssrc;
|
|
||||||
this.videoUrl = this.getUrlByStreamInfo();
|
|
||||||
this.hasAudio = this.streamInfo.tracks && this.streamInfo.tracks.length > 1
|
|
||||||
}else {
|
|
||||||
this.$message({
|
|
||||||
showClose: true,
|
|
||||||
message: res.data.msg,
|
|
||||||
type: "error",
|
|
||||||
});
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
},
|
|
||||||
gbPlay(){
|
|
||||||
console.log('前端控制:播放');
|
|
||||||
this.$axios({
|
|
||||||
method: 'get',
|
|
||||||
url: '/api/playback/resume/' + this.streamId
|
|
||||||
}).then((res)=> {
|
|
||||||
this.$refs["recordVideoPlayer"].play(this.videoUrl)
|
|
||||||
});
|
|
||||||
},
|
|
||||||
control(command, playbackSpeed, time){
|
|
||||||
this.$axios({
|
|
||||||
method: 'get',
|
|
||||||
url: '/api/jt1078/playback/control',
|
|
||||||
params: {
|
|
||||||
phoneNumber: this.phoneNumber,
|
|
||||||
channelId: this.channelId,
|
|
||||||
command: command,
|
|
||||||
playbackSpeed: playbackSpeed,
|
|
||||||
time: time
|
|
||||||
}
|
|
||||||
}).then(function (res) {});
|
|
||||||
},
|
|
||||||
scale(command){
|
|
||||||
this.control(command[0], command[1])
|
|
||||||
},
|
|
||||||
downloadRecord: function (row) {
|
|
||||||
let baseUrl = window.baseUrl ? window.baseUrl : "";
|
|
||||||
let downloadFile = ((process.env.NODE_ENV === 'development') ? process.env.BASE_API : baseUrl) +
|
|
||||||
`/api/jt1078/playback/download?phoneNumber=${this.phoneNumber}&channelId=${this.channelId}&startTime=${row.startTime}&endTime=${row.endTime}`+
|
|
||||||
`&alarmSign=${row.alarmSign}&mediaType=${row.mediaType}&streamType=${row.streamType}&storageType=${row.storageType}`
|
|
||||||
console.log(downloadFile)
|
|
||||||
let x = new XMLHttpRequest();
|
|
||||||
x.open("GET", downloadFile, true);
|
|
||||||
x.responseType = 'blob';
|
|
||||||
x.onload=(e)=> {
|
|
||||||
let url = window.URL.createObjectURL(x.response)
|
|
||||||
let a = document.createElement('a');
|
|
||||||
a.href = url
|
|
||||||
a.download = this.phoneNumber + "-" + this.channelId + ".mp4";
|
|
||||||
a.click()
|
|
||||||
}
|
|
||||||
x.send();
|
|
||||||
},
|
|
||||||
stopDownloadRecord: function (callback) {
|
|
||||||
this.$refs["recordVideoPlayer"].pause();
|
|
||||||
this.videoUrl = '';
|
|
||||||
this.$axios({
|
|
||||||
method: 'get',
|
|
||||||
url: '/api/gb_record/download/stop/' + this.deviceId + "/" + this.channelId+ "/" + this.streamId
|
|
||||||
}).then((res)=> {
|
|
||||||
if (callback) callback(res)
|
|
||||||
});
|
|
||||||
},
|
|
||||||
stopPlayRecord: function (callback) {
|
|
||||||
console.log("停止录像回放")
|
|
||||||
if (this.streamId !== "") {
|
|
||||||
this.$refs["recordVideoPlayer"].pause();
|
|
||||||
this.videoUrl = '';
|
|
||||||
this.$axios({
|
|
||||||
method: 'get',
|
|
||||||
url: '/api/jt1078/playback/stop/',
|
|
||||||
params: {
|
|
||||||
phoneNumber: this.phoneNumber,
|
|
||||||
channelId: this.channelId,
|
|
||||||
streamId: this.streamId
|
|
||||||
}
|
|
||||||
}).then(function (res) {
|
|
||||||
if (callback) callback()
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
},
|
|
||||||
getDataWidth(item){
|
|
||||||
let timeForFile = this.getTimeForFile(item);
|
|
||||||
let result = (timeForFile[2])/((this.sliderMax - this.sliderMIn)*1000)
|
|
||||||
return result*100
|
|
||||||
},
|
|
||||||
getDataLeft(item){
|
|
||||||
let timeForFile = this.getTimeForFile(item);
|
|
||||||
let differenceTime = timeForFile[0].getTime() - new Date(this.chooseDate + " 00:00:00").getTime()
|
|
||||||
return parseFloat((differenceTime - this.sliderMIn * 1000)/((this.sliderMax - this.sliderMIn)*1000))*100 ;
|
|
||||||
},
|
|
||||||
getUrlByStreamInfo(){
|
|
||||||
if (location.protocol === "https:") {
|
|
||||||
this.videoUrl = this.streamInfo["wss_flv"]
|
|
||||||
}else {
|
|
||||||
this.videoUrl = this.streamInfo["ws_flv"]
|
|
||||||
}
|
|
||||||
return this.videoUrl;
|
|
||||||
|
|
||||||
},
|
|
||||||
timePickerChange: function (val){
|
|
||||||
this.setTime(val[0], val[1])
|
|
||||||
},
|
|
||||||
playTimeChange(val){
|
|
||||||
console.log(val)
|
|
||||||
|
|
||||||
let startTimeStr = moment(new Date(this.chooseDate + " 00:00:00").getTime() + val[0]*1000).format("YYYY-MM-DD HH:mm:ss");
|
|
||||||
let endTimeStr = moment(new Date(this.chooseDate + " 00:00:00").getTime() + val[1]*1000).format("YYYY-MM-DD HH:mm:ss");
|
|
||||||
|
|
||||||
this.setTime(startTimeStr, endTimeStr)
|
|
||||||
|
|
||||||
this.playRecord();
|
|
||||||
},
|
|
||||||
setSliderFit() {
|
|
||||||
if (this.sliderMIn === 0 && this.sliderMax === 86400) {
|
|
||||||
if (this.detailFiles.length > 0){
|
|
||||||
let timeForFile = this.getTimeForFile(this.detailFiles[0]);
|
|
||||||
let lastTimeForFile = this.getTimeForFile(this.detailFiles[this.detailFiles.length - 1]);
|
|
||||||
let timeNum = timeForFile[0].getTime() - new Date(this.chooseDate + " " + "00:00:00").getTime()
|
|
||||||
let lastTimeNum = lastTimeForFile[1].getTime() - new Date(this.chooseDate + " " + "00:00:00").getTime()
|
|
||||||
|
|
||||||
this.playTime = parseInt(timeNum/1000)
|
|
||||||
this.sliderMIn = parseInt(timeNum/1000 - timeNum/1000%(60*60))
|
|
||||||
this.sliderMax = parseInt(lastTimeNum/1000 - lastTimeNum/1000%(60*60)) + 60*60
|
|
||||||
|
|
||||||
this.playTime = [this.sliderMIn, this.sliderMax];
|
|
||||||
}
|
|
||||||
}else {
|
|
||||||
this.sliderMIn = 0;
|
|
||||||
this.sliderMax = 86400;
|
|
||||||
}
|
|
||||||
},
|
|
||||||
getTimeForFile(file){
|
|
||||||
let startTime = new Date(file.startTime);
|
|
||||||
let endTime = new Date(file.endTime);
|
|
||||||
return [startTime, endTime, endTime.getTime() - startTime.getTime()];
|
|
||||||
},
|
|
||||||
playTimeFormat(val){
|
|
||||||
let h = parseInt(val/3600);
|
|
||||||
let m = parseInt((val - h*3600)/60);
|
|
||||||
let s = parseInt(val - h*3600 - m*60);
|
|
||||||
|
|
||||||
let hStr = h;
|
|
||||||
let mStr = m;
|
|
||||||
let sStr = s;
|
|
||||||
if (h < 10) {
|
|
||||||
hStr = "0" + hStr;
|
|
||||||
}
|
|
||||||
if (m < 10) {
|
|
||||||
mStr = "0" + mStr;s
|
|
||||||
}
|
|
||||||
if (s < 10) {
|
|
||||||
sStr = "0" + sStr;
|
|
||||||
}
|
|
||||||
return hStr + ":" + mStr + ":" + sStr
|
|
||||||
},
|
|
||||||
goBack(){
|
|
||||||
// 如果正在进行录像回放则,发送停止
|
|
||||||
if (this.streamId !== "") {
|
|
||||||
this.stopPlayRecord(()=> {
|
|
||||||
this.streamId = "";
|
|
||||||
})
|
|
||||||
}
|
|
||||||
window.history.go(-1);
|
|
||||||
},
|
|
||||||
}
|
|
||||||
};
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style>
|
|
||||||
.el-slider__runway {
|
|
||||||
background-color:rgba(206, 206, 206, 0.47) !important;
|
|
||||||
}
|
|
||||||
.el-slider__bar {
|
|
||||||
background-color: rgba(153, 153, 153, 0) !important;
|
|
||||||
}
|
|
||||||
.playtime-slider {
|
|
||||||
position: relative;
|
|
||||||
z-index: 100;
|
|
||||||
}
|
|
||||||
.data-picker-true{
|
|
||||||
|
|
||||||
}
|
|
||||||
.data-picker-true:after{
|
|
||||||
content: "";
|
|
||||||
position: absolute;
|
|
||||||
width: 4px;
|
|
||||||
height: 4px;
|
|
||||||
background-color: #606060;
|
|
||||||
border-radius: 4px;
|
|
||||||
left: 45%;
|
|
||||||
top: 74%;
|
|
||||||
|
|
||||||
}
|
|
||||||
.data-picker-false{
|
|
||||||
|
|
||||||
}
|
|
||||||
.slider-val-box{
|
|
||||||
height: 6px;
|
|
||||||
position: relative;
|
|
||||||
top: -22px;
|
|
||||||
}
|
|
||||||
.slider-val{
|
|
||||||
height: 6px;
|
|
||||||
background-color: #007CFF;
|
|
||||||
position: absolute;
|
|
||||||
}
|
|
||||||
.record-list-box-box{
|
|
||||||
width: 250px;
|
|
||||||
float: left;
|
|
||||||
}
|
|
||||||
.record-list-box{
|
|
||||||
overflow: auto;
|
|
||||||
width: 220px;
|
|
||||||
list-style: none;
|
|
||||||
padding: 0;
|
|
||||||
margin: 0;
|
|
||||||
margin-top: 0px;
|
|
||||||
padding: 1rem 0;
|
|
||||||
background-color: #FFF;
|
|
||||||
margin-top: 10px;
|
|
||||||
}
|
|
||||||
.record-list{
|
|
||||||
list-style: none;
|
|
||||||
padding: 0;
|
|
||||||
margin: 0;
|
|
||||||
background-color: #FFF;
|
|
||||||
|
|
||||||
}
|
|
||||||
.record-list-no-val {
|
|
||||||
position: absolute;
|
|
||||||
color: #9f9f9f;
|
|
||||||
top: 50%;
|
|
||||||
left: 110px;
|
|
||||||
}
|
|
||||||
.record-list-item{
|
|
||||||
padding: 0;
|
|
||||||
margin: 0;
|
|
||||||
margin: 0.5rem 0;
|
|
||||||
cursor: pointer;
|
|
||||||
}
|
|
||||||
.record-list-option {
|
|
||||||
width: 10px;
|
|
||||||
float: left;
|
|
||||||
margin-top: 39px;
|
|
||||||
|
|
||||||
}
|
|
||||||
.player-option-box{
|
|
||||||
padding: 0 20px;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
@ -1,77 +0,0 @@
|
|||||||
import axios from 'axios';
|
|
||||||
|
|
||||||
class JTDeviceService{
|
|
||||||
|
|
||||||
constructor() {
|
|
||||||
this.$axios = axios;
|
|
||||||
}
|
|
||||||
|
|
||||||
getDeviceList(currentPage, count, callback, errorCallback){
|
|
||||||
this.$axios({
|
|
||||||
method: 'get',
|
|
||||||
url: `/api/jt1078/terminal/list`,
|
|
||||||
params: {
|
|
||||||
page: currentPage,
|
|
||||||
count: count
|
|
||||||
}
|
|
||||||
}).then( (res)=> {
|
|
||||||
if (typeof (callback) == "function") callback(res.data)
|
|
||||||
}).catch( (error)=> {
|
|
||||||
console.error(error);
|
|
||||||
if (typeof (errorCallback) == "function") errorCallback(error)
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
getDevice(deviceId, callback, errorCallback){
|
|
||||||
this.$axios({
|
|
||||||
method: 'get',
|
|
||||||
url:`/api/jt1078/terminal/query`,
|
|
||||||
params: {
|
|
||||||
deviceId: deviceId
|
|
||||||
},
|
|
||||||
}).then((res) => {
|
|
||||||
console.log(11)
|
|
||||||
console.log(res)
|
|
||||||
if (typeof (callback) == "function") callback(res.data)
|
|
||||||
}).catch((error) => {
|
|
||||||
console.log(error);
|
|
||||||
if (typeof (errorCallback) == "function") errorCallback(error)
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
deleteDevice(deviceId, callback, errorCallback){
|
|
||||||
this.$axios({
|
|
||||||
method: 'delete',
|
|
||||||
url: '/api/jt1078/terminal/delete',
|
|
||||||
params: {
|
|
||||||
deviceId: deviceId
|
|
||||||
}
|
|
||||||
}).then((res) => {
|
|
||||||
if (typeof (callback) == "function") callback(res.data)
|
|
||||||
}).catch((error) => {
|
|
||||||
if (typeof (errorCallback) == "function") errorCallback(error)
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
getAllChannel(currentPage, count, searchSrt, deviceId, endCallback, errorCallback) {
|
|
||||||
this.$axios({
|
|
||||||
method: 'get',
|
|
||||||
url: `/api/jt1078/terminal/channel/list`,
|
|
||||||
params: {
|
|
||||||
page: currentPage,
|
|
||||||
count: count,
|
|
||||||
query: searchSrt,
|
|
||||||
deviceId: deviceId,
|
|
||||||
}
|
|
||||||
}).then(function (res) {
|
|
||||||
if (typeof (endCallback) == "function") endCallback(res.data)
|
|
||||||
}).catch(function (error) {
|
|
||||||
console.log(error);
|
|
||||||
if (typeof (errorCallback) == "function") errorCallback(error)
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
export default JTDeviceService;
|
|
||||||
Loading…
Reference in New Issue
Block a user