monitor.vue 63 KB

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