emergencyEvacuationBig.vue 72 KB

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