emergencyEvacuationBig.vue 65 KB

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