emergencyEvacuationBig.vue 65 KB

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