laboratoryInfo.vue 52 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745
  1. <!-- 我的实验室 -->
  2. <template>
  3. <view id="laboratoryInfo">
  4. <view class="name-max-box">
  5. <view class="title-box">
  6. <view :style="'border:1rpx solid '+itemData.fiedColor+';background:#fff;color:'+itemData.fiedColor+';'">{{itemData.levelName}}</view>
  7. <view>{{itemData.name}}</view>
  8. </view>
  9. <view class="address-box"><span>{{itemData.typeName}}</span>{{itemData.deptName}}</view>
  10. <view class="address-box-two">
  11. <img src="@/images/basicsModules/icon_14.png">
  12. <view>{{itemData.subAddrrStr}}</view>
  13. </view>
  14. </view>
  15. <view class="sensor-max-box" v-if="itemData.sensorFunctionList.length >0&&!saoCodeType">
  16. <view class="title-max-box">
  17. <view class="left-view"></view>
  18. <view class="right-view">传感器</view>
  19. </view>
  20. <view class="text-box">
  21. <view class="min-box" v-for="(minItem,index2) in itemData.sensorFunctionList" :key="index2">
  22. <view class="min-min-box">
  23. <img v-show="minItem.hasWarn" src="@/images/basicsModules/icon_15.png">
  24. <view :class="{'colorA':minItem.hasWarn}">{{minItem.funcName}}:{{minItem.formatVal?minItem.formatVal:'-'}}</view>
  25. </view>
  26. </view>
  27. </view>
  28. </view>
  29. <!-- 一键灭火 -->
  30. <view class="outfire" v-if='fireType'>
  31. <view class="outfire_li" v-if="!fireListType">
  32. <img src="@/images/basicsModules/icon_sy_wt.png">
  33. <text style="color: #FF7B1A;">设备已离线,请及时处理。</text>
  34. </view>
  35. <view class="outfire_li" v-if="fireStartType">
  36. <img src="@/images/basicsModules/icon_sy_mhwc.png">
  37. <text style="color: #FF2333;">灭火中,灭火程序将于<text>{{conductCountdown}}</text>秒后结束</text>
  38. </view>
  39. <view class="outfire_li" v-if="outfireEnd">
  40. <img src="@/images/basicsModules/icon_sy_mhwc.png">
  41. <text style="color: #FF2333;" class="finish">自动灭火完成,请确保在关闭灭火一体机电源后补充灭火耗材,耗材补充完毕需要打开电源并点击一体机上的复位按钮</text>
  42. </view>
  43. <template v-if="fireListType && !fireStartType && !outfireEnd">
  44. <view class="outfire_li">
  45. <img v-if='!outfireData.smoke' src="@/images/basicsModules/icon_yw_zc.png">
  46. <img v-if='outfireData.smoke' src="@/images/basicsModules/icon_yw_yc.png">
  47. <text
  48. :class="outfireData.smoke?'abnormal':'normal'">{{outfireData.smoke?'有烟雾':'无烟雾'}}</text>
  49. </view>
  50. <view class="outfire_li">
  51. <img v-if='!outfireData.temperature' src="@/images/basicsModules/icon_wd_zc.png">
  52. <img v-if='outfireData.temperature' src="@/images/basicsModules/icon_wd_yc.png">
  53. <text
  54. :class="outfireData.temperature?'abnormal':'normal'">{{outfireData.temperature?'温度异常':'温度正常'}}</text>
  55. </view>
  56. <view class="outfire_li">
  57. <img v-if='!outfireData.fire' src="@/images/basicsModules/icon_hy_zc.png">
  58. <img v-if='outfireData.fire' src="@/images/basicsModules/icon_hy_yc.png">
  59. <text :class="outfireData.fire?'abnormal':'normal'">{{outfireData.fire?'发现火焰':'无火焰'}}</text>
  60. </view>
  61. </template>
  62. <view v-if="fireListType && !fireStartType && !outfireEnd"
  63. :class="fireListType?'outfire_yes_btn':'outfire_no_btn'" @click="outfireFun()">一键灭火
  64. </view>
  65. </view>
  66. <view class="control-max-box" v-if="!saoCodeType">
  67. <view class="title-max-box">
  68. <view class="left-view"></view>
  69. <view class="right-view">智能控制</view>
  70. </view>
  71. <view class="button-max-box">
  72. <view class="button-box">
  73. <view @click="goVideo()" v-if="itemData.videoNum>0">视频监控</view>
  74. <view @click="shadeTypeClick()" v-if="trumpetList.length>0">语音广播</view>
  75. </view>
  76. <view class="for-button-box" v-for="(minItem,minIndex) in itemData.labHardwareVOList" :key="minIndex" v-if="minItem.hardwareTypeEnum.enumName!='VIDEO_MONITOR' && minItem.hardwareTypeEnum.enumName!='RFID_RECOGNIZER'&& minItem.hardwareTypeEnum.enumName!='AI_TERMINAL'&& minItem.hardwareTypeEnum.enumName!='AI_DOORLOCK'&& minItem.hardwareTypeEnum.enumName!='AI_CABINETLOCK' && minItem.hardwareName!='一键灭火' && minItem.isPcfire != '1'">
  77. <view class="for-button-p">{{minItem.hardwareName}}<text v-if="minItem.state.code=='3'&& minItem.hardwareTypeEnum.hardwareTypeCode==2">({{minItem.dictLabel}})</text></view>
  78. <img v-if="minItem.state.code=='3' && minItem.pcType != 1" src="@/images/basicsModules/icon_10.png" @click="hardwareButton(minItem,'close')">
  79. <img v-if="minItem.state.code=='4' && minItem.pcType != 1" src="@/images/basicsModules/icon_11.png" @click="hardwareButton(minItem,'open')">
  80. <view class="for-button-p" v-if="minItem.state.code=='0' && minItem.pcType != 1">离线</view>
  81. <view class="for-button-p" v-if="minItem.state.code=='2' && minItem.pcType != 1" style="color:#0183FA;">在线</view>
  82. <view v-if="minItem.pcType == 1" class="pcType-button" @click="pcTypeButtonClick(minItem.id)">操作</view>
  83. </view>
  84. </view>
  85. </view>
  86. <view class="info-max-box">
  87. <view class="title-max-box" :class="{'title-max-box-none':!infoMaxBoxType}">
  88. <view class="left-view"></view>
  89. <view class="right-view">安全信息牌</view>
  90. <view class="click-view" @click="infoMaxBoxClick">
  91. <view>{{infoMaxBoxType?'收起':'展开'}}</view>
  92. <img v-if="infoMaxBoxType" src="@/images/basicsModules/icon_06_1.png">
  93. <img v-else src="@/images/basicsModules/icon_06.png">
  94. </view>
  95. </view>
  96. <view v-if="infoMaxBoxType">
  97. <view class="text-max-box">
  98. <view class="text-min-box">
  99. <view>责任单位:</view>
  100. <view>{{itemData.deptName}}</view>
  101. </view>
  102. <view class="text-min-box">
  103. <view>实验室负责人:</view>
  104. <view>{{itemData.safeInfo.subAdmin[0]?"":"未设置"}}</view>
  105. </view>
  106. <view class="text-min-box" v-for="(item,index) in itemData.safeInfo.subAdmin" :key="index">
  107. <view style="color:#999;">{{item.name}}</view>
  108. <view>{{item.phone?item.phone:'未填写'}}</view>
  109. </view>
  110. <view class="text-min-box">
  111. <view>安全负责人:</view>
  112. <view>{{itemData.safeInfo.safeUser[0]?"":"未设置"}}</view>
  113. </view>
  114. <view class="text-min-box" v-for="(item,index) in itemData.safeInfo.safeUser" :key="index">
  115. <view style="color:#999;">{{item.name}}</view>
  116. <view>{{item.phone?item.phone:'未填写'}}</view>
  117. </view>
  118. </view>
  119. <ivew class="small_title">管控一体机信息</ivew>
  120. <view class="safety-max-box" v-if="itemData.hazardCategory[0]||itemData.riskMeasure[0]||itemData.outfire[0]">
  121. <view class="max-for-box" v-if="itemData.hazardCategory[0]">
  122. <view class="title-box">主要危险类别</view>
  123. <view class="for-box" v-for="(item,index1) in itemData.hazardCategory" :key="index1">● {{item}}</view>
  124. </view>
  125. <view class="max-for-box" v-if="itemData.riskMeasure[0]">
  126. <view class="title-box">风险防控措施</view>
  127. <view class="for-box" v-for="(item,index1) in itemData.riskMeasure" :key="index1">● {{item}}</view>
  128. </view>
  129. <view class="max-for-box" v-if="itemData.outfire[0]">
  130. <view class="title-box">灭火要点</view>
  131. <view class="for-box" v-for="(item,index1) in itemData.outfire" :key="index1">● {{item}}</view>
  132. </view>
  133. </view>
  134. <view class="img-bottom-box" v-if="itemData.safeSigns[0]||itemData.qrCode">
  135. <view class="title-box">安全警示标识</view>
  136. <view class="for-box">
  137. <img class="img-ojb" src="@/pages_manage/images/icon_aqxxp_jzxy.png" v-if="item == 'xiyan'" v-for="(item,index) in itemData.safeSigns" :key="index">
  138. <img class="img-ojb" src="@/pages_manage/images/icon_aqxxp_jzys.png" v-if="item == 'yinshi'" v-for="(item,index) in itemData.safeSigns" :key="index">
  139. <img class="img-ojb" src="@/pages_manage/images/icon_aqxxp_dxaq.png" v-if="item == 'anquan'" v-for="(item,index) in itemData.safeSigns" :key="index">
  140. <img class="img-ojb" src="@/pages_manage/images/icon_aqxxp_gzf.png" v-if="item == 'gongzuofu'" v-for="(item,index) in itemData.safeSigns" :key="index">
  141. <img class="img-ojb" src="@/pages_manage/images/icon_aqxxp_gbmc.png" v-if="item == 'menchuang'" v-for="(item,index) in itemData.safeSigns" :key="index">
  142. <img class="img-ojb" src="@/pages_manage/images/icon_aqxxp_gbsd.png" v-if="item == 'shuidian'" v-for="(item,index) in itemData.safeSigns" :key="index">
  143. </view>
  144. </view>
  145. <ivew class="small_title">电子信息牌信息</ivew>
  146. <view class="safety-max-box" v-if="item.privateList.length>0 && item.classifyType==1" v-for="(item,index) in itemData.classifyList">
  147. <view class="max-for-box">
  148. <view class="title-box">{{item.classifyName}}</view>
  149. <view class="for-box" v-for="(item2,index2) in item.privateList" :key="index2">● {{item2.infoContent}}</view>
  150. </view>
  151. </view>
  152. <view class="img-bottom-box" v-if="item.privateList.length>0 && item.classifyType==2" v-for="(item,index) in itemData.classifyList">
  153. <view class="title-box">{{item.classifyName}}</view>
  154. <view class="for-box">
  155. <img class="img-ojb" :src="baseUrl+item2.infoContent" v-for="(item2,index2) in item.privateList" :key="index2">
  156. <img v-if="itemData.safeInfo.qrCodeUrl" class="code-img" :src="itemData.safeInfo.qrCodeUrl">
  157. </view>
  158. </view>
  159. </view>
  160. </view>
  161. <!-- 一键灭火遮罩-->
  162. <view class="shade-outfire" v-if="dialogVisible">
  163. <view class="null-box" @click="dialogOutfire()"></view>
  164. <view class="shade-outfire-n">
  165. <img class="shade-outfire-n-t" src="@/images/basicsModules/icon_mh.png" />
  166. <view class="shade-outfire-n-m">一键灭火启动中,倒计时<text>{{countdown}}</text>秒</view>
  167. <view class="shade-outfire-n-b" @click="cancelOutfire()">放弃一键灭火</view>
  168. </view>
  169. </view>
  170. <!-- 语音广播-->
  171. <view class="shade-max-big-box" v-if="broadcastType">
  172. <view class="null-box" @click="shadeTypeClick()"></view>
  173. <!-- 语音广播-执行疏散 -->
  174. <view class="broadcast">
  175. <view class="broadcast_t">语音广播<label>选择喇叭位置</label></view>
  176. <!-- 按钮部分 -->
  177. <view class="trumpet-max-box">
  178. <view @click="trumpetClick(index)" class="trumpet-for-box"
  179. :class="item.type?'trumpet-color-a':'trumpet-color-b'" v-for="(item,index) in trumpetList"
  180. :key="index">
  181. <img src="@/images/basicsModules/icon_sskz_zc.png" v-if="!item.type">
  182. <img src="@/images/basicsModules/icon_sskz_xz.png" v-if="item.type">
  183. {{item.name}}
  184. </view>
  185. </view>
  186. <view class="broadcast_m">
  187. <view class="broadcast_m_t" :class="liveType?'broadcast_m_t_back_a':'broadcast_m_t_back_b'"
  188. @longpress.stop="recordButton" @touchmove.stop="cancelButton" @touchend.stop="sendButton">
  189. {{liveType?'松开发送':'按住说话'}}
  190. </view>
  191. <view class="broadcast_m_b" v-if="!liveType">按住说话,录入广播内容</view>
  192. <view class="broadcast_m_b" v-if="liveType">松开发送,向上滑动取消发送</view>
  193. </view>
  194. </view>
  195. </view>
  196. </view>
  197. </template>
  198. <script>
  199. import $mqtt from '@/utils/mqtt.min.js';
  200. import { config } from '@/api/request/config.js'
  201. import { mySubjectList,subject_class,listDepartments,mangerControl,getDicts,laboratoryInfo,
  202. firedeviceStatus,firedeviceStart,firedeviceCancel,controlSwitch,getDeviceListBySub, textParseUrlIps,listData,subjectTriggerModes} from '@/api/apiDemo/index.js'
  203. export default {
  204. data() {
  205. return {
  206. baseUrl:config.base_url,
  207. itemData:{
  208. sensorFunctionList:[],
  209. },
  210. //MQTT请求参数-传感器
  211. mtopic:"lab/function/data",
  212. //MQTT请求参数-设备
  213. mtopicOne:"lab/hardware/data",
  214. msg:"",
  215. client:{},
  216. //安全信息牌
  217. infoMaxBoxType:false,
  218. subject:[],
  219. safetyWarning:[],
  220. hazardCategory:[],
  221. riskMeasure:[],
  222. extinguishingKeyPoints:[],
  223. deptId:"",
  224. saoCodeType:false,
  225. countdown: '', //倒计时
  226. timer2: null, //倒计时
  227. dialogVisible: false, //一键灭火弹出层
  228. conductCountdown: '',
  229. timer3: null, //倒计时
  230. outfireEnd: false, //灭火结束状态
  231. //新布局地图相关数据
  232. zoomData: null,
  233. mapType:false,
  234. mapList: [],
  235. mapWidth: null, //40边框距离
  236. mapHeight: null, //40边框距离
  237. //新MQTT
  238. floorClient: {},
  239. evacuationTopic: "lab/newexit/line", //疏散
  240. //灭火设备MQTT相关
  241. fireClient:{},
  242. fireTopic:"lab/fireDevice/Warn/",//传感器状态异常
  243. fireOnlineTopic:"lab/fireDevice/isOnline/",//设备是否在线
  244. firePerformTopic:"lab/fireDevice/executing/",//是否正在执行灭火操作
  245. fireType:false,//有无火焰设备状态
  246. fireListType:false,//灭火设备在线离线
  247. fireCode:null,// //灭火设备code
  248. fireStartType:false, //灭火启动状态
  249. outfireData: {}, //一键灭火
  250. subId:'',
  251. broadcastType: false,
  252. //喇叭数据
  253. trumpetList: [],
  254. //广播相关
  255. liveType: false,
  256. sendLock: true, //发送锁,当为true时上锁,false时解锁发送
  257. recorderManager: wx.getRecorderManager(),
  258. isEvacuate: true, //疏散按钮控制,当为true时候执行疏散
  259. //滑动记录
  260. startPoint: {},
  261. }
  262. },
  263. onLoad(option) {
  264. let self = this;
  265. if(uni.getStorageSync('saoCodeId')){
  266. this.saoCodeType = true;
  267. this.subId=uni.getStorageSync('saoCodeId');
  268. this.laboratoryInfo();
  269. }else{
  270. if(option.q){
  271. let text = decodeURIComponent(option.q)
  272. console.log('text',text)
  273. let codeId = "";
  274. let newList = text.split("?")[1].split("&")
  275. let list = newList[0].split("=")[1].split("-")
  276. codeId = list[0];
  277. uni.setStorageSync('saoCodeId',codeId)
  278. this.subId=uni.getStorageSync('saoCodeId');
  279. this.saoCodeType = true;
  280. this.laboratoryInfo();
  281. }else{
  282. this.deptId = JSON.parse(decodeURIComponent(option.deptId));
  283. this.itemData = JSON.parse(decodeURIComponent(option.item));
  284. this.subId=this.itemData.id;
  285. self.itemData.videoNum = 0;
  286. self.itemData.hardwareNUM = "";
  287. for(let i=0;i<self.itemData.labHardwareVOList.length;i++){
  288. if(self.itemData.labHardwareVOList[i].hardwareTypeEnum.enumName=='VIDEO_MONITOR'){
  289. self.itemData.hardwareNUM = self.itemData.hardwareNUM+self.itemData.labHardwareVOList[i].hardwareNUM+',';
  290. self.itemData.videoNum++
  291. }
  292. }
  293. this.itemData.safeUserName = this.itemData.safeInfo.safeUserName
  294. this.itemData.safePhone = this.itemData.safeInfo.safePhone
  295. if(this.itemData.safeInfo.hazardCategory){
  296. this.itemData.hazardCategory = this.itemData.safeInfo.hazardCategory
  297. }
  298. if(this.itemData.safeInfo.riskMeasure){
  299. this.itemData.riskMeasure = this.itemData.safeInfo.riskMeasure
  300. }
  301. if(this.itemData.safeInfo.safeSigns){
  302. this.itemData.safeSigns = this.itemData.safeInfo.safeSigns
  303. }
  304. if(this.itemData.safeInfo.outfire){
  305. this.itemData.outfire = this.itemData.safeInfo.outfire
  306. }
  307. if(this.itemData.safeInfo.safeUserNameAdminPhone){
  308. let list = [];
  309. let newList = [];
  310. list = this.itemData.safeInfo.safeUserNameAdminPhone.split(",");
  311. for(let i=0;i<list.length;i++){
  312. list[i] = list[i].split("@");
  313. let obj = {
  314. name:list[i][0],
  315. phone:list[i][1]
  316. }
  317. newList.push(obj);
  318. }
  319. this.itemData.safeInfo.safeUser = newList;
  320. }
  321. if(this.itemData.safeInfo.adminNameAndPhone){
  322. let list = [];
  323. let newList = [];
  324. list = this.itemData.safeInfo.adminNameAndPhone.split(",");
  325. for(let i=0;i<list.length;i++){
  326. list[i] = list[i].split("@");
  327. let obj = {
  328. name:list[i][0],
  329. phone:list[i][1]
  330. }
  331. newList.push(obj);
  332. }
  333. this.itemData.safeInfo.subAdmin = newList;
  334. }
  335. this.saoCodeType = false;
  336. }
  337. }
  338. this.firedeviceStatus();
  339. this.getListData();
  340. if(this.itemData.subAddrr.floorId){
  341. this.getDeviceListBySub();
  342. }
  343. },
  344. onShow(){
  345. if(!this.saoCodeType){
  346. // //监听传感器信息
  347. getApp().watch(this.getMqttSensorData,'mqttSensorData')
  348. // //监听设备信息
  349. getApp().watch(this.getMqttDeviceData,'mqttDeviceData')
  350. //一键灭火-灭火传感器状态异常
  351. getApp().watch(this.getMqttfireData,'mqttfireData')
  352. //一键灭火-是否正在执行灭火操作
  353. getApp().watch(this.getMqttPerformData,'mqttPerformData')
  354. }
  355. },
  356. methods: {
  357. shadeTypeClick() {
  358. this.broadcastType = !this.broadcastType
  359. },
  360. //查询控制记录触发方式
  361. async getListData() {
  362. let _this = this;
  363. let obj={
  364. pageNum:1,
  365. pageSize:20,
  366. dictType:'trigger_modes'
  367. }
  368. const {data} = await listData(obj)
  369. if (data.code == 200) {
  370. this.fanList=data.rows
  371. }
  372. },
  373. //一键灭火-查询设备状态
  374. async firedeviceStatus() {
  375. let _this = this;
  376. const {data} = await firedeviceStatus(_this.subId)
  377. if (data.code == 200) {
  378. if(data.data.isexist){//是否有灭火设备
  379. this.$set(this,'fireType',data.data.isexist);
  380. if(data.data.online){
  381. _this.outfireData = data.data
  382. _this.$set(this,'fireListType',data.data.online);
  383. _this.$set(this,'fireCode',data.data.fireDevice.deviceCode);
  384. if(data.data.temperature && data.data.smoke){
  385. if(!this.fireStartType){
  386. this.$set(this,'fireStartType',true);
  387. this.sendCode2(data.data.timeDifference);
  388. }
  389. }
  390. if(data.data.timeDifference != -1){
  391. if(!this.fireStartType){
  392. this.$set(this,'fireStartType',true);
  393. this.sendCode2(data.data.timeDifference);
  394. }
  395. }
  396. }else{
  397. this.$set(this,'fireListType',false);
  398. this.$set(this,'fireCode',null);
  399. }
  400. }else{
  401. this.$set(this,'fireType',false);
  402. }
  403. this.mqttInfo()
  404. }
  405. },
  406. //启动灭火设备
  407. async firedeviceStart() {
  408. let _this = this;
  409. let obj={
  410. subjectId:this.subId,
  411. deviceCode:_this.fireCode
  412. }
  413. const {data} = await firedeviceStart(obj)
  414. if (data.code == 200) {
  415. if (data.data.online) {
  416. _this.dialogVisible = true;
  417. _this.$set(this,'fireListType',data.data.online);
  418. _this.countdown = data.data.waitTime;//灭火倒计时
  419. _this.sendCode() //倒计时
  420. } else {
  421. wx.showToast({
  422. title: '一键灭火启动失败!',
  423. icon: "none",
  424. duration: 6000
  425. });
  426. }
  427. }
  428. },
  429. //取消灭火设备
  430. async firedeviceCancel() {
  431. let _this = this;
  432. const {data} = await firedeviceCancel(_this.itemData.subjectId)
  433. if (data.code == 200) {
  434. wx.showToast({
  435. title: '放弃一键灭火!',
  436. icon: "none",
  437. duration: 2000
  438. });
  439. }
  440. },
  441. //一键灭火按钮
  442. outfireFun() {
  443. let _this = this;
  444. uni.showModal({
  445. title: "是否确认执行一键灭火?",
  446. content: '该操作存在风险,请您务必确认实验室内人员已安全撤离?',
  447. cancelColor: "#999",
  448. confirmColor: "#0183FA",
  449. success: function(res) {
  450. if (res.confirm) {
  451. _this.firedeviceStart(); //启动灭火设备
  452. } else if (res.cancel) {
  453. }
  454. }
  455. });
  456. },
  457. //一键灭火弹出层关闭
  458. dialogOutfire() {
  459. this.dialogVisible = !this.dialogVisible
  460. this.clearTimer(); //关闭定时器
  461. },
  462. //取消一键灭火
  463. cancelOutfire() {
  464. this.dialogVisible = false;
  465. this.clearTimer(); //关闭定时器
  466. this.firedeviceCancel()
  467. },
  468. //倒计时
  469. sendCode() {
  470. let _this = this;
  471. _this.loading(); //启动定时器
  472. _this.timer2 = setInterval(() => {
  473. //创建定时器
  474. if (_this.countdown === 1) {
  475. _this.clearTimer(); //关闭定时器
  476. } else {
  477. _this.loading();
  478. }
  479. }, 1000);
  480. },
  481. loading() {
  482. //启动定时器
  483. this.countdown--; //定时器减1
  484. },
  485. clearTimer() {
  486. //清除定时器
  487. clearInterval(this.timer2);
  488. this.timer2 = null;
  489. this.dialogVisible = false;
  490. },
  491. //进行中倒计时
  492. sendCode2(time) {
  493. let _this = this;
  494. _this.conductCountdown=time
  495. _this.loading2(); //启动定时器
  496. _this.timer3 = setInterval(() => {
  497. //创建定时器
  498. if (_this.conductCountdown <= 1) {
  499. _this.clearTimer2(); //关闭定时器
  500. _this.outfireEnd = true; //灭火倒计时结束
  501. _this.fireStartType = false; //灭火状态
  502. console.log()
  503. } else {
  504. _this.loading2();
  505. }
  506. }, 1000);
  507. },
  508. loading2() {
  509. //启动定时器
  510. this.conductCountdown--; //定时器减1
  511. },
  512. clearTimer2() {
  513. //清除定时器
  514. clearInterval(this.timer3);
  515. this.timer3 = null;
  516. },
  517. //详情页面MQTT
  518. mqttInfo(){
  519. let list = [];
  520. let obj = {
  521. type:"lab/function/data",
  522. idList:[this.itemData.id],
  523. }
  524. let objOne = {
  525. type:"lab/hardware/data",
  526. idList:[this.itemData.id],
  527. }
  528. let objTow = {
  529. type:"lab/fireDevice/Warn/",
  530. fireCode:this.fireCode,
  531. }
  532. let objThree = {
  533. type:"lab/fireDevice/isOnline/",
  534. fireCode:this.fireCode,
  535. }
  536. let objFour = {
  537. type:"lab/fireDevice/executing/",
  538. fireCode:this.fireCode,
  539. }
  540. list.push(obj);
  541. list.push(objOne);
  542. list.push(objTow);
  543. list.push(objThree);
  544. list.push(objFour);
  545. // mqtt订阅因为返回数据频率问题 暂时取消列表的MQTT刷新
  546. getApp().appMqttOn(1,list);
  547. },
  548. //查询详情
  549. async laboratoryInfo(){
  550. let self = this;
  551. let id = uni.getStorageSync('saoCodeId');
  552. const {data} = await laboratoryInfo(id);
  553. if(data.code == 200){
  554. uni.removeStorageSync('saoCodeId')
  555. this.itemData = data.data[0];
  556. self.itemData.videoNum = 0;
  557. self.itemData.hardwareNUM = "";
  558. this.itemData.safeUserName = this.itemData.safeInfo.safeUserName
  559. this.itemData.safePhone = this.itemData.safeInfo.safePhone
  560. if(this.itemData.safeInfo.hazardCategory){
  561. this.itemData.hazardCategory = this.itemData.safeInfo.hazardCategory
  562. }
  563. if(this.itemData.safeInfo.riskMeasure){
  564. this.itemData.riskMeasure = this.itemData.safeInfo.riskMeasure
  565. }
  566. if(this.itemData.safeInfo.safeSigns){
  567. this.itemData.safeSigns = this.itemData.safeInfo.safeSigns
  568. }
  569. if(this.itemData.safeInfo.outfire){
  570. this.itemData.outfire = this.itemData.safeInfo.outfire
  571. }
  572. if(this.itemData.safeInfo.safeUserNameAdminPhone){
  573. let list = [];
  574. let newList = [];
  575. list = this.itemData.safeInfo.safeUserNameAdminPhone.split(",");
  576. for(let i=0;i<list.length;i++){
  577. list[i] = list[i].split("@");
  578. let obj = {
  579. name:list[i][0],
  580. phone:list[i][1]
  581. }
  582. newList.push(obj);
  583. }
  584. this.itemData.safeInfo.safeUser = newList;
  585. }
  586. if(this.itemData.safeInfo.adminNameAndPhone){
  587. let list = [];
  588. let newList = [];
  589. list = this.itemData.safeInfo.adminNameAndPhone.split(",");
  590. for(let i=0;i<list.length;i++){
  591. list[i] = list[i].split("@");
  592. let obj = {
  593. name:list[i][0],
  594. phone:list[i][1]
  595. }
  596. newList.push(obj);
  597. }
  598. this.itemData.safeInfo.subAdmin = newList;
  599. }
  600. this.infoMaxBoxType = true;
  601. //循环判断如果是排风扇的话,启动的时候是人工还是预案还是定时
  602. for(let i=0;i<self.itemData.labHardwareVOList.length;i++){
  603. if(self.itemData.labHardwareVOList[i].hardwareTypeEnum.hardwareTypeCode == '2'){
  604. for(let b=0;b<self.fanList.length;b++){
  605. if(self.fanList[b].dictValue==self.itemData.labHardwareVOList[i].triggerModes){
  606. self.itemData.labHardwareVOList[i].dictLabel=self.fanList[b].dictLabel
  607. }
  608. }
  609. }
  610. }
  611. }
  612. },
  613. //一键灭火-传感器状态异常
  614. getMqttfireData(val){
  615. let self = this;
  616. if(val){
  617. //传感器状态
  618. console.log('传感器状态');
  619. self.firedeviceStatus();
  620. }
  621. },
  622. //一键灭火-是否正在执行灭火操作
  623. getMqttPerformData(val){
  624. let self = this;
  625. if(val){
  626. //灭火执行操作
  627. if(val.fireStatus == 1){
  628. if(!self.fireStartType){
  629. self.firedeviceStatus();
  630. }else if(val.fireStatus == 0){
  631. uni.showToast({
  632. title: '一键灭火启动失败',
  633. icon: "none",
  634. mask: true,
  635. duration: 2000
  636. });
  637. }
  638. }
  639. }
  640. },
  641. //点击开关按钮开启的时候充电调用硬件状态
  642. async subjectTriggerModes(row){
  643. let self=this;
  644. const {data} = await subjectTriggerModes(row.id)
  645. console.log('data',data)
  646. if(data.code==200){
  647. for(let b=0;b<self.fanList.length;b++){
  648. if(self.fanList[b].dictValue==data.data.triggerModes){
  649. for(let i=0;i<self.itemData.labHardwareVOList.length;i++){
  650. if(row.id == self.itemData.labHardwareVOList[i].id){
  651. this.$set(self.itemData.labHardwareVOList[i],'dictLabel',self.fanList[b].dictLabel);
  652. this.$set(self.itemData.labHardwareVOList[i],'triggerModes',data.data.triggerModes);
  653. }
  654. }
  655. }
  656. }
  657. }
  658. },
  659. //监听传感器信息
  660. getMqttSensorData(val){
  661. console.log('传感器',val)
  662. let self = this;
  663. if(val.subId){
  664. if(self.itemData.id == val.subId){
  665. self.$set(self.itemData,'sensorFunctionList',val.functionStatuses);
  666. }
  667. }
  668. },
  669. //监听设备信息
  670. getMqttDeviceData(val){
  671. let self = this;
  672. console.log('页面获取的-设备信息',val)
  673. for(let i=0;i<val.length;i++){
  674. for(let k=0;k<self.itemData.labHardwareVOList.length;k++){
  675. if(val[i].num == self.itemData.labHardwareVOList[k].id){
  676. if(val[i].hardwareOperate == 'CLOSE'){
  677. self.itemData.labHardwareVOList[k].state.code = 4;
  678. }else if(val[i].hardwareOperate == 'OPEN'){
  679. self.itemData.labHardwareVOList[k].state.code = 3;
  680. self.itemData.labHardwareVOList[k].state.code = 3;
  681. }else if(val[i].hardwareOperate == 'OFFLINE'){
  682. self.itemData.labHardwareVOList[k].state.code = 0;
  683. }else if(val[i].hardwareOperate == 'ONLINE'){
  684. self.itemData.labHardwareVOList[k].state.code = 2;
  685. }
  686. if(self.itemData.labHardwareVOList[k].hardwareTypeEnum.hardwareTypeCode == '2' && self.itemData.labHardwareVOList[k].pcType == '0'){
  687. self.subjectTriggerModes(self.itemData.labHardwareVOList[k])
  688. }
  689. }
  690. }
  691. }
  692. },
  693. infoMaxBoxClick(){
  694. this.infoMaxBoxType = !this.infoMaxBoxType;
  695. },
  696. async getSafetyWarning(){
  697. const {data} = await getDicts('sys_safety_warning');
  698. if(data.code == 200){
  699. this.safetyWarning = data.data;
  700. }
  701. },
  702. async getHazardCategory(){
  703. const {data} = await getDicts('sys_hazard_category');
  704. if(data.code == 200){
  705. this.hazardCategory = data.data;
  706. }
  707. },
  708. async getRiskMeasure(){
  709. const {data} = await getDicts('sys_risk_measure');
  710. if(data.code == 200){
  711. this.riskMeasure = data.data;
  712. }
  713. },
  714. async getExtinguishingKeyPoints(){
  715. const {data} = await getDicts('sys_extinguishing_key_points');
  716. if(data.code == 200){
  717. this.extinguishingKeyPoints = data.data;
  718. }
  719. },
  720. //MQTT订阅-传感器
  721. subscriptionMQTT(){
  722. let self = this;
  723. const mqttOptions = {
  724. keepalive: 30,
  725. clean: false,//保留会话
  726. connectTimeout: 5000, // 超时时间
  727. reconnectPeriod:5000, // 重连间隔
  728. clientId: 'lab/function/data',
  729. username: uni.getStorageSync('mqttUser'),
  730. password: uni.getStorageSync('mqttPassword'),
  731. }
  732. const connectUrl = uni.getStorageSync('mqttUrl');
  733. this.client = $mqtt.connect('wxs://' + connectUrl, mqttOptions);
  734. this.client.on('connect', () => {
  735. // 这是为了给自己发条消息,其它无作用
  736. this.client.subscribe(this.mtopic, (err) => {
  737. if (!err) {
  738. console.log("订阅传感器成功",this.mtopic)
  739. }
  740. })
  741. this.client.subscribe(this.mtopicOne, (err) => {
  742. if (!err) {
  743. console.log("订阅设备成功",this.mtopicOne)
  744. }
  745. })
  746. });
  747. // 自动重连
  748. this.client.on('reconnect', (msg) => {
  749. console.log('reconnect', msg)
  750. });
  751. // 错误
  752. this.client.on('error', () => {
  753. console.log('error')
  754. });
  755. // 断开
  756. this.client.on('end', () => {
  757. console.log('end')
  758. });
  759. // 掉线
  760. this.client.on('offline', (msg) => {
  761. console.log('offline',msg)
  762. });
  763. // 收到消息
  764. this.client.on('message', (topic, message) => {
  765. let data = JSON.parse(message)
  766. console.log('topic',topic)
  767. console.log('data',data)
  768. if(topic == this.mtopic){
  769. if(data.data.subId){
  770. if(self.itemData.id == data.data.subId){
  771. self.$set(self.itemData,'sensorFunctionList',data.data.functionStatuses);
  772. }
  773. }
  774. }else if(topic == this.mtopicOne){
  775. for(let i=0;i<data.data.length;i++){
  776. for(let k=0;k<self.itemData.labHardwareVOList.length;k++){
  777. if(data.data[i].num == self.itemData.labHardwareVOList[k].id){
  778. if(data.data[i].hardwareOperate == 'CLOSE'){
  779. self.itemData.labHardwareVOList[k].state.code = 4;
  780. }else if(data.data[i].hardwareOperate == 'OPEN'){
  781. self.itemData.labHardwareVOList[k].state.code = 3;
  782. }else if(data.data[i].hardwareOperate == 'OFFLINE'){
  783. self.itemData.labHardwareVOList[k].state.code = 0;
  784. }else if(data.data[i].hardwareOperate == 'ONLINE'){
  785. self.itemData.labHardwareVOList[k].state.code = 2;
  786. }
  787. }
  788. }
  789. }
  790. }
  791. })
  792. // 全局监听是否有关闭mqtt的消息的事件
  793. uni.$on('closeMqtt',() => {
  794. this.client.end(true); // 主动断开连接
  795. })
  796. },
  797. //取消订阅关闭MQTT连接
  798. offMQTT(){
  799. this.client.unsubscribe(this.mtopic, error => {
  800. if (error) {
  801. console.log('Unsubscribe error', error)
  802. }
  803. })
  804. this.client.end();
  805. this.client = {};
  806. },
  807. pcTypeButtonClick(id){
  808. let self = this;
  809. uni.showModal({
  810. content: '确认要操作该设备吗?',
  811. cancelColor:"#999",
  812. confirmColor:"#0183FA",
  813. success: function (res) {
  814. if (res.confirm) {
  815. self.controlSwitch(id);
  816. console.log('用户点击确定');
  817. } else if (res.cancel) {
  818. console.log('用户点击取消');
  819. }
  820. }
  821. });
  822. },
  823. async controlSwitch(id){
  824. const {data} = await controlSwitch({id:id});
  825. if(data.code == 200){
  826. uni.showToast({
  827. title: '操作成功',
  828. icon:"none",
  829. mask:true,
  830. duration: 2000
  831. });
  832. }
  833. },
  834. //设备开关按钮
  835. hardwareButton(minItem,command){
  836. let self = this;
  837. let text = '';
  838. if(command == 'close'){
  839. text = '关闭';
  840. }else if(command == 'open'){
  841. text = '开启';
  842. }
  843. uni.showModal({
  844. content: '确认要'+text+'吗?',
  845. cancelColor:"#999",
  846. confirmColor:"#0183FA",
  847. success: function (res) {
  848. if (res.confirm) {
  849. self.mangerControl(minItem,command);
  850. console.log('用户点击确定');
  851. } else if (res.cancel) {
  852. console.log('用户点击取消');
  853. }
  854. }
  855. });
  856. },
  857. //设备开关
  858. async mangerControl(minItem,command){
  859. let obj = {
  860. id:minItem.id,
  861. command:command,
  862. };
  863. const {data} = await mangerControl(obj);
  864. if(data.code == 200){
  865. if(command == 'open'){
  866. minItem.type = 3;
  867. }else if(command == 'close'){
  868. minItem.type = 4;
  869. }
  870. uni.showToast({
  871. title: '操作成功',
  872. icon:"none",
  873. mask:true,
  874. duration: 2000
  875. });
  876. }
  877. },
  878. //获取喇叭列表
  879. async getDeviceListBySub() {
  880. let _this=this;
  881. let obj = {
  882. subId: _this.subId,
  883. floorId: _this.itemData.subAddrr.floorId,
  884. page: 1,
  885. pageSize: 100,
  886. };
  887. const {
  888. data
  889. } = await getDeviceListBySub(obj)
  890. if (data.code == 200) {
  891. for (let i = 0; i < data.data.length; i++) {
  892. data.data[i].type = false;
  893. }
  894. this.$set(this, 'trumpetList', data.data)
  895. }
  896. },
  897. //点击选择喇叭
  898. trumpetClick(index) {
  899. this.trumpetList[index].type = !this.trumpetList[index].type
  900. },
  901. //录制
  902. recordButton(e) {
  903. console.log("按下")
  904. let self = this;
  905. let num = 0;
  906. for (let i = 0; i < self.trumpetList.length; i++) {
  907. if (self.trumpetList[i].type) {
  908. num++
  909. }
  910. }
  911. if (num == 0) {
  912. uni.showToast({
  913. title: '请选择喇叭',
  914. icon: "none",
  915. mask: true,
  916. duration: 2000
  917. });
  918. return
  919. }
  920. this.liveType = true;
  921. console.log('录制', e)
  922. this.startPoint = e.touches[0]; //记录长按时开始点信息,后面用于计算上划取消时手指滑动的距离。
  923. const options = {
  924. duration: 10000,
  925. sampleRate: 16000,
  926. numberOfChannels: 1,
  927. encodeBitRate: 48000,
  928. format: 'mp3',
  929. frameSize: 50
  930. }
  931. this.recorderManager.start(options); //开始录音
  932. this.recorderManager.onStart(() => {
  933. console.log('recorder start')
  934. })
  935. this.recorderManager.onError((res) => {
  936. console.log(res);
  937. })
  938. wx.showToast({
  939. title: "正在录音,上划取消发送",
  940. icon: "none",
  941. duration: 60000 //先定义个60秒,后面可以手动调用wx.hideToast()隐藏
  942. });
  943. this.sendLock = false; //长按时是不上锁的。
  944. },
  945. //取消
  946. cancelButton(e) {
  947. console.log("移动")
  948. let self = this;
  949. let num = 0;
  950. for (let i = 0; i < self.trumpetList.length; i++) {
  951. if (self.trumpetList[i].type) {
  952. num++
  953. }
  954. }
  955. if (num == 0) {
  956. return
  957. }
  958. this.liveType = false;
  959. console.log('取消', e)
  960. let moveLenght = e.touches[e.touches.length - 1].clientY - this.startPoint.clientY; //移动距离
  961. if (Math.abs(moveLenght) > 50) {
  962. wx.showToast({
  963. title: "松开手指,取消发送",
  964. icon: "none",
  965. duration: 60000
  966. });
  967. this.sendLock = true; //触发了上滑取消发送,上锁
  968. } else {
  969. wx.showToast({
  970. title: "正在录音,上划取消发送",
  971. icon: "none",
  972. duration: 60000
  973. });
  974. this.sendLock = false; //上划距离不足,依然可以发送,不上锁
  975. }
  976. },
  977. //发送
  978. sendButton(e) {
  979. console.log("松开")
  980. let self = this;
  981. let num = 0;
  982. for (let i = 0; i < self.trumpetList.length; i++) {
  983. if (self.trumpetList[i].type) {
  984. num++
  985. }
  986. }
  987. if (num == 0) {
  988. return
  989. }
  990. this.liveType = false;
  991. console.log('发送', e)
  992. wx.hideToast(); //结束录音、隐藏Toast提示框
  993. this.recorderManager.stop(); //结束录音
  994. this.recorderManager.onStop((res) => {
  995. if (!this.sendLock) {
  996. console.log('1', this.recorderManager)
  997. this.uploadImg(res.tempFilePath);
  998. }
  999. console.log('停止录音', res.tempFilePath)
  1000. console.log("sendLock", this.sendLock);
  1001. })
  1002. },
  1003. //上传MP3
  1004. async uploadImg(tempFilePaths) {
  1005. var self = this;
  1006. uni.uploadFile({
  1007. url: config.base_url + '/base/file/upload', //仅为示例,非真实的接口地址
  1008. header: {
  1009. 'Authorization': uni.getStorageSync('token')
  1010. },
  1011. filePath: tempFilePaths,
  1012. name: 'file',
  1013. formData: {
  1014. 'user': 'test'
  1015. },
  1016. success: (uploadFileRes) => {
  1017. let res = JSON.parse(uploadFileRes.data);
  1018. if (res.code == 200) {
  1019. console.log("上传成功", res)
  1020. self.textParseUrlIps(config.base_url + '/' + res.data.url);
  1021. } else {
  1022. uni.showToast({
  1023. title: res.msg,
  1024. icon: "none",
  1025. mask: true,
  1026. duration: 2000
  1027. });
  1028. }
  1029. },
  1030. fail: err => {
  1031. uni.hideLoading()
  1032. },
  1033. complete: () => {}
  1034. });
  1035. },
  1036. //发送语音
  1037. async textParseUrlIps(text) {
  1038. let self = this;
  1039. let newList = [];
  1040. for (let i = 0; i < self.trumpetList.length; i++) {
  1041. if (self.trumpetList[i].type) {
  1042. let obj = {
  1043. sn: self.trumpetList[i].deviceSn,
  1044. port: self.trumpetList[i].port,
  1045. deviceIp: self.trumpetList[i].deviceIp,
  1046. type: "",
  1047. name: "",
  1048. speed: "",
  1049. params: {
  1050. tid: "",
  1051. vol: self.trumpetList[i].deviceVol,
  1052. urls: []
  1053. }
  1054. };
  1055. newList.push(obj);
  1056. }
  1057. }
  1058. const {
  1059. data
  1060. } = await textParseUrlIps(newList, text)
  1061. if (data.code == 200) {
  1062. uni.showToast({
  1063. title: '发送成功',
  1064. icon: "none",
  1065. mask: true,
  1066. duration: 2000
  1067. });
  1068. }
  1069. },
  1070. goVideo(){
  1071. this.itemData.floorId = this.itemData.subAddrr.floorId;
  1072. uni.navigateTo({
  1073. url:'/pages_manage/laboratory/monitor?item='+encodeURIComponent(JSON.stringify(this.itemData))+'&deptId='+this.deptId
  1074. })
  1075. },
  1076. goWord(){
  1077. uni.navigateTo({
  1078. url:'/pages_manage/laboratory/word?item='+encodeURIComponent(JSON.stringify(this.itemData))
  1079. })
  1080. },
  1081. },
  1082. onHide(){
  1083. // //删除传感器监听
  1084. getApp().deleteSensorWatch();
  1085. // //删除设备监听
  1086. getApp().deleteDeviceWatch();
  1087. //删除一键灭火-传感器状态
  1088. getApp().deletefireData();
  1089. //删除一键灭火-设备是否在线
  1090. getApp().deleteOnlineData();
  1091. //删除一键灭火-是否正在执行灭火
  1092. getApp().deletePerformData();
  1093. },
  1094. beforeDestroy(){
  1095. // //删除传感器监听
  1096. getApp().deleteSensorWatch();
  1097. // //删除设备监听
  1098. getApp().deleteDeviceWatch();
  1099. //删除一键灭火-传感器状态
  1100. getApp().deletefireData();
  1101. //删除一键灭火-设备是否在线
  1102. getApp().deleteOnlineData();
  1103. //删除一键灭火-是否正在执行灭火
  1104. getApp().deletePerformData();
  1105. }
  1106. }
  1107. </script>
  1108. <style lang="stylus" scoped>
  1109. #laboratoryInfo{
  1110. height:100%;
  1111. display flex;
  1112. flex-direction column;
  1113. .small_title{
  1114. padding: 0 20rpx;
  1115. font-size: 34rpx;
  1116. }
  1117. /* 语音广播 */
  1118. .shade-max-big-box {
  1119. height: 100%;
  1120. width: 100%;
  1121. position: fixed;
  1122. display: flex;
  1123. flex-direction: column;
  1124. z-index: 10;
  1125. background: rgba(0, 0, 0, 0.2);
  1126. .null-box {
  1127. flex: 1;
  1128. }
  1129. /* 语音广播-执行疏散 */
  1130. .broadcast {
  1131. width: 100%;
  1132. // height: 532rpx;
  1133. background: #FFFFFF;
  1134. border-top-left-radius: 20rpx;
  1135. border-top-right-radius: 20rpx;
  1136. padding:22rpx 30rpx 30rpx;
  1137. box-sizing: border-box;
  1138. margin-top: 20rpx;
  1139. .broadcast_t {
  1140. font-size: 30rpx;
  1141. font-family: PingFang SC;
  1142. font-weight: 500;
  1143. color: #333333;
  1144. line-height: 30rpx;
  1145. >label {
  1146. font-size: 24rpx;
  1147. font-family: PingFang SC;
  1148. font-weight: 500;
  1149. color: #999999;
  1150. line-height: 30rpx;
  1151. margin-left: 16rpx;
  1152. }
  1153. }
  1154. .trumpet-max-box {
  1155. display: flex;
  1156. justify-content: flex-start;
  1157. margin-top: 22rpx;
  1158. flex-wrap: wrap;
  1159. .trumpet-for-box {
  1160. display: inline-block;
  1161. width: auto;
  1162. height: 60rpx;
  1163. line-height: 60rpx;
  1164. font-size: 24rpx;
  1165. text-align: center;
  1166. cursor: pointer;
  1167. overflow: hidden;
  1168. border: 1rpx solid #E0E0E0;
  1169. border-radius: 10rpx;
  1170. color: #E0E0E0;
  1171. display: flex;
  1172. justify-content: center;
  1173. margin-right: 20rpx;
  1174. margin-bottom: 10rpx;
  1175. padding: 0 12rpx;
  1176. box-sizing: border-box;
  1177. >img {
  1178. width: 36rpx;
  1179. height: 34rpx;
  1180. margin: 12rpx 20rpx 0 25rpx;
  1181. }
  1182. }
  1183. .trumpet-color-a {
  1184. border: 1px solid #0183FA;
  1185. color: #0183FA;
  1186. }
  1187. .trumpet-color-b {
  1188. border: 1px solid #CCCCCC;
  1189. color: #999;
  1190. }
  1191. }
  1192. .broadcast_m {
  1193. width: 100%;
  1194. .broadcast_m_t {
  1195. width: 142rpx;
  1196. height: 142rpx;
  1197. margin: 30rpx 0 0 258rpx;
  1198. position: relative;
  1199. font-size: 24rpx;
  1200. font-family: PingFang SC;
  1201. font-weight: 500;
  1202. line-height: 170rpx;
  1203. text-align: center;
  1204. >img {
  1205. width: 142rpx;
  1206. height: 142rpx;
  1207. position: absolute;
  1208. }
  1209. >label {
  1210. width: 100%;
  1211. font-size: 24rpx;
  1212. font-family: PingFang SC;
  1213. font-weight: 500;
  1214. color: #0183FA;
  1215. line-height: 24rpx;
  1216. display: inline-block;
  1217. text-align: center;
  1218. position: absolute;
  1219. top: 76rpx;
  1220. }
  1221. /* 按下 */
  1222. .press_color {
  1223. color: #FFFFFF;
  1224. }
  1225. /* 松开 */
  1226. .slip_color {
  1227. color: #0183FA;
  1228. }
  1229. }
  1230. .broadcast_m_t_back_a {
  1231. background: url(@/images/basicsModules/icon_sskz_skfs.png);
  1232. background-size: 100%;
  1233. color: #FFFFFF;
  1234. }
  1235. .broadcast_m_t_back_b {
  1236. background: url(@/images/basicsModules/icon_sskz_azsh.png);
  1237. background-size: 100%;
  1238. color: #0183FA;
  1239. }
  1240. .broadcast_m_b {
  1241. font-size: 24rpx;
  1242. font-family: PingFang SC;
  1243. font-weight: 500;
  1244. color: #999999;
  1245. line-height: 24rpx;
  1246. text-align: center;
  1247. margin-top: 14rpx;
  1248. }
  1249. }
  1250. /* 疏散按钮 */
  1251. .evacuation-button-box {
  1252. width: 650rpx;
  1253. height: 100rpx;
  1254. background: #0183FA;
  1255. color: #fff;
  1256. text-align center;
  1257. line-height: 100rpx;
  1258. font-size: 28rpx;
  1259. margin: 88rpx auto 0;
  1260. border-radius: 20rpx;
  1261. }
  1262. }
  1263. }
  1264. /* 一键灭火 */
  1265. .outfire {
  1266. width: 750rpx;
  1267. height: auto;
  1268. background: #FFFFFF;
  1269. margin: 20rpx 0;
  1270. padding: 20rpx 10rpx;
  1271. box-sizing: border-box;
  1272. display: flex;
  1273. justify-content: space-between;
  1274. align-items: center;
  1275. .outfire_li {
  1276. display: flex;
  1277. justify-content: flex-start;
  1278. //align-items: center;
  1279. >img {
  1280. width: 24rpx;
  1281. height: 30rpx;
  1282. margin-right: 12rpx;
  1283. margin-top: 8rpx;
  1284. }
  1285. .finish{
  1286. flex: 1;
  1287. }
  1288. .normal {
  1289. font-size: 24rpx;
  1290. font-family: PingFang SC;
  1291. font-weight: 500;
  1292. color: #333333;
  1293. }
  1294. .abnormal {
  1295. font-size: 24rpx;
  1296. font-family: PingFang SC;
  1297. font-weight: 500;
  1298. color: #F11C00;
  1299. }
  1300. }
  1301. .outfire_li:nth-of-type(1) {
  1302. >img {
  1303. width: 30rpx;
  1304. height: 28rpx;
  1305. margin-right: 12rpx;
  1306. }
  1307. }
  1308. .outfire_yes_btn {
  1309. width: 120rpx;
  1310. height: 40rpx;
  1311. font-size: 24rpx;
  1312. font-family: PingFang SC;
  1313. font-weight: 500;
  1314. color: #F21C00;
  1315. line-height: 40rpx;
  1316. border: 1px solid #F21C00;
  1317. border-radius: 8rpx;
  1318. text-align: center;
  1319. margin-left: 54rpx;
  1320. }
  1321. .outfire_no_btn {
  1322. width: 120rpx;
  1323. height: 40rpx;
  1324. font-size: 24rpx;
  1325. font-family: PingFang SC;
  1326. font-weight: 500;
  1327. color: #CCCCCC;
  1328. line-height: 40rpx;
  1329. border: 1px solid #E0E0E0;
  1330. border-radius: 8rpx;
  1331. text-align: center;
  1332. margin-left: 54rpx;
  1333. }
  1334. }
  1335. /* 一键灭火 */
  1336. .shade-outfire {
  1337. height: 100%;
  1338. width: 100%;
  1339. position: fixed;
  1340. display: flex;
  1341. flex-direction: column;
  1342. z-index: 10;
  1343. background: rgba(0, 0, 0, 0.2);
  1344. .null-box {
  1345. flex: 1;
  1346. }
  1347. .shade-outfire-n {
  1348. width: 625rpx;
  1349. height: 450rpx;
  1350. background: #FFFFFF;
  1351. border-radius: 20rpx;
  1352. position: absolute;
  1353. top: 370rpx;
  1354. left: 62rpx;
  1355. .shade-outfire-n-t {
  1356. width: 172rpx;
  1357. height: 172rpx;
  1358. margin: 38rpx 0 0 226rpx;
  1359. }
  1360. .shade-outfire-n-m {
  1361. font-size: 30rpx;
  1362. font-family: PingFang SC;
  1363. font-weight: 500;
  1364. color: #E30000;
  1365. line-height: 84rpx;
  1366. text-align: center;
  1367. border-bottom: 1px solid #E0E0E0;
  1368. >text {
  1369. font-size: 40rpx;
  1370. }
  1371. }
  1372. .shade-outfire-n-b {
  1373. width: 402rpx;
  1374. height: 82rpx;
  1375. background: #FFFFFF;
  1376. border: 2rpx solid #0183FA;
  1377. border-radius: 10rpx;
  1378. font-size: 28rpx;
  1379. line-height: 82rpx;
  1380. font-family: PingFang SC;
  1381. font-weight: 500;
  1382. color: #0183FA;
  1383. text-align: center;
  1384. margin: 30rpx 0 0 112rpx;
  1385. }
  1386. }
  1387. }
  1388. .name-max-box{
  1389. background #fff
  1390. .title-box{
  1391. margin:20rpx 20rpx 0;
  1392. display flex
  1393. view:nth-child(1){
  1394. height:40rpx;
  1395. line-height:40rpx;
  1396. font-size:20rpx;
  1397. border-radius:10rpx;
  1398. padding:0 20rpx;
  1399. color:#fff;
  1400. margin-right:20rpx;
  1401. }
  1402. view:nth-child(2){
  1403. line-height:42rpx;
  1404. font-size:30rpx;
  1405. color:#0183FA;
  1406. max-width:600rpx;
  1407. flex:1;
  1408. }
  1409. img{
  1410. width:12rpx;
  1411. height:20rpx;
  1412. margin-top:11rpx;
  1413. }
  1414. .colorA{
  1415. background:#aa2315;
  1416. }
  1417. .colorB{
  1418. background:#ff9b09;
  1419. }
  1420. .colorC{
  1421. background:#3ea3e9;
  1422. }
  1423. .colorD{
  1424. background:#3ea34c;
  1425. }
  1426. }
  1427. .address-box{
  1428. margin:20rpx 20rpx;
  1429. font-size:26rpx;
  1430. color:#999999;
  1431. span{
  1432. margin-right:60rpx;
  1433. }
  1434. }
  1435. .address-box-two{
  1436. display flex
  1437. margin:0 20rpx 20rpx 20rpx;
  1438. img{
  1439. width:28rpx;
  1440. height:30rpx;
  1441. margin-right:18rpx;
  1442. }
  1443. view{
  1444. line-height:30rpx;
  1445. font-size:24rpx;
  1446. color:#999999;
  1447. }
  1448. }
  1449. }
  1450. .title-max-box-none{
  1451. border:none!important;
  1452. }
  1453. .title-max-box{
  1454. display flex
  1455. height:80rpx;
  1456. border-bottom:1rpx solid #E0E0E0;
  1457. .left-view{
  1458. width: 4rpx;
  1459. height: 34rpx;
  1460. margin:25rpx 24rpx 0 20rpx;
  1461. background:#0D97EB;
  1462. }
  1463. .right-view{
  1464. line-height:80rpx;
  1465. font-size: 30rpx;
  1466. color: #333333;
  1467. flex:1;
  1468. }
  1469. .click-view{
  1470. display flex
  1471. padding:0 20rpx;
  1472. view{
  1473. line-height:80rpx;
  1474. font-size: 24rpx;
  1475. color: #666666;
  1476. }
  1477. img{
  1478. width:20rpx;
  1479. height:10rpx;
  1480. margin:35rpx 0 0 20rpx;
  1481. }
  1482. }
  1483. }
  1484. .sensor-max-box{
  1485. background #fff
  1486. margin-top:20rpx;
  1487. .text-box{
  1488. /*border-top:1rpx dashed #e0e0e0;*/
  1489. /*border-top:1rpx solid #E0E0E0;*/
  1490. padding:0 20rpx;
  1491. /*
  1492. overflow-x:scroll;
  1493. overflow-y:hidden;
  1494. white-space: nowrap;
  1495. */
  1496. .min-box{
  1497. display inline-block
  1498. /*padding:0 30rpx 0 10rpx;*/
  1499. width:355rpx;
  1500. .min-min-box{
  1501. display: flex
  1502. img{
  1503. width:30rpx;
  1504. height:27rpx;
  1505. margin-top:24rpx;
  1506. margin-right:10rpx;
  1507. }
  1508. view{
  1509. line-height:74rpx;
  1510. text-align center
  1511. font-size:28rpx;
  1512. color:#333;
  1513. }
  1514. .colorA{
  1515. color:#EE3A3A;
  1516. }
  1517. }
  1518. }
  1519. }
  1520. }
  1521. .control-max-box{
  1522. background #fff
  1523. margin-top:20rpx;
  1524. .button-max-box{
  1525. .button-box:last-child{
  1526. border:none!important;
  1527. }
  1528. .button-box{
  1529. display flex
  1530. border-bottom:1rpx solid #e0e0e0;
  1531. margin:0 20rpx;
  1532. view{
  1533. width:200rpx;
  1534. line-height:70rpx;
  1535. border: 2rpx solid #0183FA;
  1536. border-radius: 35rpx;
  1537. color: #0183FA;
  1538. font-size: 24rpx;
  1539. text-align center;
  1540. margin:30rpx 0 30rpx 0;
  1541. }
  1542. view:nth-child(1){
  1543. margin-right: 18rpx;
  1544. }
  1545. view:nth-child(2){
  1546. }
  1547. }
  1548. .for-button-box:last-child{
  1549. border:none!important;
  1550. }
  1551. .for-button-box{
  1552. display flex
  1553. border-bottom:1rpx solid #e0e0e0;
  1554. margin:0 20rpx;
  1555. .for-button-p{
  1556. flex:1;
  1557. line-height:90rpx;
  1558. color:#333333;
  1559. font-size:28rpx;
  1560. >text{
  1561. font-size: 28rpx;
  1562. color: #0183FA;
  1563. }
  1564. }
  1565. img{
  1566. height:50rpx;
  1567. width:100rpx;
  1568. margin:20rpx 0 20rpx 0;
  1569. }
  1570. view:nth-child(2){
  1571. text-align right
  1572. color:#999;
  1573. }
  1574. .pcType-button{
  1575. width:120rpx;
  1576. line-height:42rpx;
  1577. border:4rpx solid #0183FA;
  1578. border-radius:30rpx;
  1579. color: #0183FA !important;
  1580. font-size: 24rpx;
  1581. text-align center !important;
  1582. margin:20rpx 0 20rpx 0;
  1583. }
  1584. }
  1585. }
  1586. }
  1587. .info-max-box{
  1588. background #fff
  1589. margin-top:20rpx;
  1590. .top-name-max-box{
  1591. background #fff
  1592. overflow hidden
  1593. .name-box{
  1594. margin:27rpx 20rpx 0;
  1595. display:flex;
  1596. view:nth-child(1){
  1597. background:#f95f5f;
  1598. color:#fff;
  1599. border-radius:6rpx;
  1600. font-size:20rpx;
  1601. padding:0 10rpx;
  1602. height:42rpx;
  1603. line-height:42rpx;
  1604. }
  1605. view:nth-child(2){
  1606. color:#333;
  1607. margin-left:20rpx;
  1608. font-size:28rpx;
  1609. height:30rpx;
  1610. line-height:42rpx;
  1611. font-weight:700;
  1612. }
  1613. }
  1614. .address-box{
  1615. margin:22rpx 20rpx;
  1616. font-size:26rpx;
  1617. }
  1618. }
  1619. .text-max-box{
  1620. background #fff
  1621. padding:8rpx 20rpx;
  1622. border-bottom:1rpx solid #e0e0e0;
  1623. margin-bottom: 20rpx;
  1624. .text-min-box{
  1625. display:flex;
  1626. view{
  1627. line-height:66rpx;
  1628. height:66rpx;
  1629. font-size:28rpx;
  1630. }
  1631. view:nth-child(1){
  1632. width:220rpx;
  1633. color:#333;
  1634. }
  1635. view:nth-child(2){
  1636. flex:1;
  1637. color:#999;
  1638. text-align:right;
  1639. }
  1640. }
  1641. }
  1642. .safety-max-box{
  1643. background #fff
  1644. padding:8rpx 20rpx;
  1645. .max-for-box{
  1646. .title-box{
  1647. line-height:76rpx;
  1648. font-size:30rpx;
  1649. color:#333;
  1650. }
  1651. .for-box{
  1652. line-height:48rpx;
  1653. font-size:28rpx;
  1654. color:#999;
  1655. }
  1656. }
  1657. }
  1658. .img-bottom-box{
  1659. margin-top:20rpx;
  1660. background #fff
  1661. padding:8rpx 20rpx 20rpx;
  1662. border-bottom: 1rpx solid #e0e0e0;
  1663. margin-bottom: 20rpx;
  1664. .title-box{
  1665. line-height:76rpx;
  1666. font-size:28rpx;
  1667. color:#333;
  1668. }
  1669. .for-box{
  1670. line-height:48rpx;
  1671. font-size:26rpx;
  1672. color:#999;
  1673. .img-ojb{
  1674. display inline-block
  1675. width:86rpx;
  1676. height:114rpx;
  1677. margin-left:30rpx;
  1678. }
  1679. .code-img{
  1680. width:200rpx;
  1681. height:200rpx;
  1682. margin:20rpx auto 40rpx;
  1683. }
  1684. }
  1685. }
  1686. }
  1687. }
  1688. </style>