laboratoryInfo.vue 51 KB

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