eventLocation.vue 44 KB

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