emergencyEvacuationBig.vue 68 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274
  1. <!-- 应急疏散 -->
  2. <template>
  3. <view id="emergencyEvacuationBig">
  4. <view class="setUpEvacuation" v-if="pageType == 1">
  5. <view class="evacuation-max-box">
  6. <view class="picker-max-box">
  7. <view class="picker-title-box">
  8. <view></view>
  9. <view>学院楼栋</view>
  10. </view>
  11. <picker @change="buildingChange" :range-key="'name'" :value="id" :range="buildingList">
  12. <view class="picker-min-box">
  13. <view>{{buildingName?buildingName:'请选择学院楼栋'}}</view>
  14. <img src="@/images/icon_06.png">
  15. </view>
  16. </picker>
  17. </view>
  18. <view class="picker-max-box">
  19. <view class="picker-title-box">
  20. <view></view>
  21. <view>楼层</view>
  22. </view>
  23. <picker @change="floorChange" :disabled="!buildingId" :range-key="'name'" :value="id"
  24. :range="floorList">
  25. <view class="picker-min-box">
  26. <view>{{floorName?floorName:'请选择楼层'}}</view>
  27. <img src="@/images/icon_06.png">
  28. </view>
  29. </picker>
  30. </view>
  31. <view class="picker-max-box">
  32. <view class="picker-title-box">
  33. <view></view>
  34. <view>实验室</view>
  35. </view>
  36. <picker @change="fjListChange" :disabled="!floorId" :range-key="'subName'" :value="subId"
  37. :range="fjListArray">
  38. <view class="picker-min-box">
  39. <view>{{subName?subName:'请选择实验室'}}</view>
  40. <img src="@/images/icon_06.png">
  41. </view>
  42. </picker>
  43. </view>
  44. </view>
  45. <view class="setUpEvacuation-bottom-button" @click="confirmBtn">确认</view>
  46. </view>
  47. <view class="implementEvacuation" v-if="pageType == 2">
  48. <view class="evacuation-max-box">
  49. <!-- 头部 -->
  50. <view class="evacuation-title-box">
  51. <view class="evacuation-title-left">
  52. <view class="evacuation-title-name-box">{{checkSubName}}</view>
  53. <view class="site"><img src="@/images/icon_14.png">{{address}}</view>
  54. </view>
  55. <view class="evacuation-title-right" @click="backButton()">选择房间</view>
  56. </view>
  57. <!-- 地图部分 -->
  58. <view class="roadmap">
  59. <view class="roadmap_t">
  60. <view class="monito_li_r_l"></view>
  61. <view class="monito_li_r_r_button" @click="goAllPage">全屏</view>
  62. </view>
  63. <view class="evacuation-map-box">
  64. <view class="emergencyEvacuationBigFullScreen-page" v-if="mapType"
  65. :style="'width:'+mapWidth+'rpx;height:'+mapHeight+'rpx;transform: scale('+zoomData+');margin-top:-'+mapHeight/2+'rpx;margin-left:-'+mapWidth/2+'rpx;'">
  66. <view class="map-max-box" :style="'width:'+mapWidth+'rpx;height:'+mapHeight+'rpx;'">
  67. <view class="map-max-for-box for-map-box" v-if="item.type == 1"
  68. v-for="(item,index) in mapList":key="index"
  69. :class="!item.policeType && checkSubId ==item.subId ? 'room-type-one':(
  70. item.policeType && checkSubId !=item.subId ? 'room-type-two':(
  71. item.policeType && checkSubId ==item.subId ? 'room-type-three':(
  72. !item.loginAdmin ? 'room-type-noe':'')))"
  73. :style="'top:'+item.y+'rpx;left:'+item.x+'rpx;width:'+(item.w-4)+'rpx;height:'+(item.h-4)+'rpx;'">
  74. <view class="map-max-for-min-box">
  75. <view class="map-for-name-p" :style="'margin-top:'+((item.h/2)-20)+'rpx;'">
  76. {{item.roomType == '-99'?item.roomName:item.subName}}</view>
  77. <view class="map-for-num-p">({{item.roomNum}})</view>
  78. <view class="position-box" src="@/images/evacuation3_2/icon_sysbjt_m.png"
  79. :class="minItem.toward=='top'?'center-move-door-p-t':(minItem.toward=='bottom'?'center-move-door-p-b':(minItem.toward=='left'?'center-move-door-p-l':(minItem.toward=='right'?'center-move-door-p-r':'')))"
  80. v-for="(minItem,minIndex) in item.doorList" :key="minIndex"
  81. :style="'top:'+minItem.y+'rpx;left:'+minItem.x+'rpx;width:'+minItem.w+'rpx;height:'+minItem.h+'rpx;'">
  82. </view>
  83. </view>
  84. </view>
  85. <view class="map-max-for-box for-map-box-one" v-if="item.type == 2" v-for="(item,index) in mapList"
  86. :key="index" :style="'top:'+item.y+'rpx;left:'+item.x+'rpx;width:'+item.w+'rpx;height:'+item.h+'rpx;'">
  87. <view class="map-max-for-min-box">
  88. <view class="position-box"
  89. :class="minItem.state=='1'&&minItem.openType?'lightTopOn':(minItem.state=='1'&&!minItem.openType?'lightTopOff':
  90. (minItem.state=='2'&&minItem.openType?'lightBottomOn':(minItem.state=='2'&&!minItem.openType?'lightBottomOff':
  91. (minItem.state=='3'&&minItem.openType?'lightLeftOn':(minItem.state=='3'&&!minItem.openType?'lightLeftOff':
  92. (minItem.state=='4'&&minItem.openType?'lightRightOn':(minItem.state=='4'&&!minItem.openType?'lightRightOff':'')))))))"
  93. v-for="(minItem,minIndex) in item.lightList" :key="minIndex"
  94. :style="'top:'+minItem.y+'rpx;left:'+minItem.x+'rpx;width:'+minItem.w+'rpx;height:'+minItem.h+'rpx;'">
  95. </view>
  96. </view>
  97. </view>
  98. <view class="map-max-for-box for-map-box-two" v-if="item.type == 3" v-for="(item,index) in mapList"
  99. :key="index" :class="item.roomCheckType?'for-map-box-two-check':''"
  100. :style="'top:'+item.y+'rpx;left:'+item.x+'rpx;width:'+item.w+'rpx;height:'+item.h+'rpx;'">
  101. </view>
  102. </view>
  103. </view>
  104. </view>
  105. </view>
  106. <!-- 一键灭火 -->
  107. <view class="outfire" v-if='fireType'>
  108. <view class="outfire_li" v-if="!fireListType">
  109. <img src="@/images/icon_sy_wt.png">
  110. <text style="color: #FF7B1A;">设备已离线,请及时处理。</text>
  111. </view>
  112. <view class="outfire_li" v-if="fireStartType">
  113. <img src="@/images/icon_sy_mhwc.png">
  114. <text style="color: #FF2333;">灭火中,灭火程序将于<text>{{conductCountdown}}</text>秒后结束</text>
  115. </view>
  116. <view class="outfire_li" v-if="outfireEnd">
  117. <img src="@/images/icon_sy_mhwc.png">
  118. <text style="color: #FF2333;" class="finish">自动灭火完成,请确保在关闭灭火一体机电源后补充灭火耗材,耗材补充完毕需要打开电源并点击一体机上的复位按钮</text>
  119. </view>
  120. <template v-if="fireListType && !fireStartType && !outfireEnd">
  121. <view class="outfire_li">
  122. <img v-if='!outfireData.smoke' src="@/images/icon_yw_zc.png">
  123. <img v-if='outfireData.smoke' src="@/images/icon_yw_yc.png">
  124. <text
  125. :class="outfireData.smoke?'abnormal':'normal'">{{outfireData.smoke?'有烟雾':'无烟雾'}}</text>
  126. </view>
  127. <view class="outfire_li">
  128. <img v-if='!outfireData.temperature' src="@/images/icon_wd_zc.png">
  129. <img v-if='outfireData.temperature' src="@/images/icon_wd_yc.png">
  130. <text
  131. :class="outfireData.temperature?'abnormal':'normal'">{{outfireData.temperature?'温度异常':'温度正常'}}</text>
  132. </view>
  133. <view class="outfire_li">
  134. <img v-if='!outfireData.fire' src="@/images/icon_hy_zc.png">
  135. <img v-if='outfireData.fire' src="@/images/icon_hy_yc.png">
  136. <text :class="outfireData.fire?'abnormal':'normal'">{{outfireData.fire?'发现火焰':'无火焰'}}</text>
  137. </view>
  138. </template>
  139. <view v-if="fireListType && !fireStartType && !outfireEnd"
  140. :class="fireListType?'outfire_yes_btn':'outfire_no_btn'" @click="outfireFun()">一键灭火
  141. </view>
  142. </view>
  143. <!-- 视频部分 -->
  144. <view class="video-max-box" v-if="urlList[0]">
  145. <video v-for="(item,index) in urlList" :key="index" ref="videoRef" :src="item.url"
  146. :poster="videoCover" :custom-cache='false' :autoplay="true" :controls="true"
  147. :enable-danmu="false" :muted="true" :show-fullscreen-btn="true" :show-center-play-btn="false"
  148. :show-play-btn="false" @error="videoErrorCallback">
  149. </video>
  150. </view>
  151. <view class="bottom-button-box">
  152. <view @click="shadeTypeClick()">语音广播</view>
  153. <view @click="evacuationButton(1)" v-if="isEvacuate">执行疏散</view>
  154. <view @click="evacuationButton(2)" v-if="!isEvacuate">结束疏散</view>
  155. </view>
  156. </view>
  157. <!-- 语音广播-->
  158. <view class="shade-max-big-box" v-if="broadcastType">
  159. <view class="null-box" @click="shadeTypeClick()"></view>
  160. <!-- 语音广播-执行疏散 -->
  161. <view class="broadcast">
  162. <view class="broadcast_t">语音广播<label>选择喇叭位置</label></view>
  163. <!-- 按钮部分 -->
  164. <view class="trumpet-max-box">
  165. <view @click="trumpetClick(index)" class="trumpet-for-box"
  166. :class="item.type?'trumpet-color-a':'trumpet-color-b'" v-for="(item,index) in trumpetList"
  167. :key="index">
  168. <img src="@/images/icon_sskz_zc.png" v-if="!item.type">
  169. <img src="@/images/icon_sskz_xz.png" v-if="item.type">
  170. {{item.name}}
  171. </view>
  172. </view>
  173. <view class="broadcast_m">
  174. <view class="broadcast_m_t" :class="liveType?'broadcast_m_t_back_a':'broadcast_m_t_back_b'"
  175. @longpress.stop="recordButton" @touchmove.stop="cancelButton" @touchend.stop="sendButton">
  176. {{liveType?'松开发送':'按住说话'}}
  177. </view>
  178. <view class="broadcast_m_b" v-if="!liveType">按住说话,录入广播内容</view>
  179. <view class="broadcast_m_b" v-if="liveType">松开发送,向上滑动取消发送</view>
  180. </view>
  181. </view>
  182. </view>
  183. <!-- 一键灭火遮罩-->
  184. <view class="shade-outfire" v-if="dialogVisible">
  185. <view class="null-box" @click="dialogOutfire()"></view>
  186. <view class="shade-outfire-n">
  187. <img class="shade-outfire-n-t" src="@/images/icon_mh.png" />
  188. <view class="shade-outfire-n-m">一键灭火启动中,倒计时<text>{{countdown}}</text>秒</view>
  189. <view class="shade-outfire-n-b" @click="cancelOutfire()">放弃一键灭火</view>
  190. </view>
  191. </view>
  192. </view>
  193. <view></view>
  194. </view>
  195. </template>
  196. <script>
  197. import $mqtt from '@/utils/mqtt.min.js';
  198. import {
  199. config
  200. } from '@/api/request/config.js'
  201. import {
  202. lablayout,
  203. evacuate,
  204. closure,
  205. lineEvacuate,
  206. getRedis,
  207. getDeviceList,
  208. textParseUrlIps,
  209. laboratoryInfo,
  210. getCameraByFloor,
  211. lineEvacuateTow,
  212. treeselectByUser,
  213. getBuilding,
  214. getDeviceListBySub,
  215. GetStartList,
  216. firedeviceStatus,
  217. firedeviceStatusTiming,
  218. firedeviceStart,
  219. firedeviceCancel
  220. } from '@/api/index.js'
  221. import {
  222. getBuildOrFloorList,
  223. getFloorData,
  224. getRedisEvacuation,
  225. openLight,
  226. closeLight,
  227. executeEvacuation,
  228. endEvacuation,
  229. selectTriggerInfo,
  230. riskPlanId
  231. } from '@/api/index.js'
  232. export default {
  233. data() {
  234. return {
  235. videoCover: uni.getStorageSync('videoCover'),
  236. //页面状态
  237. pageType: "1",
  238. deptIndex: 0,
  239. //院系楼栋数据
  240. buildingList: [],
  241. buildingName: "",
  242. buildingId: "",
  243. //楼层数据
  244. floorList: [],
  245. floorName: "",
  246. floorId: "",
  247. //实验室
  248. fjListArray: [],
  249. //疏散方向
  250. buttonArray: [{
  251. name: "向左疏散",
  252. id: "1"
  253. },
  254. {
  255. name: "向右疏散",
  256. id: "2"
  257. },
  258. {
  259. name: "两侧疏散",
  260. id: "0"
  261. },
  262. ],
  263. buttonArrayIndex: "2",
  264. //视频数据
  265. urlList: [],
  266. //布局数据
  267. fjList: [],
  268. lightList: [{
  269. id: "5",
  270. type: false,
  271. },
  272. {
  273. id: "2",
  274. type: false,
  275. },
  276. {
  277. id: "3",
  278. type: false,
  279. },
  280. {
  281. id: "4",
  282. type: false,
  283. },
  284. {
  285. id: "1",
  286. type: false,
  287. },
  288. {
  289. id: "6",
  290. type: false,
  291. },
  292. ],
  293. //接收参数
  294. subId: "",
  295. subName: "",
  296. title: "",
  297. type: "",
  298. //喇叭数据
  299. trumpetList: [],
  300. //广播相关
  301. liveType: false,
  302. sendLock: true, //发送锁,当为true时上锁,false时解锁发送
  303. recorderManager: wx.getRecorderManager(),
  304. isEvacuate: true, //疏散按钮控制,当为true时候执行疏散
  305. //滑动记录
  306. startPoint: {},
  307. //摄像头信息
  308. deptId: '',
  309. itemData: {
  310. hardwareNUM: '',
  311. name: '',
  312. },
  313. broadcastType: false,
  314. //选中楼栋
  315. checkSubName:"",
  316. address: "",
  317. videoHardwareNUM: [], //实验室和楼道摄像头编码
  318. countdown: '', //倒计时
  319. timer2: null, //倒计时
  320. dialogVisible: false, //一键灭火弹出层
  321. conductCountdown: '',
  322. timer3: null, //倒计时
  323. outfireEnd: false, //灭火结束状态
  324. //新布局地图相关数据
  325. zoomData: null,
  326. mapType:false,
  327. mapList: [],
  328. mapWidth: null, //40边框距离
  329. mapHeight: null, //40边框距离
  330. //新MQTT
  331. floorClient: {},
  332. evacuationTopic: "lab/newexit/line", //疏散
  333. //灭火设备MQTT相关
  334. fireClient:{},
  335. fireTopic:"lab/fireDevice/Warn/",//传感器状态异常
  336. fireOnlineTopic:"lab/fireDevice/isOnline/",//设备是否在线
  337. firePerformTopic:"lab/fireDevice/executing/",//是否正在执行灭火操作
  338. fireType:false,//有无火焰设备状态
  339. fireListType:false,//灭火设备在线离线
  340. fireCode:null,// //灭火设备code
  341. fireStartType:false, //灭火启动状态
  342. outfireData: {}, //一键灭火
  343. }
  344. },
  345. onLoad(option) {
  346. if(option.item){
  347. let obj = JSON.parse(decodeURIComponent(option.item));
  348. this.$set(this,'buildingId',obj.buildId);
  349. this.$set(this,'deptId',obj.buildId);
  350. this.$set(this,'floorId',obj.floorId);
  351. this.$set(this,'subId',obj.subId);
  352. this.$set(this.itemData,'subjectId',obj.subId);
  353. this.$set(this,'pageType',2);
  354. this.confirmBtn();
  355. this.riskPlanId(obj.groupId);
  356. }
  357. //一键灭火正式使用需要注销
  358. // this.itemData.subjectId=85
  359. // this.firedeviceStatus();
  360. },
  361. onShow() {
  362. this.treeselectByUser();
  363. if(this.floorId&&this.subId){
  364. this.getBuildingData();
  365. }
  366. },
  367. onUnload() {
  368. },
  369. methods: {
  370. //返回按钮
  371. backButton(){
  372. let self = this;
  373. this.offMQTT();
  374. this.$set(this,'buildingName',null);
  375. this.$set(this,'buildingId',null);
  376. this.$set(this,'deptId',null);
  377. this.$set(this,'floorName',null);
  378. this.$set(this,'floorId',null);
  379. this.$set(this,'subId',null);
  380. this.$set(this,'subName',null);
  381. // console.log('this.$refs.videoRef',this.$refs.videoRef)
  382. // console.log('this.$refs.videoRef',this.$refs.videoRef.getTotalList())
  383. // for(let i=0;i<self.urlList.length;i++){
  384. // let id = self.urlList[i].id;
  385. // console.log(self.$refs.id);
  386. // console.log('urlList',this.urlList[i]);
  387. // let query = wx.createSelectorQuery();//创建节点查询器 query
  388. // query.select('#440102004920000000010014')
  389. // let a = query.select('#440102004920000000010014');
  390. // console.log('query',query.select('#440102004920000000010014'));
  391. // console.log('wx.createSelectorQuery',wx.createSelectorQuery('440102004920000000010014'));
  392. // let videoElement1 = document.getElementById('440102004920000000010014');
  393. // console.log('videoElement1',videoElement1);
  394. // let videoElement = document.getElementById(self.urlList[i].id);
  395. // console.log('videoElement',videoElement);
  396. // videoElement.pause();
  397. // videoElement.removeAttribute('src'); // empty source
  398. // videoElement.load();
  399. // // console.log('关闭',self.urlList[i].videoContext)
  400. // // self.urlList[i].videoContext.stop();
  401. // }
  402. // return
  403. this.$set(this,'pageType',1);
  404. this.$set(this,'urlList',[]);
  405. this.treeselectByUser();
  406. },
  407. //全屏疏散页面
  408. goAllPage() {
  409. let obj = {
  410. buildingId:this.buildingId,
  411. floorId:this.floorId,
  412. type:1,
  413. }
  414. uni.navigateTo({
  415. url: '/pages/emergencyEvacuationBigFullScreen?item='+encodeURIComponent(JSON.stringify(obj)),
  416. });
  417. },
  418. //一键灭火-查询设备状态
  419. async firedeviceStatus(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. console.log()
  556. } else {
  557. _this.loading2();
  558. }
  559. }, 1000);
  560. },
  561. loading2() {
  562. //启动定时器
  563. this.conductCountdown--; //定时器减1
  564. },
  565. clearTimer2() {
  566. //清除定时器
  567. clearInterval(this.timer3);
  568. this.timer3 = null;
  569. },
  570. //获取楼栋数据
  571. async treeselectByUser(option) {
  572. const { data } = await getBuildOrFloorList({type:2,parentId:''})
  573. this.$set(this, 'buildingList', data.data);
  574. // this.$set(this, 'buildingName', "");
  575. // this.$set(this, 'buildingId', "");
  576. // this.$set(this, 'deptId', "");
  577. // this.$set(this, 'floorList', []);
  578. // this.$set(this, 'floorName', "");
  579. // this.$set(this, 'floorId', "");
  580. // this.$set(this, 'fjListArray', []);
  581. // this.$set(this, 'subName', "");
  582. // this.$set(this, 'subId', "");
  583. this.selectTriggerInfo(1);
  584. },
  585. //获取楼层数据
  586. async getBuilding(buildingId) {
  587. const { data } = await getBuildOrFloorList({type:3,parentId:buildingId})
  588. this.$set(this, 'floorList', data.data);
  589. this.$set(this, 'floorName', "");
  590. this.$set(this, 'floorId', "");
  591. this.$set(this, 'fjListArray', []);
  592. this.$set(this, 'subName', "");
  593. this.$set(this, 'subId', "");
  594. this.selectTriggerInfo(2);
  595. },
  596. //楼栋选中
  597. buildingChange(e) {
  598. this.$set(this, 'buildingName', this.buildingList[e.detail.value].name);
  599. this.$set(this, 'buildingId', this.buildingList[e.detail.value].id);
  600. this.$set(this, 'deptId', this.buildingList[e.detail.value].id);
  601. this.$set(this, 'floorId', null);
  602. this.$set(this, 'floorName', null);
  603. this.$set(this, 'subId', null);
  604. this.$set(this, 'subName', null);
  605. this.$set(this.itemData, 'subjectId', null);
  606. this.$set(this, 'floorList', []);
  607. this.$set(this, 'fjListArray', []);
  608. this.getBuilding(this.buildingList[e.detail.value].id);
  609. },
  610. //楼层选中
  611. floorChange(e) {
  612. this.$set(this, 'floorName', this.floorList[e.detail.value].name);
  613. this.$set(this, 'floorId', this.floorList[e.detail.value].id);
  614. this.$set(this, 'subId', null);
  615. this.$set(this, 'subName', null);
  616. this.$set(this.itemData, 'subjectId', null);
  617. this.$set(this, 'fjListArray', []);
  618. this.getBuildingData();
  619. },
  620. //实验室选择
  621. fjListChange(e) {
  622. this.$set(this, 'subName', this.fjListArray[e.detail.value].subName);
  623. this.$set(this, 'subId', this.fjListArray[e.detail.value].subId);
  624. this.$set(this.itemData, 'subjectId', this.fjListArray[e.detail.value].subId);
  625. },
  626. async riskPlanId(id){
  627. let obj = {
  628. groupId:id,
  629. ifCheck:1,
  630. };
  631. const {data} = await riskPlanId(obj);
  632. },
  633. //获取预案数据
  634. async selectTriggerInfo(type){
  635. let self = this;
  636. const {data} = await selectTriggerInfo();
  637. if(data.code == 200){
  638. if(type == 1){
  639. //标记楼栋
  640. for(let o=0;o<self.buildingList.length;o++){
  641. for(let i=0;i<data.data.length;i++){
  642. if(data.data[i].buildId == self.buildingList[o].id){
  643. self.buildingList[o].name.replace('(预案发生)')
  644. self.buildingList[o].name = '(预案发生) '+self.buildingList[o].name
  645. }
  646. }
  647. }
  648. }
  649. if(type == 2){
  650. //标记楼层
  651. for(let o=0;o<self.floorList.length;o++){
  652. for(let i=0;i<data.data.length;i++){
  653. if(data.data[i].floorId == self.floorList[o].id){
  654. self.floorList[o].name.replace('(预案发生)')
  655. self.floorList[o].name = '(预案发生) '+self.floorList[o].name
  656. }
  657. }
  658. }
  659. }
  660. if(type == 3){
  661. //标记实验室
  662. for(let o=0;o<self.fjListArray.length;o++){
  663. for(let i=0;i<data.data.length;i++){
  664. if(data.data[i].subId == self.fjListArray[o].subId){
  665. self.fjListArray[o].subName.replace('(预案发生)')
  666. self.fjListArray[o].subName = '(预案发生) '+self.fjListArray[o].subName
  667. }
  668. }
  669. }
  670. }
  671. }
  672. console.log('data.data',data.data);
  673. },
  674. getAppExitLine() {
  675. let list = [{
  676. type: "lab/exit/line"
  677. }, {
  678. type: "lab/fireDevice/Warn/"
  679. }];
  680. getApp().appMqttOn(1, list);
  681. },
  682. getAppOutfire() {
  683. // let list = [{type:"lab/fireDevice/Warn/"}]
  684. let list = [{
  685. type: "lab/function/data"
  686. }];
  687. getApp().appMqttOn(1, list);
  688. },
  689. shadeTypeClick() {
  690. this.broadcastType = !this.broadcastType
  691. },
  692. //获取实验室摄像头
  693. async laboratoryInfo() {
  694. let _this = this;
  695. const {
  696. data
  697. } = await laboratoryInfo(_this.itemData.subjectId);
  698. if (data.code == 200) {
  699. let list = data.data[0];
  700. list.labHardwareVOList.forEach(function(item) {
  701. if (item.hardwareTypeEnum.enumName == 'VIDEO_MONITOR') {
  702. console.log(item.hardwareNUM)
  703. _this.videoHardwareNUM.push(item.hardwareNUM)
  704. }
  705. })
  706. this.getCameraByFloor();
  707. }
  708. },
  709. //获取楼层摄像头列表
  710. async getCameraByFloor() {
  711. let _this = this;
  712. const {
  713. data
  714. } = await getCameraByFloor({
  715. floorId: this.floorId
  716. })
  717. if (data.code == 200) {
  718. if (data.data[0]) {
  719. let list = _this.videoHardwareNUM.concat(data.data)
  720. let qc = []
  721. for (var i = 0; i < list.length - 1; i++) {
  722. for (var j = i + 1; j < list.length; j++) {
  723. if (list[i] === list[j]) {
  724. list.splice(j, 1);
  725. j--;
  726. }
  727. }
  728. }
  729. this.GetStartList(list);
  730. } else {
  731. this.GetStartList(_this.videoHardwareNUM);
  732. }
  733. }
  734. },
  735. async GetStartList(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.data.length;i++){
  755. let text = uni.getStorageSync('cameraUrl');
  756. let url = data.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.data[i].deviceID,
  762. url: newUrl,
  763. videoContext:wx.createVideoContext(data.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/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/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/emergencyEvacuationBigFullScreen'){
  1350. currPage.$vm.mqttPageFunction('FLOOR_EXITLINE')
  1351. }
  1352. } else if (data.data == 'FLOOR_OVER_EXITLINE') {
  1353. if(currPage.route == 'pages/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>