monitor.vue 69 KB

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