laboratoryInfo.vue 50 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694
  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. }else if(val[i].hardwareOperate == 'OFFLINE'){
  644. self.itemData.labHardwareVOList[k].state.code = 0;
  645. }else if(val[i].hardwareOperate == 'ONLINE'){
  646. self.itemData.labHardwareVOList[k].state.code = 2;
  647. }
  648. }
  649. }
  650. }
  651. },
  652. infoMaxBoxClick(){
  653. this.infoMaxBoxType = !this.infoMaxBoxType;
  654. },
  655. async getSafetyWarning(){
  656. const {data} = await getDicts('sys_safety_warning');
  657. if(data.code == 200){
  658. this.safetyWarning = data.data;
  659. }
  660. },
  661. async getHazardCategory(){
  662. const {data} = await getDicts('sys_hazard_category');
  663. if(data.code == 200){
  664. this.hazardCategory = data.data;
  665. }
  666. },
  667. async getRiskMeasure(){
  668. const {data} = await getDicts('sys_risk_measure');
  669. if(data.code == 200){
  670. this.riskMeasure = data.data;
  671. }
  672. },
  673. async getExtinguishingKeyPoints(){
  674. const {data} = await getDicts('sys_extinguishing_key_points');
  675. if(data.code == 200){
  676. this.extinguishingKeyPoints = data.data;
  677. }
  678. },
  679. //MQTT订阅-传感器
  680. subscriptionMQTT(){
  681. let self = this;
  682. const mqttOptions = {
  683. keepalive: 30,
  684. clean: false,//保留会话
  685. connectTimeout: 5000, // 超时时间
  686. reconnectPeriod:5000, // 重连间隔
  687. clientId: 'lab/function/data',
  688. username: uni.getStorageSync('mqttUser'),
  689. password: uni.getStorageSync('mqttPassword'),
  690. }
  691. const connectUrl = uni.getStorageSync('mqttUrl');
  692. this.client = $mqtt.connect('wxs://' + connectUrl, mqttOptions);
  693. this.client.on('connect', () => {
  694. // 这是为了给自己发条消息,其它无作用
  695. this.client.subscribe(this.mtopic, (err) => {
  696. if (!err) {
  697. console.log("订阅传感器成功",this.mtopic)
  698. }
  699. })
  700. this.client.subscribe(this.mtopicOne, (err) => {
  701. if (!err) {
  702. console.log("订阅设备成功",this.mtopicOne)
  703. }
  704. })
  705. });
  706. // 自动重连
  707. this.client.on('reconnect', (msg) => {
  708. console.log('reconnect', msg)
  709. });
  710. // 错误
  711. this.client.on('error', () => {
  712. console.log('error')
  713. });
  714. // 断开
  715. this.client.on('end', () => {
  716. console.log('end')
  717. });
  718. // 掉线
  719. this.client.on('offline', (msg) => {
  720. console.log('offline',msg)
  721. });
  722. // 收到消息
  723. this.client.on('message', (topic, message) => {
  724. let data = JSON.parse(message)
  725. console.log('topic',topic)
  726. console.log('data',data)
  727. if(topic == this.mtopic){
  728. if(data.data.subId){
  729. if(self.itemData.id == data.data.subId){
  730. self.$set(self.itemData,'sensorFunctionList',data.data.functionStatuses);
  731. }
  732. }
  733. }else if(topic == this.mtopicOne){
  734. for(let i=0;i<data.data.length;i++){
  735. for(let k=0;k<self.itemData.labHardwareVOList.length;k++){
  736. if(data.data[i].num == self.itemData.labHardwareVOList[k].id){
  737. if(data.data[i].hardwareOperate == 'CLOSE'){
  738. self.itemData.labHardwareVOList[k].state.code = 4;
  739. }else if(data.data[i].hardwareOperate == 'OPEN'){
  740. self.itemData.labHardwareVOList[k].state.code = 3;
  741. }else if(data.data[i].hardwareOperate == 'OFFLINE'){
  742. self.itemData.labHardwareVOList[k].state.code = 0;
  743. }else if(data.data[i].hardwareOperate == 'ONLINE'){
  744. self.itemData.labHardwareVOList[k].state.code = 2;
  745. }
  746. }
  747. }
  748. }
  749. }
  750. })
  751. // 全局监听是否有关闭mqtt的消息的事件
  752. uni.$on('closeMqtt',() => {
  753. this.client.end(true); // 主动断开连接
  754. })
  755. },
  756. //取消订阅关闭MQTT连接
  757. offMQTT(){
  758. this.client.unsubscribe(this.mtopic, error => {
  759. if (error) {
  760. console.log('Unsubscribe error', error)
  761. }
  762. })
  763. this.client.end();
  764. this.client = {};
  765. },
  766. pcTypeButtonClick(id){
  767. let self = this;
  768. uni.showModal({
  769. content: '确认要操作该设备吗?',
  770. cancelColor:"#999",
  771. confirmColor:"#0183FA",
  772. success: function (res) {
  773. if (res.confirm) {
  774. self.controlSwitch(id);
  775. console.log('用户点击确定');
  776. } else if (res.cancel) {
  777. console.log('用户点击取消');
  778. }
  779. }
  780. });
  781. },
  782. async controlSwitch(id){
  783. const {data} = await controlSwitch({id:id});
  784. if(data.code == 200){
  785. uni.showToast({
  786. title: '操作成功',
  787. icon:"none",
  788. mask:true,
  789. duration: 2000
  790. });
  791. }
  792. },
  793. //设备开关按钮
  794. hardwareButton(minItem,command){
  795. let self = this;
  796. let text = '';
  797. if(command == 'close'){
  798. text = '关闭';
  799. }else if(command == 'open'){
  800. text = '开启';
  801. }
  802. uni.showModal({
  803. content: '确认要'+text+'吗?',
  804. cancelColor:"#999",
  805. confirmColor:"#0183FA",
  806. success: function (res) {
  807. if (res.confirm) {
  808. self.mangerControl(minItem,command);
  809. console.log('用户点击确定');
  810. } else if (res.cancel) {
  811. console.log('用户点击取消');
  812. }
  813. }
  814. });
  815. },
  816. //设备开关
  817. async mangerControl(minItem,command){
  818. let obj = {
  819. id:minItem.id,
  820. command:command,
  821. };
  822. const {data} = await mangerControl(obj);
  823. if(data.code == 200){
  824. if(command == 'open'){
  825. minItem.type = 3;
  826. }else if(command == 'close'){
  827. minItem.type = 4;
  828. }
  829. uni.showToast({
  830. title: '操作成功',
  831. icon:"none",
  832. mask:true,
  833. duration: 2000
  834. });
  835. }
  836. },
  837. //获取喇叭列表
  838. async getDeviceListBySub() {
  839. let _this=this;
  840. let obj = {
  841. subId: _this.subId,
  842. floorId: _this.itemData.subAddrr.floorId,
  843. page: 1,
  844. pageSize: 100,
  845. };
  846. const {
  847. data
  848. } = await getDeviceListBySub(obj)
  849. if (data.code == 200) {
  850. for (let i = 0; i < data.data.length; i++) {
  851. data.data[i].type = false;
  852. }
  853. this.$set(this, 'trumpetList', data.data)
  854. }
  855. },
  856. //点击选择喇叭
  857. trumpetClick(index) {
  858. this.trumpetList[index].type = !this.trumpetList[index].type
  859. },
  860. //录制
  861. recordButton(e) {
  862. console.log("按下")
  863. let self = this;
  864. let num = 0;
  865. for (let i = 0; i < self.trumpetList.length; i++) {
  866. if (self.trumpetList[i].type) {
  867. num++
  868. }
  869. }
  870. if (num == 0) {
  871. uni.showToast({
  872. title: '请选择喇叭',
  873. icon: "none",
  874. mask: true,
  875. duration: 2000
  876. });
  877. return
  878. }
  879. this.liveType = true;
  880. console.log('录制', e)
  881. this.startPoint = e.touches[0]; //记录长按时开始点信息,后面用于计算上划取消时手指滑动的距离。
  882. const options = {
  883. duration: 10000,
  884. sampleRate: 16000,
  885. numberOfChannels: 1,
  886. encodeBitRate: 48000,
  887. format: 'mp3',
  888. frameSize: 50
  889. }
  890. this.recorderManager.start(options); //开始录音
  891. this.recorderManager.onStart(() => {
  892. console.log('recorder start')
  893. })
  894. this.recorderManager.onError((res) => {
  895. console.log(res);
  896. })
  897. wx.showToast({
  898. title: "正在录音,上划取消发送",
  899. icon: "none",
  900. duration: 60000 //先定义个60秒,后面可以手动调用wx.hideToast()隐藏
  901. });
  902. this.sendLock = false; //长按时是不上锁的。
  903. },
  904. //取消
  905. cancelButton(e) {
  906. console.log("移动")
  907. let self = this;
  908. let num = 0;
  909. for (let i = 0; i < self.trumpetList.length; i++) {
  910. if (self.trumpetList[i].type) {
  911. num++
  912. }
  913. }
  914. if (num == 0) {
  915. return
  916. }
  917. this.liveType = false;
  918. console.log('取消', e)
  919. let moveLenght = e.touches[e.touches.length - 1].clientY - this.startPoint.clientY; //移动距离
  920. if (Math.abs(moveLenght) > 50) {
  921. wx.showToast({
  922. title: "松开手指,取消发送",
  923. icon: "none",
  924. duration: 60000
  925. });
  926. this.sendLock = true; //触发了上滑取消发送,上锁
  927. } else {
  928. wx.showToast({
  929. title: "正在录音,上划取消发送",
  930. icon: "none",
  931. duration: 60000
  932. });
  933. this.sendLock = false; //上划距离不足,依然可以发送,不上锁
  934. }
  935. },
  936. //发送
  937. sendButton(e) {
  938. console.log("松开")
  939. let self = this;
  940. let num = 0;
  941. for (let i = 0; i < self.trumpetList.length; i++) {
  942. if (self.trumpetList[i].type) {
  943. num++
  944. }
  945. }
  946. if (num == 0) {
  947. return
  948. }
  949. this.liveType = false;
  950. console.log('发送', e)
  951. wx.hideToast(); //结束录音、隐藏Toast提示框
  952. this.recorderManager.stop(); //结束录音
  953. this.recorderManager.onStop((res) => {
  954. if (!this.sendLock) {
  955. console.log('1', this.recorderManager)
  956. this.uploadImg(res.tempFilePath);
  957. }
  958. console.log('停止录音', res.tempFilePath)
  959. console.log("sendLock", this.sendLock);
  960. })
  961. },
  962. //上传MP3
  963. async uploadImg(tempFilePaths) {
  964. var self = this;
  965. uni.uploadFile({
  966. url: config.base_url + '/base/file/upload', //仅为示例,非真实的接口地址
  967. header: {
  968. 'Authorization': uni.getStorageSync('token')
  969. },
  970. filePath: tempFilePaths,
  971. name: 'file',
  972. formData: {
  973. 'user': 'test'
  974. },
  975. success: (uploadFileRes) => {
  976. let res = JSON.parse(uploadFileRes.data);
  977. if (res.code == 200) {
  978. console.log("上传成功", res)
  979. self.textParseUrlIps(config.base_url + '/' + res.data.url);
  980. } else {
  981. uni.showToast({
  982. title: res.msg,
  983. icon: "none",
  984. mask: true,
  985. duration: 2000
  986. });
  987. }
  988. },
  989. fail: err => {
  990. uni.hideLoading()
  991. },
  992. complete: () => {}
  993. });
  994. },
  995. //发送语音
  996. async textParseUrlIps(text) {
  997. let self = this;
  998. let newList = [];
  999. for (let i = 0; i < self.trumpetList.length; i++) {
  1000. if (self.trumpetList[i].type) {
  1001. let obj = {
  1002. sn: self.trumpetList[i].deviceSn,
  1003. port: self.trumpetList[i].port,
  1004. deviceIp: self.trumpetList[i].deviceIp,
  1005. type: "",
  1006. name: "",
  1007. speed: "",
  1008. params: {
  1009. tid: "",
  1010. vol: self.trumpetList[i].deviceVol,
  1011. urls: []
  1012. }
  1013. };
  1014. newList.push(obj);
  1015. }
  1016. }
  1017. const {
  1018. data
  1019. } = await textParseUrlIps(newList, text)
  1020. if (data.code == 200) {
  1021. uni.showToast({
  1022. title: '发送成功',
  1023. icon: "none",
  1024. mask: true,
  1025. duration: 2000
  1026. });
  1027. }
  1028. },
  1029. goVideo(){
  1030. this.itemData.floorId = this.itemData.subAddrr.floorId;
  1031. uni.navigateTo({
  1032. url:'/pages_manage/workbench/laboratory/monitor?item='+encodeURIComponent(JSON.stringify(this.itemData))+'&deptId='+this.deptId
  1033. })
  1034. },
  1035. goWord(){
  1036. uni.navigateTo({
  1037. url:'/pages_manage/workbench/laboratory/word?item='+encodeURIComponent(JSON.stringify(this.itemData))
  1038. })
  1039. },
  1040. },
  1041. onHide(){
  1042. // //删除传感器监听
  1043. getApp().deleteSensorWatch();
  1044. // //删除设备监听
  1045. getApp().deleteDeviceWatch();
  1046. //删除一键灭火-传感器状态
  1047. getApp().deletefireData();
  1048. //删除一键灭火-设备是否在线
  1049. getApp().deleteOnlineData();
  1050. //删除一键灭火-是否正在执行灭火
  1051. getApp().deletePerformData();
  1052. },
  1053. beforeDestroy(){
  1054. // //删除传感器监听
  1055. getApp().deleteSensorWatch();
  1056. // //删除设备监听
  1057. getApp().deleteDeviceWatch();
  1058. //删除一键灭火-传感器状态
  1059. getApp().deletefireData();
  1060. //删除一键灭火-设备是否在线
  1061. getApp().deleteOnlineData();
  1062. //删除一键灭火-是否正在执行灭火
  1063. getApp().deletePerformData();
  1064. }
  1065. }
  1066. </script>
  1067. <style lang="stylus" scoped>
  1068. #laboratoryInfo{
  1069. height:100%;
  1070. display flex;
  1071. flex-direction column;
  1072. /* 语音广播 */
  1073. .shade-max-big-box {
  1074. height: 100%;
  1075. width: 100%;
  1076. position: fixed;
  1077. display: flex;
  1078. flex-direction: column;
  1079. z-index: 10;
  1080. background: rgba(0, 0, 0, 0.2);
  1081. .null-box {
  1082. flex: 1;
  1083. }
  1084. /* 语音广播-执行疏散 */
  1085. .broadcast {
  1086. width: 100%;
  1087. // height: 532rpx;
  1088. background: #FFFFFF;
  1089. border-top-left-radius: 20rpx;
  1090. border-top-right-radius: 20rpx;
  1091. padding:22rpx 30rpx 30rpx;
  1092. box-sizing: border-box;
  1093. margin-top: 20rpx;
  1094. .broadcast_t {
  1095. font-size: 30rpx;
  1096. font-family: PingFang SC;
  1097. font-weight: 500;
  1098. color: #333333;
  1099. line-height: 30rpx;
  1100. >label {
  1101. font-size: 24rpx;
  1102. font-family: PingFang SC;
  1103. font-weight: 500;
  1104. color: #999999;
  1105. line-height: 30rpx;
  1106. margin-left: 16rpx;
  1107. }
  1108. }
  1109. .trumpet-max-box {
  1110. display: flex;
  1111. justify-content: flex-start;
  1112. margin-top: 22rpx;
  1113. flex-wrap: wrap;
  1114. .trumpet-for-box {
  1115. display: inline-block;
  1116. width: auto;
  1117. height: 60rpx;
  1118. line-height: 60rpx;
  1119. font-size: 24rpx;
  1120. text-align: center;
  1121. cursor: pointer;
  1122. overflow: hidden;
  1123. border: 1rpx solid #E0E0E0;
  1124. border-radius: 10rpx;
  1125. color: #E0E0E0;
  1126. display: flex;
  1127. justify-content: center;
  1128. margin-right: 20rpx;
  1129. margin-bottom: 10rpx;
  1130. padding: 0 12rpx;
  1131. box-sizing: border-box;
  1132. >img {
  1133. width: 36rpx;
  1134. height: 34rpx;
  1135. margin: 12rpx 20rpx 0 25rpx;
  1136. }
  1137. }
  1138. .trumpet-color-a {
  1139. border: 1px solid #0183FA;
  1140. color: #0183FA;
  1141. }
  1142. .trumpet-color-b {
  1143. border: 1px solid #CCCCCC;
  1144. color: #999;
  1145. }
  1146. }
  1147. .broadcast_m {
  1148. width: 100%;
  1149. .broadcast_m_t {
  1150. width: 142rpx;
  1151. height: 142rpx;
  1152. margin: 30rpx 0 0 258rpx;
  1153. position: relative;
  1154. font-size: 24rpx;
  1155. font-family: PingFang SC;
  1156. font-weight: 500;
  1157. line-height: 170rpx;
  1158. text-align: center;
  1159. >img {
  1160. width: 142rpx;
  1161. height: 142rpx;
  1162. position: absolute;
  1163. }
  1164. >label {
  1165. width: 100%;
  1166. font-size: 24rpx;
  1167. font-family: PingFang SC;
  1168. font-weight: 500;
  1169. color: #0183FA;
  1170. line-height: 24rpx;
  1171. display: inline-block;
  1172. text-align: center;
  1173. position: absolute;
  1174. top: 76rpx;
  1175. }
  1176. /* 按下 */
  1177. .press_color {
  1178. color: #FFFFFF;
  1179. }
  1180. /* 松开 */
  1181. .slip_color {
  1182. color: #0183FA;
  1183. }
  1184. }
  1185. .broadcast_m_t_back_a {
  1186. background: url(@/images/icon_sskz_skfs.png);
  1187. background-size: 100%;
  1188. color: #FFFFFF;
  1189. }
  1190. .broadcast_m_t_back_b {
  1191. background: url(@/images/icon_sskz_azsh.png);
  1192. background-size: 100%;
  1193. color: #0183FA;
  1194. }
  1195. .broadcast_m_b {
  1196. font-size: 24rpx;
  1197. font-family: PingFang SC;
  1198. font-weight: 500;
  1199. color: #999999;
  1200. line-height: 24rpx;
  1201. text-align: center;
  1202. margin-top: 14rpx;
  1203. }
  1204. }
  1205. /* 疏散按钮 */
  1206. .evacuation-button-box {
  1207. width: 650rpx;
  1208. height: 100rpx;
  1209. background: #0183FA;
  1210. color: #fff;
  1211. text-align center;
  1212. line-height: 100rpx;
  1213. font-size: 28rpx;
  1214. margin: 88rpx auto 0;
  1215. border-radius: 20rpx;
  1216. }
  1217. }
  1218. }
  1219. /* 一键灭火 */
  1220. .outfire {
  1221. width: 750rpx;
  1222. height: auto;
  1223. background: #FFFFFF;
  1224. margin: 20rpx 0;
  1225. padding: 20rpx 10rpx;
  1226. box-sizing: border-box;
  1227. display: flex;
  1228. justify-content: space-between;
  1229. align-items: center;
  1230. .outfire_li {
  1231. display: flex;
  1232. justify-content: flex-start;
  1233. //align-items: center;
  1234. >img {
  1235. width: 24rpx;
  1236. height: 30rpx;
  1237. margin-right: 12rpx;
  1238. margin-top: 8rpx;
  1239. }
  1240. .finish{
  1241. flex: 1;
  1242. }
  1243. .normal {
  1244. font-size: 24rpx;
  1245. font-family: PingFang SC;
  1246. font-weight: 500;
  1247. color: #333333;
  1248. }
  1249. .abnormal {
  1250. font-size: 24rpx;
  1251. font-family: PingFang SC;
  1252. font-weight: 500;
  1253. color: #F11C00;
  1254. }
  1255. }
  1256. .outfire_li:nth-of-type(1) {
  1257. >img {
  1258. width: 30rpx;
  1259. height: 28rpx;
  1260. margin-right: 12rpx;
  1261. }
  1262. }
  1263. .outfire_yes_btn {
  1264. width: 120rpx;
  1265. height: 40rpx;
  1266. font-size: 24rpx;
  1267. font-family: PingFang SC;
  1268. font-weight: 500;
  1269. color: #F21C00;
  1270. line-height: 40rpx;
  1271. border: 1px solid #F21C00;
  1272. border-radius: 8rpx;
  1273. text-align: center;
  1274. margin-left: 54rpx;
  1275. }
  1276. .outfire_no_btn {
  1277. width: 120rpx;
  1278. height: 40rpx;
  1279. font-size: 24rpx;
  1280. font-family: PingFang SC;
  1281. font-weight: 500;
  1282. color: #CCCCCC;
  1283. line-height: 40rpx;
  1284. border: 1px solid #E0E0E0;
  1285. border-radius: 8rpx;
  1286. text-align: center;
  1287. margin-left: 54rpx;
  1288. }
  1289. }
  1290. /* 一键灭火 */
  1291. .shade-outfire {
  1292. height: 100%;
  1293. width: 100%;
  1294. position: fixed;
  1295. display: flex;
  1296. flex-direction: column;
  1297. z-index: 10;
  1298. background: rgba(0, 0, 0, 0.2);
  1299. .null-box {
  1300. flex: 1;
  1301. }
  1302. .shade-outfire-n {
  1303. width: 625rpx;
  1304. height: 450rpx;
  1305. background: #FFFFFF;
  1306. border-radius: 20rpx;
  1307. position: absolute;
  1308. top: 370rpx;
  1309. left: 62rpx;
  1310. .shade-outfire-n-t {
  1311. width: 172rpx;
  1312. height: 172rpx;
  1313. margin: 38rpx 0 0 226rpx;
  1314. }
  1315. .shade-outfire-n-m {
  1316. font-size: 30rpx;
  1317. font-family: PingFang SC;
  1318. font-weight: 500;
  1319. color: #E30000;
  1320. line-height: 84rpx;
  1321. text-align: center;
  1322. border-bottom: 1px solid #E0E0E0;
  1323. >text {
  1324. font-size: 40rpx;
  1325. }
  1326. }
  1327. .shade-outfire-n-b {
  1328. width: 402rpx;
  1329. height: 82rpx;
  1330. background: #FFFFFF;
  1331. border: 2rpx solid #0183FA;
  1332. border-radius: 10rpx;
  1333. font-size: 28rpx;
  1334. line-height: 82rpx;
  1335. font-family: PingFang SC;
  1336. font-weight: 500;
  1337. color: #0183FA;
  1338. text-align: center;
  1339. margin: 30rpx 0 0 112rpx;
  1340. }
  1341. }
  1342. }
  1343. .name-max-box{
  1344. background #fff
  1345. .title-box{
  1346. margin:20rpx 20rpx 0;
  1347. display flex
  1348. view:nth-child(1){
  1349. height:40rpx;
  1350. line-height:40rpx;
  1351. font-size:20rpx;
  1352. border-radius:10rpx;
  1353. padding:0 20rpx;
  1354. color:#fff;
  1355. margin-right:20rpx;
  1356. }
  1357. view:nth-child(2){
  1358. line-height:42rpx;
  1359. font-size:30rpx;
  1360. color:#0183FA;
  1361. max-width:600rpx;
  1362. flex:1;
  1363. }
  1364. img{
  1365. width:12rpx;
  1366. height:20rpx;
  1367. margin-top:11rpx;
  1368. }
  1369. .colorA{
  1370. background:#aa2315;
  1371. }
  1372. .colorB{
  1373. background:#ff9b09;
  1374. }
  1375. .colorC{
  1376. background:#3ea3e9;
  1377. }
  1378. .colorD{
  1379. background:#3ea34c;
  1380. }
  1381. }
  1382. .address-box{
  1383. margin:20rpx 20rpx;
  1384. font-size:26rpx;
  1385. color:#999999;
  1386. span{
  1387. margin-right:60rpx;
  1388. }
  1389. }
  1390. .address-box-two{
  1391. display flex
  1392. margin:0 20rpx 20rpx 20rpx;
  1393. img{
  1394. width:28rpx;
  1395. height:30rpx;
  1396. margin-right:18rpx;
  1397. }
  1398. view{
  1399. line-height:30rpx;
  1400. font-size:24rpx;
  1401. color:#999999;
  1402. }
  1403. }
  1404. }
  1405. .title-max-box-none{
  1406. border:none!important;
  1407. }
  1408. .title-max-box{
  1409. display flex
  1410. height:80rpx;
  1411. border-bottom:1rpx solid #E0E0E0;
  1412. .left-view{
  1413. width: 4rpx;
  1414. height: 34rpx;
  1415. margin:25rpx 24rpx 0 20rpx;
  1416. background:#0D97EB;
  1417. }
  1418. .right-view{
  1419. line-height:80rpx;
  1420. font-size: 30rpx;
  1421. color: #333333;
  1422. flex:1;
  1423. }
  1424. .click-view{
  1425. display flex
  1426. padding:0 20rpx;
  1427. view{
  1428. line-height:80rpx;
  1429. font-size: 24rpx;
  1430. color: #666666;
  1431. }
  1432. img{
  1433. width:20rpx;
  1434. height:10rpx;
  1435. margin:35rpx 0 0 20rpx;
  1436. }
  1437. }
  1438. }
  1439. .sensor-max-box{
  1440. background #fff
  1441. margin-top:20rpx;
  1442. .text-box{
  1443. /*border-top:1rpx dashed #e0e0e0;*/
  1444. /*border-top:1rpx solid #E0E0E0;*/
  1445. padding:0 20rpx;
  1446. /*
  1447. overflow-x:scroll;
  1448. overflow-y:hidden;
  1449. white-space: nowrap;
  1450. */
  1451. .min-box{
  1452. display inline-block
  1453. /*padding:0 30rpx 0 10rpx;*/
  1454. width:355rpx;
  1455. .min-min-box{
  1456. display: flex
  1457. img{
  1458. width:30rpx;
  1459. height:27rpx;
  1460. margin-top:24rpx;
  1461. margin-right:10rpx;
  1462. }
  1463. view{
  1464. line-height:74rpx;
  1465. text-align center
  1466. font-size:28rpx;
  1467. color:#333;
  1468. }
  1469. .colorA{
  1470. color:#EE3A3A;
  1471. }
  1472. }
  1473. }
  1474. }
  1475. }
  1476. .control-max-box{
  1477. background #fff
  1478. margin-top:20rpx;
  1479. .button-max-box{
  1480. .button-box:last-child{
  1481. border:none!important;
  1482. }
  1483. .button-box{
  1484. display flex
  1485. border-bottom:1rpx solid #e0e0e0;
  1486. margin:0 20rpx;
  1487. view{
  1488. width:200rpx;
  1489. line-height:70rpx;
  1490. border: 2rpx solid #0183FA;
  1491. border-radius: 35rpx;
  1492. color: #0183FA;
  1493. font-size: 24rpx;
  1494. text-align center;
  1495. margin:30rpx 0 30rpx 0;
  1496. }
  1497. view:nth-child(1){
  1498. margin-right: 18rpx;
  1499. }
  1500. view:nth-child(2){
  1501. }
  1502. }
  1503. .for-button-box:last-child{
  1504. border:none!important;
  1505. }
  1506. .for-button-box{
  1507. display flex
  1508. border-bottom:1rpx solid #e0e0e0;
  1509. margin:0 20rpx;
  1510. .for-button-p{
  1511. flex:1;
  1512. line-height:90rpx;
  1513. color:#333333;
  1514. font-size:28rpx;
  1515. >text{
  1516. font-size: 28rpx;
  1517. color: #0183FA;
  1518. }
  1519. }
  1520. img{
  1521. height:50rpx;
  1522. width:100rpx;
  1523. margin:20rpx 0 20rpx 0;
  1524. }
  1525. view:nth-child(2){
  1526. text-align right
  1527. color:#999;
  1528. }
  1529. .pcType-button{
  1530. width:120rpx;
  1531. line-height:42rpx;
  1532. border:4rpx solid #0183FA;
  1533. border-radius:30rpx;
  1534. color: #0183FA !important;
  1535. font-size: 24rpx;
  1536. text-align center !important;
  1537. margin:20rpx 0 20rpx 0;
  1538. }
  1539. }
  1540. }
  1541. }
  1542. .info-max-box{
  1543. background #fff
  1544. margin-top:20rpx;
  1545. .top-name-max-box{
  1546. background #fff
  1547. overflow hidden
  1548. .name-box{
  1549. margin:27rpx 20rpx 0;
  1550. display:flex;
  1551. view:nth-child(1){
  1552. background:#f95f5f;
  1553. color:#fff;
  1554. border-radius:6rpx;
  1555. font-size:20rpx;
  1556. padding:0 10rpx;
  1557. height:42rpx;
  1558. line-height:42rpx;
  1559. }
  1560. view:nth-child(2){
  1561. color:#333;
  1562. margin-left:20rpx;
  1563. font-size:28rpx;
  1564. height:30rpx;
  1565. line-height:42rpx;
  1566. font-weight:700;
  1567. }
  1568. }
  1569. .address-box{
  1570. margin:22rpx 20rpx;
  1571. font-size:26rpx;
  1572. }
  1573. }
  1574. .text-max-box{
  1575. background #fff
  1576. padding:8rpx 20rpx;
  1577. border-bottom:1rpx solid #e0e0e0;
  1578. .text-min-box{
  1579. display:flex;
  1580. view{
  1581. line-height:66rpx;
  1582. height:66rpx;
  1583. font-size:28rpx;
  1584. }
  1585. view:nth-child(1){
  1586. width:220rpx;
  1587. color:#333;
  1588. }
  1589. view:nth-child(2){
  1590. flex:1;
  1591. color:#999;
  1592. text-align:right;
  1593. }
  1594. }
  1595. }
  1596. .safety-max-box{
  1597. background #fff
  1598. padding:8rpx 20rpx;
  1599. .max-for-box{
  1600. .title-box{
  1601. line-height:76rpx;
  1602. font-size:30rpx;
  1603. color:#333;
  1604. }
  1605. .for-box{
  1606. line-height:48rpx;
  1607. font-size:28rpx;
  1608. color:#999;
  1609. }
  1610. }
  1611. }
  1612. .img-bottom-box{
  1613. margin-top:20rpx;
  1614. background #fff
  1615. padding:8rpx 20rpx 20rpx;
  1616. .title-box{
  1617. line-height:76rpx;
  1618. font-size:28rpx;
  1619. color:#333;
  1620. }
  1621. .for-box{
  1622. line-height:48rpx;
  1623. font-size:26rpx;
  1624. color:#999;
  1625. .img-ojb{
  1626. display inline-block
  1627. width:86rpx;
  1628. height:114rpx;
  1629. margin-left:30rpx;
  1630. }
  1631. .code-img{
  1632. width:200rpx;
  1633. height:200rpx;
  1634. margin:20rpx auto 40rpx;
  1635. }
  1636. }
  1637. }
  1638. }
  1639. }
  1640. </style>