monitor.vue 63 KB

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