emergencyEvacuationBig.vue 72 KB

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