monitor.vue 69 KB

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