emergencyEvacuationBig.vue 68 KB

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