laboratoryInfo.vue 49 KB

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