eventLocation.vue 42 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043
  1. <template>
  2. <div>
  3. <el-dialog title="事件定位" :visible.sync="eventLocationVisible" v-if="eventLocationVisible" width="80%"
  4. @close="cancelEventLocationShow()">
  5. <div class="event-info">
  6. <div class="event-info-con">
  7. <div class="e-location-left">
  8. <el-tabs v-model="activeName" @tab-click="handleClick">
  9. <el-tab-pane label="周边点位" name="monitor">
  10. <div class="forthis">
  11. <div class="i-list-con overflow-y" style="height: 50vh;">
  12. <span v-for="(item,index) in cameraList"
  13. v-on:click="dropLocation(item.latitude,item.longitude)">
  14. <div class="d-l-con" @click="">
  15. <div class="d-l-l-text">
  16. <i class="iconfont sj-icon-jkzx icon-sxt"></i>
  17. <h4>{{ item.cameraName }}</h4>
  18. </div>
  19. </div>
  20. </span>
  21. </div>
  22. </div>
  23. </el-tab-pane>
  24. <el-tab-pane label="周边事件" name="event">
  25. <div class="forthis">
  26. <div class="i-list-con overflow-y" style="height: 50vh;">
  27. <div class="d-l-con padding-box nowrap" v-for="(item,index) in eventList"
  28. @click="dropLocation(item.latitude,item.longitude)">
  29. <div class="bgt-img">
  30. <img v-if="item.picturePath!=null&&item.picturePath!=''" :src="item.picturePath"
  31. style="width: 93px;height: 64px"/>
  32. <img v-else src="../assets/images/integrated/event-img-sub.png"
  33. style="width: 93px;height: 64px"/>
  34. </div>
  35. <div class="bgt-info">
  36. <div v-if="item.eventStatusValue=='forest_event_status_1'&&item.urgeCount==0"
  37. class="event-state-sb">
  38. <i class="el-icon-caret-left"></i>
  39. <div class="event-list-state-sb">
  40. 新上报
  41. </div>
  42. </div>
  43. <div v-if="item.eventStatusValue=='forest_event_status_1'&&item.urgeCount>0"
  44. class="event-state-cb">
  45. <i class="el-icon-caret-left"></i>
  46. <div class="event-list-state-cb">
  47. 催办
  48. </div>
  49. </div>
  50. <div v-if="item.eventStatusValue=='forest_event_status_2'" class="event-state-qs">
  51. <i class="el-icon-caret-left"></i>
  52. <div class="event-list-state-qs">
  53. 签收
  54. </div>
  55. </div>
  56. <div v-if="item.eventStatusValue=='forest_event_status_3'" class="event-state-wb">
  57. <i class="el-icon-caret-left"></i>
  58. <div class="event-list-state-wb">
  59. 误报
  60. </div>
  61. </div>
  62. <div v-if="item.eventStatusValue=='forest_event_status_4'" class="event-state-cf">
  63. <i class="el-icon-caret-left"></i>
  64. <div class="event-list-state-cf">
  65. 重复
  66. </div>
  67. </div>
  68. <div v-if="item.eventStatusValue=='forest_event_status_5'" class="event-state-bj">
  69. <i class="el-icon-caret-left"></i>
  70. <div class="event-list-state-bj">
  71. 办结
  72. </div>
  73. </div>
  74. <div v-if="item.eventStatusValue=='forest_event_status_6'" class="event-state-gd">
  75. <i class="el-icon-caret-left"></i>
  76. <div class="event-list-state-gd">
  77. 归档
  78. </div>
  79. </div>
  80. <div v-if="item.eventStatusValue=='forest_event_status_7'" class="event-state-qr">
  81. <i class="el-icon-caret-left"></i>
  82. <div class="event-list-state-qr">
  83. 确认
  84. </div>
  85. </div>
  86. <div class="bgt-info-name">{{ item.reportor }} {{ item.eventName }}</div>
  87. <div class="bgt-info-place">
  88. <ul>
  89. <li>{{ item.createTime }}</li>
  90. </ul>
  91. </div>
  92. </div>
  93. </div>
  94. </div>
  95. </div>
  96. </el-tab-pane>
  97. </el-tabs>
  98. </div>
  99. <div class="e-location-right" style="height: 57.8vh;">
  100. <div class="event-info-top">
  101. <el-form>
  102. <div class="event-info-top-grp">
  103. <el-input placeholder="输入经度" type="number" v-model="longitude" class="m-l-none">
  104. </el-input>
  105. <el-input placeholder="输入纬度" type="number" v-model="latitude">
  106. </el-input>
  107. <el-button type="success" size="mini" @click="getNearEvent()">定位</el-button>
  108. </div>
  109. </el-form>
  110. </div>
  111. <!-- 地图 -->
  112. <eventLocationSupermap ref="eventLocationSupermap" style="width: 100%;height: 51vh;"
  113. :mapDiv="'eventLocationMap'" :mapSite="{doubleClickZoom:false,zoom:8}"
  114. :codes="['9fa5']"
  115. :isSideBySide="false" @preview="preview"
  116. @showEventDialog="showEventDialog"></eventLocationSupermap>
  117. <!-- :showLatLng="showLatLng"-->
  118. </div>
  119. </div>
  120. </div>
  121. </el-dialog>
  122. <TVWall ref="TVWall"></TVWall>
  123. <!--事件弹层-->
  124. <div class="event-info">
  125. <eventdetailsdialog ref="eventdetailsdialog" :calendarDay="this.getCurrentDataStr"></eventdetailsdialog>
  126. </div>
  127. <el-dialog :title="cameraTitle" :visible.sync="cameraVisible" v-if="cameraVisible" customClass="videoCustomWidth"
  128. @close="cancelEventLocationShow()">
  129. <div style="width:1020px;height:625px;position:relative;">
  130. <!--视频窗口展示---海康-->
  131. <div id="playWnd" class="playWnd" style="left: 0px; top: 0px;"></div>
  132. </div>
  133. </el-dialog>
  134. </div>
  135. </template>
  136. <script>
  137. import {
  138. getNearEvent1,
  139. getNearCamera
  140. } from '@/api/event'
  141. import {
  142. getHaiKangVideoServer
  143. } from '@/api/haikang/haikang'
  144. import eventLocationSupermap from '@/components/supermap' //超图
  145. import eventdetailsdialog from '@/views/eventdetailsdialog.vue' //事件详情弹窗
  146. /** ----------------------------------摄像头预览开始------------------------------------- */
  147. import {
  148. getDahuaVideoServer, getTVWallList
  149. } from '@/api/dahua/dahua'
  150. import DHWs from '@/dahua/lib/DHWs'
  151. import TVWall from "@/components/TVWall.vue";
  152. /** ----------------------------------摄像头预览结束------------------------------------- */
  153. export default {
  154. dicts: ['event_source'],
  155. components: {
  156. eventLocationSupermap,
  157. eventdetailsdialog,
  158. TVWall
  159. },
  160. data() {
  161. return {
  162. /** ----------------------------------摄像头预览开始------------------------------------- */
  163. activePanel: 'key1',
  164. isLogin: false,
  165. cameraParams: [],
  166. ws: null,
  167. /** ----------------------------------摄像头预览结束------------------------------------- */
  168. //海康
  169. cameraTitle: '',
  170. cameraVisible: false,
  171. initCount: 0,
  172. pubKey: '',
  173. oWebControl: null,
  174. /** ----------------------------------事件弹窗开始------------------------------------- */
  175. eventInfoVisibleActiveName: 'info',
  176. eventInfoVisible_notProcessed: false,
  177. eventInfoVisible_Processed: false,
  178. listEventPic: [], //事件图片
  179. url: '',
  180. id: '',
  181. eventType: '',
  182. deptName: '',
  183. eventStatus: '',
  184. cameraId: '',
  185. createTime: '',
  186. reportAddress: '',
  187. eventCode: null,
  188. eventSource: '',
  189. //事件详情弹出显隐
  190. eventTypeShow: false,
  191. listEventDept: [], //涉事单位List,
  192. listLog: [], //处理过程List,
  193. listoperateDept: [],
  194. optionsNotProcessed: [{
  195. value: 'wyc',
  196. label: '无异常'
  197. }, {
  198. value: 'qr',
  199. label: '确认'
  200. }],
  201. listeventType: [],
  202. updateEventStatusForm: {
  203. id: '',
  204. eventStatus: '',
  205. eventCode: '',
  206. deptId: '',
  207. deptName: '',
  208. eventType: '',
  209. zt: ''
  210. },
  211. /** ----------------------------------事件弹窗结束-未处理------------------------------------- */
  212. aniu: true,
  213. showZt: true,
  214. zt: null,
  215. fireReport: false,
  216. optionsProcessed: [{
  217. value: 'bj',
  218. label: '办结'
  219. }, {
  220. value: 'zy',
  221. label: '支援'
  222. },
  223. {
  224. value: 'gd',
  225. label: '归档'
  226. }
  227. ],
  228. // 弹出层 基本信息
  229. information: [{
  230. name: '标题',
  231. id: '',
  232. content: '前段发现警情信息'
  233. },
  234. {
  235. name: '时间',
  236. id: '',
  237. content: '2022-02-14 14:30'
  238. },
  239. {
  240. name: '来源',
  241. id: '',
  242. content: '摄像头'
  243. },
  244. {
  245. name: '坐标',
  246. id: '',
  247. content: '125.78945646'
  248. },
  249. {
  250. name: '纬度',
  251. id: '',
  252. content: '43.987424'
  253. },
  254. {
  255. name: '上报人',
  256. id: '',
  257. content: '党校监控点位'
  258. },
  259. {
  260. name: '详细信息',
  261. id: '',
  262. content: '这里发现病虫害,需要立刻支援'
  263. }
  264. ],
  265. eventLocationVisible: false,
  266. longitude: '',
  267. latitude: '',
  268. activeName: 'event',
  269. eventList: [],
  270. markersList: [],
  271. cameraList: [],
  272. cameraMarkersList: []
  273. }
  274. },
  275. created() {
  276. /** ----------------------------------摄像头预览开始------------------------------------- */
  277. const DHWsInstance = DHWs.getInstance()
  278. this.ws = DHWsInstance
  279. /** ----------------------------------摄像头预览结束------------------------------------- */
  280. },
  281. methods: {
  282. showLatLng(lat, lng) {
  283. this.longitude=lng
  284. this.latitude=lat
  285. },
  286. getCurrentDataStr(){
  287. let date = new Date()
  288. let y = date.getFullYear()
  289. let m = date.getMonth() + 1
  290. m = m < 10 ? '0' + m : m
  291. let d = date.getDate()
  292. d = d < 10 ? '0' + d : d
  293. return y + '-' + m + '-' + d
  294. },
  295. cancelEventLocationShow() {
  296. this.longitude=""
  297. this.latitude=""
  298. if (this.oWebControl != null) {
  299. this.oWebControl.JS_HideWnd() // 先让窗口隐藏,规避可能的插件窗口滞后于浏览器消失问题
  300. this.oWebControl.JS_Disconnect().then(function() { // 断开与插件服务连接成功
  301. },
  302. function() { // 断开与插件服务连接失败
  303. })
  304. }
  305. },
  306. showEventDialog(eventCode) {
  307. //事件信息弹出
  308. this.$refs.eventdetailsdialog.showEventDialog(eventCode)
  309. },
  310. getNearEvent() {
  311. if (this.longitude == null || this.longitude == '' || this.latitude == null || this.latitude == '') {
  312. this.$modal.msgError('请输入经纬度!')
  313. return
  314. } else if (this.longitude >180 || this.longitude < -180 || this.latitude > 90 || this.latitude < -90) {
  315. this.$modal.msgError('请输入正确经纬度!')
  316. return
  317. }
  318. this.activeName = 'event'
  319. this.$refs.eventLocationSupermap.dropLocation(this.latitude,this.longitude,10)
  320. let marker = [{
  321. lng: this.longitude,
  322. lat: this.latitude,
  323. icon: 'marker',
  324. bindPopupHtml: '搜索点位',
  325. click: '',
  326. parameter: '',
  327. keepBindPopup: false,
  328. isAggregation: false
  329. }]
  330. let that = this
  331. getNearEvent1(that.longitude, that.latitude).then(res => {
  332. that.markersList = []
  333. that.eventList = res.data
  334. if (that.eventList != null && that.eventList.length > 0) {
  335. for (let i = 0; i < that.eventList.length; i++) {
  336. let markersMap = {
  337. lng: 124.59,
  338. lat: 43.02,
  339. icon: 'marker',
  340. bindPopupHtml: '',
  341. click: '',
  342. parameter: '',
  343. keepBindPopup: false,
  344. isAggregation: false
  345. }
  346. if (that.eventList.length > 200) {
  347. markersMap.isAggregation = true
  348. }
  349. if (that.eventList[i].eventStatusValue == 'forest_event_status_1') {
  350. markersMap.click = 'showEventDialog'
  351. markersMap.icon = 'sj-icon-map-xinshangbao'
  352. }
  353. if (that.eventList[i].eventStatusValue == 'forest_event_status_1' && that.eventList[i].urgeCount > 0) {
  354. markersMap.click = 'showEventDialog'
  355. markersMap.icon = 'sj-icon-map-cuiban'
  356. } else if (that.eventList[i].eventStatusValue == 'forest_event_status_2') {
  357. markersMap.click = 'showEventDialog'
  358. markersMap.icon = 'sj-icon-map-qianshou'
  359. markersMap.isAggregation = false
  360. } else if (that.eventList[i].eventStatusValue == 'forest_event_status_5') {
  361. markersMap.click = 'showEventDialog'
  362. markersMap.icon = 'sj-icon-map-banjie'
  363. markersMap.isAggregation = false
  364. } else if (that.eventList[i].eventStatusValue == 'forest_event_status_6') {
  365. markersMap.click = 'showEventDialog'
  366. markersMap.icon = 'sj-icon-map-guidang'
  367. } else if (that.eventList[i].eventStatusValue == 'forest_event_status_7') {
  368. markersMap.click = 'showEventDialog'
  369. markersMap.icon = 'sj-icon-map-queren'
  370. }
  371. markersMap.parameter = that.eventList[i].eventCode
  372. markersMap.lng = that.eventList[i].longitude
  373. markersMap.lat = that.eventList[i].latitude
  374. markersMap.bindPopupHtml = '<div class="map-tip">' +
  375. '<span>' +
  376. ' <div class="d-l-con">' +
  377. ' <div class="d-l-l-text">' +
  378. ' <h4>经纬度:' + that.eventList[i].longitude + ',' + that.eventList[i].latitude + '</h4>' +
  379. ' </div>' +
  380. ' </div>' +
  381. ' </span>' +
  382. '<span>' +
  383. ' <div class="d-l-con">' +
  384. ' <div class="d-l-l-text">' +
  385. ' <h4>事件名称:' + that.eventList[i].eventName + '</h4>' +
  386. ' </div>' +
  387. ' </div>' +
  388. ' </span>' +
  389. '<span>' +
  390. ' <div class="d-l-con">' +
  391. ' <div class="d-l-l-text">' +
  392. ' <h4>事件时间:' + that.eventList[i].createTime + '</h4>' +
  393. ' </div>' +
  394. ' </div>' +
  395. ' </span>'
  396. if(that.eventList[i].pictureType=='image'&&that.eventList[i].picturePath != null && that.eventList[i].picturePath != ''){
  397. markersMap.bindPopupHtml += '<span>' +
  398. ' <div class="d-l-con">' +
  399. ' <div class="d-l-l-text">' +
  400. '<img src="' + that.eventList[i].picturePath + '" style="width: 150px;height: 100px"/>' +
  401. ' </div>' +
  402. ' </div>' +
  403. ' </span>'
  404. }
  405. markersMap.bindPopupHtml += '</div>'
  406. that.markersList.push(markersMap)
  407. }
  408. that.$refs.eventLocationSupermap.clearM(false)
  409. that.$refs.eventLocationSupermap.clearM(true)
  410. that.$refs.eventLocationSupermap.clearP()
  411. that.$refs.eventLocationSupermap.setMarkers(that.markersList)
  412. that.$refs.eventLocationSupermap.setMarkers(marker)
  413. } else {
  414. that.$refs.eventLocationSupermap.clearM(false)
  415. that.$refs.eventLocationSupermap.clearM(true)
  416. that.$refs.eventLocationSupermap.clearP()
  417. that.$refs.eventLocationSupermap.setMarkers(marker)
  418. }
  419. })
  420. },
  421. handleClick(tab, event) {
  422. let that = this
  423. that.$refs.eventLocationSupermap.controlLevel(8)
  424. let marker = [{
  425. lng: that.longitude,
  426. lat: that.latitude,
  427. icon: 'marker',
  428. bindPopupHtml: '定位',
  429. click: '',
  430. parameter: '',
  431. keepBindPopup: false,
  432. isAggregation: false
  433. }]
  434. if (tab.name == 'monitor') {
  435. if (that.longitude == null || that.longitude == '' || that.latitude == null || that.latitude == '') {
  436. that.$modal.msgError('请输入经纬度!')
  437. return
  438. } else if (this.longitude >180 || this.longitude < -180 || this.latitude > 90 || this.latitude < -90) {
  439. this.$modal.msgError('请输入正确经纬度!')
  440. return
  441. }
  442. that.cameraMarkersList = []
  443. that.cameraList = []
  444. getNearCamera(that.longitude, that.latitude).then(res => {
  445. //根据设备类型查看列表
  446. that.cameraList = res.data
  447. if (res.data != null && res.data.length > 0) {
  448. for (let i = 0; i < res.data.length; i++) {
  449. let markersMap = {
  450. lng: 124.59,
  451. lat: 43.02,
  452. icon: "camera",
  453. bindPopupHtml: "",
  454. click: "preview",
  455. parameter: "",
  456. name: i,
  457. keepBindPopup: false,
  458. isAggregation: false,
  459. };
  460. if (res.data[i].channelCode != null) {
  461. markersMap.parameter = {
  462. code: res.data[i].cameraCode,
  463. name: res.data[i].cameraName,
  464. type: res.data[i].cameraFactory,
  465. };
  466. } else {
  467. markersMap.parameter = [];
  468. }
  469. if (res.data.length > 50) {
  470. markersMap.isAggregation = true
  471. }
  472. markersMap.lng = res.data[i].longitude
  473. markersMap.lat = res.data[i].latitude
  474. markersMap.radius = res.data[i].cameraRadius
  475. markersMap.bindPopupHtml = '<div class="map-tip">' +
  476. '<span>' +
  477. ' <div class="d-l-con">' +
  478. ' <div class="d-l-l-text">' +
  479. ' <h4>经纬度:' + res.data[i].longitude +
  480. ',' + res.data[i].latitude + '</h4>' +
  481. ' </div>' +
  482. ' </div>' +
  483. ' </span>' +
  484. '<span>' +
  485. ' <div class="d-l-con">' +
  486. ' <div class="d-l-l-text">' +
  487. ' <h4>摄像头名称:' + res.data[i]
  488. .cameraName + '</h4>' +
  489. ' </div>' +
  490. ' </div>' +
  491. ' </span>' +
  492. '<span>' +
  493. ' <div class="d-l-con">' +
  494. ' <div class="d-l-l-text">' +
  495. ' <h4>网络运营商:' + (res.data[i].operatorType == "1" ? "联通" : (res.data[i].operatorType == "2" ? "移动":"电信")) + '</h4>' +
  496. ' </div>' +
  497. ' </div>' +
  498. ' </span>' +
  499. '<span>' +
  500. ' <div class="d-l-con">' +
  501. ' <div class="d-l-l-text">' +
  502. ' <h4>摄像头半径:' + res.data[i]
  503. .cameraRadius + '米</h4>' +
  504. ' </div>' +
  505. ' </div>' +
  506. ' </span>' +
  507. '</div>'
  508. that.cameraMarkersList.push(markersMap)
  509. }
  510. setTimeout(() => {
  511. that.$refs.eventLocationSupermap.clearM(true)
  512. that.$refs.eventLocationSupermap.clearM(false)
  513. that.$refs.eventLocationSupermap.setMarkersRadius(that.cameraMarkersList)
  514. that.$refs.eventLocationSupermap.setMarkers(marker)
  515. }, 1000)
  516. } else {
  517. setTimeout(() => {
  518. that.$refs.eventLocationSupermap.clearM(true)
  519. that.$refs.eventLocationSupermap.clearM(false)
  520. that.$refs.eventLocationSupermap.setMarkers(marker)
  521. }, 1000)
  522. }
  523. })
  524. } else {
  525. that.getNearEvent()
  526. }
  527. },
  528. dropLocation(lat, lng) {
  529. this.$refs.eventLocationSupermap.dropLocation(lat, lng)
  530. },
  531. showEventLocation() {
  532. this.eventLocationVisible = true
  533. },
  534. showTVWall(channelCode, channelName) {
  535. let tvListJson = [
  536. {
  537. switchTab: "2",
  538. treeLabels: [
  539. {
  540. id: null,
  541. labelCode: "999",
  542. labelName: "电视墙",
  543. cameraType: null,
  544. parentLabelCode: "",
  545. },
  546. {
  547. id: "spcamera00010",
  548. labelCode: channelCode,
  549. labelName: channelName,
  550. cameraType: "1",
  551. parentLabelCode: "999",
  552. },
  553. ],
  554. labelChannels: [
  555. {
  556. labelCode: channelCode,
  557. channelDates: [
  558. {
  559. channelCode: channelCode,
  560. channelName: channelName,
  561. channelSn: null,
  562. cameraType: "1",
  563. online: "1",
  564. cameraCode: "1",
  565. },
  566. ],
  567. },
  568. ],
  569. },
  570. ];
  571. this.$refs.TVWall.showTVWall(tvListJson, [
  572. {
  573. channelId: channelCode,
  574. },
  575. ]);
  576. },
  577. /** ----------------------------------摄像头预览开始------------------------------------- */
  578. alertLogin: function() {
  579. this.$modal.msg('登录中....')
  580. },
  581. alertLoginSuccess: function() {
  582. this.$modal.msgSuccess('登录成功!')
  583. },
  584. alertLoginFailed: function() {
  585. this.$modal.msgError('登陆失败!')
  586. },
  587. alertReinstall: function() {
  588. this.$modal.msgWarning('请重新安装客户端')
  589. },
  590. /** 预览按钮操作 */
  591. preview(cameraParam) {
  592. this.showTVWall(cameraParam.code, cameraParam.name);
  593. },
  594. realTimeVideoDialog(cameraParams) { // 调用弹窗实时播放接口
  595. if (!this.isLogin) {
  596. this.$Message.info('正在登陆客户端,请稍等......')
  597. return false
  598. }
  599. const params = [cameraParams]
  600. this.ws.openVideo(params)
  601. },
  602. /** ----------------------------------摄像头预览结束------------------------------------- */
  603. /** ----------------------------------海康摄像头预览开始------------------------------------- */
  604. // 创建播放实例
  605. initPlugin(newappkey, newloginIp, newsecret, newloginPort) {
  606. let that = this
  607. that.oWebControl = new WebControl({
  608. szPluginContainer: 'playWnd', // 指定容器id
  609. iServicePortStart: 15900, // 指定起止端口号,建议使用该值
  610. iServicePortEnd: 15909,
  611. szClassId: '23BF3B0A-2C56-4D97-9C03-0CB103AA8F11', // 用于IE10使用ActiveX的clsid
  612. cbConnectSuccess: function() { // 创建WebControl实例成功
  613. that.oWebControl.JS_StartService('window', { // WebControl实例创建成功后需要启动服务
  614. dllPath: './VideoPluginConnect.dll' // 值"./VideoPluginConnect.dll"写死
  615. }).then(function() { // 启动插件服务成功
  616. that.oWebControl.JS_SetWindowControlCallback({ // 设置消息回调
  617. cbIntegrationCallBack: cbIntegrationCallBack
  618. })
  619. that.oWebControl.JS_CreateWnd('playWnd', 1020, 600).then(function() { //JS_CreateWnd创建视频播放窗口,宽高可设定
  620. that.init(newappkey, newloginIp, newsecret, newloginPort) // 创建播放实例成功后初始化
  621. })
  622. }, function() { // 启动插件服务失败
  623. })
  624. },
  625. cbConnectError: function() { // 创建WebControl实例失败
  626. that.oWebControl = null
  627. $('#playWnd').html('插件未启动,正在尝试启动,请稍候...<a href="./hk/VideoWebPlugin.exe">点击下载插件</a>')
  628. WebControl.JS_WakeUp('VideoWebPlugin://') // 程序未启动时执行error函数,采用wakeup来启动程序
  629. initCount++
  630. if (initCount < 3) {
  631. setTimeout(function() {
  632. that.initPlugin(newappkey, newloginIp, newsecret, newloginPort)
  633. }, 3000)
  634. } else {
  635. $('#playWnd').html('插件启动失败,请检查插件是否安装!<a href="./hk/VideoWebPlugin.exe">点击下载插件</a>')
  636. }
  637. },
  638. cbConnectClose: function(bNormalClose) {
  639. // 异常断开:bNormalClose = false
  640. // JS_Disconnect正常断开:bNormalClose = true
  641. console.log('cbConnectClose')
  642. that.oWebControl = null
  643. }
  644. })
  645. },
  646. //播放海康摄像头
  647. playhk(channelCode) {
  648. var cameraIndexCode = channelCode //获取输入的监控点编号值,必填
  649. var streamMode = 0 //主子码流标识:0-主码流,1-子码流
  650. var transMode = 1 //传输协议:0-UDP,1-TCP
  651. var gpuMode = 0 //是否启用GPU硬解,0-不启用,1-启用
  652. var wndId = -1 //播放窗口序号(在2x2以上布局下可指定播放窗口)
  653. cameraIndexCode = cameraIndexCode.replace(/(^\s*)/g, '')
  654. cameraIndexCode = cameraIndexCode.replace(/(\s*$)/g, '')
  655. this.oWebControl.JS_RequestInterface({
  656. funcName: 'startPreview',
  657. argument: JSON.stringify({
  658. cameraIndexCode: cameraIndexCode, //监控点编号
  659. streamMode: streamMode, //主子码流标识
  660. transMode: transMode, //传输协议
  661. gpuMode: gpuMode, //是否开启GPU硬解
  662. wndId: wndId //可指定播放窗口
  663. })
  664. })
  665. },
  666. //初始化
  667. init(newappkey, newloginIp, newsecret, newloginPort) {
  668. let that = this
  669. that.getPubKey(function() {
  670. ////////////////////////////////// 请自行修改以下变量值 ////////////////////////////////////
  671. var appkey = newappkey //综合安防管理平台提供的appkey,必填
  672. var secret = that.setEncrypt(newsecret) //综合安防管理平台提供的secret,必填
  673. var ip = newloginIp //综合安防管理平台IP地址,必填
  674. var playMode = 0 //初始播放模式:0-预览,1-回放
  675. var port = Number(newloginPort) //综合安防管理平台端口,若启用HTTPS协议,默认443
  676. var snapDir = 'D:\\SnapDir' //抓图存储路径
  677. var videoDir = 'D:\\VideoDir' //紧急录像或录像剪辑存储路径
  678. var layout = '1x1' //playMode指定模式的布局
  679. var enableHTTPS = 1 //是否启用HTTPS协议与综合安防管理平台交互,这里总是填1
  680. var encryptedFields = 'secret' //加密字段,默认加密领域为secret
  681. var showToolbar = 1 //是否显示工具栏,0-不显示,非0-显示
  682. var showSmart = 1 //是否显示智能信息(如配置移动侦测后画面上的线框),0-不显示,非0-显示
  683. var buttonIDs = '0,16,256,257,258,259,260,512,513,514,515,516,517,768,769' //自定义工具条按钮
  684. ////////////////////////////////// 请自行修改以上变量值 ////////////////////////////////////
  685. that.oWebControl.JS_RequestInterface({
  686. funcName: 'init',
  687. argument: JSON.stringify({
  688. appkey: appkey, //API网关提供的appkey
  689. secret: secret, //API网关提供的secret
  690. ip: ip, //API网关IP地址
  691. playMode: playMode, //播放模式(决定显示预览还是回放界面)
  692. port: port, //端口
  693. snapDir: snapDir, //抓图存储路径
  694. videoDir: videoDir, //紧急录像或录像剪辑存储路径
  695. layout: layout, //布局
  696. enableHTTPS: enableHTTPS, //是否启用HTTPS协议
  697. encryptedFields: encryptedFields, //加密字段
  698. showToolbar: showToolbar, //是否显示工具栏
  699. showSmart: showSmart, //是否显示智能信息
  700. buttonIDs: buttonIDs //自定义工具条按钮
  701. })
  702. }).then(function(oData) {
  703. that.oWebControl.JS_Resize(1020, 600) // 初始化后resize一次,规避firefox下首次显示窗口后插件窗口未与DIV窗口重合问题
  704. })
  705. })
  706. },
  707. //获取公钥
  708. getPubKey(callback) {
  709. let that = this
  710. that.oWebControl.JS_RequestInterface({
  711. funcName: 'getRSAPubKey',
  712. argument: JSON.stringify({
  713. keyLength: 1024
  714. })
  715. }).then(function(oData) {
  716. console.log(oData)
  717. if (oData.responseMsg.data) {
  718. that.pubKey = oData.responseMsg.data
  719. callback()
  720. }
  721. })
  722. },
  723. //RSA加密
  724. setEncrypt(value) {
  725. var encrypt = new JSEncrypt()
  726. encrypt.setPublicKey(this.pubKey)
  727. return encrypt.encrypt(value)
  728. },
  729. /** ----------------------------------海康摄像头预览结束------------------------------------- */
  730. /** ----------------------------------事件弹窗开始------------------------------------- */
  731. editableLayers(processedState) {
  732. if (processedState == 'notProcessedSupermap') {
  733. let aa = this.$refs.notProcessedSupermap.isEditableLayers
  734. if (!this.$refs.notProcessedSupermap.isEditableLayers) {
  735. this.$refs.notProcessedSupermap.isEditableLayers = true
  736. } else {
  737. this.$refs.notProcessedSupermap.isEditableLayers = false
  738. }
  739. } else {
  740. let bb = this.$refs.processedSupermap.isEditableLayers
  741. if (!this.$refs.processedSupermap.isEditableLayers) {
  742. this.$refs.processedSupermap.isEditableLayers = true
  743. } else {
  744. this.$refs.processedSupermap.isEditableLayers = false
  745. }
  746. }
  747. },
  748. switchImage(url) {
  749. this.url = url
  750. },
  751. formLeaveTable() {
  752. let p = new Promise((resolve, reject) =>
  753. reject()
  754. )
  755. return p
  756. },
  757. async beforeLeave(newactiveName, oldActiveName) {
  758. let that = this
  759. if (newactiveName == 'frame') {
  760. return await that.formLeaveTable()
  761. }
  762. },
  763. setXsYc() {
  764. let that = this
  765. if (this.eventStatus == 'qr') {
  766. this.eventTypeShow = true
  767. } else {
  768. this.eventTypeShow = false
  769. }
  770. },
  771. setValue(event) {
  772. this.deptId = event.value
  773. this.deptName = event.label
  774. },
  775. cancelEventShow() {
  776. this.eventInfoVisibleActiveName = 'info'
  777. this.listEventPic = [] //事件图片
  778. this.listEventDept = [] //涉事单位List,
  779. this.listLog = [] //处理过程List,
  780. this.listoperateDept = []
  781. },
  782. /** 重置按钮操作 */
  783. resetQuery() {
  784. this.eventTypeShow = false
  785. this.eventType = ''
  786. this.deptName = ''
  787. this.eventStatus = ''
  788. },
  789. /** ----------------------------------事件弹窗结束------------------------------------- */
  790. /** ----------------------------------海康摄像头预览开始------------------------------------- */
  791. // 创建播放实例
  792. initPlugin(newappkey, newloginIp, newsecret, newloginPort) {
  793. let that = this
  794. that.oWebControl = new WebControl({
  795. szPluginContainer: 'playWnd', // 指定容器id
  796. iServicePortStart: 15900, // 指定起止端口号,建议使用该值
  797. iServicePortEnd: 15909,
  798. szClassId: '23BF3B0A-2C56-4D97-9C03-0CB103AA8F11', // 用于IE10使用ActiveX的clsid
  799. cbConnectSuccess: function() { // 创建WebControl实例成功
  800. that.oWebControl.JS_StartService('window', { // WebControl实例创建成功后需要启动服务
  801. dllPath: './VideoPluginConnect.dll' // 值"./VideoPluginConnect.dll"写死
  802. }).then(function() { // 启动插件服务成功
  803. that.oWebControl.JS_SetWindowControlCallback({ // 设置消息回调
  804. cbIntegrationCallBack: cbIntegrationCallBack
  805. })
  806. that.oWebControl.JS_CreateWnd('playWnd', 1020, 600).then(function() { //JS_CreateWnd创建视频播放窗口,宽高可设定
  807. that.init(newappkey, newloginIp, newsecret, newloginPort) // 创建播放实例成功后初始化
  808. })
  809. }, function() { // 启动插件服务失败
  810. })
  811. },
  812. cbConnectError: function() { // 创建WebControl实例失败
  813. that.oWebControl = null
  814. $('#playWnd').html('插件未启动,正在尝试启动,请稍候...<a href="./hk/VideoWebPlugin.exe">点击下载插件</a>')
  815. WebControl.JS_WakeUp('VideoWebPlugin://') // 程序未启动时执行error函数,采用wakeup来启动程序
  816. that.initCount++
  817. if (that.initCount < 3) {
  818. setTimeout(function() {
  819. that.initPlugin(newappkey, newloginIp, newsecret, newloginPort)
  820. }, 3000)
  821. } else {
  822. $('#playWnd').html('插件启动失败,请检查插件是否安装!<a href="./hk/VideoWebPlugin.exe">点击下载插件</a>')
  823. }
  824. },
  825. cbConnectClose: function(bNormalClose) {
  826. // 异常断开:bNormalClose = false
  827. // JS_Disconnect正常断开:bNormalClose = true
  828. that.oWebControl = null
  829. }
  830. })
  831. },
  832. //播放海康摄像头
  833. playhk(channelCode) {
  834. var cameraIndexCode = channelCode //获取输入的监控点编号值,必填
  835. var streamMode = 0 //主子码流标识:0-主码流,1-子码流
  836. var transMode = 1 //传输协议:0-UDP,1-TCP
  837. var gpuMode = 0 //是否启用GPU硬解,0-不启用,1-启用
  838. var wndId = -1 //播放窗口序号(在2x2以上布局下可指定播放窗口)
  839. cameraIndexCode = cameraIndexCode.replace(/(^\s*)/g, '')
  840. cameraIndexCode = cameraIndexCode.replace(/(\s*$)/g, '')
  841. this.oWebControl.JS_RequestInterface({
  842. funcName: 'startPreview',
  843. argument: JSON.stringify({
  844. cameraIndexCode: cameraIndexCode, //监控点编号
  845. streamMode: streamMode, //主子码流标识
  846. transMode: transMode, //传输协议
  847. gpuMode: gpuMode, //是否开启GPU硬解
  848. wndId: wndId //可指定播放窗口
  849. })
  850. })
  851. },
  852. //初始化
  853. init(newappkey, newloginIp, newsecret, newloginPort) {
  854. let that = this
  855. that.getPubKey(function() {
  856. ////////////////////////////////// 请自行修改以下变量值 ////////////////////////////////////
  857. var appkey = newappkey //综合安防管理平台提供的appkey,必填
  858. var secret = that.setEncrypt(newsecret) //综合安防管理平台提供的secret,必填
  859. var ip = newloginIp //综合安防管理平台IP地址,必填
  860. var playMode = 0 //初始播放模式:0-预览,1-回放
  861. var port = Number(newloginPort) //综合安防管理平台端口,若启用HTTPS协议,默认443
  862. var snapDir = 'D:\\SnapDir' //抓图存储路径
  863. var videoDir = 'D:\\VideoDir' //紧急录像或录像剪辑存储路径
  864. var layout = '1x1' //playMode指定模式的布局
  865. var enableHTTPS = 1 //是否启用HTTPS协议与综合安防管理平台交互,这里总是填1
  866. var encryptedFields = 'secret' //加密字段,默认加密领域为secret
  867. var showToolbar = 1 //是否显示工具栏,0-不显示,非0-显示
  868. var showSmart = 1 //是否显示智能信息(如配置移动侦测后画面上的线框),0-不显示,非0-显示
  869. var buttonIDs = '0,16,256,257,258,259,260,512,513,514,515,516,517,768,769' //自定义工具条按钮
  870. ////////////////////////////////// 请自行修改以上变量值 ////////////////////////////////////
  871. that.oWebControl.JS_RequestInterface({
  872. funcName: 'init',
  873. argument: JSON.stringify({
  874. appkey: appkey, //API网关提供的appkey
  875. secret: secret, //API网关提供的secret
  876. ip: ip, //API网关IP地址
  877. playMode: playMode, //播放模式(决定显示预览还是回放界面)
  878. port: port, //端口
  879. snapDir: snapDir, //抓图存储路径
  880. videoDir: videoDir, //紧急录像或录像剪辑存储路径
  881. layout: layout, //布局
  882. enableHTTPS: enableHTTPS, //是否启用HTTPS协议
  883. encryptedFields: encryptedFields, //加密字段
  884. showToolbar: showToolbar, //是否显示工具栏
  885. showSmart: showSmart, //是否显示智能信息
  886. buttonIDs: buttonIDs //自定义工具条按钮
  887. })
  888. }).then(function(oData) {
  889. that.oWebControl.JS_Resize(1020, 600) // 初始化后resize一次,规避firefox下首次显示窗口后插件窗口未与DIV窗口重合问题
  890. })
  891. })
  892. },
  893. //获取公钥
  894. getPubKey(callback) {
  895. let that = this
  896. that.oWebControl.JS_RequestInterface({
  897. funcName: 'getRSAPubKey',
  898. argument: JSON.stringify({
  899. keyLength: 1024
  900. })
  901. }).then(function(oData) {
  902. console.log(oData)
  903. if (oData.responseMsg.data) {
  904. that.pubKey = oData.responseMsg.data
  905. callback()
  906. }
  907. })
  908. },
  909. //RSA加密
  910. setEncrypt(value) {
  911. var encrypt = new JSEncrypt()
  912. encrypt.setPublicKey(this.pubKey)
  913. return encrypt.encrypt(value)
  914. }
  915. /** ----------------------------------海康摄像头预览结束------------------------------------- */
  916. }
  917. }
  918. // 推送消息
  919. function cbIntegrationCallBack(oData) {
  920. console.log(JSON.stringify(oData.responseMsg))
  921. }
  922. </script>
  923. <style rel="stylesheet/scss" lang="scss" scoped>
  924. @import '@/assets/styles/base.scss';
  925. .event-info-con {
  926. width: 100%;
  927. display: flex;
  928. .e-left {
  929. width: 32%;
  930. }
  931. .e-center {
  932. width: 30%;
  933. margin-left: 1%;
  934. .img-company {
  935. width: 100%;
  936. height: 18.3vh;
  937. img {
  938. }
  939. }
  940. }
  941. .e-right {
  942. margin-left: 1%;
  943. width: 45%;
  944. }
  945. .e-location-left {
  946. width: 28%;
  947. }
  948. .e-location-right {
  949. width: 71%;
  950. margin-left: 1rem;
  951. }
  952. }
  953. .el-dialog:not(.is-fullscreen) {
  954. margin-top: 5.5vh !important;
  955. }
  956. .bottom-menu-normal {
  957. max-width: 90%;
  958. padding: 0 3rem;
  959. position: absolute;
  960. left: 50%;
  961. transform: translateX(-50%);
  962. bottom: 0;
  963. z-index: 100000;
  964. border-radius: 5px;
  965. display: flex;
  966. justify-content: center;
  967. align-items: center;
  968. background: url(../assets/images/integrated/btm-menu.png) center no-repeat;
  969. background-size: cover;
  970. overflow: hidden;
  971. .btm-m-con {
  972. position: relative;
  973. color: $inBlue;
  974. font-size: .5rem;
  975. padding: 1rem 1.5rem;
  976. display: flex;
  977. align-items: center;
  978. justify-content: center;
  979. -webkit-transform: translateY(0);
  980. transform: translateY(0);
  981. transition: all 0.2s ease-in-out;
  982. cursor: pointer;
  983. white-space: nowrap;
  984. i {
  985. font-size: 1rem;
  986. color: $inBlue;
  987. text-shadow: 0 0 10px rgba($color: $inBlue, $alpha: .6);
  988. margin-right: 0.2rem;
  989. }
  990. }
  991. .btm-m-con:hover {
  992. text-shadow: 0 0 20px rgba($color: $inBlueHover, $alpha: 1.0);
  993. filter: brightness(2.3);
  994. -webkit-transform: translateX(0.2rem);
  995. transform: translateX(0.2rem);
  996. transition: all 0.2s ease-in-out;
  997. i {
  998. color: $inBlueHover;
  999. text-shadow: 0 0 20px rgba($color: $inBlueHover, $alpha: 1.0);
  1000. }
  1001. }
  1002. .m-l-none {
  1003. .el-input__inner {
  1004. margin-left: 0 !important;
  1005. }
  1006. }
  1007. }
  1008. </style>