emergencyEvacuationBig.vue 68 KB

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