emergencyEvacuationBig.vue 65 KB

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