monitor.vue 70 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666
  1. <!--监控中心-->
  2. <template>
  3. <div class="visual-con">
  4. <!--头部-->
  5. <vheader></vheader>
  6. <!--主体-->
  7. <div class="visual-body">
  8. <!-- 左侧 -->
  9. <div class="leftbar" :class="indentleft" ref="left">
  10. <div class="forthis">
  11. <dv-border-box-13 backgroundColor="rgba(12, 19, 38, .90)" style="padding-bottom: 1rem;">
  12. <img src="../assets/images/integrated/light.png" style="width: 100%; margin-top: .4rem;" />
  13. <div class="this-title">
  14. <span>事态感知</span>
  15. <dv-decoration-3 style="width:150px;height:15px;margin-right: 1rem;" />
  16. </div>
  17. <div class="i-list-con h-73">
  18. <div class="d-l-con-icon">
  19. <div class="icon-con w-33 m-btm-no" :class="{on:onShe}" @click="sheClick">
  20. <!-- -->
  21. <div class="icon icon-dot"></div>
  22. <div class="icon-text">
  23. <h6>{{ visuForestCloudMapDeviceBOList[0].deviceCount }}</h6>
  24. <h5>{{ visuForestCloudMapDeviceBOList[0].deviceName }}</h5>
  25. </div>
  26. </div>
  27. <div class="icon-con w-33 m-btm-no" :class="{on:onChuan}" @click="chuanClick">
  28. <div class="icon icon-dot"></div>
  29. <div class="icon-text">
  30. <h6>{{ sensorNum }}</h6>
  31. <h5>传感器</h5>
  32. </div>
  33. </div>
  34. <div class="icon-con w-33 m-btm-no" :class="{on:onLa}" @click="laClick">
  35. <div class="icon icon-dot"></div>
  36. <div class="icon-text">
  37. <h6>{{ loudspeakerNum }}</h6>
  38. <h5>大喇叭</h5>
  39. </div>
  40. </div>
  41. </div>
  42. <!-- <div class="overflow-y" style="height: 33vh;">-->
  43. <!-- <el-collapse accordion>-->
  44. <!-- <el-collapse-item v-for="(item,index) in region" :key="index">-->
  45. <!-- &lt;!&ndash; deptId &ndash;&gt;-->
  46. <!-- <template slot="title">-->
  47. <!-- <div class="d-l-con sj-collapse" :class="{on:listCurrentIndex1==item.deptId}"-->
  48. <!-- v-on:click="selectCameraByDeptId(item.deptId)">-->
  49. <!-- <div class="d-l-l-text">-->
  50. <!-- <h4 class="collapse-title">{{ item.deptName }}</h4>-->
  51. <!-- </div>-->
  52. <!-- <div class="d-l-l-count">{{ item.deptCount }}</div>-->
  53. <!-- </div>-->
  54. <!-- </template>-->
  55. <!-- </el-collapse-item>-->
  56. <!-- </el-collapse>-->
  57. <!-- </div>-->
  58. <!-- &lt;!&ndash; 横向柱状 echart &ndash;&gt;-->
  59. <!-- <div class="overflow-y" style="height: 33vh;">-->
  60. <!-- <div id="camera-chart" style="width: 100%;height:33vh;"></div>-->
  61. <!-- </div>-->
  62. <div class="overflow-y" style="height: 70vh;">
  63. <div class="i-list-con h-65">
  64. <div class="head-container">
  65. <el-input v-model="deptName" placeholder="请输入部门名称" clearable size="small"
  66. prefix-icon="el-icon-search" style="margin-bottom: 20px" />
  67. </div>
  68. <div class="head-container tree-scrollbar" style="height: 700px;overflow-y:auto;">
  69. <el-tree :data="deptOptions" :props="defaultProps" :expand-on-click-node="false"
  70. :filter-node-method="filterNode" ref="tree" node-key="id" :default-expanded-keys="[100]"
  71. @node-click="handleNodeClick" />
  72. </div>
  73. </div>
  74. </div>
  75. </div>
  76. </dv-border-box-13>
  77. </div>
  78. </div>
  79. <!-- 地图 -->
  80. <supermap ref="supermap" style="width: 100%;height: 100vh;" @preview="preview" @jump="jump">
  81. </supermap>
  82. <!-- 右侧 -->
  83. <div class="rightbar" :class="indentright" ref="right">
  84. <div class="forthis">
  85. <dv-border-box-13 backgroundColor="rgba(12, 19, 38, .90)" style="padding-bottom: 1rem;">
  86. <img src="../assets/images/integrated/light.png" style="width: 100%; margin-top: .4rem;" />
  87. <div class="this-title">
  88. <span>列表</span>
  89. <dv-decoration-3 style="width:150px;height:15px;margin-right: 1rem;" />
  90. </div>
  91. <div class="i-list-con h-43">
  92. <el-input v-model="rightDeptName" :placeholder="placeholderMsg" clearable size="small"
  93. prefix-icon="el-icon-search" style="margin-bottom: 20px" />
  94. <div class="d-l-con" v-for="(item,index) in visuForestCloudCameraBOListSearch"
  95. :class="{on:listCurrentIndex2 == index}" v-on:click="dropLocation(item.latitude,item.longitude,index)">
  96. <div class="d-l-l-text">
  97. <i class="iconfont sj-icon-jkzx icon-sxt"></i>
  98. <h4>{{ item.cameraName }}</h4>
  99. <!-- <h4 v-if="onChuan" v-html="cgqData[index]"></h4> -->
  100. </div>
  101. </div>
  102. </div>
  103. </dv-border-box-13>
  104. </div>
  105. <div class="forthis">
  106. <dv-border-box-13 backgroundColor="rgba(12, 19, 38, .90)" style="padding-bottom: 1rem;">
  107. <img src="../assets/images/integrated/light.png" style="width: 100%; margin-top: .4rem;" />
  108. <div class="this-title">
  109. <span>重点区域</span>
  110. <dv-decoration-3 style="width:150px;height:15px;margin-right: 1rem;" />
  111. </div>
  112. <div class="i-list-con h-25">
  113. <div class="d-l-con" v-for="(item,index) in keyAreaList" :class="{on:listCurrentIndex3 == index}"
  114. @click="getRegionalFlag(item.id)">
  115. <div class="d-l-l-text">
  116. <i class="i-small"></i>
  117. <h4>{{ item.areaName }}</h4>
  118. </div>
  119. </div>
  120. </div>
  121. </dv-border-box-13>
  122. </div>
  123. </div>
  124. <vBottomMenu ref="bottomMenu"></vBottomMenu>
  125. <!-- <el-tooltip :content="indentText" placement="top" :disabled="indentdisabled">-->
  126. <!-- <div class="mascot" ref="mascot" :class="indentStyle" @click="indent"><img-->
  127. <!-- src="@/assets/images/mascot.png"/></div>-->
  128. <!-- </el-tooltip>-->
  129. </div>
  130. <eventLocation ref="eventLocation"></eventLocation>
  131. <TVWall ref="TVWall"></TVWall>
  132. <TVWalls ref="TVWalls"></TVWalls>
  133. <el-dialog :title="cameraTitle" :visible.sync="cameraVisible" v-if="cameraVisible" customClass="videoCustomWidth"
  134. @close="cancelEventLocationShow()">
  135. <div style="width:1020px;height:625px;position:relative;">
  136. <!--视频窗口展示---海康-->
  137. <div id="playWnd" class="playWnd" style="left: 0px; top: 0px;"></div>
  138. </div>
  139. </el-dialog>
  140. </div>
  141. </template>
  142. <script>
  143. import {
  144. getMonitorDeviceAndDataList,
  145. selectDeviceType,
  146. selectCameraByDeptId,
  147. getSensorListByDeptId,
  148. getDlblistBydeptId,
  149. selectKeyAreaList,
  150. getRegionalFlag,
  151. getCamerasByDeptId
  152. } from '@/api/monitor'
  153. import {
  154. treeselect
  155. } from '@/api/system/dept'
  156. import supermap from '@/components/supermap-2.5d' //超图
  157. import vheader from '@/components/v-header.vue' //一体化共用头部
  158. import vBottomMenu from '@/components/vBottomMenu.vue' //一体化公共底部菜单
  159. import eventLocation from '@/components/eventLocation.vue' //事件定位弹窗
  160. import TVWall from '@/components/TVWall.vue' //电视墙弹窗
  161. import TVWalls from '@/components/TVWalls.vue' //电视墙弹窗
  162. /** ----------------------------------摄像头预览开始------------------------------------- */
  163. import {
  164. getDahuaVideoServer
  165. } from '@/api/dahua/dahua'
  166. import {
  167. getHaiKangVideoServer
  168. } from '@/api/haikang/haikang'
  169. import DHWs from '@/dahua/lib/DHWs'
  170. /** ----------------------------------摄像头预览结束------------------------------------- */
  171. // import echarts from 'echarts'
  172. let echarts = require('echarts')
  173. import Cookies from 'js-cookie';
  174. export default {
  175. components: {
  176. supermap,
  177. vheader,
  178. vBottomMenu,
  179. eventLocation,
  180. TVWalls,
  181. TVWall
  182. },
  183. created() {
  184. /** ----------------------------------摄像头预览开始------------------------------------- */
  185. const DHWsInstance = DHWs.getInstance()
  186. this.ws = DHWsInstance
  187. /** ----------------------------------摄像头预览结束------------------------------------- */
  188. /** ----------------------------------底部按钮公用组件开始------------------------------------- */
  189. window.showDialog = this.showDialog
  190. window.choseLayerSwitching = this.choseLayerSwitching
  191. window.choseLayerSwitchingList = this.choseLayerSwitchingList
  192. /** ----------------------------------底部按钮公用组件结束------------------------------------- */
  193. },
  194. mounted() {
  195. this.selectKeyAreaList()
  196. this.bottomMenuList() //获取底部公共组件消息和任务
  197. this.getTreeselect()
  198. this.deptId = Cookies.get("deptId")
  199. this.getMonitorDeviceAndDataLists()
  200. this.getDlblistBydeptIds()
  201. this.selectDeviceType(-1)
  202. // this.showTVWall();
  203. },
  204. beforeDestroy() {
  205. clearInterval(this.cgqTimer); //关闭
  206. },
  207. data() {
  208. return {
  209. //摄像头名称
  210. cgqData:[],
  211. rightDeptName: undefined,
  212. visuForestCloudCameraBOListSearch: [],
  213. // 部门名称
  214. deptName: undefined,
  215. deptId: '',
  216. // 部门树选项
  217. deptOptions: undefined,
  218. defaultProps: {
  219. children: 'children',
  220. label: 'label'
  221. },
  222. listCurrentIndex1: '-1',
  223. listCurrentIndex2: '-1',
  224. listCurrentIndex3: '-1',
  225. graphicsList: [], //重点区域
  226. /** ----------------------------------摄像头预览开始------------------------------------- */
  227. //大华
  228. activePanel: 'key1',
  229. isLogin: false,
  230. cameraParams: [],
  231. ws: null,
  232. //海康
  233. cameraTitle: '',
  234. cameraVisible: false,
  235. initCount: 0,
  236. pubKey: '',
  237. oWebControl: null,
  238. /** ----------------------------------摄像头预览结束------------------------------------- */
  239. visuForestCloudMapDeviceBOList: [{
  240. deviceCount: 0,
  241. deviceName: "摄像头"
  242. }],
  243. visuForestCloudCameraBOList: [],
  244. cameraMarkersList: [],
  245. sourceData: [],
  246. keyAreaList: [], //重点区域
  247. iframeBoo: true,
  248. open: false,
  249. iframeVue: null,
  250. activeName: 'info',
  251. radio: '1',
  252. region: [],
  253. //左右缩进
  254. indentStyle: '',
  255. indentleft: '',
  256. indentright: '',
  257. indentText: '收起左右栏',
  258. indentdisabled: false,
  259. placeholderMsg: "请输入摄像头名称",
  260. domId: 'dom1',
  261. localMark: "she",
  262. onShe: false,
  263. onChuan: false,
  264. onLa: false,
  265. colors: "green",
  266. sensorNum: 0,
  267. loudspeakerNum: 0,
  268. cgqTimer: null,
  269. values: Math.random()
  270. }
  271. },
  272. watch: {
  273. // 根据名称筛选部门树
  274. deptName(val) {
  275. this.$refs.tree.filter(val)
  276. },
  277. rightDeptName(val) {
  278. this.visuForestCloudCameraBOListSearch = [];
  279. for (let i in this.visuForestCloudCameraBOList) {
  280. if (this.visuForestCloudCameraBOList[i].cameraName.indexOf(val) != -1) {
  281. this.visuForestCloudCameraBOListSearch.push(this.visuForestCloudCameraBOList[i]);
  282. }
  283. }
  284. }
  285. },
  286. methods: {
  287. // setcgqValue: function() {
  288. // let that = this
  289. // for (let i = 0; i < that.visuForestCloudCameraBOListSearch.length; i++) {
  290. // var color = "green";
  291. // var value = Math.random();
  292. // var up = "▲";
  293. // var down = "▼";
  294. // if (value > 0.5) {
  295. // color = "red";
  296. // value = value + "" + up;
  297. // } else {
  298. // value = value + "" + down;
  299. // }
  300. // that.cgqData.push("<span style='color:" + color + "'>" + value + "</span>")
  301. // }
  302. // setInterval(function() {
  303. // var color = "green";
  304. // var value = Math.random();
  305. // var up = "▲";
  306. // var down = "▼";
  307. // if (value > 0.5) {
  308. // color = "red";
  309. // value = value + "" + up;
  310. // } else {
  311. // value = value + "" + down;
  312. // }
  313. // that.cgqData.push("<span style='color:" + color + "'>" + value + "</span>")
  314. // if (that.cgqData.length > that.visuForestCloudCameraBOListSearch.length) {
  315. // console.log(that.cgqData)
  316. // that.cgqData.splice(0, 1)
  317. // }
  318. // }, 5000)
  319. // },
  320. /* 电视墙替换开始 */
  321. showTVWall(channelCode, channelName) {
  322. let tvListJson = [
  323. {
  324. "switchTab": "2",
  325. "treeLabels": [
  326. {
  327. "id": null,
  328. "labelCode": "999",
  329. "labelName": "电视墙",
  330. "cameraType": null,
  331. "parentLabelCode": ""
  332. },
  333. {
  334. "id": "spcamera00010",
  335. "labelCode": channelCode,
  336. "labelName": channelName,
  337. "cameraType": "1",
  338. "parentLabelCode": "999"
  339. }
  340. ],
  341. "labelChannels": [
  342. {
  343. "labelCode": channelCode,
  344. "channelDates": [
  345. {
  346. "channelCode": channelCode,
  347. "channelName": channelName,
  348. "channelSn": null,
  349. "cameraType": "1",
  350. "online": "1",
  351. "cameraCode": "1"
  352. }
  353. ]
  354. }
  355. ]
  356. }
  357. ]
  358. this.$refs.TVWall.showTVWall(tvListJson, [{
  359. "channelId": channelCode
  360. }]);
  361. this.$refs.bottomMenu.showMeasure = false;
  362. this.$refs.bottomMenu.showChild = false;
  363. this.$refs.bottomMenu.showBanChild = false;
  364. this.$refs.bottomMenu.showChangChild = false;
  365. },
  366. /* 电视墙替换结束 */
  367. /** 部门树*/
  368. // 查询部门下拉树结构
  369. getTreeselect() {
  370. treeselect().then(response => {
  371. console.log(response.data)
  372. this.deptOptions = response.data
  373. })
  374. },
  375. jump() { // 跳转大喇叭页面
  376. window.open("https://sts.sty1818.com");
  377. },
  378. // 筛选节点
  379. filterNode(value, data) {
  380. if (!value) return true
  381. return data.label.indexOf(value) !== -1
  382. },
  383. // 节点单击事件
  384. handleNodeClick(data) {
  385. let that = this
  386. that.deptId = data.id
  387. console.log("节点单击事件", data, that.localMark);
  388. // this.findCameraByDept(data.id)
  389. if (that.localMark == 'she') {
  390. that.selectCameraByDeptId(data.id);
  391. getCamerasByDeptId(data.id).then(res => {
  392. that.$refs.TVWalls.showTVWall(res.data, {
  393. longitude: data.deptLongitude,
  394. latitude: data.deptLatitude
  395. });
  396. })
  397. } else if (that.localMark == 'chuan') {
  398. that.getMonitorDeviceAndDataList()
  399. } else if (that.localMark == 'la') {
  400. that.getDlblistBydeptId()
  401. }
  402. },
  403. sheClick() {
  404. this.onLa = false
  405. this.onShe = true
  406. this.onChuan = false
  407. this.localMark = 'she'
  408. this.placeholderMsg = "请输入摄像头名称"
  409. clearInterval(this.cgqTimer)
  410. this.selectDeviceType()
  411. },
  412. laClick() {
  413. this.onLa = true
  414. this.onShe = false
  415. this.onChuan = false
  416. this.localMark = 'la'
  417. this.placeholderMsg = "请输入大喇叭名称"
  418. this.deptId = Cookies.get("deptId")
  419. clearInterval(this.cgqTimer)
  420. this.getDlblistBydeptId()
  421. },
  422. chuanClick() {
  423. this.onLa = false
  424. this.onShe = false
  425. this.onChuan = true
  426. this.localMark = 'chuan'
  427. this.placeholderMsg = "请输入传感器名称"
  428. this.deptId = Cookies.get("deptId")
  429. this.getMonitorDeviceAndDataList()
  430. clearInterval(this.cgqTimer)
  431. this.cgqTimer = setInterval(() => {
  432. this.getMonitorDeviceAndDataList()
  433. }, 5 * 60 * 1000)
  434. },
  435. //传感器2
  436. getMonitorDeviceAndDataLists() {
  437. let that = this
  438. getMonitorDeviceAndDataList(this.deptId).then((res) => {
  439. that.sensorNum = res.data.length
  440. })
  441. },
  442. // 大喇叭
  443. getDlblistBydeptId() {
  444. let that = this;
  445. let markersList = [];
  446. getDlblistBydeptId(that.deptId).then(function(res) {
  447. that.loudspeakerNum = res.data.length
  448. that.visuForestCloudCameraBOListSearch = []
  449. if (res.data != null && res.data.length > 0) {
  450. for (let j = 0; j < res.data.length; j++) {
  451. let dat = {
  452. cameraName: res.data[j].name,
  453. longitude: res.data[j].longitude,
  454. latitude: res.data[j].latitude,
  455. }
  456. that.visuForestCloudCameraBOListSearch.push(dat)
  457. }
  458. for (let i = 0; i < res.data.length; i++) {
  459. let markersMap = {
  460. lng: 124.59,
  461. lat: 43.02,
  462. icon: "marker",
  463. bindPopupHtml: "",
  464. click: 'jump',
  465. parameter: "",
  466. name: "",
  467. keepBindPopup: false,
  468. isAggregation: false,
  469. };
  470. markersMap.icon = "big-horn";
  471. markersMap.lng = res.data[i].longitude;
  472. markersMap.lat = res.data[i].latitude;
  473. markersList.push(markersMap);
  474. }
  475. setTimeout(() => {
  476. that.$refs.supermap.clearM();
  477. that.$refs.supermap.clearMRadius()
  478. that.$refs.supermap.setMarkers(markersList);
  479. }, 2000);
  480. } else {
  481. setTimeout(() => {
  482. that.$refs.supermap.clearM();
  483. that.$refs.supermap.clearMRadius()
  484. }, 2000);
  485. }
  486. })
  487. .catch(function(error) {
  488. console.error(error);
  489. });
  490. },
  491. getDlblistBydeptIds() {
  492. let that = this;
  493. getDlblistBydeptId(that.deptId).then(function(res) {
  494. that.loudspeakerNum = res.data.length
  495. })
  496. .catch(function(error) {
  497. console.error(error);
  498. });
  499. },
  500. getMonitorDeviceAndDataList() {
  501. let list = []
  502. let markersList = [];
  503. getMonitorDeviceAndDataList(this.deptId).then((res) => {
  504. this.visuForestCloudCameraBOListSearch = []
  505. list = res.data
  506. // this.sensorNum = list.length
  507. list.forEach(item => {
  508. let dat = {
  509. cameraName: item.deviceName,
  510. longitude: item.longitude,
  511. latitude: item.latitude,
  512. }
  513. this.visuForestCloudCameraBOListSearch.push(dat)
  514. let markersMap = {
  515. lng: 124.59,
  516. lat: 43.02,
  517. icon: "marker",
  518. bindPopupHtml: '<div class="map-tip">' +
  519. "<span>" +
  520. ' <div class="d-l-con">' +
  521. ' <div class="d-l-l-text">' +
  522. " <h4>名称:" +
  523. (item.deviceName ? item.deviceName : "") +
  524. "</h4>" +
  525. " </div>" +
  526. " </div>" +
  527. " </span>" +
  528. "<span>" +
  529. ' <div class="d-l-con">' +
  530. ' <div class="d-l-l-text">' +
  531. " <h4>厂家:" +
  532. (item.brand ? item.brand : "") +
  533. "</h4>" +
  534. " </div>" +
  535. " </div>" +
  536. " </span>" +
  537. "<span>" +
  538. ' <div class="d-l-con">' +
  539. ' <div class="d-l-l-text">' +
  540. " <h4>经纬度:" +
  541. item.longitude + "," + item.latitude +
  542. "</h4>" +
  543. " </div>" +
  544. " </div>" +
  545. " </span>" +
  546. "</div>",
  547. click: "",
  548. parameter: "",
  549. name: "",
  550. keepBindPopup: false,
  551. isAggregation: false,
  552. };
  553. if (item.deviceType == 1) { // 水质传感器
  554. markersMap.icon = "sj-icon-map-centerdata_water_quality_sensor";
  555. markersMap.bindPopupHtml += '<div class="map-tip">' +
  556. "<span>" +
  557. ' <div class="d-l-con">' +
  558. ' <div class="d-l-l-text">' +
  559. " <h4>水中PH:" +
  560. (item.data.waterPh ? item.data.waterPh : "") +
  561. "</h4>" +
  562. " </div>" +
  563. " </div>" +
  564. " </span>" +
  565. "<span>" +
  566. ' <div class="d-l-con">' +
  567. ' <div class="d-l-l-text">' +
  568. " <h4>生化需氧量:" +
  569. (item.data.bod ? item.data.bod : "") +
  570. "</h4>" +
  571. " </div>" +
  572. " </div>" +
  573. " </span>" +
  574. "<span>" +
  575. ' <div class="d-l-con">' +
  576. ' <div class="d-l-l-text">' +
  577. " <h4>信号强度:" +
  578. (item.data.signalStrength ? item.data.signalStrength : "") +
  579. "</h4>" +
  580. " </div>" +
  581. " </div>" +
  582. " </span>" +
  583. "<span>" +
  584. ' <div class="d-l-con">' +
  585. ' <div class="d-l-l-text">' +
  586. " <h4>化学需氧量:" +
  587. (item.data.cod ? item.data.cod : "") +
  588. "</h4>" +
  589. " </div>" +
  590. " </div>" +
  591. " </span>" +
  592. "<span>" +
  593. ' <div class="d-l-con">' +
  594. ' <div class="d-l-l-text">' +
  595. " <h4>氨氮:" +
  596. (item.data.ammoniaNitrogen ? item.data.ammoniaNitrogen : "") +
  597. "</h4>" +
  598. " </div>" +
  599. " </div>" +
  600. " </span>" +
  601. "<span>" +
  602. ' <div class="d-l-con">' +
  603. ' <div class="d-l-l-text">' +
  604. " <h4>水温:" +
  605. (item.data.waterTemperature ? item.data.waterTemperature : "") +
  606. "</h4>" +
  607. " </div>" +
  608. " </div>" +
  609. " </span>" +
  610. "<span>" +
  611. ' <div class="d-l-con">' +
  612. ' <div class="d-l-l-text">' +
  613. " <h4>版本号:" +
  614. (item.data.version ? item.data.version : "") +
  615. "</h4>" +
  616. " </div>" +
  617. " </div>" +
  618. " </span>" +
  619. "<span>" +
  620. ' <div class="d-l-con">' +
  621. ' <div class="d-l-l-text">' +
  622. " <h4>水质悬浮物:" +
  623. (item.data.waterQualitySuspension ? item.data.waterQualitySuspension : "") +
  624. "</h4>" +
  625. " </div>" +
  626. " </div>" +
  627. " </span>" +
  628. "</div>";
  629. } else if (item.deviceType == '002') { // 水尺
  630. markersMap.icon = "sj-icon-map-centerdata_water_gauge";
  631. } else if (item.deviceType == '003') { // 水文监测设备
  632. markersMap.icon = "sj-icon-map-centerdata_hydrological_monitoring_equipment";
  633. } else if (item.deviceType == 2) { // 土壤监测设备
  634. markersMap.icon = "sj-icon-map-centerdata_soil_monitoring_equipment";
  635. markersMap.bindPopupHtml += '<div class="map-tip">' +
  636. "<span>" +
  637. ' <div class="d-l-con">' +
  638. ' <div class="d-l-l-text">' +
  639. " <h4>钾含量:" +
  640. (item.data.potassium ? item.data.potassium : "") +
  641. "</h4>" +
  642. " </div>" +
  643. " </div>" +
  644. " </span>" +
  645. "<span>" +
  646. ' <div class="d-l-con">' +
  647. ' <div class="d-l-l-text">' +
  648. " <h4>导电率:" +
  649. (item.data.conductivity ? item.data.conductivity : "") +
  650. "</h4>" +
  651. " </div>" +
  652. " </div>" +
  653. " </span>" +
  654. "<span>" +
  655. ' <div class="d-l-con">' +
  656. ' <div class="d-l-l-text">' +
  657. " <h4>氮含量:" +
  658. (item.data.nitrogen ? item.data.nitrogen : "") +
  659. "</h4>" +
  660. " </div>" +
  661. " </div>" +
  662. " </span>" +
  663. "<span>" +
  664. ' <div class="d-l-con">' +
  665. ' <div class="d-l-l-text">' +
  666. " <h4>信号强度:" +
  667. (item.data.signalStrength ? item.data.signalStrength : "") +
  668. "</h4>" +
  669. " </div>" +
  670. " </div>" +
  671. " </span>" +
  672. "<span>" +
  673. ' <div class="d-l-con">' +
  674. ' <div class="d-l-l-text">' +
  675. " <h4>温度:" +
  676. (item.data.temperature ? item.data.temperature : "") +
  677. "</h4>" +
  678. " </div>" +
  679. " </div>" +
  680. " </span>" +
  681. "<span>" +
  682. ' <div class="d-l-con">' +
  683. ' <div class="d-l-l-text">' +
  684. " <h4>ph值:" +
  685. (item.data.ph ? item.data.ph : "") +
  686. "</h4>" +
  687. " </div>" +
  688. " </div>" +
  689. " </span>" +
  690. "<span>" +
  691. ' <div class="d-l-con">' +
  692. ' <div class="d-l-l-text">' +
  693. " <h4>湿度:" +
  694. (item.data.humidity ? item.data.humidity : "") +
  695. "</h4>" +
  696. " </div>" +
  697. " </div>" +
  698. " </span>" +
  699. "<span>" +
  700. ' <div class="d-l-con">' +
  701. ' <div class="d-l-l-text">' +
  702. " <h4>错误码:" +
  703. (item.data.errorCode ? item.data.errorCode : "") +
  704. "</h4>" +
  705. " </div>" +
  706. " </div>" +
  707. " </span>" +
  708. "<span>" +
  709. ' <div class="d-l-con">' +
  710. ' <div class="d-l-l-text">' +
  711. " <h4>版本号:" +
  712. (item.data.version ? item.data.version : "") +
  713. "</h4>" +
  714. " </div>" +
  715. " </div>" +
  716. " </span>" +
  717. "<span>" +
  718. ' <div class="d-l-con">' +
  719. ' <div class="d-l-l-text">' +
  720. " <h4>磷含量:" +
  721. (item.data.phosphorus ? item.data.phosphorus : "") +
  722. "</h4>" +
  723. " </div>" +
  724. " </div>" +
  725. " </span>" +
  726. "<span>" +
  727. ' <div class="d-l-con">' +
  728. ' <div class="d-l-l-text">' +
  729. " <h4>电压:" +
  730. (item.data.voltage ? item.data.voltage : "") +
  731. "</h4>" +
  732. " </div>" +
  733. " </div>" +
  734. " </span>" +
  735. "</div>";
  736. } else if (item.deviceType == 4) { // 病虫害监测站
  737. markersMap.icon = "sj-icon-map-centerdata_pest_and_disease_monitoring_station";
  738. } else if (item.deviceType == 5) { // 大气传感器
  739. markersMap.icon = "sj-icon-map-centerdata_atmospheric_sensor";
  740. markersMap.bindPopupHtml += '<div class="map-tip">' +
  741. "<span>" +
  742. ' <div class="d-l-con">' +
  743. ' <div class="d-l-l-text">' +
  744. " <h4>总挥发性有机物:" +
  745. (item.data.tvoc ? item.data.tvoc : "") +
  746. "</h4>" +
  747. " </div>" +
  748. " </div>" +
  749. " </span>" +
  750. "<span>" +
  751. ' <div class="d-l-con">' +
  752. ' <div class="d-l-l-text">' +
  753. " <h4>二氧化硫:" +
  754. (item.data.sulfurDioxide ? item.data.sulfurDioxide : "") +
  755. "</h4>" +
  756. " </div>" +
  757. " </div>" +
  758. " </span>" +
  759. "<span>" +
  760. ' <div class="d-l-con">' +
  761. ' <div class="d-l-l-text">' +
  762. " <h4>电池电压:" +
  763. (item.data.batteryVoltage ? item.data.batteryVoltage : "") +
  764. "</h4>" +
  765. " </div>" +
  766. " </div>" +
  767. " </span>" +
  768. "<span>" +
  769. ' <div class="d-l-con">' +
  770. ' <div class="d-l-l-text">' +
  771. " <h4>信号强度:" +
  772. (item.data.signalStrength ? item.data.signalStrength : "") +
  773. "</h4>" +
  774. " </div>" +
  775. " </div>" +
  776. " </span>" +
  777. "<span>" +
  778. ' <div class="d-l-con">' +
  779. ' <div class="d-l-l-text">' +
  780. " <h4>可吸入颗粒物:" +
  781. (item.data.suctionParticle ? item.data.suctionParticle : "") +
  782. "</h4>" +
  783. " </div>" +
  784. " </div>" +
  785. " </span>" +
  786. "<span>" +
  787. ' <div class="d-l-con">' +
  788. ' <div class="d-l-l-text">' +
  789. " <h4>一氧化碳:" +
  790. (item.data.carbonMonoxide ? item.data.carbonMonoxide : "") +
  791. "</h4>" +
  792. " </div>" +
  793. " </div>" +
  794. " </span>" +
  795. "<span>" +
  796. ' <div class="d-l-con">' +
  797. ' <div class="d-l-l-text">' +
  798. " <h4>臭氧:" +
  799. (item.data.ozone ? item.data.ozone : "") +
  800. "</h4>" +
  801. " </div>" +
  802. " </div>" +
  803. " </span>" +
  804. "<span>" +
  805. ' <div class="d-l-con">' +
  806. ' <div class="d-l-l-text">' +
  807. " <h4>总悬浮颗粒物:" +
  808. (item.data.tsp ? item.data.tsp : "") +
  809. "</h4>" +
  810. " </div>" +
  811. " </div>" +
  812. " </span>" +
  813. "<span>" +
  814. ' <div class="d-l-con">' +
  815. ' <div class="d-l-l-text">' +
  816. " <h4>温度:" +
  817. (item.data.temperature ? item.data.temperature : "") +
  818. "</h4>" +
  819. " </div>" +
  820. " </div>" +
  821. " </span>" +
  822. "<span>" +
  823. ' <div class="d-l-con">' +
  824. ' <div class="d-l-l-text">' +
  825. " <h4>湿度:" +
  826. (item.data.humidity ? item.data.humidity : "") +
  827. "</h4>" +
  828. " </div>" +
  829. " </div>" +
  830. " </span>" +
  831. "<span>" +
  832. ' <div class="d-l-con">' +
  833. ' <div class="d-l-l-text">' +
  834. " <h4>细颗粒:" +
  835. (item.data.fineParticle ? item.data.fineParticle : "") +
  836. "</h4>" +
  837. " </div>" +
  838. " </div>" +
  839. " </span>" +
  840. "<span>" +
  841. ' <div class="d-l-con">' +
  842. ' <div class="d-l-l-text">' +
  843. " <h4>二氧化氮:" +
  844. (item.data.nitrogenDioxide ? item.data.nitrogenDioxide : "") +
  845. "</h4>" +
  846. " </div>" +
  847. " </div>" +
  848. " </span>" +
  849. "<span>" +
  850. ' <div class="d-l-con">' +
  851. ' <div class="d-l-l-text">' +
  852. " <h4>风向:" +
  853. (item.data.windDirection ? item.data.windDirection : "") +
  854. "</h4>" +
  855. " </div>" +
  856. " </div>" +
  857. " </span>" +
  858. "<span>" +
  859. ' <div class="d-l-con">' +
  860. ' <div class="d-l-l-text">' +
  861. " <h4>风速:" +
  862. (item.data.windSpeed ? item.data.windSpeed : "") +
  863. "</h4>" +
  864. " </div>" +
  865. " </div>" +
  866. " </span>" +
  867. "</div>";
  868. } else if (item.deviceType == 6) { // 水压传感器
  869. markersMap.icon = "sj-icon-map-centerdata_water_pressure_sensor";
  870. markersMap.bindPopupHtml += '<div class="map-tip">' +
  871. "<span>" +
  872. ' <div class="d-l-con">' +
  873. ' <div class="d-l-l-text">' +
  874. " <h4>设备编码:" +
  875. (item.data.IMEI ? item.data.IMEI : "") +
  876. "</h4>" +
  877. " </div>" +
  878. " </div>" +
  879. " </span>" +
  880. "<span>" +
  881. ' <div class="d-l-con">' +
  882. ' <div class="d-l-l-text">' +
  883. " <h4>下限警报使能:" +
  884. (item.data.thresholdLowEnable ? item.data.thresholdLowEnable : "") +
  885. "</h4>" +
  886. " </div>" +
  887. " </div>" +
  888. " </span>" +
  889. "<span>" +
  890. ' <div class="d-l-con">' +
  891. ' <div class="d-l-l-text">' +
  892. " <h4>上限警报使能:" +
  893. (item.data.thresholdHighEnable ? item.data.thresholdHighEnable : "") +
  894. "</h4>" +
  895. " </div>" +
  896. " </div>" +
  897. " </span>" +
  898. "<span>" +
  899. ' <div class="d-l-con">' +
  900. ' <div class="d-l-l-text">' +
  901. " <h4>信号强度:" +
  902. (item.data.signalPower ? item.data.signalPower : "") +
  903. "</h4>" +
  904. " </div>" +
  905. " </div>" +
  906. " </span>" +
  907. "<span>" +
  908. ' <div class="d-l-con">' +
  909. ' <div class="d-l-l-text">' +
  910. " <h4>水压力值:" +
  911. (item.data.hydraulicValue ? item.data.hydraulicValue : "") +
  912. "</h4>" +
  913. " </div>" +
  914. " </div>" +
  915. " </span>" +
  916. "<span>" +
  917. ' <div class="d-l-con">' +
  918. ' <div class="d-l-l-text">' +
  919. " <h4>水压下限阈值:" +
  920. (item.data.hydraulicThresholdMin ? item.data.hydraulicThresholdMin : "") +
  921. "</h4>" +
  922. " </div>" +
  923. " </div>" +
  924. " </span>" +
  925. "<span>" +
  926. ' <div class="d-l-con">' +
  927. ' <div class="d-l-l-text">' +
  928. " <h4>水压上限阈值:" +
  929. (item.data.hydraulicThresholdMax ? item.data.hydraulicThresholdMax : "") +
  930. "</h4>" +
  931. " </div>" +
  932. " </div>" +
  933. " </span>" +
  934. "<span>" +
  935. ' <div class="d-l-con">' +
  936. ' <div class="d-l-l-text">' +
  937. " <h4>水压力值:" +
  938. (item.data.hydraulicValue ? item.data.hydraulicValue : "") +
  939. "</h4>" +
  940. " </div>" +
  941. " </div>" +
  942. " </span>" +
  943. "<span>" +
  944. ' <div class="d-l-con">' +
  945. ' <div class="d-l-l-text">' +
  946. " <h4>心跳周期:" +
  947. (item.data.heartbeatTime ? item.data.heartbeatTime : "") +
  948. "</h4>" +
  949. " </div>" +
  950. " </div>" +
  951. " </span>" +
  952. "<span>" +
  953. ' <div class="d-l-con">' +
  954. ' <div class="d-l-l-text">' +
  955. " <h4>电池电压:" +
  956. (item.data.batteryVoltage ? item.data.batteryVoltage : "") +
  957. "</h4>" +
  958. " </div>" +
  959. " </div>" +
  960. " </span>" +
  961. "<span>" +
  962. ' <div class="d-l-con">' +
  963. ' <div class="d-l-l-text">' +
  964. " <h4>电池电量:" +
  965. (item.data.batteryValue ? item.data.batteryValue : "") +
  966. "</h4>" +
  967. " </div>" +
  968. " </div>" +
  969. " </span>" +
  970. "</div>";
  971. } else if (item.deviceType == 7) //水流速传感器
  972. {
  973. markersMap.icon = "sj-icon-map-centerdata_water_pressure_sensor";
  974. markersMap.bindPopupHtml += '<div class="map-tip">' +
  975. "<span>" +
  976. ' <div class="d-l-con">' +
  977. ' <div class="d-l-l-text">' +
  978. " <h4>两流量累计之和:" +
  979. (item.data.Q ? item.data.Q : "") +
  980. "</h4>" +
  981. " </div>" +
  982. " </div>" +
  983. " </span>" +
  984. "<span>" +
  985. ' <div class="d-l-con">' +
  986. ' <div class="d-l-l-text">' +
  987. " <h4>流量Q1:" +
  988. (item.data.Q1 ? item.data.Q1 : "") +
  989. "</h4>" +
  990. " </div>" +
  991. " </div>" +
  992. " </span>" +
  993. "<span>" +
  994. ' <div class="d-l-con">' +
  995. ' <div class="d-l-l-text">' +
  996. " <h4>流量Q2:" +
  997. (item.data.Q2 ? item.data.Q2 : "") +
  998. "</h4>" +
  999. " </div>" +
  1000. " </div>" +
  1001. " </span>" +
  1002. "<span>" +
  1003. ' <div class="d-l-con">' +
  1004. ' <div class="d-l-l-text">' +
  1005. " <h4>Q1累计流量:" +
  1006. (item.data.CQ1 ? item.data.CQ1 : "") +
  1007. "</h4>" +
  1008. " </div>" +
  1009. " </div>" +
  1010. " </span></div>";
  1011. }
  1012. markersMap.lng = item.longitude;
  1013. markersMap.lat = item.latitude;
  1014. markersList.push(markersMap);
  1015. })
  1016. console.log(markersList)
  1017. })
  1018. setTimeout(() => {
  1019. this.$refs.supermap.clearM();
  1020. this.$refs.supermap.clearMRadius()
  1021. this.$refs.supermap.setMarkers(markersList);
  1022. }, 2000);
  1023. },
  1024. // 传感器
  1025. getSensorListByDeptId() {
  1026. let that = this;
  1027. let markersList = [];
  1028. getSensorListByDeptId(that.deptId).then(function(res) {
  1029. that.visuForestCloudCameraBOListSearch = []
  1030. // that.sensorNum = res.data.length
  1031. if (res.data != null && res.data.length > 0) {
  1032. for (let j = 0; j < res.data.length; j++) {
  1033. let dat = {
  1034. cameraName: res.data[j].deviceName,
  1035. longitude: res.data[j].longitude,
  1036. latitude: res.data[j].latitude,
  1037. }
  1038. that.visuForestCloudCameraBOListSearch.push(dat)
  1039. }
  1040. for (let i = 0; i < res.data.length; i++) {
  1041. let markersMap = {
  1042. lng: 124.59,
  1043. lat: 43.02,
  1044. icon: "marker",
  1045. bindPopupHtml: "",
  1046. click: "",
  1047. parameter: "",
  1048. name: i,
  1049. keepBindPopup: false,
  1050. isAggregation: false,
  1051. };
  1052. if (res.data[i].deviceType == 1) { // 水质传感器
  1053. markersMap.icon = "sj-icon-map-centerdata_water_quality_sensor";
  1054. } else if (res.data[i].deviceType == '002') { // 水尺
  1055. markersMap.icon = "sj-icon-map-centerdata_water_gauge";
  1056. } else if (res.data[i].deviceType == '003') { // 水文监测设备
  1057. markersMap.icon = "sj-icon-map-centerdata_hydrological_monitoring_equipment";
  1058. } else if (res.data[i].deviceType == 2) { // 土壤监测设备
  1059. markersMap.icon = "sj-icon-map-centerdata_soil_monitoring_equipment";
  1060. } else if (res.data[i].deviceType == 4) { // 病虫害监测站
  1061. markersMap.icon = "sj-icon-map-centerdata_pest_and_disease_monitoring_station";
  1062. } else if (res.data[i].deviceType == 5) { // 大气传感器
  1063. markersMap.icon = "sj-icon-map-centerdata_atmospheric_sensor";
  1064. } else if (res.data[i].deviceType == 6) { // 水压传感器
  1065. markersMap.icon = "sj-icon-map-centerdata_water_pressure_sensor";
  1066. }
  1067. markersMap.lng = res.data[i].longitude;
  1068. markersMap.lat = res.data[i].latitude;
  1069. markersList.push(markersMap);
  1070. }
  1071. // that.setcgqValue()
  1072. setTimeout(() => {
  1073. that.$refs.supermap.clearM();
  1074. that.$refs.supermap.clearMRadius()
  1075. that.$refs.supermap.setMarkers(markersList);
  1076. }, 2000);
  1077. } else {
  1078. setTimeout(() => {
  1079. that.$refs.supermap.clearM();
  1080. that.$refs.supermap.clearMRadius()
  1081. }, 2000);
  1082. }
  1083. that.onLa = false
  1084. that.onShe = false
  1085. that.onChuan = true
  1086. })
  1087. .catch(function(error) {
  1088. console.error(error);
  1089. });
  1090. },
  1091. getSensorListByDeptIds() {
  1092. let that = this;
  1093. getSensorListByDeptId(that.deptId).then(function(res) {
  1094. that.sensorNum = res.data.length
  1095. })
  1096. .catch(function(error) {
  1097. console.error(error);
  1098. });
  1099. },
  1100. selectKeyAreaList() {
  1101. this.keyAreaList = []
  1102. //获取重点区域列表
  1103. let that = this
  1104. selectKeyAreaList().then(res => {
  1105. that.keyAreaList = res.data
  1106. })
  1107. },
  1108. getRegionalFlag(id) {
  1109. //获取重点区域
  1110. this.listCurrentIndex3 = id
  1111. let that = this
  1112. getRegionalFlag(id).then(res => {
  1113. that.graphicsList = []
  1114. //地图标记
  1115. if (res.data != null && res.data.length > 0) {
  1116. for (let i = 0; i < res.data.length; i++) {
  1117. that.graphicsList.push(res.data[i].lng)
  1118. that.graphicsList.push(res.data[i].lat)
  1119. }
  1120. setTimeout(() => {
  1121. that.$refs.supermap.clearG()
  1122. that.$refs.supermap.setGraphicsList(this.graphicsList, 'red',0.8)
  1123. }, 1000)
  1124. } else {
  1125. that.$refs.supermap.clearG()
  1126. }
  1127. })
  1128. },
  1129. /** ----------------------------------底部按钮公用组件开始------------------------------------- */
  1130. bottomMenuList() {
  1131. this.$refs.bottomMenu.selectTaskList() //获取任务列表
  1132. this.$refs.bottomMenu.selectMessageList() //获取消息列表
  1133. },
  1134. showDialog(click) {
  1135. if (click == 'eventLocation') {
  1136. this.$refs.eventLocation.showEventLocation()
  1137. this.$refs.bottomMenu.showMeasure = false
  1138. this.$refs.bottomMenu.showChild = false
  1139. this.$refs.bottomMenu.showBanChild = false
  1140. this.$refs.bottomMenu.showChangChild = false
  1141. } else if (click == 'editableLayers') {
  1142. this.$refs.bottomMenu.showChild = false
  1143. this.$refs.bottomMenu.showBanChild = false
  1144. this.$refs.bottomMenu.showChangChild = false
  1145. if (!this.$refs.bottomMenu.showMeasure) {
  1146. this.$refs.bottomMenu.showMeasure = true
  1147. } else {
  1148. this.$refs.bottomMenu.showMeasure = false
  1149. }
  1150. } else if (click == 'layerSwitching') {
  1151. this.$refs.bottomMenu.showMeasure = false
  1152. this.$refs.bottomMenu.showBanChild = false
  1153. this.$refs.bottomMenu.showChangChild = false
  1154. if (!this.$refs.bottomMenu.showChild) {
  1155. this.$refs.bottomMenu.showChild = true
  1156. } else {
  1157. this.$refs.bottomMenu.showChild = false
  1158. }
  1159. } else if (click == 'TVWall') {
  1160. this.$refs.TVWall.showTVWall()
  1161. this.$refs.bottomMenu.showMeasure = false
  1162. this.$refs.bottomMenu.showChild = false
  1163. this.$refs.bottomMenu.showBanChild = false
  1164. this.$refs.bottomMenu.showChangChild = false
  1165. } else if (click == 'forestban') {
  1166. this.$refs.bottomMenu.showMeasure = false
  1167. this.$refs.bottomMenu.showChild = false
  1168. this.$refs.bottomMenu.showChangChild = false
  1169. if (!this.$refs.bottomMenu.showBanChild) {
  1170. this.$refs.bottomMenu.showBanChild = true
  1171. } else {
  1172. this.$refs.bottomMenu.showBanChild = false
  1173. }
  1174. } else if (click == 'forestchang') {
  1175. this.$refs.bottomMenu.showMeasure = false
  1176. this.$refs.bottomMenu.showBanChild = false
  1177. this.$refs.bottomMenu.showChild = false
  1178. if (!this.$refs.bottomMenu.showChangChild) {
  1179. this.$refs.bottomMenu.showChangChild = true
  1180. } else {
  1181. this.$refs.bottomMenu.showChangChild = false
  1182. }
  1183. }
  1184. },
  1185. //选择图层
  1186. choseLayerSwitching(url, isClear) {
  1187. this.$refs.supermap.layerSwitching(url, isClear)
  1188. },
  1189. //选择图层(传递数组)
  1190. choseLayerSwitchingList(urlList) {
  1191. this.$refs.supermap.layerSwitchingList(urlList)
  1192. },
  1193. /** ----------------------------------底部按钮公用组件结束------------------------------------- */
  1194. selectDeviceType() {
  1195. //获取左侧动态感知设备
  1196. let that = this
  1197. selectDeviceType().then(res => {
  1198. that.cameraMarkersList = []
  1199. that.visuForestCloudMapDeviceBOList = res.data.visuForestCloudMapDeviceBOList
  1200. that.region = res.data.visuForestCloudTodaySjfbBOList
  1201. if (res.data.visuForestCloudTodaySjfbBOList != null && res.data.visuForestCloudTodaySjfbBOList
  1202. .length > 0) {
  1203. for (let i = 0; i < res.data.visuForestCloudTodaySjfbBOList.length; i++) {
  1204. let aa = []
  1205. aa.push(res.data.visuForestCloudTodaySjfbBOList[i].deptName)
  1206. aa.push(Number(res.data.visuForestCloudTodaySjfbBOList[i].deptCount))
  1207. this.sourceData.push(aa)
  1208. }
  1209. }
  1210. that.visuForestCloudCameraBOList = res.data.visuForestCloudCameraBOList
  1211. that.visuForestCloudCameraBOListSearch = res.data.visuForestCloudCameraBOList
  1212. if (res.data.visuForestCloudCameraBOList != null && res.data.visuForestCloudCameraBOList.length > 0) {
  1213. for (let i = 0; i < res.data.visuForestCloudCameraBOList.length; i++) {
  1214. let markersMap = {
  1215. lng: 124.59,
  1216. lat: 43.02,
  1217. icon: 'camera',
  1218. bindPopupHtml: '',
  1219. click: 'preview',
  1220. parameter: '',
  1221. name: i,
  1222. keepBindPopup: false,
  1223. isAggregation: false
  1224. }
  1225. if (res.data.visuForestCloudCameraBOList[i].channelCode != null) {
  1226. markersMap.parameter = {
  1227. code: res.data.visuForestCloudCameraBOList[i].cameraCode,
  1228. name: res.data.visuForestCloudCameraBOList[i].cameraName,
  1229. type: res.data.visuForestCloudCameraBOList[i].cameraFactory
  1230. }
  1231. } else {
  1232. markersMap.parameter = []
  1233. }
  1234. markersMap.lng = res.data.visuForestCloudCameraBOList[i].longitude
  1235. markersMap.lat = res.data.visuForestCloudCameraBOList[i].latitude
  1236. markersMap.radius = res.data.visuForestCloudCameraBOList[i].cameraRadius
  1237. markersMap.bindPopupHtml = '<div class="map-tip">' +
  1238. '<span>' +
  1239. ' <div class="d-l-con">' +
  1240. ' <div class="d-l-l-text">' +
  1241. ' <h4>经纬度:' + res.data.visuForestCloudCameraBOList[i].longitude +
  1242. ',' + res.data.visuForestCloudCameraBOList[i].latitude + '</h4>' +
  1243. ' </div>' +
  1244. ' </div>' +
  1245. ' </span>' +
  1246. '<span>' +
  1247. ' <div class="d-l-con">' +
  1248. ' <div class="d-l-l-text">' +
  1249. ' <h4>摄像头名称:' + res.data.visuForestCloudCameraBOList[i]
  1250. .cameraName + '</h4>' +
  1251. ' </div>' +
  1252. ' </div>' +
  1253. ' </span>' +
  1254. '<span>' +
  1255. ' <div class="d-l-con">' +
  1256. ' <div class="d-l-l-text">' +
  1257. ' <h4>网络运营商:' + (res.data.visuForestCloudCameraBOList[i].operatorType == "1" ?
  1258. "联通" : (res.data.visuForestCloudCameraBOList[i].operatorType == "2" ? "移动" : "电信")) + '</h4>' +
  1259. ' </div>' +
  1260. ' </div>' +
  1261. ' </span>' +
  1262. '<span>' +
  1263. ' <div class="d-l-con">' +
  1264. ' <div class="d-l-l-text">' +
  1265. ' <h4>摄像头半径:' + res.data.visuForestCloudCameraBOList[i]
  1266. .cameraRadius + '米</h4>' +
  1267. ' </div>' +
  1268. ' </div>' +
  1269. ' </span>' +
  1270. '</div>'
  1271. this.cameraMarkersList.push(markersMap)
  1272. // cameraAccount: "1"
  1273. // cameraCode: "1000010"
  1274. // cameraFactory: "2"
  1275. // cameraIp: "1"
  1276. // cameraName: "2"
  1277. // cameraPasword: "2"
  1278. // cameraPort: 2
  1279. // cameraRadius: 20
  1280. // cameraRegion: "3"
  1281. // dataDeptId: null
  1282. // dataStatus: null
  1283. // eventType: null
  1284. // height: "11"
  1285. // id: "0d165fc362514f79b12a899ea66295fd"
  1286. // latitude: "49.325625"
  1287. // longitude: "125.3333"
  1288. }
  1289. setTimeout(() => {
  1290. that.$refs.supermap.clearM();
  1291. that.$refs.supermap.clearMRadius()
  1292. that.$refs.supermap.setMarkersRadius(this.cameraMarkersList)
  1293. }, 3000)
  1294. } else {
  1295. setTimeout(() => {
  1296. that.$refs.supermap.clearM();
  1297. that.$refs.supermap.clearMRadius()
  1298. }, 1000)
  1299. }
  1300. })
  1301. },
  1302. dropLocation(lat, lng, index) {
  1303. this.listCurrentIndex2 = index
  1304. this.$refs.supermap.dropLocation(lat, lng, 15)
  1305. },
  1306. selectCameraByDeptId(depId) {
  1307. this.listCurrentIndex1 = depId
  1308. let that = this
  1309. that.cameraMarkersList = []
  1310. that.visuForestCloudCameraBOList = []
  1311. selectCameraByDeptId(depId).then(res => {
  1312. //根据设备类型查看列表
  1313. that.visuForestCloudCameraBOList = res.data
  1314. that.visuForestCloudCameraBOListSearch = res.data
  1315. if (res.data != null && res.data.length > 0) {
  1316. for (let i = 0; i < res.data.length; i++) {
  1317. let markersMap = {
  1318. lng: 124.59,
  1319. lat: 43.02,
  1320. icon: 'camera',
  1321. bindPopupHtml: '',
  1322. click: 'preview',
  1323. parameter: '',
  1324. name: i,
  1325. keepBindPopup: false,
  1326. isAggregation: false
  1327. }
  1328. if (res.data[i].channelCode != null) {
  1329. markersMap.parameter = {
  1330. code: res.data[i].cameraCode,
  1331. name: res.data[i].cameraName,
  1332. type: res.data[i].cameraFactory
  1333. }
  1334. } else {
  1335. markersMap.parameter = []
  1336. }
  1337. markersMap.lng = res.data[i].longitude
  1338. markersMap.lat = res.data[i].latitude
  1339. markersMap.radius = res.data[i].cameraRadius
  1340. markersMap.bindPopupHtml = '<div class="map-tip">' +
  1341. '<span>' +
  1342. ' <div class="d-l-con">' +
  1343. ' <div class="d-l-l-text">' +
  1344. ' <h4>经纬度:' + res.data[i].longitude + ',' + res.data[i].latitude +
  1345. '</h4>' +
  1346. ' </div>' +
  1347. ' </div>' +
  1348. ' </span>' +
  1349. '<span>' +
  1350. ' <div class="d-l-con">' +
  1351. ' <div class="d-l-l-text">' +
  1352. ' <h4>摄像头名称:' + res.data[i].cameraName + '</h4>' +
  1353. ' </div>' +
  1354. ' </div>' +
  1355. ' </span>' +
  1356. '<span>' +
  1357. ' <div class="d-l-con">' +
  1358. ' <div class="d-l-l-text">' +
  1359. ' <h4>网络运营商:' + (res.data[i].operatorType == "1" ? "联通" : (res.data[i]
  1360. .operatorType == "2" ? "移动" : "电信")) + '</h4>' +
  1361. ' </div>' +
  1362. ' </div>' +
  1363. ' </span>' +
  1364. '<span>' +
  1365. ' <div class="d-l-con">' +
  1366. ' <div class="d-l-l-text">' +
  1367. ' <h4>摄像头半径:' + res.data[i]
  1368. .cameraRadius + '米</h4>' +
  1369. ' </div>' +
  1370. ' </div>' +
  1371. ' </span>' +
  1372. '</div>'
  1373. this.cameraMarkersList.push(markersMap)
  1374. }
  1375. setTimeout(() => {
  1376. that.$refs.supermap.clearMRadius()
  1377. that.$refs.supermap.clearM();
  1378. that.$refs.supermap.setMarkersRadius(this.cameraMarkersList)
  1379. }, 3000)
  1380. } else {
  1381. setTimeout(() => {
  1382. that.$refs.supermap.clearM();
  1383. that.$refs.supermap.clearMRadius()
  1384. }, 1000)
  1385. }
  1386. })
  1387. },
  1388. //吉祥物收起左右框
  1389. indent() {
  1390. let list = document.getElementsByClassName('el-tooltip__popper')
  1391. list[list.length - 1].style.display = 'none'
  1392. if (this.indentStyle == '') {
  1393. this.indentStyle = 'indent-style'
  1394. this.indentleft = 'indent-left'
  1395. this.indentright = 'indent-right'
  1396. this.indentText = '展开左右栏'
  1397. } else if (this.indentText == '展开左右栏') {
  1398. this.indentStyle = ''
  1399. this.indentleft = ''
  1400. this.indentright = ''
  1401. this.indentText = '收起左右栏'
  1402. }
  1403. },
  1404. /** ----------------------------------摄像头预览开始------------------------------------- */
  1405. alertLogin: function() {
  1406. this.$modal.msg('登录中....')
  1407. },
  1408. alertLoginSuccess: function() {
  1409. this.$modal.msgSuccess('登录成功!')
  1410. },
  1411. alertLoginFailed: function() {
  1412. this.$modal.msgError('登陆失败!')
  1413. },
  1414. alertReinstall: function() {
  1415. this.$modal.msgWarning('请重新安装客户端')
  1416. },
  1417. cancelEventLocationShow() {
  1418. if (this.oWebControl != null) {
  1419. this.oWebControl.JS_HideWnd() // 先让窗口隐藏,规避可能的插件窗口滞后于浏览器消失问题
  1420. this.oWebControl.JS_Disconnect().then(function() { // 断开与插件服务连接成功
  1421. },
  1422. function() { // 断开与插件服务连接失败
  1423. })
  1424. }
  1425. },
  1426. /** 预览按钮操作 */
  1427. preview(cameraParam) {
  1428. this.showTVWall(cameraParam.code, cameraParam.name);
  1429. },
  1430. /** 预览按钮操作 */
  1431. preview_废弃(cameraParam) {
  1432. if (cameraParam.type == '1') {
  1433. getDahuaVideoServer().then(newResponse => {
  1434. console.log(newResponse)
  1435. this.ws.detectConnectQt().then(res => {
  1436. if (res) { // 连接客户端成功
  1437. this.alertLogin()
  1438. this.ws.login({
  1439. loginIp: newResponse.loginIp,
  1440. loginPort: newResponse.loginPort,
  1441. userName: newResponse.userName,
  1442. userPwd: newResponse.userPwd,
  1443. token: '',
  1444. https: 1
  1445. })
  1446. this.ws.on('loginState', (res) => {
  1447. this.isLogin = res
  1448. console.log('---res-----', res)
  1449. if (res) {
  1450. this.alertLoginSuccess()
  1451. this.activePanel = 'key2'
  1452. this.realTimeVideoDialog(cameraParam.code)
  1453. } else {
  1454. this.alertLoginFailed()
  1455. }
  1456. })
  1457. } else { // 连接客户端失败
  1458. this.alertReinstall()
  1459. }
  1460. })
  1461. })
  1462. } else if (cameraParam.type == '0') {
  1463. let that = this
  1464. that.cameraVisible = true
  1465. getHaiKangVideoServer({
  1466. cameraCode: cameraParam.code
  1467. }).then(newResponse => {
  1468. that.cameraTitle = '摄像头-' + newResponse.data.cameraName
  1469. that.initPlugin(newResponse.data.appkey, newResponse.data.loginIp, newResponse.data.secret, newResponse
  1470. .data.loginPort)
  1471. setTimeout(function() {
  1472. that.playhk(newResponse.data.channelCode)
  1473. }, 5000)
  1474. })
  1475. }
  1476. },
  1477. realTimeVideoDialog(cameraParams) { // 调用弹窗实时播放接口
  1478. if (!this.isLogin) {
  1479. this.$Message.info('正在登陆客户端,请稍等......')
  1480. return false
  1481. }
  1482. const params = [cameraParams];
  1483. this.ws.openVideo(params)
  1484. },
  1485. /** ----------------------------------摄像头预览结束------------------------------------- */
  1486. /** ----------------------------------海康摄像头预览开始------------------------------------- */
  1487. // 创建播放实例
  1488. initPlugin(newappkey, newloginIp, newsecret, newloginPort) {
  1489. let that = this
  1490. that.oWebControl = new WebControl({
  1491. szPluginContainer: 'playWnd', // 指定容器id
  1492. iServicePortStart: 15900, // 指定起止端口号,建议使用该值
  1493. iServicePortEnd: 15909,
  1494. szClassId: '23BF3B0A-2C56-4D97-9C03-0CB103AA8F11', // 用于IE10使用ActiveX的clsid
  1495. cbConnectSuccess: function() { // 创建WebControl实例成功
  1496. that.oWebControl.JS_StartService('window', { // WebControl实例创建成功后需要启动服务
  1497. dllPath: './VideoPluginConnect.dll' // 值"./VideoPluginConnect.dll"写死
  1498. }).then(function() { // 启动插件服务成功
  1499. that.oWebControl.JS_SetWindowControlCallback({ // 设置消息回调
  1500. cbIntegrationCallBack: cbIntegrationCallBack
  1501. })
  1502. that.oWebControl.JS_CreateWnd('playWnd', 1020, 600).then(
  1503. function() { //JS_CreateWnd创建视频播放窗口,宽高可设定
  1504. that.init(newappkey, newloginIp, newsecret, newloginPort) // 创建播放实例成功后初始化
  1505. })
  1506. }, function() { // 启动插件服务失败
  1507. })
  1508. },
  1509. cbConnectError: function() { // 创建WebControl实例失败
  1510. that.oWebControl = null
  1511. $('#playWnd').html('插件未启动,正在尝试启动,请稍候...<a href="./hk/VideoWebPlugin.exe">点击下载插件</a>')
  1512. WebControl.JS_WakeUp('VideoWebPlugin://') // 程序未启动时执行error函数,采用wakeup来启动程序
  1513. initCount++
  1514. if (initCount < 3) {
  1515. setTimeout(function() {
  1516. that.initPlugin(newappkey, newloginIp, newsecret, newloginPort)
  1517. }, 3000)
  1518. } else {
  1519. $('#playWnd').html('插件启动失败,请检查插件是否安装!<a href="./hk/VideoWebPlugin.exe">点击下载插件</a>')
  1520. }
  1521. },
  1522. cbConnectClose: function(bNormalClose) {
  1523. // 异常断开:bNormalClose = false
  1524. // JS_Disconnect正常断开:bNormalClose = true
  1525. console.log('cbConnectClose')
  1526. that.oWebControl = null
  1527. }
  1528. })
  1529. },
  1530. //播放海康摄像头
  1531. playhk(channelCode) {
  1532. var cameraIndexCode = channelCode //获取输入的监控点编号值,必填
  1533. var streamMode = 0 //主子码流标识:0-主码流,1-子码流
  1534. var transMode = 1 //传输协议:0-UDP,1-TCP
  1535. var gpuMode = 0 //是否启用GPU硬解,0-不启用,1-启用
  1536. var wndId = -1 //播放窗口序号(在2x2以上布局下可指定播放窗口)
  1537. cameraIndexCode = cameraIndexCode.replace(/(^\s*)/g, '')
  1538. cameraIndexCode = cameraIndexCode.replace(/(\s*$)/g, '')
  1539. this.oWebControl.JS_RequestInterface({
  1540. funcName: 'startPreview',
  1541. argument: JSON.stringify({
  1542. cameraIndexCode: cameraIndexCode, //监控点编号
  1543. streamMode: streamMode, //主子码流标识
  1544. transMode: transMode, //传输协议
  1545. gpuMode: gpuMode, //是否开启GPU硬解
  1546. wndId: wndId //可指定播放窗口
  1547. })
  1548. })
  1549. },
  1550. //初始化
  1551. init(newappkey, newloginIp, newsecret, newloginPort) {
  1552. let that = this
  1553. that.getPubKey(function() {
  1554. ////////////////////////////////// 请自行修改以下变量值 ////////////////////////////////////
  1555. var appkey = newappkey //综合安防管理平台提供的appkey,必填
  1556. var secret = that.setEncrypt(newsecret) //综合安防管理平台提供的secret,必填
  1557. var ip = newloginIp //综合安防管理平台IP地址,必填
  1558. var playMode = 0 //初始播放模式:0-预览,1-回放
  1559. var port = Number(newloginPort) //综合安防管理平台端口,若启用HTTPS协议,默认443
  1560. var snapDir = 'D:\\SnapDir' //抓图存储路径
  1561. var videoDir = 'D:\\VideoDir' //紧急录像或录像剪辑存储路径
  1562. var layout = '1x1' //playMode指定模式的布局
  1563. var enableHTTPS = 1 //是否启用HTTPS协议与综合安防管理平台交互,这里总是填1
  1564. var encryptedFields = 'secret' //加密字段,默认加密领域为secret
  1565. var showToolbar = 1 //是否显示工具栏,0-不显示,非0-显示
  1566. var showSmart = 1 //是否显示智能信息(如配置移动侦测后画面上的线框),0-不显示,非0-显示
  1567. var buttonIDs = '0,16,256,257,258,259,260,512,513,514,515,516,517,768,769' //自定义工具条按钮
  1568. ////////////////////////////////// 请自行修改以上变量值 ////////////////////////////////////
  1569. that.oWebControl.JS_RequestInterface({
  1570. funcName: 'init',
  1571. argument: JSON.stringify({
  1572. appkey: appkey, //API网关提供的appkey
  1573. secret: secret, //API网关提供的secret
  1574. ip: ip, //API网关IP地址
  1575. playMode: playMode, //播放模式(决定显示预览还是回放界面)
  1576. port: port, //端口
  1577. snapDir: snapDir, //抓图存储路径
  1578. videoDir: videoDir, //紧急录像或录像剪辑存储路径
  1579. layout: layout, //布局
  1580. enableHTTPS: enableHTTPS, //是否启用HTTPS协议
  1581. encryptedFields: encryptedFields, //加密字段
  1582. showToolbar: showToolbar, //是否显示工具栏
  1583. showSmart: showSmart, //是否显示智能信息
  1584. buttonIDs: buttonIDs //自定义工具条按钮
  1585. })
  1586. }).then(function(oData) {
  1587. that.oWebControl.JS_Resize(1020, 600) // 初始化后resize一次,规避firefox下首次显示窗口后插件窗口未与DIV窗口重合问题
  1588. })
  1589. })
  1590. },
  1591. //获取公钥
  1592. getPubKey(callback) {
  1593. let that = this
  1594. that.oWebControl.JS_RequestInterface({
  1595. funcName: 'getRSAPubKey',
  1596. argument: JSON.stringify({
  1597. keyLength: 1024
  1598. })
  1599. }).then(function(oData) {
  1600. console.log(oData)
  1601. if (oData.responseMsg.data) {
  1602. that.pubKey = oData.responseMsg.data
  1603. callback()
  1604. }
  1605. })
  1606. },
  1607. //RSA加密
  1608. setEncrypt(value) {
  1609. var encrypt = new JSEncrypt()
  1610. encrypt.setPublicKey(this.pubKey)
  1611. return encrypt.encrypt(value)
  1612. },
  1613. /** ----------------------------------海康摄像头预览结束------------------------------------- */
  1614. }
  1615. }
  1616. // 推送消息
  1617. function cbIntegrationCallBack(oData) {
  1618. console.log(JSON.stringify(oData.responseMsg))
  1619. }
  1620. </script>
  1621. <style rel="stylesheet/scss" lang="scss" scoped>
  1622. @import '@/assets/styles/base.scss';
  1623. .playWnd {
  1624. margin: 4px 0 0 8px;
  1625. width: 1020px;
  1626. /*播放容器的宽和高设定*/
  1627. height: 600px;
  1628. border: 1px solid red;
  1629. }
  1630. </style>