laboratoryInfo.vue 51 KB

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