eventLocation.vue 44 KB

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