emergencyEvacuationBig.vue 30 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990
  1. <!--应急疏散大屏-->
  2. <template>
  3. <div class="emergencyEvacuationBig scrollbar-box">
  4. <div class="top-max-title-box">
  5. <p>{{title}}<span>{{minTitle}}</span></p>
  6. <!--<p class="inquire-button-one" @click="clickClosure">{{evacuationType?'执行疏散':'结束疏散'}}</p>-->
  7. <p></p>
  8. <p></p>
  9. <p class="reset-button-one" v-if="buttonType" @click="goAllBig"><i class="el-icon-full-screen" style="margin-right:10px;"></i>全屏</p>
  10. <p class="reset-button-one" v-if="!buttonType" @click="clickBack"><i class="el-icon-full-screen" style="margin-right:10px;"></i>退出全屏</p>
  11. <p class="reset-button-one" style="margin-left:20px;" v-if="buttonType" @click="backButton">返回</p>
  12. </div>
  13. <div class="video-max-box">
  14. <div class="video-for-box" v-for="(item,index) in videoList" :key="index">
  15. <div class="video-for-title-box">
  16. <div class="video-for-title">{{item.name}}</div>
  17. <div class="video-for-button" @click="videoFullScreen(index)">
  18. <img src="@/assets/newImages/icon_monitor_enlarge.png">
  19. </div>
  20. </div>
  21. <video class="video-box" :id="item.divId" ref="videoRef" autoplay controls muted width="610px" height="429px"></video>
  22. </div>
  23. </div>
  24. <pagination
  25. layout="total, prev, pager, next, jumper"
  26. style="margin:0 40px 50px;"
  27. v-show="videoMaxNum>0"
  28. :page-sizes="[4]"
  29. :total="videoMaxNum"
  30. :page.sync="videoPage"
  31. :limit.sync="videoPageSize"
  32. @pagination="videoPageNumButton"
  33. />
  34. <div class="map-max-box">
  35. <div class="map-left-box">
  36. <!--<div class="max-title-box">-->
  37. <!--<p>{{minTitle}}</p>-->
  38. <!--<p>疏散路径:</p>-->
  39. <!--<el-select v-model="value" placeholder="请选择" @change="lineEvacuate">-->
  40. <!--<el-option-->
  41. <!--v-for="item in routeList"-->
  42. <!--:key="item.id"-->
  43. <!--:label="item.name"-->
  44. <!--:value="item.id">-->
  45. <!--</el-option>-->
  46. <!--</el-select>-->
  47. <!--</div>-->
  48. <div class="map-big-box">
  49. <div class="map-min-box">
  50. <div class="map-min-for-box" :class="item.subjectId == subId?'map-min-for-box-color':''"
  51. v-for="(item,index) in fjList" :key="index">
  52. {{item.room}}
  53. </div>
  54. <img class="map-min-img" src="@/assets/ZDimages/icon_zjt.gif" v-show="lightList[0].type">
  55. <img class="map-min-img" src="@/assets/ZDimages/icon_yjt.gif" v-show="lightList[1].type">
  56. <img class="map-min-img" src="@/assets/ZDimages/icon_zjt.gif" v-show="lightList[2].type">
  57. <img class="map-min-img" src="@/assets/ZDimages/icon_yjt.gif" v-show="lightList[3].type">
  58. <img class="map-min-img" src="@/assets/ZDimages/icon_zjt.gif" v-show="lightList[4].type">
  59. <img class="map-min-img" src="@/assets/ZDimages/icon_yjt.gif" v-show="lightList[5].type">
  60. </div>
  61. </div>
  62. </div>
  63. <div class="map-right-box">
  64. <div class="bottom-max-box">
  65. <div class="select-button-box">
  66. <p class="select-button-title">疏散路径:</p>
  67. <div class="select-button-min-box">
  68. <el-select v-model="value" placeholder="请选择" @change="lineEvacuate" style="flex:1;">
  69. <el-option
  70. v-for="item in routeList"
  71. :key="item.id"
  72. :label="item.name"
  73. :value="item.id">
  74. </el-option>
  75. </el-select>
  76. <p class="inquire-button-one" @click="clickClosure">{{evacuationType?'执行疏散':'结束疏散'}}</p>
  77. </div>
  78. </div>
  79. <div class="select-button-box">
  80. <p class="select-button-title">疏散喇叭:</p>
  81. <div class="top-for-max-box">
  82. <div class="top-for-min-box" @click="trumpetClick(item)"
  83. :class="item.type?'for-color-a':'for-color-b'"
  84. v-for="(item,index) in trumpetList" :key="index">
  85. {{item.name}}
  86. <img v-if="item.type" src="@/assets/ZDimages/icon_30.png">
  87. </div>
  88. </div>
  89. </div>
  90. <div class="scrollbar-list scrollbar-box">
  91. <div class="for-scrollbar-box" v-for="(item,index) in informationList" :key="index">
  92. <p>{{item.date}}</p>
  93. <p>{{item.text}}</p>
  94. </div>
  95. <p v-if="!informationList[0]" style="line-height:40px;text-align: center;color:#999;font-size:14px;">暂无喇叭数据</p>
  96. </div>
  97. <div class="bottom-input-text-box">
  98. <el-input
  99. type="textarea"
  100. :rows="4"
  101. resize='none'
  102. maxLength="100"
  103. placeholder="请输入播报内容"
  104. v-model="textarea">
  105. </el-input>
  106. </div>
  107. <p class="bottom-button-p" @click="textParseUrlIps">发送</p>
  108. </div>
  109. </div>
  110. </div>
  111. </div>
  112. </template>
  113. <script>
  114. import { lablayout, lineEvacuateTow } from "@/api/laboratory/emergencyEvacuation";
  115. import { getListStatus } from '@/api/bigData/index.js'
  116. import flvjs from 'flv.js'
  117. import { evacuate, closure, lineEvacuate, IntelligentGuidance,getRedis,getDeviceList,textParseUrlIps,getCameraByFloor,startUrlJiNanDaXue,startUrl } from '@/api/executeThePlan.js'
  118. import mqtt from 'mqtt'
  119. export default {
  120. name: 'emergencyEvacuationBig',
  121. props:{
  122. routerType:{},
  123. },
  124. data() {
  125. return {
  126. mtopic:"lab/exit/line",
  127. client:{},
  128. buttonType:false,
  129. subId:"",
  130. type:"",
  131. value:"0",
  132. title:"",
  133. minTitle:"环境与测绘大楼1F",
  134. //疏散方向数据
  135. routeList:[
  136. {
  137. id:"1",
  138. name:"向左疏散",
  139. },
  140. {
  141. id:"2",
  142. name:"向右疏散",
  143. },
  144. {
  145. id:"0",
  146. name:"两侧疏散",
  147. },
  148. ],
  149. //监控列表
  150. videoNewList:[],
  151. videoList:[],
  152. //房间列表
  153. fjList:[],
  154. //灯列表
  155. lightList:[
  156. {
  157. id:"5",
  158. type:false,
  159. },
  160. {
  161. id:"2",
  162. type:false,
  163. },
  164. {
  165. id:"3",
  166. type:false,
  167. },
  168. {
  169. id:"4",
  170. type:false,
  171. },
  172. {
  173. id:"1",
  174. type:false,
  175. },
  176. {
  177. id:"6",
  178. type:false,
  179. },
  180. ],
  181. //喇叭列表
  182. trumpetList:[],
  183. //消息列表
  184. informationList:[],
  185. textarea:"",
  186. evacuationType:false,
  187. //视频数据
  188. videoMaxNum:0,
  189. videoPage:1,
  190. videoPageSize:4,
  191. videoPageList:[],
  192. }
  193. },
  194. created(){
  195. this.getRedis();
  196. //判断入口是否全屏路由地址
  197. if(this.routerType){
  198. //应急疏散页面进入
  199. this.buttonType = true;
  200. }else {
  201. //预案报警进入
  202. this.buttonType = false;
  203. }
  204. this.lablayout();
  205. },
  206. mounted(){
  207. this.subscriptionMQTT();
  208. this.getDeviceList();
  209. },
  210. methods:{
  211. //获取实验室的疏散数据
  212. lineEvacuateTow(id,type){
  213. lineEvacuateTow(id,type).then(response => {
  214. this.initialization(response.data);
  215. });
  216. },
  217. getCameraByFloor(){
  218. getCameraByFloor({floorId:5}).then(response => {
  219. this.startUrl(response.data);
  220. });
  221. },
  222. //文字转语音播放
  223. textParseUrlIps(){
  224. let self = this;
  225. let num = 0;
  226. let newList = [];
  227. for(let i=0;i<self.trumpetList.length;i++){
  228. if(self.trumpetList[i].type){
  229. let obj = {
  230. sn:self.trumpetList[i].deviceSn,
  231. port:self.trumpetList[i].port,
  232. type:"",
  233. name:"",
  234. speed:"",
  235. params:{
  236. tid:"",
  237. vol:"",
  238. urls:[]
  239. }
  240. };
  241. newList.push(obj);
  242. num++
  243. }
  244. }
  245. if(num == 0){
  246. this.msgError("请选择要播放的喇叭")
  247. return
  248. }
  249. if(!this.textarea){
  250. this.msgError("请输入要播放的内容")
  251. return
  252. }
  253. textParseUrlIps(newList,this.textarea).then(response => {
  254. console.log('response',response);
  255. this.textarea = "";
  256. let newObj = {
  257. date:response.data.date,
  258. text:response.data.text,
  259. };
  260. this.informationList.push(newObj);
  261. this.msgSuccess("操作成功")
  262. });
  263. },
  264. //喇叭选中
  265. trumpetClick(item){
  266. item.type = !item.type;
  267. },
  268. //获取喇叭列表
  269. getDeviceList(){
  270. let obj ={
  271. floorId:5,
  272. page:1,
  273. pageSize:100,
  274. };
  275. getDeviceList(obj).then(response => {
  276. for(let i=0;i<response.data.length;i++){
  277. response.data[i].type = false;
  278. }
  279. this.$set(this,'trumpetList',response.data)
  280. });
  281. },
  282. //MQTT订阅
  283. subscriptionMQTT(){
  284. let self = this;
  285. this.client = mqtt.connect(process.env.VUE_APP_BASE_MQTT_API, {
  286. username: process.env.VUE_APP_BASE_MQTT_USERNAME,
  287. password: process.env.VUE_APP_BASE_MQTT_PASSWORD
  288. });
  289. this.client.on("connect", e =>{
  290. console.log("连接成功");
  291. this.client.subscribe(this.mtopic, (err) => {
  292. if (!err) {
  293. console.log("订阅成功:" + this.mtopic);
  294. }
  295. });
  296. });
  297. this.client.on("message", (topic, message) => {
  298. if (message){
  299. let data = JSON.parse(message)
  300. if(topic == this.mtopic){
  301. console.log("应急疏散数据变更",data);
  302. //应急疏散数据变更
  303. if(data.data.EXIT_LINE_MESSAGE){
  304. this.evacuate();
  305. self.evacuationType = false;
  306. }else{
  307. if(self.evacuationType){
  308. self.msgSuccess("应急疏散已结束");
  309. }
  310. self.evacuationType = true;
  311. // self.$router.push({
  312. // path: "/emergencyManagement/evacuation/performEvacuation"
  313. // })
  314. // this.$parent.backPage();
  315. }
  316. }
  317. }
  318. });
  319. },
  320. //获取当前疏散状态
  321. getRedis(){
  322. let self = this;
  323. getRedis().then( data => {
  324. if(data.data){
  325. this.subId = data.data.subId;
  326. this.title = data.data.subName;
  327. this.evacuationType = false;
  328. this.evacuate();
  329. }else{
  330. if(localStorage.getItem('evacuationSubId')){
  331. this.subId = localStorage.getItem('evacuationSubId');
  332. this.title = localStorage.getItem('evacuationTitel');
  333. localStorage.removeItem('evacuationSubId')
  334. localStorage.removeItem('evacuationTitel')
  335. }else{
  336. this.subId = this.$route.query.subId;
  337. this.title = this.$route.query.text;
  338. }
  339. this.evacuationType = true;
  340. this.lineEvacuateTow(this.subId,0);
  341. }
  342. });
  343. },
  344. //获取实验室数据
  345. lablayout(){
  346. let self = this;
  347. let id = 137;
  348. lablayout(id).then(response => {
  349. for(let i=0;i<response.data.length;i++){
  350. if(response.data[i].id == 5){
  351. self.fjList = response.data[i].list;
  352. }
  353. }
  354. });
  355. },
  356. //执行预案
  357. evacuate(){
  358. let self = this;
  359. evacuate(this.subId).then( data => {
  360. if(data.code == 200){
  361. if(data.data){
  362. this.initialization(data.data);
  363. }
  364. }
  365. });
  366. },
  367. //结束预案
  368. clickClosure(){
  369. let self = this;
  370. if (this.evacuationType){
  371. this.$confirm('是否确认执行疏散?', "警告", {
  372. confirmButtonText: "确定",
  373. cancelButtonText: "取消",
  374. type: "warning"
  375. }).then(function() {
  376. self.lineEvacuate(0);
  377. }).then(() => {
  378. }).catch(() => {});
  379. } else {
  380. this.$confirm('是否确认结束疏散?', "警告", {
  381. confirmButtonText: "确定",
  382. cancelButtonText: "取消",
  383. type: "warning"
  384. }).then(function() {
  385. self.closure();
  386. }).then(() => {
  387. }).catch(() => {});
  388. }
  389. },
  390. closure(){
  391. let self = this;
  392. closure(this.subId).then( data => {
  393. if(data.code == 200){
  394. this.evacuationType = true;
  395. self.msgSuccess("操作成功")
  396. // self.$router.push({
  397. // path: "/emergencyManagement/evacuation/performEvacuation"
  398. // })
  399. // this.$parent.backPage();
  400. console.log("结束",data)
  401. }
  402. });
  403. },
  404. //切换线路
  405. lineEvacuate(e){
  406. let self = this;
  407. lineEvacuate(this.subId,e).then( data => {
  408. if(data.code == 200){
  409. self.msgSuccess("操作成功")
  410. if(data.data){
  411. this.initialization(data.data);
  412. this.evacuationType = false;
  413. }
  414. }
  415. });
  416. },
  417. //灯初始化
  418. initialization(list){
  419. let self = this;
  420. let newList = [
  421. {
  422. id:"5",
  423. type:false,
  424. },
  425. {
  426. id:"2",
  427. type:false,
  428. },
  429. {
  430. id:"3",
  431. type:false,
  432. },
  433. {
  434. id:"4",
  435. type:false,
  436. },
  437. {
  438. id:"1",
  439. type:false,
  440. },
  441. {
  442. id:"6",
  443. type:false,
  444. },
  445. ];
  446. for(let i=0;i<list.length;i++){
  447. for(let o=0;o<newList.length;o++){
  448. if(list[i].lightId == newList[o].id){
  449. newList[o].type = true;
  450. }
  451. }
  452. }
  453. this.lightList = newList;
  454. this.getCameraByFloor();
  455. },
  456. goAllBig(){
  457. this.$router.push({
  458. path: "/emergencyEvacuationBig",
  459. query: {
  460. subId: this.subId,
  461. text:this.title,
  462. type:"2",
  463. }
  464. })
  465. },
  466. //返回方法
  467. clickBack(){
  468. let self = this;
  469. self.$router.push({
  470. path: "/emergencyManagement/evacuation/performEvacuation",
  471. query: {
  472. subId: self.subId,
  473. text:self.title,
  474. }
  475. })
  476. },
  477. //返回按钮
  478. backButton(){
  479. let self = this;
  480. for(let i=0;i<self.videoNewList.length;i++){
  481. self.videoNewList[i].flvPlayer.pause();
  482. self.videoNewList[i].flvPlayer.unload();
  483. self.videoNewList[i].flvPlayer.detachMediaElement();
  484. self.videoNewList[i].flvPlayer.destroy();
  485. self.videoNewList[i].flvPlayer = null
  486. }
  487. this.$set(this,'videoNewList',[]);
  488. this.$parent.goPage(1);
  489. },
  490. //视屏全屏方法
  491. videoFullScreen(index){
  492. this.$refs.videoRef[index].webkitRequestFullScreen();
  493. },
  494. //获取摄像头地址
  495. async startUrl(rows){
  496. let self = this;
  497. let list = "";
  498. for(let i=0;i<rows.length;i++){
  499. list = list + rows[i]+","
  500. }
  501. let obj = {
  502. page:"1",
  503. count:"100",
  504. deviceIds:list,
  505. };
  506. let urlText = window.location.href;
  507. if(urlText.indexOf("192.168") != -1){
  508. const { data } = await startUrl(obj);
  509. if(data){
  510. self.videoPageList = [];
  511. for(let i=0;i<data.length;i++){
  512. let obj = {
  513. divId:'divId'+i,
  514. hasAudio:false,
  515. height:false,
  516. videoError:"",
  517. videoUrl:data[i].result.body.data.ws_flv,
  518. }
  519. self.videoPageList.push(obj)
  520. }
  521. this.videoMaxNum = this.videoPageList.length
  522. this.videoPageNumButton({page:1,limit:4});
  523. }
  524. } else {
  525. const { data } = await startUrlJiNanDaXue(obj);
  526. if(data){
  527. self.videoPageList = [];
  528. for(let i=0;i<data.length;i++){
  529. let text = 'ws://lab.sxitdlc.com/jinandaxue/stream/';
  530. let url = data[i].result.body.data.ws_flv;
  531. url = url.split("rtp/");
  532. let newUrl = text+'rtp/'+url[1];
  533. let obj = {
  534. divId:'divId'+i,
  535. hasAudio:false,
  536. height:false,
  537. videoError:"",
  538. videoUrl:newUrl,
  539. }
  540. self.videoPageList.push(obj)
  541. }
  542. this.videoMaxNum = this.videoPageList.length
  543. this.videoPageNumButton({page:1,limit:4});
  544. }
  545. }
  546. },
  547. //视频翻页处理
  548. videoPageNumButton(val){
  549. this.loading = true;
  550. let self = this;
  551. //清除已有播放流
  552. if(self.videoNewList[0]){
  553. for(let i=0;i<self.videoNewList.length;i++){
  554. self.videoNewList[i].flvPlayer.pause();
  555. self.videoNewList[i].flvPlayer.unload();
  556. self.videoNewList[i].flvPlayer.detachMediaElement();
  557. self.videoNewList[i].flvPlayer.destroy();
  558. self.videoNewList[i].flvPlayer = null;
  559. }
  560. self.videoNewList = [];
  561. }
  562. //计算新数据
  563. let num = 0;
  564. let numMax = val.page * val.limit;
  565. if(val.page!=0){
  566. num = ( val.page - 1 ) * val.limit
  567. }
  568. if(numMax>self.videoPageList.length){
  569. numMax = self.videoPageList.length;
  570. }
  571. let list = [];
  572. for(let i=num;i<numMax;i++){
  573. list.push(self.videoPageList[i]);
  574. }
  575. this.$set(this,'videoList',list);
  576. setTimeout(function(){
  577. self.videoPlay();
  578. },500);
  579. },
  580. videoPlay(){
  581. let self = this;
  582. this.loading = false;
  583. for(let i=0;i<self.videoList.length;i++){
  584. let obj = {
  585. player :{},
  586. flvPlayer:{}
  587. };
  588. obj.player = document.getElementById(self.videoList[i].divId);
  589. obj.flvPlayer = flvjs.createPlayer(
  590. {
  591. // isLive: true, //=> 是否为直播流
  592. // hasAudio: false, //=> 是否开启声音
  593. type: 'flv', //媒体类型 flv 或 mp4
  594. url: self.videoList[i].videoUrl //视频流地址
  595. },
  596. {
  597. enableStashBuffer: true,//启用 IO 存储缓冲区。 如果您需要实时流播放(最小延迟),请设置为 false,但如果存在网络抖动,则可能会停止。
  598. stashInitialSize: 128,//IO 存储缓冲区初始大小。 默认值为 384KB。 指示合适的大小可以改善视频加载/搜索时间。
  599. isLive: true,//是否是直播
  600. lazyLoadRecoverDuration: 30,//指示以秒为单位的lazyLoad 恢复时间边界。
  601. autoCleanupSourceBuffer: true,//进行自动清理
  602. autoCleanupMaxBackwardDuration: 3 * 60,//3 * 60 当向后缓冲持续时间超过这个值(以秒为单位)时,对 SourceBuffer 进行自动清理
  603. autoCleanupMinBackwardDuration: 2 * 60,//2 * 60 指示在执行自动清理时为后向缓冲区保留的持续时间(以秒为单位)。
  604. }
  605. );
  606. self.videoNewList.push(obj);
  607. // }
  608. console.log("i",i)
  609. }
  610. for(let i=0;i<self.videoNewList.length;i++){
  611. self.videoNewList[i].flvPlayer.attachMediaElement(self.videoNewList[i].player);
  612. self.videoNewList[i].flvPlayer.load(); //加载
  613. self.videoNewList[i].flvPlayer.play(); //加载
  614. }
  615. },
  616. videoFunction(){
  617. let self = this;
  618. // self.videoList = [];
  619. for(let i=0;i<self.checkedSubject.videoData.length;i++){
  620. let obj = {
  621. player :{},
  622. flvPlayer:{}
  623. };
  624. obj.player = document.getElementById(self.checkedSubject.videoData[i].divId);
  625. // if (flvjs.isSupported()) {
  626. obj.flvPlayer = flvjs.createPlayer(
  627. {
  628. // isLive: true, //=> 是否为直播流
  629. // hasAudio: false, //=> 是否开启声音
  630. type: self.checkedSubject.videoData[i].videoType, //媒体类型 flv 或 mp4
  631. url: self.checkedSubject.videoData[i].url //视频流地址
  632. },
  633. {
  634. enableStashBuffer: true,//启用 IO 存储缓冲区。 如果您需要实时流播放(最小延迟),请设置为 false,但如果存在网络抖动,则可能会停止。
  635. stashInitialSize: 128,//IO 存储缓冲区初始大小。 默认值为 384KB。 指示合适的大小可以改善视频加载/搜索时间。
  636. isLive: true,//是否是直播
  637. lazyLoadRecoverDuration: 30,//指示以秒为单位的lazyLoad 恢复时间边界。
  638. autoCleanupSourceBuffer: true,//进行自动清理
  639. autoCleanupMaxBackwardDuration: 3 * 60,//3 * 60 当向后缓冲持续时间超过这个值(以秒为单位)时,对 SourceBuffer 进行自动清理
  640. autoCleanupMinBackwardDuration: 2 * 60,//2 * 60 指示在执行自动清理时为后向缓冲区保留的持续时间(以秒为单位)。
  641. }
  642. );
  643. self.videoList.push(obj);
  644. // }
  645. console.log("i",i)
  646. }
  647. for(let i=0;i<self.videoList.length;i++){
  648. self.videoList[i].flvPlayer.attachMediaElement(self.videoList[i].player);
  649. self.videoList[i].flvPlayer.load(); //加载
  650. self.videoList[i].flvPlayer.play(); //加载
  651. }
  652. },
  653. //取消订阅关闭MQTT连接
  654. offMQTT(){
  655. this.client.unsubscribe(this.mtopic, error => {
  656. if (error) {
  657. console.log('Unsubscribe error', error)
  658. }
  659. })
  660. this.client.end();
  661. this.client = {};
  662. },
  663. },
  664. beforeDestroy() {
  665. //清除定时器
  666. let self = this;
  667. self.offMQTT();
  668. console.log("beforeDestroy");
  669. },
  670. }
  671. </script>
  672. <style scoped lang="scss">
  673. .emergencyEvacuationBig{
  674. height:100%;
  675. width:100%;
  676. display: flex !important;
  677. flex-direction: column;
  678. box-shadow: 0 0 8px 2px rgba(0, 0, 0, 0.1);
  679. overflow-y:scroll;
  680. p{
  681. margin:0;
  682. }
  683. .top-max-title-box{
  684. display: flex;
  685. padding:0 30px;
  686. p{
  687. margin:27px 0;
  688. }
  689. p:nth-child(1){
  690. font-size:18px;
  691. font-weight:700;
  692. color:#0045AF;
  693. line-height:40px;
  694. span{
  695. color:#999;
  696. font-size:14px;
  697. margin-left:20px;
  698. }
  699. }
  700. p:nth-child(2){
  701. margin-left:70px;
  702. width:120px;
  703. }
  704. p:nth-child(3){
  705. flex:1;
  706. }
  707. p:nth-child(4){
  708. width:120px;
  709. }
  710. }
  711. .video-max-box{
  712. .video-for-box{
  713. display: inline-block;
  714. width:348px;
  715. /*height:260px;*/
  716. height:196px;
  717. position: relative;
  718. margin:0 0 30px 30px;
  719. .video-for-title-box{
  720. position: absolute;
  721. top:0;
  722. left:0;
  723. width:348px;
  724. height:40px;
  725. background: rgba(0,0,0,0.2);
  726. display: flex;
  727. z-index:10;
  728. .video-for-title{
  729. flex:1;
  730. color:#fff;
  731. font-size:14px;
  732. line-height:40px;
  733. display: block;
  734. overflow:hidden;
  735. text-overflow:ellipsis;
  736. white-space:nowrap;
  737. padding:0 17px;
  738. }
  739. .video-for-button{
  740. width:40px;
  741. height:40px;
  742. cursor: pointer;
  743. img{
  744. height:20px;
  745. width:20px;
  746. margin:10px;
  747. }
  748. }
  749. }
  750. .video-box{
  751. /*height:260px;*/
  752. height:196px;
  753. width:348px;
  754. }
  755. }
  756. }
  757. .pagination-container{
  758. margin:0;
  759. }
  760. .map-max-box{
  761. flex:1;
  762. margin-left:18px;
  763. display: flex;
  764. .map-left-box{
  765. width:1143px;
  766. .max-title-box{
  767. display: flex;
  768. margin:0 0 25px;
  769. p:nth-child(1){
  770. line-height:40px;
  771. font-size:18px;
  772. font-weight:700;
  773. color:#094CB2;
  774. }
  775. p:nth-child(2){
  776. flex:1;
  777. line-height:40px;
  778. text-align: right;
  779. font-size:16px;
  780. }
  781. }
  782. .map-big-box{
  783. width:1143px;
  784. height:610px;
  785. border:1px solid #E0E0E0;
  786. margin-bottom:20px;
  787. overflow: hidden;
  788. .map-min-box{
  789. height:505px;
  790. width:1133px;
  791. margin:50px auto;
  792. background: url("../assets/ZDimages/icon_bj_syspmtcy.png");
  793. position: relative;
  794. .map-min-for-box{
  795. overflow: hidden;
  796. display: inline-block;
  797. line-height:150px;
  798. text-align: center;
  799. }
  800. .map-min-for-box-color{
  801. background: rgba(0,189,255,0.3);
  802. }
  803. .map-min-for-box:nth-child(1){
  804. margin:6px 0 0 2px;
  805. width:136px;
  806. height:173px;
  807. }
  808. .map-min-for-box:nth-child(2){
  809. margin:6px 0 0 154px;
  810. width:172px;
  811. height:173px;
  812. }
  813. .map-min-for-box:nth-child(3){
  814. margin:6px 500px 0 2px;
  815. width:119px;
  816. height:173px;
  817. }
  818. .map-min-for-box:nth-child(4){
  819. margin:143px 0 0 164px;
  820. width:300px;
  821. height:173px;
  822. }
  823. .map-min-for-box:nth-child(5){
  824. margin:143px 0 0 2px;
  825. width:118px;
  826. height:173px;
  827. }
  828. .map-min-for-box:nth-child(6){
  829. margin:143px 0 0 2px;
  830. width:102px;
  831. height:173px;
  832. }
  833. .map-min-for-box:nth-child(7){
  834. margin:143px 0 59px 2px;
  835. width:60px;
  836. height:114px;
  837. }
  838. .map-min-for-box:nth-child(8){
  839. margin:143px 0 0 2px;
  840. width:152px;
  841. height:173px;
  842. }
  843. .map-min-for-box:nth-child(9){
  844. margin:143px 0 0 2px;
  845. width:76px;
  846. height:173px;
  847. }
  848. .map-min-for-box:nth-child(10){
  849. margin:143px 0 0 2px;
  850. width:90px;
  851. height:173px;
  852. }
  853. .map-min-img{
  854. position: absolute;
  855. width:40px;
  856. height:28px;
  857. }
  858. .map-min-img:nth-child(11){
  859. top:240px;
  860. left:126px;
  861. }
  862. .map-min-img:nth-child(12){
  863. top:240px;
  864. left:190px;
  865. }
  866. .map-min-img:nth-child(13){
  867. top:240px;
  868. left:424px;
  869. }
  870. .map-min-img:nth-child(14){
  871. top:240px;
  872. left:490px;
  873. }
  874. .map-min-img:nth-child(15){
  875. top:240px;
  876. left:648px;
  877. }
  878. .map-min-img:nth-child(16){
  879. top:240px;
  880. left:716px;
  881. }
  882. }
  883. }
  884. }
  885. .map-right-box{
  886. flex:1;
  887. display: flex;
  888. flex-direction: column;
  889. height:610px;
  890. overflow: hidden;
  891. margin:0 10px 20px;
  892. .top-for-max-box{
  893. margin-left:15px;
  894. .top-for-min-box{
  895. width:110px;
  896. height:40px;
  897. line-height:40px;
  898. font-size:14px;
  899. padding:0 10px;
  900. display: inline-block;
  901. margin:0 13px 18px 0;
  902. border-radius:4px;
  903. cursor: pointer;
  904. position: relative;
  905. overflow: hidden;
  906. img{
  907. width:25px;
  908. height:25px;
  909. position: absolute;
  910. right:0;
  911. bottom:0;
  912. }
  913. }
  914. .for-color-a{
  915. border:1px solid #0183FA;
  916. color:#0183FA;
  917. }
  918. .for-color-b{
  919. border:1px solid #CCCCCC;
  920. color:#CCCCCC;
  921. }
  922. }
  923. .bottom-max-box{
  924. flex:1;
  925. display: flex;
  926. flex-direction: column;
  927. border:1px solid #E0E0E0;
  928. overflow: hidden;
  929. .select-button-box{
  930. font-weight:500;
  931. .select-button-title{
  932. font-size:14px;
  933. margin-left:15px;
  934. line-height:40px;
  935. color:#333;
  936. }
  937. .select-button-min-box{
  938. display: flex;
  939. margin-left:15px;
  940. .inquire-button-one{
  941. margin:0 20px;
  942. width:100px;
  943. font-size:14px;
  944. line-height:40px;
  945. height:40px;
  946. }
  947. }
  948. }
  949. .scrollbar-list{
  950. flex:1;
  951. .for-scrollbar-box{
  952. font-size:14px;
  953. margin:0 15px;
  954. p:nth-child(1){
  955. line-height:40px;
  956. text-align: center;
  957. color:#999;
  958. font-weight:500;
  959. }
  960. p:nth-child(2){
  961. color:#666;
  962. line-height:18px;
  963. font-weight:500;
  964. }
  965. }
  966. }
  967. .bottom-input-text-box{
  968. height:96px;
  969. margin:20px 20px 0;
  970. }
  971. .bottom-button-p{
  972. background:#0183FA;
  973. color:#fff;
  974. font-size:16px;
  975. text-align: center;
  976. line-height:40px;
  977. border-radius:10px;
  978. margin:20px 40px;
  979. cursor: pointer;
  980. }
  981. }
  982. }
  983. }
  984. }
  985. </style>