eventLocation.vue 45 KB

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