monitor.vue 63 KB

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