laboratoryInfo.vue 51 KB

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