eventLocation.vue 34 KB

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