emergencyEvacuationBig.vue 67 KB

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