emergencyEvacuationBig.vue 57 KB

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