monitor.vue 63 KB

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