laboratoryInfo.vue 49 KB

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