laboratoryInfo.vue 50 KB

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