emergencyEvacuationBig.vue 50 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957
  1. <!-- 应急疏散 -->
  2. <template>
  3. <view id="emergencyEvacuationBig">
  4. <view class="setUpEvacuation" v-if="pageType == 1">
  5. <view class="evacuation-max-box">
  6. <view class="picker-max-box">
  7. <view class="picker-title-box">
  8. <view></view>
  9. <view>楼栋</view>
  10. </view>
  11. <picker @change="buildingChange" :range-key="'name'" :range="buildingList">
  12. <view class="picker-min-box">
  13. <view>{{buildingName?buildingName:'请选择楼栋'}}</view>
  14. <img src="@/pages_manage/images/icon_06.png">
  15. </view>
  16. </picker>
  17. </view>
  18. <view class="picker-max-box">
  19. <view class="picker-title-box">
  20. <view></view>
  21. <view>楼层</view>
  22. </view>
  23. <picker @change="floorChange" :disabled="!buildingId" :range-key="'name'" :range="floorList">
  24. <view class="picker-min-box">
  25. <view>{{floorName?floorName:'请选择楼层'}}</view>
  26. <img src="@/pages_manage/images/icon_06.png">
  27. </view>
  28. </picker>
  29. </view>
  30. <view class="picker-max-box">
  31. <view class="picker-title-box">
  32. <view></view>
  33. <view>实验室</view>
  34. </view>
  35. <picker @change="fjListChange" :disabled="!floorId" :range-key="'subName'" :range="fjListArray">
  36. <view class="picker-min-box">
  37. <view>{{subName?subName:'请选择实验室'}}</view>
  38. <img src="@/pages_manage/images/icon_06.png">
  39. </view>
  40. </picker>
  41. </view>
  42. </view>
  43. <view class="setUpEvacuation-bottom-button" @click="confirmBtn">确认</view>
  44. </view>
  45. <view class="implementEvacuation" v-if="pageType == 2">
  46. <view class="evacuation-max-box">
  47. <!-- 头部 -->
  48. <view class="evacuation-title-box">
  49. <view class="evacuation-title-left">
  50. <view class="evacuation-title-name-box">{{textFiltration(subName)}}</view>
  51. <view class="site"><img src="@/pages_manage/images/icon_14.png">{{textFiltration(buildingName)}}
  52. {{textFiltration(floorName)}}
  53. </view>
  54. </view>
  55. <view class="evacuation-title-right" @click="backButton()">选择房间</view>
  56. </view>
  57. <!-- 地图部分 -->
  58. <view class="roadmap">
  59. <view class="roadmap_t">
  60. <view class="monito_li_r_l"></view>
  61. <view class="monito_li_r_r_button" @click="goAllPage">全屏</view>
  62. </view>
  63. <view class="evacuation-map-box">
  64. <view class="emergencyEvacuationBigFullScreen-page" v-if="mapType"
  65. :style="'width:'+mapWidth+'rpx;height:'+mapHeight+'rpx;transform: scale('+zoomData+');margin-top:-'+mapHeight/2+'rpx;margin-left:-'+mapWidth/2+'rpx;'">
  66. <view class="map-max-box" :style="'width:'+mapWidth+'rpx;height:'+mapHeight+'rpx;'">
  67. <!-- 实验室 -->
  68. <view class="map-max-for-box for-map-box" v-if="item.type == 1" v-for="(item,index) in mapList"
  69. :key="index" :class="!item.policeType && subId ==item.subId ? 'room-type-one':(
  70. item.policeType && subId !=item.subId ? 'room-type-two':(
  71. item.policeType && subId ==item.subId ? 'room-type-three':(
  72. !item.loginAdmin ? 'room-type-noe':'')))"
  73. :style="'top:'+item.y+'rpx;left:'+item.x+'rpx;width:'+(item.w-4)+'rpx;height:'+(item.h-4)+'rpx;'">
  74. <view class="map-max-for-min-box">
  75. <view class="map-for-name-p" :style="'margin-top:'+((item.h/2)-20)+'rpx;'">
  76. {{item.roomType == '-99'?item.roomName:item.subName}}
  77. </view>
  78. <view class="map-for-num-p">({{item.roomNum}})</view>
  79. <view class="position-box" src="@/pages_manage/images/icon_sysbjt_m.png"
  80. :class="minItem.toward=='top'?'center-move-door-p-t':(minItem.toward=='bottom'?'center-move-door-p-b':(minItem.toward=='left'?'center-move-door-p-l':(minItem.toward=='right'?'center-move-door-p-r':'')))"
  81. v-for="(minItem,minIndex) in item.doorList" :key="minIndex"
  82. :style="'top:'+minItem.y+'rpx;left:'+minItem.x+'rpx;width:'+minItem.w+'rpx;height:'+minItem.h+'rpx;'">
  83. </view>
  84. </view>
  85. </view>
  86. <!-- 走廊 -->
  87. <view class="map-max-for-box for-map-box-one" v-if="item.type == 2" v-for="(item,index) in mapList"
  88. :key="index"
  89. :style="'top:'+item.y+'rpx;left:'+item.x+'rpx;width:'+item.w+'rpx;height:'+item.h+'rpx;'">
  90. <view class="map-max-for-min-box">
  91. <view class="position-box"
  92. :class="minItem.state=='1'&&minItem.openType?'lightTopOn':(minItem.state=='1'&&!minItem.openType?'lightTopOff':
  93. (minItem.state=='2'&&minItem.openType?'lightBottomOn':(minItem.state=='2'&&!minItem.openType?'lightBottomOff':
  94. (minItem.state=='3'&&minItem.openType?'lightLeftOn':(minItem.state=='3'&&!minItem.openType?'lightLeftOff':
  95. (minItem.state=='4'&&minItem.openType?'lightRightOn':(minItem.state=='4'&&!minItem.openType?'lightRightOff':'')))))))"
  96. v-for="(minItem,minIndex) in item.lightList" :key="minIndex"
  97. :style="'top:'+minItem.y+'rpx;left:'+minItem.x+'rpx;width:'+minItem.w+'rpx;height:'+minItem.h+'rpx;'">
  98. </view>
  99. </view>
  100. </view>
  101. <!-- 疏散口 -->
  102. <view class="map-max-for-box for-map-box-two" v-if="item.type == 3" v-for="(item,index) in mapList"
  103. :key="index" :class="item.roomCheckType?'for-map-box-two-check':''"
  104. :style="'top:'+item.y+'rpx;left:'+item.x+'rpx;width:'+item.w+'rpx;height:'+item.h+'rpx;'">
  105. </view>
  106. </view>
  107. </view>
  108. </view>
  109. </view>
  110. <!-- 视频部分 -->
  111. <view class="video-max-box" v-if="urlList[0]">
  112. <video v-for="(item,index) in urlList" :key="index" ref="videoRef" :src="item.url" :poster="videoCover"
  113. :custom-cache='false' :autoplay="true" :controls="true" :enable-danmu="false" :muted="true"
  114. :show-fullscreen-btn="true" :show-center-play-btn="false" :show-play-btn="false"
  115. @error="videoErrorCallback">
  116. </video>
  117. </view>
  118. <view class="bottom-button-box">
  119. <view class="voice" @click="shadeTypeClick()">语音广播</view>
  120. <view class="plan" v-if="planStatus" @click="closePlan()">结束预案</view>
  121. <view class="evacuate" @click="evacuationButton(1)" v-if="isEvacuate">执行疏散</view>
  122. <view class="evacuate" @click="evacuationButton(2)" v-if="!isEvacuate">结束疏散</view>
  123. </view>
  124. </view>
  125. <!-- 语音广播-->
  126. <view class="shade-max-big-box" v-if="broadcastType">
  127. <view class="null-box" @click="shadeTypeClick()"></view>
  128. <!-- 语音广播-执行疏散 -->
  129. <view class="broadcast">
  130. <view class="broadcast_t">语音广播<label>选择喇叭位置</label></view>
  131. <!-- 按钮部分 -->
  132. <view class="trumpet-max-box">
  133. <view @click="trumpetClick(index)" class="trumpet-for-box"
  134. :class="item.type?'trumpet-color-a':'trumpet-color-b'" v-for="(item,index) in trumpetList" :key="index">
  135. <img src="@/pages_manage/images/icon_sskz_zc.png" v-if="!item.type">
  136. <img src="@/pages_manage/images/icon_sskz_xz.png" v-if="item.type">
  137. {{item.deviceName}}
  138. </view>
  139. </view>
  140. <view class="broadcast_m">
  141. <view class="broadcast_m_t" :class="liveType?'broadcast_m_t_back_a':'broadcast_m_t_back_b'"
  142. @longpress.stop="recordButton" @touchmove.stop="cancelButton" @touchend.stop="sendButton">
  143. {{liveType?'松开发送':'按住说话'}}
  144. </view>
  145. <view class="broadcast_m_b" v-if="!liveType">按住说话,录入广播内容</view>
  146. <view class="broadcast_m_b" v-if="liveType">松开发送,向上滑动取消发送</view>
  147. </view>
  148. </view>
  149. </view>
  150. </view>
  151. <view></view>
  152. </view>
  153. </template>
  154. <script>
  155. import { controlsRestrictVerify} from '@/utils/index'
  156. import $mqtt from '@/utils/mqtt.min.js';
  157. import {
  158. textParseUrlIps,
  159. laboratoryInfo,
  160. getCameraByFloor,
  161. getDeviceListBySub,
  162. GetStartList,
  163. firedeviceStatus,
  164. firedeviceStart,
  165. firedeviceCancel,
  166. closeRiskPlan,
  167. getBuildOrFloorList,
  168. getFloorData,
  169. getRedisEvacuation,
  170. openLight,
  171. closeLight,
  172. executeEvacuation,
  173. endEvacuation,
  174. selectTriggerInfo,
  175. riskPlanId
  176. } from '@/api/apiDemo/index.js'
  177. import {
  178. config
  179. } from '@/api/request/config.js'
  180. import {
  181. iotAppSpeakerFindHorn,
  182. iotAppSpeakerPlayVoice
  183. } from '@/pages_manage/api/index.js'
  184. import {
  185. laboratoryBigViewGetBuildByBigView,
  186. laboratoryBigViewSelectTriggerInfo,
  187. laboratoryBigViewGetFloorByBigView,
  188. laboratoryExitLineGetRedisEvacuation,
  189. laboratoryPlanCloseRiskPlan,
  190. laboratoryExitLineExecuteEvacuation,
  191. laboratoryexitLineEndEvacuation,
  192. } from '@/pages_manage/api/index.js'
  193. export default {
  194. data() {
  195. return {
  196. videoCover: uni.getStorageSync('videoCover'),
  197. //页面状态
  198. pageType: "1",
  199. deptIndex: 0,
  200. //院系楼栋数据
  201. buildingList: [],
  202. buildingName: "",
  203. buildingId: "",
  204. //楼层数据
  205. floorList: [],
  206. floorName: "",
  207. floorId: "",
  208. //实验室
  209. fjListArray: [],
  210. //视频数据
  211. urlList: [],
  212. //接收参数
  213. subId: "",
  214. subName: "",
  215. title: "",
  216. type: "",
  217. //喇叭数据
  218. trumpetList: [],
  219. //广播相关
  220. liveType: false,
  221. sendLock: true, //发送锁,当为true时上锁,false时解锁发送
  222. recorderManager: wx.getRecorderManager(),
  223. isEvacuate: true, //疏散按钮控制,当为true时候执行疏散
  224. //滑动记录
  225. startPoint: {},
  226. //摄像头信息
  227. deptId: '',
  228. itemData: {
  229. hardwareNUM: '',
  230. name: '',
  231. },
  232. broadcastType: false,
  233. //选中楼栋
  234. checkSubName: "",
  235. address: "",
  236. videoHardwareNUM: [], //实验室和楼道摄像头编码
  237. //新布局地图相关数据
  238. zoomData: null,
  239. mapType: false,
  240. mapList: [],
  241. mapWidth: null, //40边框距离
  242. mapHeight: null, //40边框距离
  243. //MQTT请求参数-预案
  244. mtopic: "lab/risk/plan/change",
  245. //MQTT请求参数-疏散
  246. mtopicOne: "lab/floor/exit/line",
  247. client: {},
  248. groupId: null,
  249. planStatus: false,
  250. warnData: null,
  251. }
  252. },
  253. onLoad(option) {
  254. console.log('option', option);
  255. if (option.item) {
  256. let obj = JSON.parse(decodeURIComponent(option.item));
  257. console.log('obj', obj);
  258. this.$set(this, 'warnData', obj);
  259. console.log('obj', obj);
  260. this.$set(this, 'buildingId', obj.buildId);
  261. this.$set(this, 'deptId', obj.buildId);
  262. this.$set(this, 'floorId', obj.floorId);
  263. this.$set(this, 'subId', obj.subId);
  264. this.$set(this.itemData, 'subjectId', obj.subId);
  265. this.$set(this, 'groupId', obj.groupId);
  266. this.$set(this, 'pageType', 2);
  267. console.log('groupId', this.groupId);
  268. }
  269. },
  270. onShow() {
  271. if (this.warnData) {
  272. this.getDataA();
  273. } else {
  274. this.laboratoryBigViewGetBuildByBigView();
  275. }
  276. this.getRedisEvacuation();
  277. },
  278. onUnload() {},
  279. methods: {
  280. //跳转进来后的初始化
  281. async getDataA() {
  282. const {
  283. data
  284. } = await laboratoryBigViewGetBuildByBigView({
  285. type: 2
  286. })
  287. if(data.code == 200){
  288. this.$set(this, 'buildingList', data.data);
  289. data.data.forEach((item)=>{
  290. if(this.buildingId == item.id){
  291. this.$set(this,'buildingName',item.name);
  292. }
  293. }),
  294. this.selectTriggerInfo(1);
  295. this.getDataB()
  296. }
  297. },
  298. async getDataB() {
  299. const {
  300. data
  301. } = await laboratoryBigViewGetBuildByBigView({
  302. type: 3,
  303. id: this.deptId
  304. })
  305. if (data.code == 200) {
  306. this.$set(this, 'floorList', data.data);
  307. data.data.forEach((item)=>{
  308. if(this.floorId == item.id){
  309. this.$set(this,'floorName',item.name);
  310. }
  311. }),
  312. this.selectTriggerInfo(2);
  313. this.confirmBtn();
  314. this.getBuildingData();
  315. }
  316. },
  317. //返回按钮
  318. backButton() {
  319. let self = this;
  320. this.$set(this, 'pageType', 1);
  321. this.$set(this, 'urlList', []);
  322. this.laboratoryBigViewGetBuildByBigView();
  323. },
  324. //结束预案
  325. closePlan() {
  326. let self = this;
  327. if(!controlsRestrictVerify('performEvacuation')){
  328. uni.showToast({
  329. title: '没有相关操作权限,请联系管理员',
  330. icon: "none",
  331. mask: true,
  332. duration: 2000
  333. });
  334. return
  335. }
  336. uni.showModal({
  337. content: '传感器数据监测异常,确定要强制结束预案?关闭报警后,3分钟内系统不再触发预案报警,请核实确认后再执行此操作?',
  338. cancelColor: "#999",
  339. confirmColor: "#0183FA",
  340. success: function(res) {
  341. if (res.confirm) {
  342. self.closeRiskPlan();
  343. } else if (res.cancel) {}
  344. }
  345. });
  346. },
  347. async closeRiskPlan() {
  348. console.log('this.groupId',this.groupId);
  349. const {
  350. data
  351. } = await laboratoryPlanCloseRiskPlan({
  352. eventId: this.groupId
  353. });
  354. if (data.code == 200) {
  355. uni.showToast({
  356. title: '操作成功',
  357. icon: "none",
  358. mask: true,
  359. duration: 2000
  360. });
  361. this.selectTriggerInfo();
  362. }
  363. },
  364. //全屏疏散页面
  365. goAllPage() {
  366. let obj = {
  367. buildingId: this.buildingId,
  368. floorId: this.floorId,
  369. type: 1,
  370. }
  371. uni.navigateTo({
  372. url: '/pages_manage/views/emergencyEvacuationBigFullScreen?item=' + encodeURIComponent(JSON
  373. .stringify(obj)),
  374. });
  375. },
  376. //获取楼栋数据
  377. async laboratoryBigViewGetBuildByBigView(option) {
  378. const {
  379. data
  380. } = await laboratoryBigViewGetBuildByBigView({
  381. type: 2
  382. })
  383. this.$set(this, 'buildingList', data.data);
  384. this.selectTriggerInfo(1);
  385. },
  386. //获取楼层数据
  387. async getBuilding(buildingId) {
  388. const {
  389. data
  390. } = await laboratoryBigViewGetBuildByBigView({
  391. type: 3,
  392. id: buildingId
  393. })
  394. this.$set(this, 'floorList', data.data);
  395. this.$set(this, 'floorName', "");
  396. this.$set(this, 'floorId', "");
  397. this.$set(this, 'fjListArray', []);
  398. this.$set(this, 'subName', "");
  399. this.$set(this, 'subId', "");
  400. this.selectTriggerInfo(2);
  401. },
  402. //楼栋选中
  403. buildingChange(e) {
  404. this.$set(this, 'buildingName', this.buildingList[e.detail.value].name);
  405. this.$set(this, 'buildingId', this.buildingList[e.detail.value].id);
  406. this.$set(this, 'deptId', this.buildingList[e.detail.value].id);
  407. this.$set(this, 'floorId', null);
  408. this.$set(this, 'floorName', null);
  409. this.$set(this, 'subId', null);
  410. this.$set(this, 'subName', null);
  411. this.$set(this.itemData, 'subjectId', null);
  412. this.$set(this, 'floorList', []);
  413. this.$set(this, 'fjListArray', []);
  414. this.getBuilding(this.buildingList[e.detail.value].id);
  415. },
  416. //楼层选中
  417. floorChange(e) {
  418. this.$set(this, 'floorName', this.floorList[e.detail.value].name);
  419. this.$set(this, 'floorId', this.floorList[e.detail.value].id);
  420. this.$set(this, 'subId', null);
  421. this.$set(this, 'subName', null);
  422. this.$set(this.itemData, 'subjectId', null);
  423. this.$set(this, 'fjListArray', []);
  424. this.getBuildingData();
  425. },
  426. //实验室选择
  427. fjListChange(e) {
  428. this.$set(this, 'subName', this.fjListArray[e.detail.value].subName);
  429. this.$set(this, 'subId', this.fjListArray[e.detail.value].subId);
  430. this.$set(this.itemData, 'subjectId', this.fjListArray[e.detail.value].subId);
  431. },
  432. shadeTypeClick() {
  433. if(!controlsRestrictVerify('performEvacuation')){
  434. uni.showToast({
  435. title: '没有相关操作权限,请联系管理员',
  436. icon: "none",
  437. mask: true,
  438. duration: 2000
  439. });
  440. return
  441. }
  442. this.broadcastType = !this.broadcastType
  443. },
  444. //获取预案数据
  445. async selectTriggerInfo(type) {
  446. let self = this;
  447. const {
  448. data
  449. } = await laboratoryBigViewSelectTriggerInfo();
  450. if (data.code == 200) {
  451. if (type == 1) {
  452. //标记楼栋
  453. for (let o = 0; o < self.buildingList.length; o++) {
  454. for (let i = 0; i < data.data.length; i++) {
  455. if (data.data[i].buildId == self.buildingList[o].id) {
  456. self.buildingList[o].name.replace('(预案发生)')
  457. self.buildingList[o].name = '(预案发生) ' + self.buildingList[o].name
  458. }
  459. }
  460. }
  461. }
  462. if (type == 2) {
  463. //标记楼层
  464. for (let o = 0; o < self.floorList.length; o++) {
  465. for (let i = 0; i < data.data.length; i++) {
  466. if (data.data[i].floorId == self.floorList[o].id) {
  467. self.floorList[o].name.replace('(预案发生)')
  468. self.floorList[o].name = '(预案发生) ' + self.floorList[o].name
  469. }
  470. }
  471. }
  472. }
  473. if (type == 3) {
  474. //标记实验室
  475. let bigNum = 0;
  476. for (let o = 0; o < self.fjListArray.length; o++) {
  477. let num = 0;
  478. for (let i = 0; i < data.data.length; i++) {
  479. if (data.data[i].subId == self.fjListArray[o].subId) {
  480. num++
  481. bigNum++
  482. self.$set(this, 'groupId', data.data[i].eventId)
  483. self.fjListArray[o].subName.replace('(预案发生)')
  484. self.fjListArray[o].subName = '(预案发生) ' + self.fjListArray[o].subName
  485. }
  486. }
  487. if (num == 0) {
  488. self.fjListArray[o].subName.replace('(预案发生)')
  489. }
  490. }
  491. if (bigNum != 0) {
  492. self.$set(self, 'planStatus', true)
  493. } else {
  494. self.$set(self, 'planStatus', false)
  495. }
  496. for (let o = 0; o < self.mapList.length; o++) {
  497. if (self.mapList[o].type == 1) {
  498. let num = 0;
  499. for (let i = 0; i < data.data.length; i++) {
  500. if (data.data[i].subId == self.mapList[o].subId) {
  501. num++
  502. }
  503. }
  504. if (num != 0) {
  505. self.mapList[o].policeType = true;
  506. } else {
  507. self.mapList[o].policeType = false;
  508. }
  509. }
  510. }
  511. }
  512. this.$forceUpdate();
  513. }
  514. },
  515. getAppExitLine() {
  516. let list = [{
  517. type: "lab/exit/line"
  518. }, {
  519. type: "lab/fireDevice/Warn/"
  520. }];
  521. getApp().appMqttOn(1, list);
  522. },
  523. //获取实验室摄像头
  524. async laboratoryInfo() {
  525. let _this = this;
  526. const {
  527. data
  528. } = await laboratoryInfo(_this.itemData.subjectId);
  529. if (data.code == 200) {
  530. let list = data.data[0];
  531. list.labHardwareVOList.forEach(function(item) {
  532. if (item.hardwareTypeEnum.enumName == 'VIDEO_MONITOR') {
  533. console.log(item.hardwareNUM)
  534. _this.videoHardwareNUM.push(item.hardwareNUM)
  535. }
  536. })
  537. this.getCameraByFloor();
  538. }
  539. },
  540. //获取楼层摄像头列表
  541. async getCameraByFloor() {
  542. let _this = this;
  543. const {
  544. data
  545. } = await getCameraByFloor({
  546. floorId: this.floorId
  547. })
  548. if (data.code == 200) {
  549. if (data.data[0]) {
  550. let list = _this.videoHardwareNUM.concat(data.data)
  551. let qc = []
  552. for (var i = 0; i < list.length - 1; i++) {
  553. for (var j = i + 1; j < list.length; j++) {
  554. if (list[i] === list[j]) {
  555. list.splice(j, 1);
  556. j--;
  557. }
  558. }
  559. }
  560. this.GetStartList(list);
  561. } else {
  562. this.GetStartList(_this.videoHardwareNUM);
  563. }
  564. }
  565. },
  566. async GetStartList(rows) {
  567. console.log(rows)
  568. let self = this;
  569. if (!rows[0]) {
  570. return
  571. }
  572. let list = "";
  573. for (let i = 0; i < rows.length; i++) {
  574. list = list + rows[i] + ","
  575. }
  576. let obj = {
  577. page: "1",
  578. count: "100",
  579. deviceIds: list,
  580. };
  581. const {
  582. data
  583. } = await GetStartList(obj)
  584. if (data.code == 200) {
  585. let list = [];
  586. for (let i = 0; i < data.data.length; i++) {
  587. let text = uni.getStorageSync('cameraUrl');
  588. let url = data.data[i].hls;
  589. url = url.split("rtp/");
  590. let newUrl = text + 'rtp/' + url[1];
  591. let obj = {
  592. name: "楼道监控" + (i + 1),
  593. id: data.data[i].deviceID,
  594. url: newUrl,
  595. videoContext: wx.createVideoContext(data.data[i].deviceID)
  596. }
  597. list.push(obj)
  598. }
  599. this.urlList = list;
  600. }
  601. },
  602. //点击选择喇叭
  603. trumpetClick(index) {
  604. this.trumpetList[index].type = !this.trumpetList[index].type
  605. // let _this = this;
  606. // if (_this.trumpetList[index].type == true) {
  607. // _this.trumpetList.forEach(function(item2) {
  608. // if (item2.deviceSn == _this.trumpetList[index].deviceSn) {
  609. // item2.type = true
  610. // } else {
  611. // item2.type = false
  612. // }
  613. // })
  614. // }
  615. },
  616. //录制
  617. recordButton(e) {
  618. console.log("按下")
  619. let self = this;
  620. let num = 0;
  621. for (let i = 0; i < self.trumpetList.length; i++) {
  622. if (self.trumpetList[i].type) {
  623. num++
  624. }
  625. }
  626. if (num == 0) {
  627. uni.showToast({
  628. title: '请选择喇叭',
  629. icon: "none",
  630. mask: true,
  631. duration: 2000
  632. });
  633. return
  634. }
  635. this.liveType = true;
  636. console.log('录制', e)
  637. this.startPoint = e.touches[0]; //记录长按时开始点信息,后面用于计算上划取消时手指滑动的距离。
  638. const options = {
  639. duration: 10000,
  640. sampleRate: 16000,
  641. numberOfChannels: 1,
  642. encodeBitRate: 48000,
  643. format: 'mp3',
  644. frameSize: 50
  645. }
  646. this.recorderManager.start(options); //开始录音
  647. this.recorderManager.onStart(() => {
  648. console.log('recorder start')
  649. })
  650. this.recorderManager.onError((res) => {
  651. console.log(res);
  652. })
  653. wx.showToast({
  654. title: "正在录音,上划取消发送",
  655. icon: "none",
  656. duration: 60000 //先定义个60秒,后面可以手动调用wx.hideToast()隐藏
  657. });
  658. this.sendLock = false; //长按时是不上锁的。
  659. },
  660. //取消
  661. cancelButton(e) {
  662. console.log("移动")
  663. let self = this;
  664. let num = 0;
  665. for (let i = 0; i < self.trumpetList.length; i++) {
  666. if (self.trumpetList[i].type) {
  667. num++
  668. }
  669. }
  670. if (num == 0) {
  671. return
  672. }
  673. this.liveType = false;
  674. console.log('取消', e)
  675. let moveLenght = e.touches[e.touches.length - 1].clientY - this.startPoint.clientY; //移动距离
  676. if (Math.abs(moveLenght) > 50) {
  677. wx.showToast({
  678. title: "松开手指,取消发送",
  679. icon: "none",
  680. duration: 60000
  681. });
  682. this.sendLock = true; //触发了上滑取消发送,上锁
  683. } else {
  684. wx.showToast({
  685. title: "正在录音,上划取消发送",
  686. icon: "none",
  687. duration: 60000
  688. });
  689. this.sendLock = false; //上划距离不足,依然可以发送,不上锁
  690. }
  691. },
  692. //发送
  693. sendButton(e) {
  694. console.log("松开")
  695. let self = this;
  696. let num = 0;
  697. for (let i = 0; i < self.trumpetList.length; i++) {
  698. if (self.trumpetList[i].type) {
  699. num++
  700. }
  701. }
  702. if (num == 0) {
  703. return
  704. }
  705. this.liveType = false;
  706. console.log('发送', e)
  707. wx.hideToast(); //结束录音、隐藏Toast提示框
  708. this.recorderManager.stop(); //结束录音
  709. this.recorderManager.onStop((res) => {
  710. if (!this.sendLock) {
  711. console.log('1', this.recorderManager)
  712. this.uploadImg(res.tempFilePath);
  713. }
  714. console.log('停止录音', res.tempFilePath)
  715. console.log("sendLock", this.sendLock);
  716. })
  717. },
  718. //上传MP3
  719. async uploadImg(tempFilePaths) {
  720. var self = this;
  721. uni.uploadFile({
  722. url: config.base_url + '/system/file/upload', //仅为示例,非真实的接口地址
  723. header: {
  724. 'Authorization': uni.getStorageSync('token')
  725. },
  726. filePath: tempFilePaths,
  727. name: 'file',
  728. formData: {
  729. 'user': 'test'
  730. },
  731. success: (uploadFileRes) => {
  732. let res = JSON.parse(uploadFileRes.data);
  733. if (res.code == 200) {
  734. console.log("上传成功", res)
  735. let url = 'http://'+config.base_url.split('://')[1]+ '/' +res.data.url
  736. self.iotAppSpeakerPlayVoice(url);
  737. } else {
  738. uni.showToast({
  739. title: res.msg,
  740. icon: "none",
  741. mask: true,
  742. duration: 2000
  743. });
  744. }
  745. },
  746. fail: err => {
  747. uni.hideLoading()
  748. },
  749. complete: () => {}
  750. });
  751. },
  752. //发送语音
  753. async iotAppSpeakerPlayVoice(text) {
  754. let self = this;
  755. let list = [];
  756. for (let i = 0; i < self.trumpetList.length; i++) {
  757. if (self.trumpetList[i].type) {
  758. list.push(self.trumpetList[i].deviceNo)
  759. }
  760. }
  761. console.log(text)
  762. let obj = {
  763. deviceNo: list.join(','),
  764. voiceUrls: text,
  765. cycle: 1,
  766. }
  767. const {
  768. data
  769. } = await iotAppSpeakerPlayVoice(obj)
  770. if (data.code == 200) {
  771. uni.showToast({
  772. title: '发送成功',
  773. icon: "none",
  774. mask: true,
  775. duration: 2000
  776. });
  777. }
  778. },
  779. //监听应急疏散数据变更
  780. getMqttLineData(val) {
  781. console.log('收到疏散MQTT')
  782. let self = this;
  783. if (val.EXIT_LINE_MESSAGE) {
  784. console.log('数据改变')
  785. this.evacuate();
  786. } else {
  787. console.log('应急疏散已结束')
  788. uni.showToast({
  789. title: '应急疏散已结束',
  790. icon: "none",
  791. mask: true,
  792. duration: 2000
  793. });
  794. setTimeout(function() {
  795. uni.navigateBack();
  796. }, 2000);
  797. }
  798. },
  799. /* 确认 */
  800. confirmBtn() {
  801. if (!this.subId) {
  802. uni.showToast({
  803. title: '请选择实验室',
  804. icon: "none",
  805. mask: true,
  806. duration: 2000
  807. });
  808. return
  809. }
  810. this.$set(this, 'pageType', 2);
  811. this.getDeviceList();
  812. //this.laboratoryInfo();
  813. this.getRedisEvacuation();
  814. },
  815. //执行疏散
  816. async lineEvacuate() {
  817. let obj = {
  818. buildingId: this.buildingId,
  819. floorId: this.floorId,
  820. type: 2,
  821. }
  822. uni.navigateTo({
  823. url: '/pages_manage/views/emergencyEvacuationBigFullScreen?item=' + encodeURIComponent(JSON
  824. .stringify(obj)),
  825. });
  826. },
  827. //获取喇叭列表
  828. async getDeviceList() {
  829. let obj = {
  830. subId: this.itemData.subjectId,
  831. floorId: this.floorId,
  832. };
  833. const {
  834. data
  835. } = await iotAppSpeakerFindHorn(obj)
  836. if (data.code == 200) {
  837. for (let i = 0; i < data.data.length; i++) {
  838. data.data[i].type = false;
  839. }
  840. this.$set(this, 'trumpetList', data.data)
  841. }
  842. },
  843. //摄像头切换
  844. scrollBoxClick(index) {
  845. this.videoIndex = index;
  846. },
  847. /*新疏散相关接口*/
  848. //地图数据
  849. async getBuildingData() {
  850. let self = this;
  851. const {
  852. data
  853. } = await laboratoryBigViewGetFloorByBigView({
  854. id: this.floorId
  855. })
  856. console.log('data', data)
  857. if (data.code == 200) {
  858. if (data.data[0].buildLayoutVoList[0]) {
  859. let list = JSON.parse(data.data[0].labExitLineVo.layoutJoinData)
  860. this.zoomCalculate(list, 348, 668);
  861. for (let i = 0; i < list.length; i++) {
  862. if (list[i].type == '2') {
  863. //楼道
  864. for (let o = 0; o < list[i].lightList.length; o++) {
  865. list[i].lightList[o].openType = false;
  866. }
  867. } else if (list[i].type == '1') {
  868. for (let o = 0; o < data.data[0].buildLayoutVoList.length; o++) {
  869. if (list[i].key == data.data[0].buildLayoutVoList[o].pointName) {
  870. list[i].id = data.data[0].buildLayoutVoList[o].id;
  871. list[i].buildId = data.data[0].buildLayoutVoList[o].buildId;
  872. list[i].floorId = data.data[0].buildLayoutVoList[o].floorId;
  873. list[i].roomType = data.data[0].buildLayoutVoList[o].roomType;
  874. list[i].roomName = data.data[0].buildLayoutVoList[o].roomName;
  875. list[i].roomNum = data.data[0].buildLayoutVoList[o].roomNum;
  876. list[i].subName = data.data[0].buildLayoutVoList[o].subName;
  877. list[i].subId = data.data[0].buildLayoutVoList[o].subId;
  878. list[i].online = data.data[0].buildLayoutVoList[o].online;
  879. list[i].loginAdmin = data.data[0].buildLayoutVoList[o].loginAdmin;
  880. list[i].policeType = false;
  881. }
  882. }
  883. } else if (list[i].type == 3) {
  884. list[i].roomCheckType = false;
  885. }
  886. }
  887. let subList = [];
  888. for (let o = 0; o < data.data[0].buildLayoutVoList.length; o++) {
  889. subList.push(data.data[0].buildLayoutVoList[o])
  890. // if (self.subId == data.data[0].buildLayoutVoList[o].subId) {
  891. // self.$set(self, 'checkSubName', data.data[0].buildLayoutVoList[o].subName);
  892. // self.$set(self, 'address', data.data.labExitLineVo.buildName + '' + data.data[0]
  893. // .labExitLineVo.floorName);
  894. // }
  895. }
  896. this.$set(this, 'fjListArray', subList);
  897. subList.forEach((item)=>{
  898. if(this.subId == item.subId){
  899. this.$set(this,'subName',item.subName);
  900. }
  901. })
  902. this.$set(this, 'mapList', JSON.parse(JSON.stringify(list)));
  903. // this.$set(this, 'shadeMapList', JSON.parse(JSON.stringify(list)));
  904. this.$set(this, 'mapType', true);
  905. this.offMQTT('on');
  906. this.selectTriggerInfo(3);
  907. }
  908. setTimeout(function() {
  909. self.getRedisEvacuation();
  910. }, 500);
  911. }
  912. },
  913. //获取疏散数据
  914. async getRedisEvacuation() {
  915. let self = this;
  916. let obj = {
  917. buildId: this.buildingId,
  918. floorId: this.floorId,
  919. }
  920. const {
  921. data
  922. } = await laboratoryExitLineGetRedisEvacuation(obj)
  923. if (data.code == 200) {
  924. if (data.data.doorPointNames) {
  925. this.$set(this, 'isEvacuate', false);
  926. for (let o = 0; o < self.mapList.length; o++) {
  927. if (self.mapList[o].type == 2) {
  928. for (let x = 0; x < self.mapList[o].lightList.length; x++) {
  929. let num = 0;
  930. for (let i = 0; i < data.data.lightPointSet.length; i++) {
  931. if (data.data.lightPointSet[i]) { //处理后端返回的异常的NULL
  932. if (self.mapList[o].lightList[x].key == data.data.lightPointSet[i].key) {
  933. num++
  934. }
  935. }
  936. }
  937. self.mapList[o].lightList[x].openType = num != 0;
  938. }
  939. }
  940. if (self.mapList[o].type == 3) {
  941. let age = 0;
  942. for (let i = 0; i < data.data.doorPointNames.length; i++) {
  943. if (data.data.doorPointNames[i] == self.mapList[o].key) {
  944. age++
  945. }
  946. }
  947. self.mapList[o].roomCheckType = age != 0;
  948. }
  949. }
  950. } else {
  951. this.$set(this, 'isEvacuate', true);
  952. for (let o = 0; o < self.mapList.length; o++) {
  953. if (self.mapList[o].type == 2) {
  954. for (let x = 0; x < self.mapList[o].lightList.length; x++) {
  955. self.mapList[o].lightList[x].openType = false;
  956. }
  957. }
  958. if (self.mapList[o].type == 3) {
  959. self.mapList[o].roomCheckType = false;
  960. }
  961. }
  962. }
  963. };
  964. },
  965. //缩放计算
  966. zoomCalculate(list, height, width) {
  967. let maxWidth = 0
  968. let maxHeight = 0
  969. let zoomData = 1;
  970. for (let i = 0; i < list.length; i++) {
  971. if ((list[i].x + list[i].w) > maxWidth) {
  972. maxWidth = list[i].x + list[i].w
  973. }
  974. if ((list[i].y + list[i].h) > maxHeight) {
  975. maxHeight = list[i].y + list[i].h
  976. }
  977. }
  978. //处理等值数据
  979. if (maxHeight == height) {
  980. maxHeight--
  981. }
  982. if (maxWidth == width) {
  983. maxWidth--
  984. }
  985. this.$set(this, 'mapWidth', maxWidth);
  986. this.$set(this, 'mapHeight', maxHeight);
  987. //缩放判断
  988. let zoomNumOne = height / maxHeight;
  989. if (parseInt(this.accMul(zoomNumOne, maxHeight)) <= height && parseInt(this.accMul(zoomNumOne,
  990. maxWidth)) <= width) {
  991. zoomData = zoomNumOne;
  992. this.$set(this, 'zoomData', zoomNumOne);
  993. }
  994. let zoomNumTwo = width / maxWidth;
  995. if (parseInt(this.accMul(zoomNumTwo, maxHeight)) <= height && parseInt(this.accMul(zoomNumTwo,
  996. maxWidth)) <= width) {
  997. zoomData = zoomNumTwo;
  998. this.$set(this, 'zoomData', zoomNumTwo);
  999. }
  1000. },
  1001. accMul(arg1, arg2) {
  1002. var m = 0,
  1003. s1 = arg1.toString(),
  1004. s2 = arg2.toString();
  1005. try {
  1006. m += s1.split(".")[1].length
  1007. } catch (e) {}
  1008. try {
  1009. m += s2.split(".")[1].length
  1010. } catch (e) {}
  1011. return Number(s1.replace(".", "")) * Number(s2.replace(".", "")) / Math.pow(10, m)
  1012. },
  1013. //结束疏散
  1014. evacuationButton() {
  1015. let self = this;
  1016. if(!controlsRestrictVerify('performEvacuation')){
  1017. uni.showToast({
  1018. title: '没有相关操作权限,请联系管理员',
  1019. icon: "none",
  1020. mask: true,
  1021. duration: 2000
  1022. });
  1023. return
  1024. }
  1025. if (this.isEvacuate) {
  1026. let obj = {
  1027. buildingId: this.buildingId,
  1028. floorId: this.floorId,
  1029. subId: this.subId,
  1030. type: 2,
  1031. }
  1032. uni.navigateTo({
  1033. url: '/pages_manage/views/emergencyEvacuationBigFullScreen?item=' + encodeURIComponent(JSON
  1034. .stringify(obj)),
  1035. });
  1036. } else {
  1037. uni.showModal({
  1038. content: '确认' + (this.isEvacuate ? '执行' : '结束') + '疏散吗?',
  1039. cancelColor: "#999",
  1040. confirmColor: "#0183FA",
  1041. success: function(res) {
  1042. if (res.confirm) {
  1043. if (self.isEvacuate) {
  1044. self.executeEvacuation();
  1045. } else {
  1046. self.endEvacuation();
  1047. }
  1048. console.log('用户点击确定');
  1049. } else if (res.cancel) {
  1050. console.log('用户点击取消');
  1051. }
  1052. }
  1053. });
  1054. }
  1055. },
  1056. //开始疏散
  1057. async executeEvacuation() {
  1058. let self = this;
  1059. let doorPointNames = [];
  1060. for (let i = 0; i < self.mapList.length; i++) {
  1061. if (self.mapList[i].type == 3) {
  1062. doorPointNames.push(self.mapList[i].key)
  1063. }
  1064. }
  1065. let obj = {
  1066. buildId: this.buildingId,
  1067. floorId: this.floorId,
  1068. subId: this.subId,
  1069. badPointNames: [],
  1070. doorPointNames: doorPointNames,
  1071. }
  1072. const {
  1073. data
  1074. } = await laboratoryExitLineExecuteEvacuation(obj)
  1075. console.log('data', data)
  1076. if (data.code == 200) {
  1077. this.$set(this, 'isEvacuate', false);
  1078. uni.showToast({
  1079. title: '执行成功',
  1080. icon: "none",
  1081. mask: true,
  1082. duration: 2000
  1083. });
  1084. }
  1085. },
  1086. //结束疏散
  1087. async endEvacuation() {
  1088. let self = this;
  1089. let obj = {
  1090. buildId: this.buildingId,
  1091. floorId: this.floorId,
  1092. }
  1093. const {
  1094. data
  1095. } = await laboratoryexitLineEndEvacuation(obj)
  1096. console.log('data', data)
  1097. if (data.code == 200) {
  1098. this.$set(this, 'isEvacuate', true);
  1099. uni.showToast({
  1100. title: '执行成功',
  1101. icon: "none",
  1102. mask: true,
  1103. duration: 2000
  1104. });
  1105. if (this.warnData) {
  1106. this.getDataA();
  1107. } else {
  1108. this.laboratoryBigViewGetBuildByBigView();
  1109. }
  1110. this.getRedisEvacuation();
  1111. }
  1112. },
  1113. videoErrorCallback(e) {
  1114. //console.log("播放失败",e);
  1115. // uni.showToast({
  1116. // title: '视频播放失败',
  1117. // icon:"none",
  1118. // mask:true,
  1119. // duration: 3000
  1120. // });
  1121. },
  1122. //过滤'预案发生'标记文字并返回数据
  1123. textFiltration(str) {
  1124. if (str.indexOf("(预案发生)") != -1) {
  1125. return str.slice(str.indexOf(")") + 1);
  1126. } else {
  1127. return str
  1128. }
  1129. },
  1130. //MQTT订阅
  1131. sensorMQTT() {
  1132. let self = this;
  1133. this.client = $mqtt.connect('wxs://' + uni.getStorageSync('mqttUrl'), {
  1134. username: uni.getStorageSync('mqttUser'),
  1135. password: uni.getStorageSync('mqttPassword')
  1136. });
  1137. this.client.on("connect", e => {
  1138. this.client.subscribe(this.mtopic, (err) => {
  1139. if (!err) {
  1140. console.log("预案订阅成功:" + this.mtopic);
  1141. } else {
  1142. // console.log("连接错误:" + err);
  1143. }
  1144. });
  1145. this.client.subscribe(this.mtopicOne, (err) => {
  1146. if (!err) {
  1147. console.log("疏散订阅成功:" + this.mtopicOne);
  1148. } else {
  1149. // console.log("连接错误:" + err);
  1150. }
  1151. });
  1152. });
  1153. this.client.on("message", (topic, message) => {
  1154. console.log('message', message);
  1155. console.log('topic,', topic);
  1156. if (message) {
  1157. if (topic == this.mtopic) {
  1158. //预案触发
  1159. this.selectTriggerInfo(3);
  1160. } else if (topic == this.mtopicOne) {
  1161. //疏散触发
  1162. this.getRedisEvacuation();
  1163. }
  1164. }
  1165. });
  1166. },
  1167. //取消订阅关闭MQTT连接
  1168. offMQTT(type) {
  1169. let self = this;
  1170. if (self.client.unsubscribe) {
  1171. self.client.unsubscribe(self.mtopicOne, error => {
  1172. if (error) {
  1173. // console.log('mqtt关闭连接错误:', error)
  1174. }
  1175. })
  1176. self.client.unsubscribe(self.mtopic, error => {
  1177. if (error) {
  1178. // console.log('mqtt关闭连接错误:', error)
  1179. }
  1180. })
  1181. self.client.end();
  1182. this.$set(this, 'client', {});
  1183. }
  1184. //判断传入参数如果存在 发起一次新的连接
  1185. if (type) {
  1186. this.sensorMQTT();
  1187. }
  1188. },
  1189. },
  1190. onHide() {
  1191. //清除定时器
  1192. let self = this;
  1193. self.offMQTT();
  1194. },
  1195. beforeDestroy() {
  1196. //清除定时器
  1197. let self = this;
  1198. self.offMQTT();
  1199. },
  1200. }
  1201. </script>
  1202. <style lang="stylus" scoped>
  1203. #emergencyEvacuationBig {
  1204. height: 100%;
  1205. width: 100%;
  1206. display: flex;
  1207. flex-direction: column;
  1208. overflow-y: scroll;
  1209. .setUpEvacuation {
  1210. flex: 1;
  1211. display: flex;
  1212. flex-direction: column;
  1213. overflow-y: scroll;
  1214. .evacuation-max-box {
  1215. width: 710rpx;
  1216. margin: 20rpx 20rpx;
  1217. background: #fff;
  1218. border-radius: 20rpx;
  1219. padding: 20rpx 0;
  1220. .picker-max-box {
  1221. .picker-title-box {
  1222. padding: 0 20rpx;
  1223. display: flex;
  1224. view {
  1225. line-height: 80rpx;
  1226. font-size: 28rpx;
  1227. }
  1228. view:nth-child(1) {
  1229. color: red;
  1230. }
  1231. view:nth-child(2) {}
  1232. view:nth-child(3) {
  1233. color: #999;
  1234. }
  1235. }
  1236. .picker-min-box {
  1237. display: flex;
  1238. height: 80rpx;
  1239. width: 667rpx;
  1240. border: 1rpx solid #a2a2a2;
  1241. border-radius: 10rpx;
  1242. margin: 0 20rpx;
  1243. view {
  1244. flex: 1;
  1245. line-height: 80rpx;
  1246. padding: 0 20rpx;
  1247. color: #999;
  1248. font-size: 28rpx;
  1249. overflow: hidden;
  1250. }
  1251. img {
  1252. width: 24rpx;
  1253. height: 12rpx;
  1254. margin: 35rpx 23rpx;
  1255. }
  1256. }
  1257. }
  1258. }
  1259. }
  1260. .implementEvacuation {
  1261. flex: 1;
  1262. display: flex;
  1263. flex-direction: column;
  1264. overflow-y: scroll;
  1265. .evacuation-max-box {
  1266. width: 710rpx;
  1267. margin: 20rpx 20rpx;
  1268. /* background #fff */
  1269. border-radius: 20rpx;
  1270. padding: 20rpx 0 30rpx;
  1271. .evacuation-title-box {
  1272. // height:150rpx;
  1273. //border-bottom:1rpx solid #dedede;
  1274. background: #FFFFFF;
  1275. border-radius: 20rpx;
  1276. padding: 34rpx 22rpx;
  1277. box-sizing: border-box;
  1278. display: flex;
  1279. .evacuation-title-left {
  1280. flex: 1;
  1281. .evacuation-title-name-box {
  1282. font-size: 30rpx;
  1283. font-family: PingFang SC;
  1284. font-weight: 500;
  1285. color: #333333;
  1286. line-height: 30rpx;
  1287. }
  1288. .site {
  1289. font-size: 28rpx;
  1290. font-family: PingFang SC;
  1291. font-weight: 500;
  1292. color: #999999;
  1293. line-height: 30rpx;
  1294. margin-top: 32rpx;
  1295. display: flex;
  1296. justify-content: flex-start;
  1297. align-items: center;
  1298. >img {
  1299. width: 28rpx;
  1300. height: 30rpx;
  1301. margin-right: 18rpx;
  1302. }
  1303. }
  1304. }
  1305. .evacuation-title-right {
  1306. color: #0183FA;
  1307. font-size: 28rpx;
  1308. line-height: 100rpx;
  1309. }
  1310. }
  1311. /* 一键灭火 */
  1312. .outfire {
  1313. width: 710rpx;
  1314. height: auto;
  1315. background: #FFFFFF;
  1316. border-radius: 20rpx;
  1317. margin: 20rpx 0;
  1318. padding: 26 10rpx;
  1319. box-sizing: border-box;
  1320. display: flex;
  1321. justify-content: space-between;
  1322. align-items: center;
  1323. .outfire_li {
  1324. display: flex;
  1325. justify-content: flex-start;
  1326. padding: 20rpx 10rpx;
  1327. box-sizing: border-box;
  1328. //align-items: center;
  1329. .finish {
  1330. flex: 1;
  1331. }
  1332. >img {
  1333. width: 24rpx;
  1334. height: 30rpx;
  1335. margin-right: 12rpx;
  1336. margin-top: 8rpx;
  1337. }
  1338. .normal {
  1339. font-size: 24rpx;
  1340. font-family: PingFang SC;
  1341. font-weight: 500;
  1342. color: #333333;
  1343. }
  1344. .abnormal {
  1345. font-size: 24rpx;
  1346. font-family: PingFang SC;
  1347. font-weight: 500;
  1348. color: #F11C00;
  1349. }
  1350. }
  1351. .outfire_li:nth-of-type(1) {
  1352. >img {
  1353. width: 30rpx;
  1354. height: 28rpx;
  1355. margin-right: 12rpx;
  1356. }
  1357. }
  1358. .outfire_yes_btn {
  1359. width: 120rpx;
  1360. height: 40rpx;
  1361. font-size: 24rpx;
  1362. font-family: PingFang SC;
  1363. font-weight: 500;
  1364. color: #F21C00;
  1365. line-height: 40rpx;
  1366. border: 1px solid #F21C00;
  1367. border-radius: 8rpx;
  1368. text-align: center;
  1369. margin-left: 54rpx;
  1370. }
  1371. .outfire_no_btn {
  1372. width: 120rpx;
  1373. height: 40rpx;
  1374. font-size: 24rpx;
  1375. font-family: PingFang SC;
  1376. font-weight: 500;
  1377. color: #CCCCCC;
  1378. line-height: 40rpx;
  1379. border: 1px solid #E0E0E0;
  1380. border-radius: 8rpx;
  1381. text-align: center;
  1382. margin-left: 54rpx;
  1383. }
  1384. }
  1385. .evacuation-scroll-box {
  1386. height: 95rpx;
  1387. overflow-x: scroll;
  1388. overflow-y: hidden;
  1389. white-space: nowrap;
  1390. margin: 0 20rpx;
  1391. view {
  1392. line-height: 95rpx;
  1393. font-size: 28rpx;
  1394. display: inline-block;
  1395. margin-right: 45rpx;
  1396. }
  1397. .scroll-box-color {
  1398. color: #0183FA;
  1399. }
  1400. }
  1401. .evacuation-video-box {
  1402. width: 668rpx;
  1403. height: 341rpx;
  1404. margin: 0 auto;
  1405. position: relative;
  1406. video {
  1407. position: absolute;
  1408. top: 0;
  1409. left: 0;
  1410. width: 668rpx;
  1411. height: 341rpx;
  1412. margin: 0 auto;
  1413. }
  1414. .video-a {
  1415. z-index: 100;
  1416. }
  1417. .video-b {
  1418. z-index: 0;
  1419. }
  1420. }
  1421. /* 路线图 */
  1422. .roadmap {
  1423. width: 710rpx;
  1424. height: 464rpx;
  1425. background: #FFFFFF;
  1426. border-radius: 20rpx;
  1427. padding: 20rpx 20rpx 0;
  1428. box-sizing: border-box;
  1429. margin-top: 20rpx;
  1430. .roadmap_t {
  1431. font-size: 30rpx;
  1432. font-family: PingFang SC;
  1433. font-weight: 500;
  1434. color: #333333;
  1435. line-height: 30rpx;
  1436. display: flex;
  1437. .monito_li_r_l {
  1438. flex: 1;
  1439. line-height: 61rpx;
  1440. font-size: 28rpx;
  1441. }
  1442. .monito_li_r_r_button {
  1443. width: 100rpx;
  1444. text-align: center;
  1445. line-height: 61rpx;
  1446. font-size: 28rpx;
  1447. color: #0183FA;
  1448. }
  1449. .monito_li_r {
  1450. width: 380rpx;
  1451. font-size: 24rpx;
  1452. font-family: PingFang SC;
  1453. font-weight: 500;
  1454. color: #0183FA;
  1455. line-height: 80rpx;
  1456. display: flex;
  1457. justify-content: flex-end;
  1458. align-items: center;
  1459. >img {
  1460. width: 9rpx;
  1461. height: 22rpx;
  1462. margin-left: 20rpx;
  1463. }
  1464. .evacuation-title-button-box {
  1465. display: flex;
  1466. overflow: hidden;
  1467. view {
  1468. line-height: 61rpx;
  1469. font-size: 28rpx;
  1470. }
  1471. .colorA {
  1472. color: #0183FA;
  1473. }
  1474. .colorB {
  1475. color: #0183FA;
  1476. }
  1477. img {
  1478. margin: 28rpx 20rpx 0;
  1479. width: 24rpx;
  1480. height: 9rpx;
  1481. }
  1482. }
  1483. }
  1484. }
  1485. .evacuation-map-box {
  1486. width: 668rpx;
  1487. height: 348rpx;
  1488. margin: 0 auto;
  1489. overflow: hidden;
  1490. border: 1rpx solid #E0E0E0;
  1491. margin-top: 20rpx;
  1492. position: relative;
  1493. .emergencyEvacuationBigFullScreen-page {
  1494. // overflow: scroll;
  1495. overflow: hidden;
  1496. position: absolute;
  1497. top: 50%;
  1498. left: 50%;
  1499. .map-max-box {
  1500. position: relative;
  1501. .map-max-for-box {
  1502. position: absolute;
  1503. display: flex;
  1504. flex-direction: column;
  1505. .map-max-for-min-box {
  1506. position: relative;
  1507. .position-box {
  1508. position: absolute;
  1509. }
  1510. .map-for-name-p {
  1511. padding: 0 10rpx;
  1512. height: 20rpx;
  1513. line-height: 20rpx;
  1514. font-size: 14rpx;
  1515. text-align: center;
  1516. color: #333;
  1517. overflow: hidden;
  1518. text-overflow: ellipsis;
  1519. white-space: nowrap;
  1520. }
  1521. .map-for-num-p {
  1522. padding: 0 10rpx;
  1523. height: 20rpx;
  1524. line-height: 20rpx;
  1525. font-size: 14rpx;
  1526. text-align: center;
  1527. color: #333;
  1528. overflow: hidden;
  1529. text-overflow: ellipsis;
  1530. white-space: nowrap;
  1531. }
  1532. .center-move-door-p-t {
  1533. background: url("@/pages_manage/images/icon_sysbjt_m.png") !important;
  1534. background-size: 100% !important;
  1535. transform: rotate(180deg);
  1536. }
  1537. .center-move-door-p-b {
  1538. background: url("@/pages_manage/images/icon_sysbjt_m.png") !important;
  1539. background-size: 100% !important;
  1540. }
  1541. .center-move-door-p-l {
  1542. background: url("@/pages_manage/images/icon_sysbjt_m.png") !important;
  1543. background-size: 100% !important;
  1544. transform: rotate(90deg);
  1545. }
  1546. .center-move-door-p-r {
  1547. background: url("@/pages_manage/images/icon_sysbjt_m.png") !important;
  1548. background-size: 100% !important;
  1549. transform: rotateZ(270deg);
  1550. }
  1551. .lightTopOn {
  1552. background: url("@/pages_manage/images/icon_sjt.png");
  1553. background-size: 100%;
  1554. }
  1555. .lightTopOff {
  1556. background: url("@/pages_manage/images/icon_shang_hs.png");
  1557. background-size: 100%;
  1558. }
  1559. .lightBottomOn {
  1560. background: url("@/pages_manage/images/icon_xjt.png");
  1561. background-size: 100%;
  1562. }
  1563. .lightBottomOff {
  1564. background: url("@/pages_manage/images/icon_xia_hs.png");
  1565. background-size: 100%;
  1566. }
  1567. .lightLeftOn {
  1568. background: url("@/pages_manage/images/icon_zuo.png");
  1569. background-size: 100%;
  1570. }
  1571. .lightLeftOff {
  1572. background: url("@/pages_manage/images/icon_zou_hs.png");
  1573. background-size: 100%;
  1574. }
  1575. .lightRightOn {
  1576. background: url("@/pages_manage/images/icon_yuo.png");
  1577. background-size: 100%;
  1578. }
  1579. .lightRightOff {
  1580. background: url("@/pages_manage/images/icon_you_hs.png");
  1581. background-size: 100%;
  1582. }
  1583. }
  1584. }
  1585. .for-map-box {
  1586. border: 2rpx solid #fff;
  1587. background: #CEF2FD;
  1588. }
  1589. .for-map-box-one {
  1590. background: #CEFDD5;
  1591. }
  1592. .for-map-box-two {
  1593. background: url("@/pages_manage/images/icon_yjtd.png") center center no-repeat #006400;
  1594. background-size: 60rpx 60rpx;
  1595. }
  1596. .for-map-box-two-check {
  1597. background: url("@/pages_manage/images/icon_yjtd.png") center center no-repeat rgba(50, 205, 50, 1);
  1598. background-size: 80rpx 80rpx;
  1599. }
  1600. .room-type-one {
  1601. //选中
  1602. background: rgba(178, 235, 255, 1);
  1603. }
  1604. .room-type-two {
  1605. //报警
  1606. background: rgba(232, 0, 0, 0.4);
  1607. box-shadow: 0 0 10rpx 1rpx #E80000 inset;
  1608. }
  1609. .room-type-three {
  1610. //选中报警
  1611. background: rgba(178, 235, 255, 1);
  1612. box-shadow: 0 0 10rpx 1rpx #E80000 inset;
  1613. }
  1614. }
  1615. }
  1616. }
  1617. }
  1618. .video-max-box {
  1619. width: 710rpx;
  1620. height: 780rpx;
  1621. overflow-y: scroll;
  1622. background: #FFFFFF;
  1623. border-radius: 20rpx;
  1624. padding: 22rpx 30rpx 30rpx;
  1625. box-sizing: border-box;
  1626. margin-top: 20rpx;
  1627. margin-bottom: 120rpx;
  1628. video {
  1629. width: 645rpx;
  1630. height: 355rpx;
  1631. }
  1632. }
  1633. .bottom-button-box {
  1634. position: absolute;
  1635. bottom: 20rpx;
  1636. display: flex;
  1637. width: 670rpx;
  1638. margin: 20rpx;
  1639. view {
  1640. width: 335rpx;
  1641. height: 100rpx;
  1642. line-height: 100rpx;
  1643. text-align: center;
  1644. color: #fff;
  1645. font-size: 28rpx;
  1646. }
  1647. .voice {
  1648. border-top-left-radius: 50rpx;
  1649. border-bottom-left-radius: 50rpx;
  1650. background: #FF9C00;
  1651. }
  1652. .plan {
  1653. background: #21A743;
  1654. }
  1655. .evacuate {
  1656. border-top-right-radius: 50rpx;
  1657. border-bottom-right-radius: 50rpx;
  1658. background: #0183FA;
  1659. }
  1660. }
  1661. }
  1662. .live-button {
  1663. width: 650rpx;
  1664. height: 100rpx;
  1665. line-height: 100rpx;
  1666. text-align: center;
  1667. font-size: 28rpx;
  1668. margin: 50rpx auto 0;
  1669. border-radius: 20rpx;
  1670. }
  1671. .live-color-a {
  1672. color: #fff;
  1673. background: #FF8686;
  1674. }
  1675. .live-color-b {
  1676. color: #fff;
  1677. background: #25C95B;
  1678. }
  1679. /* 语音广播 */
  1680. .shade-max-big-box {
  1681. height: 100%;
  1682. width: 100%;
  1683. position: fixed;
  1684. display: flex;
  1685. flex-direction: column;
  1686. z-index: 10;
  1687. background: rgba(0, 0, 0, 0.2);
  1688. .null-box {
  1689. flex: 1;
  1690. }
  1691. /* 语音广播-执行疏散 */
  1692. .broadcast {
  1693. width: 100%;
  1694. // height: 532rpx;
  1695. background: #FFFFFF;
  1696. border-top-left-radius: 20rpx;
  1697. border-top-right-radius: 20rpx;
  1698. padding: 22rpx 30rpx 30rpx;
  1699. box-sizing: border-box;
  1700. margin-top: 20rpx;
  1701. .broadcast_t {
  1702. font-size: 30rpx;
  1703. font-family: PingFang SC;
  1704. font-weight: 500;
  1705. color: #333333;
  1706. line-height: 30rpx;
  1707. >label {
  1708. font-size: 24rpx;
  1709. font-family: PingFang SC;
  1710. font-weight: 500;
  1711. color: #999999;
  1712. line-height: 30rpx;
  1713. margin-left: 16rpx;
  1714. }
  1715. }
  1716. .trumpet-max-box {
  1717. display: flex;
  1718. justify-content: flex-start;
  1719. margin-top: 22rpx;
  1720. flex-wrap: wrap;
  1721. .trumpet-for-box {
  1722. display: inline-block;
  1723. width: auto;
  1724. height: 60rpx;
  1725. line-height: 60rpx;
  1726. font-size: 24rpx;
  1727. text-align: center;
  1728. cursor: pointer;
  1729. overflow: hidden;
  1730. border: 1rpx solid #E0E0E0;
  1731. border-radius: 10rpx;
  1732. color: #E0E0E0;
  1733. display: flex;
  1734. justify-content: center;
  1735. margin-right: 20rpx;
  1736. margin-bottom: 10rpx;
  1737. padding: 0 12rpx;
  1738. box-sizing: border-box;
  1739. >img {
  1740. width: 36rpx;
  1741. height: 34rpx;
  1742. margin: 12rpx 20rpx 0 25rpx;
  1743. }
  1744. }
  1745. .trumpet-color-a {
  1746. border: 1px solid #0183FA;
  1747. color: #0183FA;
  1748. }
  1749. .trumpet-color-b {
  1750. border: 1px solid #CCCCCC;
  1751. color: #999;
  1752. }
  1753. }
  1754. .broadcast_m {
  1755. width: 100%;
  1756. margin-bottom: 80rpx;
  1757. .broadcast_m_t {
  1758. width: 142rpx;
  1759. height: 142rpx;
  1760. margin: 30rpx 0 0 258rpx;
  1761. position: relative;
  1762. font-size: 24rpx;
  1763. font-family: PingFang SC;
  1764. font-weight: 500;
  1765. line-height: 170rpx;
  1766. text-align: center;
  1767. >img {
  1768. width: 142rpx;
  1769. height: 142rpx;
  1770. position: absolute;
  1771. }
  1772. >label {
  1773. width: 100%;
  1774. font-size: 24rpx;
  1775. font-family: PingFang SC;
  1776. font-weight: 500;
  1777. color: #0183FA;
  1778. line-height: 24rpx;
  1779. display: inline-block;
  1780. text-align: center;
  1781. position: absolute;
  1782. top: 76rpx;
  1783. }
  1784. /* 按下 */
  1785. .press_color {
  1786. color: #FFFFFF;
  1787. }
  1788. /* 松开 */
  1789. .slip_color {
  1790. color: #0183FA;
  1791. }
  1792. }
  1793. .broadcast_m_t_back_a {
  1794. background: url(@/pages_manage/images/icon_sskz_skfs.png);
  1795. background-size: 100%;
  1796. color: #FFFFFF;
  1797. }
  1798. .broadcast_m_t_back_b {
  1799. background: url(@/pages_manage/images/icon_sskz_azsh.png);
  1800. background-size: 100%;
  1801. color: #0183FA;
  1802. }
  1803. .broadcast_m_b {
  1804. font-size: 24rpx;
  1805. font-family: PingFang SC;
  1806. font-weight: 500;
  1807. color: #999999;
  1808. line-height: 24rpx;
  1809. text-align: center;
  1810. margin-top: 14rpx;
  1811. }
  1812. }
  1813. /* 疏散按钮 */
  1814. .evacuation-button-box {
  1815. width: 650rpx;
  1816. height: 100rpx;
  1817. background: #0183FA;
  1818. color: #fff;
  1819. text-align center;
  1820. line-height: 100rpx;
  1821. font-size: 28rpx;
  1822. margin: 88rpx auto 0;
  1823. border-radius: 20rpx;
  1824. }
  1825. }
  1826. }
  1827. }
  1828. .setUpEvacuation-bottom-button {
  1829. width: 650rpx;
  1830. height: 100rpx;
  1831. background: #0183FA;
  1832. color: #fff;
  1833. text-align: center;
  1834. line-height: 100rpx;
  1835. font-size: 28rpx;
  1836. margin: 50rpx auto;
  1837. border-radius: 20rpx;
  1838. }
  1839. }
  1840. </style>