emergencyEvacuationBig.vue 57 KB

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