laboratoryInfo.vue 49 KB

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