eventLocation.vue 43 KB

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