|
@@ -119,22 +119,12 @@
|
|
|
|
|
|
<script>
|
|
|
import {
|
|
|
- getForest,
|
|
|
- updateCentereventTForestfireStatus,
|
|
|
getNearEvent,
|
|
|
getNearCamera
|
|
|
} from '@/api/event'
|
|
|
- import {
|
|
|
- selectByeventCode,
|
|
|
- getWarm,
|
|
|
- updateDeptEventStatus,
|
|
|
- listByEventCode,
|
|
|
- selectCameraEventByCameraId,
|
|
|
- listCenterdataTAttachByBusId,
|
|
|
- selectchannelCodeByCameraId,
|
|
|
- selectFjsxt
|
|
|
- } from '@/api/forest'
|
|
|
-
|
|
|
+ import {
|
|
|
+ getHaiKangVideoServer
|
|
|
+ } from '@/api/haikang/haikang'
|
|
|
import vBottomMenu from '@/components/vBottomMenu.vue' //一体化公共底部菜单
|
|
|
import eventLocationSupermap from '@/components/supermap' //超图
|
|
|
import eventdetailsdialog from '@/views/eventdetailsdialog.vue' //事件详情弹窗
|
|
@@ -425,21 +415,16 @@
|
|
|
let markersMap = {
|
|
|
lng: 124.59,
|
|
|
lat: 43.02,
|
|
|
- icon: 'camera',
|
|
|
- bindPopupHtml: '',
|
|
|
- click: 'preview',
|
|
|
- parameter: '',
|
|
|
+ icon: 'camera',
|
|
|
+ bindPopupHtml: '',
|
|
|
+ click: 'preview',
|
|
|
+ parameter: res.data.cameraCode,
|
|
|
keepBindPopup: false,
|
|
|
isAggregation: false
|
|
|
}
|
|
|
if (res.data.length > 50) {
|
|
|
markersMap.isAggregation = true
|
|
|
}
|
|
|
- if (res.data[i].channelCode != null) {
|
|
|
- markersMap.parameter = res.data[i].channelCode.split(',')
|
|
|
- } else {
|
|
|
- markersMap.parameter = []
|
|
|
- }
|
|
|
|
|
|
markersMap.lng = res.data[i].longitude
|
|
|
markersMap.lat = res.data[i].latitude
|
|
@@ -494,43 +479,58 @@
|
|
|
this.$modal.msgWarning('请重新安装客户端')
|
|
|
},
|
|
|
/** 预览按钮操作 */
|
|
|
- preview(channelCode) {
|
|
|
- getDahuaVideoServer().then(newResponse => {
|
|
|
- this.ws.detectConnectQt().then(res => {
|
|
|
- if (res) { // 连接客户端成功
|
|
|
- this.alertLogin()
|
|
|
- this.ws.login({
|
|
|
- loginIp: newResponse.loginIp,
|
|
|
- loginPort: newResponse.loginPort,
|
|
|
- userName: newResponse.userName,
|
|
|
- userPwd: newResponse.userPwd,
|
|
|
- token: '',
|
|
|
- https: 1
|
|
|
- })
|
|
|
- this.ws.on('loginState', (res) => {
|
|
|
- this.isLogin = res
|
|
|
- console.log('---res-----', res)
|
|
|
- if (res) {
|
|
|
- this.alertLoginSuccess()
|
|
|
- this.activePanel = 'key2'
|
|
|
- this.realTimeVideoDialog(channelCode)
|
|
|
- } else {
|
|
|
- this.alertLoginFailed()
|
|
|
- }
|
|
|
- })
|
|
|
- } else { // 连接客户端失败
|
|
|
- this.alertReinstall()
|
|
|
- }
|
|
|
- })
|
|
|
- })
|
|
|
- },
|
|
|
- realTimeVideoDialog(cameraParams) { // 调用弹窗实时播放接口
|
|
|
- if (!this.isLogin) {
|
|
|
- this.$Message.info('正在登陆客户端,请稍等......')
|
|
|
- return false
|
|
|
- }
|
|
|
- this.ws.openVideo(cameraParams)
|
|
|
- },
|
|
|
+ preview(cameraCode) {
|
|
|
+ let that = this
|
|
|
+ // getDahuaVideoServer().then(newResponse => {
|
|
|
+ // console.log(newResponse)
|
|
|
+ // this.ws.detectConnectQt().then(res => {
|
|
|
+ // if (res) { // 连接客户端成功
|
|
|
+ // this.alertLogin()
|
|
|
+ // this.ws.login({
|
|
|
+ // loginIp: newResponse.loginIp,
|
|
|
+ // loginPort: newResponse.loginPort,
|
|
|
+ // userName: newResponse.userName,
|
|
|
+ // userPwd: newResponse.userPwd,
|
|
|
+ // token: '',
|
|
|
+ // https: 1
|
|
|
+ // })
|
|
|
+ // this.ws.on('loginState', (res) => {
|
|
|
+ // this.isLogin = res
|
|
|
+ // console.log('---res-----', res)
|
|
|
+ // if (res) {
|
|
|
+ // this.alertLoginSuccess()
|
|
|
+ // this.activePanel = 'key2'
|
|
|
+ // this.realTimeVideoDialog(channelCode)
|
|
|
+ // } else {
|
|
|
+ // this.alertLoginFailed()
|
|
|
+ // }
|
|
|
+ // })
|
|
|
+ // } else { // 连接客户端失败
|
|
|
+ // this.alertReinstall()
|
|
|
+ // }
|
|
|
+ // })
|
|
|
+ // })
|
|
|
+ that.cameraVisible = true
|
|
|
+ getHaiKangVideoServer({ cameraCode: cameraCode }).then(newResponse => {
|
|
|
+ that.cameraTitle = '摄像头-' + newResponse.data.cameraName
|
|
|
+ that.initPlugin(newResponse.data.appkey, newResponse.data.loginIp, newResponse.data.secret, newResponse.data.loginPort)
|
|
|
+ that.$nextTick(()=>{
|
|
|
+ console.log(that.oWebControl)
|
|
|
+ setTimeout(function() {
|
|
|
+ console.log(that.oWebControl)
|
|
|
+ that.playhk(newResponse.data.channelCode)
|
|
|
+ }, 5000)
|
|
|
+ })
|
|
|
+ })
|
|
|
+
|
|
|
+ },
|
|
|
+ realTimeVideoDialog(cameraParams) { // 调用弹窗实时播放接口
|
|
|
+ if (!this.isLogin) {
|
|
|
+ this.$Message.info('正在登陆客户端,请稍等......')
|
|
|
+ return false
|
|
|
+ }
|
|
|
+ this.ws.openVideo(cameraParams)
|
|
|
+ },
|
|
|
/** ----------------------------------摄像头预览结束------------------------------------- */
|
|
|
|
|
|
/** ----------------------------------事件弹窗开始------------------------------------- */
|
|
@@ -566,106 +566,6 @@
|
|
|
return await that.formLeaveTable()
|
|
|
}
|
|
|
},
|
|
|
- // 弹层方法
|
|
|
- showEventInfo_notProcessed(id) {
|
|
|
- let that = this
|
|
|
- that.id = id;
|
|
|
- that.eventInfoVisible_notProcessed = true
|
|
|
- that.listEventPic = [],
|
|
|
- that.url = '',
|
|
|
- that.resetQuery()
|
|
|
- getWarm(id).then(res => {
|
|
|
- let data = res.data
|
|
|
- that.id = data.id;
|
|
|
- that.cameraId = data.reportById
|
|
|
- that.reportTime = data.reportTime
|
|
|
- that.reportAddress = data.reportAddress
|
|
|
- that.eventCode = data.eventCode
|
|
|
- that.eventSource = data.eventSource
|
|
|
- that.information[0].content = data.eventTitle
|
|
|
- that.information[1].content = data.reportTime
|
|
|
- that.information[2].content = that.selectDictLabel(that.dict.type.event_source, data
|
|
|
- .eventSource)
|
|
|
- that.information[3].content = data.longitude
|
|
|
- that.information[4].content = data.latitude
|
|
|
- that.information[5].content = data.reportBy
|
|
|
- that.information[6].content = data.eventContent
|
|
|
- selectByeventCode(data.eventCode).then(res1 => {
|
|
|
- let that = this
|
|
|
- that.listEventDept = res1.data.allDept
|
|
|
- that.listoperateDept = res1.data.operateDept
|
|
|
- })
|
|
|
-
|
|
|
- listByEventCode(data.eventCode).then(res2 => {
|
|
|
- let that = this
|
|
|
- that.listLog = res2.data
|
|
|
- })
|
|
|
-
|
|
|
-
|
|
|
- selectCameraEventByCameraId(data.reportById).then(res3 => {
|
|
|
- let that = this
|
|
|
- that.listeventType = res3.data
|
|
|
- })
|
|
|
-
|
|
|
- if (data.attachId != null) {
|
|
|
- listCenterdataTAttachByBusId(data.attachId).then(res4 => {
|
|
|
- let that = this
|
|
|
- that.listEventPic = res4.data
|
|
|
- if (that.listEventPic.length > 0) {
|
|
|
- that.url = that.listEventPic[0]
|
|
|
- } else {
|
|
|
- that.url = ""
|
|
|
- }
|
|
|
- })
|
|
|
- }
|
|
|
- })
|
|
|
- },
|
|
|
- updateEventStatusNotProcessed() {
|
|
|
- if (this.deptName == '') {
|
|
|
- this.$modal.msgError("请选择部门");
|
|
|
- return
|
|
|
- }
|
|
|
- if (this.eventStatus == '') {
|
|
|
- this.$modal.msgError("请选择状态");
|
|
|
- return
|
|
|
- }
|
|
|
- if (this.eventTypeShow) {
|
|
|
- if (this.eventType == '') {
|
|
|
- this.$modal.msgError("请选择事件类型");
|
|
|
- return
|
|
|
- }
|
|
|
- }
|
|
|
- this.updateEventStatusForm.id = this.id
|
|
|
- this.updateEventStatusForm.zt = this.eventStatus
|
|
|
- this.updateEventStatusForm.eventCode = this.eventCode
|
|
|
- this.updateEventStatusForm.deptId = this.deptId
|
|
|
- this.updateEventStatusForm.deptName = this.deptName
|
|
|
- this.updateEventStatusForm.eventType = this.eventType
|
|
|
-
|
|
|
-
|
|
|
- updateDeptEventStatus(this.updateEventStatusForm).then(response => {
|
|
|
- this.$modal.msgSuccess(response.msg)
|
|
|
- this.eventStatus = ''
|
|
|
- this.deptId = ''
|
|
|
- this.eventType = ''
|
|
|
- this.deptName = ''
|
|
|
- this.eventInfoVisible_notProcessed = false
|
|
|
- cancelEventShow();
|
|
|
- })
|
|
|
- },
|
|
|
- updateEventStatusProcessed() {
|
|
|
- if (this.eventStatus == '') {
|
|
|
- this.$modal.msgError("请选择状态");
|
|
|
- return
|
|
|
- }
|
|
|
- updateCentereventTForestfireStatus(this.id, this.eventStatus).then(response => {
|
|
|
- this.$modal.msgSuccess(response.msg)
|
|
|
- this.eventStatus = ''
|
|
|
- this.eventInfoVisible_Processed = false
|
|
|
- cancelEventShow();
|
|
|
- })
|
|
|
-
|
|
|
- },
|
|
|
setXsYc() {
|
|
|
let that = this
|
|
|
if (this.eventStatus == 'qr') {
|
|
@@ -685,78 +585,6 @@
|
|
|
this.listLog = []; //处理过程List,
|
|
|
this.listoperateDept = [];
|
|
|
},
|
|
|
- handleClickNotProcessed: function(tab, oldActiveName) {
|
|
|
- let that = this
|
|
|
- if (tab.name == 'frame') {
|
|
|
- if (that.eventSource == 'event_source_2') {
|
|
|
- selectchannelCodeByCameraId(that.cameraId).then(res => {
|
|
|
- let channelCode = [];
|
|
|
- if (res.data != null && res.data.length > 0) {
|
|
|
- for (let i = 0; i < res.data.length; i++) {
|
|
|
- channelCode.push(res.data[i].channelCode);
|
|
|
- }
|
|
|
- }
|
|
|
- //this.preview("ZgVzqsjwA1DT3G85KJ7HH0");
|
|
|
- if (channelCode != null && channelCode.length > 0) {
|
|
|
- this.preview(channelCode);
|
|
|
- } else {
|
|
|
- this.$modal.msg("没有匹配到相对应摄像头!!!");
|
|
|
- }
|
|
|
- })
|
|
|
- } else {
|
|
|
- this.$modal.msg("没有匹配到相对应摄像头!!!");
|
|
|
- }
|
|
|
- } else if (tab.name == 'point') {
|
|
|
- setTimeout(() => {
|
|
|
- that.markersMapList = [];
|
|
|
- let information = {};
|
|
|
- information.lng = that.information[3].content;
|
|
|
- information.lat = that.information[4].content;
|
|
|
- let bindPopupHtml = '';
|
|
|
- for (let i = 0; i < that.information.length; i++) {
|
|
|
- bindPopupHtml += '<span>' +
|
|
|
- ' <div class="d-l-con">' +
|
|
|
- ' <div class="d-l-l-text">' +
|
|
|
- ' <h4>' + that.information[i].name + ':' + that.information[i]
|
|
|
- .content + '</h4>' +
|
|
|
- ' </div>' +
|
|
|
- ' </div>' +
|
|
|
- ' </span>';
|
|
|
- }
|
|
|
- information.bindPopupHtml = bindPopupHtml;
|
|
|
- information.click = "";
|
|
|
- information.keepBindPopup = false;
|
|
|
- information.isAggregation = false;
|
|
|
- information.icon = "marker";
|
|
|
- that.markersMapList.push(information)
|
|
|
- // 查询火点附近摄像头
|
|
|
- selectFjsxt(that.information[3].content, that.information[4].content).then(
|
|
|
- response => {
|
|
|
- console.log("vv", response.data)
|
|
|
- if (response.data != null && response.data.length > 0) {
|
|
|
- for (let i = 0; i < response.data.length; i++) {
|
|
|
- let marke = {};
|
|
|
- marke.lng = response.data[i].longitude;
|
|
|
- marke.lat = response.data[i].latitude;
|
|
|
- let code = response.data[i].channelCode.split(",");
|
|
|
- marke.bindPopupHtml = response.data[i].cameraName;
|
|
|
- marke.click = "preview";
|
|
|
- marke.parameter = code;
|
|
|
- marke.keepBindPopup = false;
|
|
|
- marke.isAggregation = false;
|
|
|
- marke.icon = "camera";
|
|
|
- that.markersMapList.push(marke)
|
|
|
- }
|
|
|
- }
|
|
|
- that.$refs.notProcessedSupermap.dropLocation(information.lat, information
|
|
|
- .lng)
|
|
|
- that.$refs.notProcessedSupermap.clearM(false)
|
|
|
- that.$refs.notProcessedSupermap.setMarkers(that.markersMapList)
|
|
|
- })
|
|
|
- }, 1000);
|
|
|
-
|
|
|
- }
|
|
|
- },
|
|
|
/** 重置按钮操作 */
|
|
|
resetQuery() {
|
|
|
this.eventTypeShow = false
|
|
@@ -764,145 +592,137 @@
|
|
|
this.deptName = ''
|
|
|
this.eventStatus = ''
|
|
|
},
|
|
|
- handleClickProcessed(tab, event) {
|
|
|
- let that = this
|
|
|
- if (tab.name == 'frame') {
|
|
|
- if (that.eventSource == 'event_source_2') {
|
|
|
- selectchannelCodeByCameraId(that.cameraId).then(res => {
|
|
|
- let channelCode = [];
|
|
|
- if (res.data != null && res.data.length > 0) {
|
|
|
- for (let i = 0; i < res.data.length; i++) {
|
|
|
- channelCode.push(res.data[i].channelCode);
|
|
|
- }
|
|
|
- }
|
|
|
- if (channelCode != null && channelCode.length > 0) {
|
|
|
- this.preview(channelCode);
|
|
|
- } else {
|
|
|
- this.$modal.msg("没有匹配到相对应摄像头!!!");
|
|
|
- }
|
|
|
- })
|
|
|
- } else {
|
|
|
- this.$modal.msg("没有匹配到相对应摄像头!!!");
|
|
|
- }
|
|
|
- } else if (tab.name == 'point') {
|
|
|
- setTimeout(() => {
|
|
|
- that.markersMapList = [];
|
|
|
- let information = {};
|
|
|
- information.lng = that.information[3].content;
|
|
|
- information.lat = that.information[4].content;
|
|
|
- let bindPopupHtml = '';
|
|
|
- for (let i = 0; i < that.information.length; i++) {
|
|
|
- bindPopupHtml += '<span>' +
|
|
|
- ' <div class="d-l-con">' +
|
|
|
- ' <div class="d-l-l-text">' +
|
|
|
- ' <h4>' + that.information[i].name + ':' + that.information[i]
|
|
|
- .content + '</h4>' +
|
|
|
- ' </div>' +
|
|
|
- ' </div>' +
|
|
|
- ' </span>';
|
|
|
- }
|
|
|
- information.bindPopupHtml = bindPopupHtml;
|
|
|
- information.click = "";
|
|
|
- information.keepBindPopup = false;
|
|
|
- information.isAggregation = false;
|
|
|
- information.icon = "marker";
|
|
|
- that.markersMapList.push(information)
|
|
|
-
|
|
|
- // 查询火点附近摄像头
|
|
|
- selectFjsxt(that.information[3].content, that.information[4].content).then(response => {
|
|
|
- console.log("vv", response.data)
|
|
|
- if (response.data != null && response.data.length > 0) {
|
|
|
- for (let i = 0; i < response.data.length; i++) {
|
|
|
-
|
|
|
- let marke = {};
|
|
|
- marke.lng = response.data[i].longitude;
|
|
|
- marke.lat = response.data[i].latitude;
|
|
|
- let code = response.data[i].channelCode.split(",");
|
|
|
- marke.bindPopupHtml = response.data[i].cameraName;
|
|
|
- marke.click = "preview";
|
|
|
- marke.parameter = code;
|
|
|
- marke.keepBindPopup = false;
|
|
|
- marke.isAggregation = false;
|
|
|
- marke.icon = "camera";
|
|
|
- that.markersMapList.push(marke)
|
|
|
- }
|
|
|
- }
|
|
|
- that.$refs.processedSupermap.dropLocation(information.lat, information.lng)
|
|
|
- that.$refs.processedSupermap.clearM(false)
|
|
|
- that.$refs.processedSupermap.setMarkers(that.markersMapList)
|
|
|
- })
|
|
|
- }, 1000);
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
- }
|
|
|
- },
|
|
|
- showEventInfo_Processed(id) {
|
|
|
- let that = this
|
|
|
- that.id = id;
|
|
|
- that.eventInfoVisible_Processed = true;
|
|
|
- that.listEventPic = [];
|
|
|
- that.url = '';
|
|
|
- getForest(id).then(response => {
|
|
|
- let data = response.data
|
|
|
- if (data.eventStatus != 'event_event_status_1') {
|
|
|
- this.aniu = false
|
|
|
- }
|
|
|
- if (data.eventStatus == 'event_event_status_6') {
|
|
|
- this.optionsProcessed.splice(1, 2)
|
|
|
- this.zt = 3
|
|
|
- }
|
|
|
- if (data.eventStatus == 'event_event_status_1') {
|
|
|
- this.optionsProcessed.splice(2, 1)
|
|
|
- this.zt = 2
|
|
|
- }
|
|
|
- if (data.eventStatus == 'event_event_status_2') {
|
|
|
- this.optionsProcessed.splice(0, 2)
|
|
|
- this.zt = 4
|
|
|
- }
|
|
|
- if (data.eventStatus == 'event_event_status_3') {
|
|
|
- this.showZt = false
|
|
|
- this.fireReport = true
|
|
|
- this.zt = 5
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
- let that = this
|
|
|
- this.eventSource = data.eventSource
|
|
|
- this.id = data.id;
|
|
|
- this.reportTime = data.reportTime
|
|
|
- this.cameraId = data.reportById
|
|
|
- this.reportAddress = data.reportAddress
|
|
|
- this.eventCode = data.eventCode
|
|
|
- this.information[0].content = data.eventTitle
|
|
|
- this.information[1].content = data.reportTime
|
|
|
- this.information[2].content = that.selectDictLabel(that.dict.type.event_source, data
|
|
|
- .eventSource)
|
|
|
- this.information[3].content = data.longitude
|
|
|
- this.information[4].content = data.latitude
|
|
|
- this.information[5].content = data.reportBy
|
|
|
- this.information[6].content = data.eventContent
|
|
|
-
|
|
|
- selectByeventCode(data.eventCode).then(response => {
|
|
|
- that.listEventDept = response.data
|
|
|
- })
|
|
|
-
|
|
|
- listByEventCode(data.eventCode).then(response => {
|
|
|
- that.listLog = response.data
|
|
|
- })
|
|
|
- if (data.attachId != null) {
|
|
|
- listCenterdataTAttachByBusId(data.attachId).then(response => {
|
|
|
- that.listEventPic = response.data
|
|
|
- if (that.listEventPic.length > 0) {
|
|
|
- that.url = that.listEventPic[0]
|
|
|
- } else {
|
|
|
- that.url = ""
|
|
|
- }
|
|
|
- })
|
|
|
- }
|
|
|
- })
|
|
|
- },
|
|
|
/** ----------------------------------事件弹窗结束------------------------------------- */
|
|
|
+ /** ----------------------------------海康摄像头预览开始------------------------------------- */
|
|
|
+ // 创建播放实例
|
|
|
+ initPlugin(newappkey, newloginIp, newsecret, newloginPort) {
|
|
|
+ let that = this
|
|
|
+ that.oWebControl = new WebControl({
|
|
|
+ szPluginContainer: 'playWnd', // 指定容器id
|
|
|
+ iServicePortStart: 15900, // 指定起止端口号,建议使用该值
|
|
|
+ iServicePortEnd: 15909,
|
|
|
+ szClassId: '23BF3B0A-2C56-4D97-9C03-0CB103AA8F11', // 用于IE10使用ActiveX的clsid
|
|
|
+ cbConnectSuccess: function() { // 创建WebControl实例成功
|
|
|
+ that.oWebControl.JS_StartService('window', { // WebControl实例创建成功后需要启动服务
|
|
|
+ dllPath: './VideoPluginConnect.dll' // 值"./VideoPluginConnect.dll"写死
|
|
|
+ }).then(function() { // 启动插件服务成功
|
|
|
+ that.oWebControl.JS_SetWindowControlCallback({ // 设置消息回调
|
|
|
+ cbIntegrationCallBack: cbIntegrationCallBack
|
|
|
+ })
|
|
|
+
|
|
|
+ that.oWebControl.JS_CreateWnd('playWnd', 1020, 600).then(function() { //JS_CreateWnd创建视频播放窗口,宽高可设定
|
|
|
+ that.init(newappkey, newloginIp, newsecret, newloginPort) // 创建播放实例成功后初始化
|
|
|
+ })
|
|
|
+ }, function() { // 启动插件服务失败
|
|
|
+ })
|
|
|
+ },
|
|
|
+ cbConnectError: function() { // 创建WebControl实例失败
|
|
|
+ that.oWebControl = null
|
|
|
+ $('#playWnd').html('插件未启动,正在尝试启动,请稍候...<a href="./hk/VideoWebPlugin.exe">点击下载插件</a>')
|
|
|
+ WebControl.JS_WakeUp('VideoWebPlugin://') // 程序未启动时执行error函数,采用wakeup来启动程序
|
|
|
+ that.initCount++
|
|
|
+ if (that.initCount < 3) {
|
|
|
+ setTimeout(function() {
|
|
|
+ that.initPlugin(newappkey, newloginIp, newsecret, newloginPort)
|
|
|
+ }, 3000)
|
|
|
+ } else {
|
|
|
+ $('#playWnd').html('插件启动失败,请检查插件是否安装!<a href="./hk/VideoWebPlugin.exe">点击下载插件</a>')
|
|
|
+ }
|
|
|
+ },
|
|
|
+ cbConnectClose: function(bNormalClose) {
|
|
|
+ // 异常断开:bNormalClose = false
|
|
|
+ // JS_Disconnect正常断开:bNormalClose = true
|
|
|
+ that.oWebControl = null
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ //播放海康摄像头
|
|
|
+ playhk(channelCode) {
|
|
|
+ var cameraIndexCode = channelCode //获取输入的监控点编号值,必填
|
|
|
+ var streamMode = 0 //主子码流标识:0-主码流,1-子码流
|
|
|
+ var transMode = 1 //传输协议:0-UDP,1-TCP
|
|
|
+ var gpuMode = 0 //是否启用GPU硬解,0-不启用,1-启用
|
|
|
+ var wndId = -1 //播放窗口序号(在2x2以上布局下可指定播放窗口)
|
|
|
+
|
|
|
+ cameraIndexCode = cameraIndexCode.replace(/(^\s*)/g, '')
|
|
|
+ cameraIndexCode = cameraIndexCode.replace(/(\s*$)/g, '')
|
|
|
+
|
|
|
+ this.oWebControl.JS_RequestInterface({
|
|
|
+ funcName: 'startPreview',
|
|
|
+ argument: JSON.stringify({
|
|
|
+ cameraIndexCode: cameraIndexCode, //监控点编号
|
|
|
+ streamMode: streamMode, //主子码流标识
|
|
|
+ transMode: transMode, //传输协议
|
|
|
+ gpuMode: gpuMode, //是否开启GPU硬解
|
|
|
+ wndId: wndId //可指定播放窗口
|
|
|
+ })
|
|
|
+ })
|
|
|
+ },
|
|
|
+ //初始化
|
|
|
+ init(newappkey, newloginIp, newsecret, newloginPort) {
|
|
|
+ let that = this
|
|
|
+ that.getPubKey(function() {
|
|
|
+ ////////////////////////////////// 请自行修改以下变量值 ////////////////////////////////////
|
|
|
+ var appkey = newappkey //综合安防管理平台提供的appkey,必填
|
|
|
+ var secret = that.setEncrypt(newsecret) //综合安防管理平台提供的secret,必填
|
|
|
+ var ip = newloginIp //综合安防管理平台IP地址,必填
|
|
|
+ var playMode = 0 //初始播放模式:0-预览,1-回放
|
|
|
+ var port = Number(newloginPort) //综合安防管理平台端口,若启用HTTPS协议,默认443
|
|
|
+ var snapDir = 'D:\\SnapDir' //抓图存储路径
|
|
|
+ var videoDir = 'D:\\VideoDir' //紧急录像或录像剪辑存储路径
|
|
|
+ var layout = '1x1' //playMode指定模式的布局
|
|
|
+ var enableHTTPS = 1 //是否启用HTTPS协议与综合安防管理平台交互,这里总是填1
|
|
|
+ var encryptedFields = 'secret' //加密字段,默认加密领域为secret
|
|
|
+ var showToolbar = 1 //是否显示工具栏,0-不显示,非0-显示
|
|
|
+ var showSmart = 1 //是否显示智能信息(如配置移动侦测后画面上的线框),0-不显示,非0-显示
|
|
|
+ var buttonIDs = '0,16,256,257,258,259,260,512,513,514,515,516,517,768,769' //自定义工具条按钮
|
|
|
+ ////////////////////////////////// 请自行修改以上变量值 ////////////////////////////////////
|
|
|
+
|
|
|
+ that.oWebControl.JS_RequestInterface({
|
|
|
+ funcName: 'init',
|
|
|
+ argument: JSON.stringify({
|
|
|
+ appkey: appkey, //API网关提供的appkey
|
|
|
+ secret: secret, //API网关提供的secret
|
|
|
+ ip: ip, //API网关IP地址
|
|
|
+ playMode: playMode, //播放模式(决定显示预览还是回放界面)
|
|
|
+ port: port, //端口
|
|
|
+ snapDir: snapDir, //抓图存储路径
|
|
|
+ videoDir: videoDir, //紧急录像或录像剪辑存储路径
|
|
|
+ layout: layout, //布局
|
|
|
+ enableHTTPS: enableHTTPS, //是否启用HTTPS协议
|
|
|
+ encryptedFields: encryptedFields, //加密字段
|
|
|
+ showToolbar: showToolbar, //是否显示工具栏
|
|
|
+ showSmart: showSmart, //是否显示智能信息
|
|
|
+ buttonIDs: buttonIDs //自定义工具条按钮
|
|
|
+ })
|
|
|
+ }).then(function(oData) {
|
|
|
+ that.oWebControl.JS_Resize(1020, 600) // 初始化后resize一次,规避firefox下首次显示窗口后插件窗口未与DIV窗口重合问题
|
|
|
+ })
|
|
|
+ })
|
|
|
+ },
|
|
|
+ //获取公钥
|
|
|
+ getPubKey(callback) {
|
|
|
+ let that = this
|
|
|
+ that.oWebControl.JS_RequestInterface({
|
|
|
+ funcName: 'getRSAPubKey',
|
|
|
+ argument: JSON.stringify({
|
|
|
+ keyLength: 1024
|
|
|
+ })
|
|
|
+ }).then(function(oData) {
|
|
|
+ console.log(oData)
|
|
|
+ if (oData.responseMsg.data) {
|
|
|
+ that.pubKey = oData.responseMsg.data
|
|
|
+ callback()
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+//RSA加密
|
|
|
+ setEncrypt(value) {
|
|
|
+ var encrypt = new JSEncrypt()
|
|
|
+ encrypt.setPublicKey(this.pubKey)
|
|
|
+ return encrypt.encrypt(value)
|
|
|
+ }
|
|
|
+ /** ----------------------------------海康摄像头预览结束------------------------------------- */
|
|
|
}
|
|
|
}
|
|
|
</script>
|