emergencyEvacuationBig.vue 57 KB

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