emergencyEvacuationBig.vue 56 KB

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