eventLocation.vue 35 KB

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