indexOne.vue 51 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399
  1. <!--实验室列表页面(用于四医大项目,同步3.1.2版本,有智能门锁相关功能)-->
  2. <template>
  3. <div class="subject">
  4. <div class="subject-page" v-if="pageType == 1">
  5. <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch">
  6. <el-form-item label="学院" prop="deptId" label-width="60px">
  7. <el-select v-model="queryParams.deptId" placeholder="请选择学院" clearable size="small">
  8. <el-option
  9. v-for="dict in deptOptions"
  10. :key="dict.deptId"
  11. :label="dict.deptName"
  12. :value="dict.deptId"
  13. ></el-option>
  14. </el-select>
  15. </el-form-item>
  16. <el-form-item label="实验室名称" prop="name" label-width="100px">
  17. <el-input
  18. v-model="queryParams.name"
  19. placeholder="请输入实验室名称"
  20. clearable
  21. size="small"
  22. />
  23. </el-form-item>
  24. <el-form-item style="float: right;">
  25. <el-col :span="1.5" style="margin-bottom:20px;">
  26. <p class="add-button-one-120"
  27. @click="clickPage(2)"
  28. v-hasPermi="['laboratory:subject:add']"
  29. ><i class="el-icon-plus"></i>新增实验室</p>
  30. </el-col>
  31. </el-form-item>
  32. <el-form-item style="margin-right: 20px;">
  33. <p class="inquire-button-one" style="margin-left:20px;" @click="handleQuery">查询</p>
  34. <p class="reset-button-one" style="margin-left:20px;" @click="resetQuery">重置</p>
  35. </el-form-item>
  36. </el-form>
  37. <div class="subject-page-min">
  38. <div class="left-subject-list" >
  39. <el-table ref="multipleTable" border :data="subjectList" highlight-current-row @current-change="handleCurrentChange" style="cursor: pointer;">
  40. <el-table-column label="排序" align="left" prop="id" width="80">
  41. <template slot-scope="scope">
  42. <el-input maxlength="4" type="text" oninput ="value=value.replace(/[^0-9.]/g,'')" v-model="scope.row.diyOrder" @focus="liveSort(scope.row)" @blur="editSort(scope.row)"></el-input>
  43. </template>
  44. </el-table-column>
  45. <el-table-column label="实验室名称" align="left" prop="name" width="230" show-overflow-tooltip/>
  46. <el-table-column label="位置" align="left" prop="name" width="160" show-overflow-tooltip>
  47. <template slot-scope="scope">
  48. {{scope.row.buildName}}{{scope.row.floorName}}{{scope.row.room}}
  49. </template>
  50. </el-table-column>
  51. <!--<el-table-column label="类型" align="left" prop="moldName" width="100" show-overflow-tooltip/>-->
  52. <el-table-column label="安全分类" align="left" prop="typeName" width="100" show-overflow-tooltip/>
  53. <el-table-column label="安全分级" align="left" prop="levelName" width="80" show-overflow-tooltip>
  54. <template slot-scope="scope">
  55. <span :style="'color:'+scope.row.fiedColor+';'">{{scope.row.levelName}}</span>
  56. </template>
  57. </el-table-column>
  58. <el-table-column label="重大危险源辨识指标" align="left" prop="riskIndicator" width="150" show-overflow-tooltip/>
  59. <el-table-column label="学院" align="left" prop="deptName" width="150" show-overflow-tooltip/>
  60. <el-table-column label="实验室责任人" align="left" prop="adminName" width="120" show-overflow-tooltip/>
  61. <el-table-column label="安全责任人" align="left" prop="safeUserName" width="200" show-overflow-tooltip/>
  62. <el-table-column label="操作" align="left" width="160">
  63. <template slot-scope="scope">
  64. <div class="table-button-box">
  65. <p class="table-button-null"></p>
  66. <p class="table-button-p" v-hasPermi="['laboratory:subject:query']" @click="clickPage(7,scope.row)">详情</p>
  67. <el-dropdown trigger="click" size="mini" @command="(command) => handleCommand(command, scope.row)">
  68. <p class="table-button-p">更多>></p>
  69. <el-dropdown-menu slot="dropdown" style="margin:0!important;">
  70. <el-dropdown-item style="height:36px;line-height:36px;width:90px;text-align: center" command="1" v-hasPermiAnd="['laboratory:subject:query','laboratory:subject:edit']">关联配置</el-dropdown-item>
  71. <el-dropdown-item style="height:36px;line-height:36px;width:90px;text-align: center" command="2">物联配置</el-dropdown-item>
  72. <!--<el-dropdown-item style="height:36px;line-height:36px;width:90px;text-align: center" command="3" v-hasPermi="['laboratory:subjectmaterial:add']">准入配置</el-dropdown-item>-->
  73. <el-dropdown-item style="height:36px;line-height:36px;width:90px;text-align: center" command="4" v-hasPermiAnd="['laboratory:subject:query','laboratory:subject:edit']">编辑</el-dropdown-item>
  74. <!--<el-dropdown-item style="height:36px;line-height:36px;width:90px;text-align: center" command="5"-->
  75. <!--v-hasPermi="['laboratory:subject:remove']">删除</el-dropdown-item>-->
  76. </el-dropdown-menu>
  77. </el-dropdown>
  78. <p class="table-button-null"></p>
  79. </div>
  80. </template>
  81. </el-table-column>
  82. </el-table>
  83. <pagination
  84. v-show="total>0"
  85. :total="total"
  86. :page.sync="queryParams.pageNum"
  87. :limit.sync="queryParams.pageSize"
  88. @pagination="getList"
  89. />
  90. </div>
  91. <div class="right-subject-box scrollbar-box" :class="rightButtonType == 4?'overflow-box':''" v-if="checkedSubject.id">
  92. <div class="top-button-box">
  93. <div :class="rightButtonType == 1 ? 'buttonColorA' : 'buttonColorB'" @click="rightButtonClick(1)">传感器监测</div>
  94. <!--<div :class="rightButtonType == 2 ? 'buttonColorA' : 'buttonColorB'" @click="rightButtonClick(2)">物联控制</div>-->
  95. <!--<div :class="rightButtonType == 3 ? 'buttonColorA' : 'buttonColorB'" @click="rightButtonClick(3)">视频监控</div>-->
  96. <div :class="rightButtonType == 5 ? 'buttonColorA' : 'buttonColorB'" @click="rightButtonClick(5)">智能门禁</div>
  97. <div :class="rightButtonType == 4 ? 'buttonColorA' : 'buttonColorB'" @click="rightButtonClick(4)">智能声光报警器</div>
  98. </div>
  99. <!--传感器-->
  100. <div class="bottom-max-box" :class="rightButtonType == 4?'overflow-box':''">
  101. <div class="bottom-sensor-box" v-if="rightButtonType == 1">
  102. <p class="top-title">当前位置:{{checkedSubject.subAddrr.buildName}}{{checkedSubject.subAddrr.floorName}}</p>
  103. <div class="sensor-for-max-box" v-if="checkedSubject.sensorFunctionStatusList[0]">
  104. <div class="sensor-for-big-box"
  105. :class="item.type == 1 ? 'sensor-color-a' : (item.type == 2 ? 'sensor-color-b' : 'sensor-color-c')"
  106. v-for="(item,index) in checkedSubject.sensorFunctionStatusList" :key="index">
  107. <div class="sensor-for-min-box">
  108. <img src="@/assets/ZDimages/subject/icon_bj_wd.png" v-if="item.funNum == 'wendu'">
  109. <img src="@/assets/ZDimages/subject/icon_bj_sd.png" v-if="item.funNum == 'shidu'">
  110. <img src="@/assets/ZDimages/subject/icon_bj_eyht.png" v-if="item.funNum == 'co'">
  111. <img src="@/assets/ZDimages/subject/icon_bj_jwnd.png" v-if="item.funNum == 'jiawan'">
  112. <img src="@/assets/ZDimages/subject/icon_sy_yqnd.png" v-if="item.funNum == 'o2'">
  113. <img src="@/assets/ZDimages/subject/icon_bj_yg.png" v-if="item.funNum == 'yanwu'">
  114. <img src="@/assets/ZDimages/subject/icon_sy_dqy.png" v-if="item.funNum == 'daqiya'">
  115. <img src="@/assets/ZDimages/subject/icon_syspz_voc.png" v-if="item.funNum == 'voc'">
  116. <img src="@/assets/ZDimages/subject/icon_syspz_tvoc.png" v-if="item.funNum == 'tvoc'">
  117. <img src="@/assets/ZDimages/subject/icon_sy_mcnd.png" v-if="item.funNum == 'so2'">
  118. <img src="@/assets/ZDimages/subject/icon_bj_yyhd.png" v-if="item.funNum == 'no1'">
  119. <img src="@/assets/ZDimages/subject/icon_bj_dqy.png" v-if="item.funNum == 'fenchen'">
  120. <img src="@/assets/ZDimages/subject/icon_bj_qq.png" v-if="item.funNum == 'H2'">
  121. <img src="@/assets/ZDimages/subject/guangqi.png" v-if="item.funNum == 'guangqi'">
  122. <img src="@/assets/ZDimages/subject/lvqi.png" v-if="item.funNum == 'lvqi'">
  123. <div>
  124. <el-tooltip class="item" effect="dark" :content="item.describe" placement="bottom">
  125. <p>{{item.describe|ellipsis}}</p>
  126. </el-tooltip>
  127. <p>{{item.formatVal}}</p>
  128. </div>
  129. </div>
  130. </div>
  131. </div>
  132. <img class="null-data-img" src="@/assets/ZDimages/null-data.png" v-if="!checkedSubject.sensorFunctionStatusList[0]">
  133. <p class="null-text-p" v-if="!checkedSubject.sensorFunctionStatusList[0]">暂无环境监测信息,请在更多操作-物联设备配置中进行添加</p>
  134. <p class="bottom-text" v-if="checkedSubject.sensorFunctionStatusList[0]">数据上报时间:{{checkedSubject.sensorFunctionStatusList[0].sendDate}}</p>
  135. </div>
  136. <div class="bottom-switch-box" v-if="rightButtonType == 2">
  137. <p class="top-title">当前位置:{{checkedSubject.subAddrr.buildName}}{{checkedSubject.subAddrr.floorName}}</p>
  138. <div class="switch-for-max-box" v-show="checkedSubject.labHardwareVOList" v-hasPermi="['laboratory:subcontrol:set']">
  139. <div class="switch-for-big-box" v-for="(item,index) in checkedSubject.labHardwareVOList" :key="index">
  140. <div class="switch-for-min-box" v-if="item.hardwareTypeEnum.enumName == 'SWITCH'">
  141. <p class="switch-for-min-title">电源控制</p>
  142. <el-switch
  143. v-if="item.state.code == 3||item.state.code == 4"
  144. class="switch"
  145. @click.native="changeIsNeedCaptcha(item)"
  146. v-model="item.state.code"
  147. :active-value="3"
  148. :inactive-value="4"
  149. active-text="开"
  150. inactive-text="关"
  151. disabled>
  152. </el-switch>
  153. <p class="switch-null-p" v-else>{{item.state.name}}</p>
  154. </div>
  155. <div class="switch-for-min-box" v-if="item.hardwareTypeEnum.enumName == 'AI_VENTILATION'">
  156. <p class="switch-for-min-title">智能通风</p>
  157. <el-switch
  158. v-if="item.state.code == 3||item.state.code == 4"
  159. class="switch"
  160. @click.native="changeIsNeedCaptcha(item)"
  161. v-model="item.state.code"
  162. :active-value="3"
  163. :inactive-value="4"
  164. active-text="开"
  165. inactive-text="关"
  166. disabled>
  167. </el-switch>
  168. <p class="switch-null-p" v-else>{{item.state.name}}</p>
  169. </div>
  170. <!--<div class="switch-for-min-box" v-if="item.hardwareTypeEnum.enumName == 'ONE_MACHINE'">-->
  171. <!--<p class="switch-for-min-title">广播系统</p>-->
  172. <!--<p class="switch-for-min-button" @click="handleAdd(item.subId)">播放文字</p>-->
  173. <!--</div>-->
  174. </div>
  175. </div>
  176. <img class="null-data-img" src="@/assets/ZDimages/null-data.png" v-show="!checkedSubject.labHardwareVOList">
  177. <p class="null-text-p" v-show="!checkedSubject.labHardwareVOList">暂无物联控制信息,请在更多操作-物联设备配置中进行添加</p>
  178. </div>
  179. <div class="bottom-video-box" v-if="rightButtonType == 3">
  180. <p class="top-title">当前位置:{{checkedSubject.subAddrr.buildName}}{{checkedSubject.subAddrr.floorName}}</p>
  181. <div class="video-for-max-box" v-if="checkedSubject.videoData[0]">
  182. <div class="switch-for-big-box" v-for="(item,index) in checkedSubject.videoData" :key="index">
  183. <video :id="item.divId" ref="videoRef" autoplay controls muted width="490px" height="262px"></video>
  184. <p class="el-icon-full-screen position-p" @click="videoFullScreen(index)"></p>
  185. </div>
  186. </div>
  187. <img class="null-data-img" src="@/assets/ZDimages/null-data.png" v-if="!checkedSubject.videoData[0]">
  188. <p class="null-text-p" v-if="!checkedSubject.videoData[0]">暂无视频监控信息,请在更多操作-物联设备配置中进行添加</p>
  189. </div>
  190. <div class="bottom-alarm-box" v-if="rightButtonType == 4">
  191. <div class="alarm-max-box" v-if="!hardwareData[0]">
  192. <p style="line-height:120px;color:#999;text-align: center;flex:1;">暂未配置声光报警器</p>
  193. </div>
  194. <div class="alarm-max-box" v-if="hardwareData[0]">
  195. <img v-if="hardwareData[0].status==3||hardwareData[0].status==4" src="@/assets/ZDimages/medicUniversity-3_1/img_syslb_znsgbjzx.png" class="alarm-img">
  196. <img v-else src="@/assets/ZDimages/medicUniversity-3_1/img_syslb_znsgbjlx.png" class="alarm-img">
  197. <div class="alarm-big-box" v-if="hardwareData[0]">
  198. <p>报警器编号:{{hardwareData[0].hardwareNum}}</p>
  199. <p :class="hardwareData[0].status==3||hardwareData[0].status==4?'colorTypeA':'colorTypeB'">{{hardwareData[0].status==3||hardwareData[0].status==4?'在线':'离线'}}</p>
  200. </div>
  201. <div class="alarm-big-box" v-if="!hardwareData[0]">
  202. <p>未绑定报警器</p>
  203. </div>
  204. <div class="alarm-position-box" v-if="hardwareData[0]">
  205. <el-switch
  206. v-if="hardwareData[0].status == 3||hardwareData[0].status == 4"
  207. @click.native="changeIsNeedCaptchaAlarm(hardwareData[0])"
  208. class="switch captcha-img"
  209. :active-value="3"
  210. :inactive-value="4"
  211. active-color="#FF9900"
  212. inactive-color="#999"
  213. v-model="hardwareData[0].status"
  214. active-text="报警中"
  215. inactive-text="未报警"
  216. disabled
  217. ></el-switch>
  218. </div>
  219. </div>
  220. <div class="alarm-title-box">
  221. <p>报警记录</p>
  222. <p v-hasPermi="['chemical:hxpAlarmRecord:list']" @click="goAlarmRecord">更多>></p>
  223. </div>
  224. <el-table border :data="tableList" ref="multipleTable">
  225. <el-table-column label="报警时间" align="center" prop="alarmTime"/>
  226. <el-table-column label="报警时长" align="center" prop="alarmDuration" width="110"/>
  227. <el-table-column label="处理状态" align="center" prop="operate" width="100"/>
  228. <el-table-column label="处理人" align="center" prop="handlingUserName" width="90"/>
  229. </el-table>
  230. <pagination
  231. v-show="totalTwo>0"
  232. :total="totalTwo"
  233. :page.sync="queryParamsTwo.pageNum"
  234. :limit.sync="queryParamsTwo.pageSize"
  235. @pagination="getHxpAlarmRecordNoAuthList"
  236. />
  237. </div>
  238. <div class="bottom-door-box" v-if="rightButtonType == 5">
  239. <p style="line-height:120px;color:#999;text-align: center;flex:1;"
  240. v-if="!checkedSubject.doorList">暂未配置门禁</p>
  241. <div class="for-door-box" v-for="(item,index) in checkedSubject.doorList" :key="index">
  242. <img v-if="item.onLineStatus==1" src="@/assets/ZDimages/medicUniversity-3_1/img_syslb_znmjzx.png" class="alarm-img">
  243. <img v-if="item.onLineStatus!=1" src="@/assets/ZDimages/medicUniversity-3_1/img_syslb_znmjlx.png" class="alarm-img">
  244. <div>
  245. <p>门禁锁编号:{{item.lockCode}}</p>
  246. <p :class="item.onLineStatus==1?'colorTypeA':'colorTypeB'">{{item.onLineStatus==1?'在线':'离线'}}</p>
  247. </div>
  248. </div>
  249. <p class="bottom-button-go-route" @click="goAccessAuthorization">门禁授权</p>
  250. </div>
  251. </div>
  252. </div>
  253. </div>
  254. </div>
  255. <!--<add-subject v-if="pageType == 2" :subjectData="subjectData"></add-subject>-->
  256. <!--<device-list v-if="pageType == 3" :subjectData="subjectData"></device-list>-->
  257. <!--<admission-configuration v-if="pageType == 4" :subjectData="subjectData"></admission-configuration>-->
  258. <!--<association-configuration v-if="pageType == 5" :subjectData="subjectData"></association-configuration>-->
  259. <!--<info-page v-if="pageType == 6" :newData="newData"></info-page>-->
  260. <!--播放文字窗口-->
  261. <el-dialog title="广播系统" :visible.sync="open" width="500px" append-to-body>
  262. <el-form ref="form" :model="form" :rules="rules" label-width="80px">
  263. <el-form-item label="播放文字" prop="txt">
  264. <el-input v-model="form.txt" placeholder="请输入播放文字" />
  265. </el-form-item>
  266. <el-form-item label="播报方式" prop="type">
  267. <el-radio-group v-model="form.type">
  268. <el-radio :label="1">文字</el-radio>
  269. <el-radio :label="2">音频</el-radio>
  270. </el-radio-group>
  271. </el-form-item>
  272. </el-form>
  273. <div slot="footer" class="dialog-footer">
  274. <el-button @click="cancel">取 消</el-button>
  275. <el-button type="primary" @click="submitFormOne">确 定</el-button>
  276. </div>
  277. </el-dialog>
  278. </div>
  279. </template>
  280. <script>
  281. import mqtt from 'mqtt'
  282. import flvjs from 'flv.js'
  283. import { hardWareControl,alarmControl } from "@/api/laboratory/hardware";
  284. import { authListSubject,subjectInfo,updateSubject,mangerVoice,startUrl,getDetalis } from "@/api/laboratory/subject";
  285. import { listDepartments } from "@/api/system/dept";
  286. // import addSubject from "./addSubject.vue";
  287. // import deviceList from "./deviceListOne.vue";
  288. // import admissionConfiguration from "./admissionConfiguration.vue";
  289. // import associationConfiguration from "./associationConfigurationOne.vue";
  290. // import infoPage from "./infoPageOne.vue";
  291. import { getHxpAlarmRecordNoAuthList,getEnablelist } from "@/api/medicUniversity-3_1/index";
  292. export default {
  293. filters:{
  294. ellipsis(value){
  295. if (!value) return '';
  296. if (value.length > 6) {
  297. return value.slice(0,6) + '...'
  298. }
  299. return value
  300. }
  301. },
  302. name: "subject",
  303. components: {
  304. // addSubject,
  305. // deviceList,
  306. // admissionConfiguration,
  307. // associationConfiguration,
  308. // infoPage
  309. },
  310. data(){
  311. return{
  312. pageType:1,
  313. // 遮罩层
  314. loading: true,
  315. // 显示搜索条件
  316. showSearch: true,
  317. // 总条数
  318. total: 0,
  319. // 查询参数
  320. queryParams: {
  321. pageNum: 1,
  322. pageSize:20,
  323. name: null,
  324. floorId: null,
  325. room: null,
  326. deptId: null,
  327. deptName: null,
  328. adminId: null,
  329. isDel: null,
  330. userId: null,
  331. diyOrder: null
  332. },
  333. // 实验室表格数据
  334. subjectList: [],
  335. //学院列表
  336. deptOptions:[],
  337. //当前选中实验室
  338. checkedSubject:{},
  339. //当前选中右侧按钮
  340. rightButtonType:1,
  341. //编辑实验室数据
  342. subjectData:{},
  343. // 临时保存排序
  344. sort:"",
  345. //播放文字的实验室id
  346. subId:"",
  347. open:false,
  348. form:{},
  349. rules:{
  350. txt:[
  351. {required: true, message: '请输入播放文字', trigger: 'blur'},
  352. { required: true, message: "请输入播放文字", validator: this.spaceJudgment, trigger: "blur" }
  353. ],
  354. type:[
  355. {required: true, message: '请选择播报方式', trigger: 'blur'}
  356. ],
  357. },
  358. newData:{
  359. },
  360. //MQTT请求参数-传感器
  361. mtopic:"lab/function/data",
  362. //MQTT请求参数-硬件
  363. mtopicOne:"lab/hardware/data",
  364. msg:"",
  365. client:{},
  366. videoList:[],
  367. //警报数据
  368. totalTwo:0,
  369. tableList:[],
  370. queryParamsTwo:{
  371. pageNum:1,
  372. pageSize:20,
  373. },
  374. hardwareData:[],
  375. //mqtt实验室id
  376. mqttIdList:[],
  377. }
  378. },
  379. created() {
  380. },
  381. mounted(){
  382. this.getDeptList();
  383. // this.subscriptionMQTT();
  384. this.getList();
  385. },
  386. methods:{
  387. goAccessAuthorization(){
  388. this.$router.push({
  389. path: `/comprehensive/laboratoryManagement/accessAuthorization`,
  390. })
  391. },
  392. goAlarmRecord(){
  393. this.$router.push({
  394. path: `/chemicalLibrary/alarmRecord`,
  395. })
  396. },
  397. //报警器开启关闭方法
  398. changeIsNeedCaptchaAlarm(row){
  399. let self = this;
  400. console.log(row.status)
  401. if(row.status!=3 && row.status!=4){
  402. return
  403. }
  404. let text = row.status==3?'关闭':(row.status==4?'开启':'')
  405. this.$confirm(`是否`+text+`此设备`, "提示", {
  406. confirmButtonText: "确定",
  407. cancelButtonText: "取消",
  408. type: "warning"
  409. }).then(async () => {
  410. self.alarmControl(row)
  411. }).catch(() => {
  412. })
  413. },
  414. //开关按钮
  415. alarmControl(row){
  416. let switchData = {
  417. id:row.id,
  418. switchVal:row.status==3?'close':(row.status==4?'open':'')
  419. };
  420. alarmControl(switchData).then(response => {
  421. if(response.code==200){
  422. row.status = row.status==3?4:(row.status==4?3:'')
  423. }
  424. });
  425. },
  426. //获取实验室绑定报警器设备数据
  427. getEnablelist(){
  428. let obj = {
  429. subjectId:this.subId,
  430. type:"AI_ALARM"
  431. }
  432. getEnablelist(obj).then(response => {
  433. this.hardwareData = response.rows;
  434. });
  435. },
  436. //获取实验室报警列表数据
  437. getHxpAlarmRecordNoAuthList(){
  438. this.queryParamsTwo.subId = this.subId;
  439. getHxpAlarmRecordNoAuthList(this.queryParamsTwo).then(response => {
  440. this.totalTwo = response.total;
  441. this.tableList = response.rows;
  442. });
  443. },
  444. //播放文字
  445. handleAdd(id) {
  446. this.open = true;
  447. this.subId = id;
  448. },
  449. // 取消按钮
  450. cancel() {
  451. this.form = {};
  452. this.open = false;
  453. },
  454. /*播放文字*/
  455. submitFormOne(){
  456. this.$refs["form"].validate(valid => {
  457. if (valid) {
  458. let id = this.subId;
  459. mangerVoice(this.form,id).then(response => {
  460. this.msgSuccess("播放成功");
  461. this.open = false;
  462. this.getList();
  463. });
  464. }
  465. });
  466. },
  467. // 页面切换
  468. clickPage(type,row){
  469. if(this.pageType != type){
  470. if(type == 1){
  471. //列表页面
  472. this.pageType = type;
  473. this.getList();
  474. this.$set(this,'subjectData',{})
  475. }else if(type == 2){
  476. //新增页面
  477. this.pageType = type;
  478. }else if(type == 3){
  479. //编辑页面
  480. //this.pageType = 2;
  481. this.editFun(row);
  482. //this.$set(this,'subjectData',row)
  483. }else if(type == 4){
  484. this.pageType = 3;
  485. this.$set(this,'subjectData',row)
  486. }else if(type == 5){
  487. this.pageType = 4;
  488. this.$set(this,'subjectData',row)
  489. }else if(type == 6){
  490. this.pageType = 5;
  491. this.$set(this,'subjectData',row)
  492. }else if(type == 7){
  493. this.subjectInfoTwo(row);
  494. // this.$set(this,'subjectData',row)
  495. }
  496. }
  497. },
  498. //实验室编辑
  499. editFun(row){
  500. let self = this;
  501. let type = 0; //硬件 //0全部
  502. subjectInfo(row.id,type).then(response => {
  503. console.log(response.data)
  504. this.$set(this,'subjectData',response.data)
  505. this.pageType = 2;
  506. })
  507. },
  508. //获取实验室详情
  509. subjectInfoTwo(row){
  510. let self = this;
  511. let type = 0; //硬件 //0全部
  512. subjectInfo(row.id,type).then(response => {
  513. // console.log("获取实验室详情",response.data)
  514. this.$set(this,'newData',response.data);
  515. if(response.data.safeUserName){
  516. this.$set(this.newData,'safeUserName',response.data.safeUserName.split(','));
  517. }
  518. if(response.data.safeUserPhone){
  519. this.$set(this.newData,'safeUserPhone',response.data.safeUserPhone.split(','));
  520. }
  521. if(response.data.safeSigns){
  522. this.$set(this.newData,'safeSigns',response.data.safeSigns.split(','));
  523. }
  524. if(response.data.hazardCategory){
  525. this.$set(this.newData,'hazardCategory',response.data.hazardCategory.split(','));
  526. }
  527. if(response.data.outfire){
  528. this.$set(this.newData,'outfire',response.data.outfire.split(','));
  529. }
  530. if(response.data.riskMeasure){
  531. this.$set(this.newData,'riskMeasure',response.data.riskMeasure.split(','));
  532. }
  533. let list = [];
  534. let listTwo = [];
  535. if (response.data.labHardwareVOList){
  536. for(let i=0;i<response.data.labHardwareVOList.length;i++){
  537. if(response.data.labHardwareVOList[i].hardwareTypeEnum.enumName == 'VIDEO_MONITOR'){
  538. list.push(response.data.labHardwareVOList[i].hardwareNUM);
  539. }
  540. // if(response.data.labHardwareVOList[i].hardwareTypeEnum.enumName == 'SWITCH' || response.data.labHardwareVOList[i].hardwareTypeEnum.enumName == 'AI_VENTILATION' || response.data.labHardwareVOList[i].hardwareTypeEnum.enumName == 'ONE_MACHINE'){
  541. if(response.data.labHardwareVOList[i].hardwareTypeEnum.enumName == 'SWITCH' || response.data.labHardwareVOList[i].hardwareTypeEnum.enumName == 'AI_VENTILATION'){
  542. listTwo.push(response.data.labHardwareVOList[i])
  543. }
  544. }
  545. }
  546. this.$set(this.newData,'labHardwareVOListTwo',listTwo);
  547. this.pageType = 6;
  548. })
  549. },
  550. // 开启关闭验证
  551. async changeIsNeedCaptcha (row) {
  552. let self = this;
  553. console.log(row)
  554. if(row.state.code!=3 && row.state.code!=4){
  555. return
  556. }
  557. let text = row.state.code==3?'关闭':(row.state.code==4?'开启':'')
  558. this.$confirm(`是否`+text+`此设备`, "提示", {
  559. confirmButtonText: "确定",
  560. cancelButtonText: "取消",
  561. type: "warning"
  562. }).then(async () => {
  563. self.switchChange(row)
  564. }).catch(() => {
  565. })
  566. },
  567. //开关按钮
  568. switchChange(row){
  569. let switchData = {
  570. id:row.id,
  571. switchVal:row.state.code==3?'close':(row.state.code==4?'open':'')
  572. };
  573. hardWareControl(switchData).then(response => {
  574. console.log(response);
  575. if(response.code==200){
  576. row.state.code = row.state.code==3?4:(row.state.code==4?3:'')
  577. this.msgSuccess("操作成功")
  578. }
  579. });
  580. },
  581. //切换实验室展示数据
  582. rightButtonClick(type){
  583. let self = this;
  584. if(this.rightButtonType != type){
  585. this.rightButtonType = type;
  586. this.videoOff();
  587. if(type == 3){
  588. let self = this;
  589. let list = [];
  590. if(self.checkedSubject.labHardwareVOList){
  591. for(let i=0;i<self.checkedSubject.labHardwareVOList.length;i++){
  592. if(self.checkedSubject.labHardwareVOList[i].hardwareTypeEnum.enumName == 'VIDEO_MONITOR'){
  593. list.push(self.checkedSubject.labHardwareVOList[i].hardwareNUM);
  594. }
  595. }
  596. if(list[0]){
  597. let obj = {
  598. count:"100",
  599. deviceIds:list+'',
  600. page:"1",
  601. };
  602. let urlText = window.location.href;
  603. if(urlText.indexOf(localStorage.getItem('ipIdentify')) != -1){
  604. startUrl(obj).then(res => {
  605. if(res.code == 200){
  606. if(!res.data[0]){
  607. this.msgError("视频配置异常请联系管理员")
  608. return
  609. }
  610. let videoList = [];
  611. for(let i=0;i<res.data.length;i++){
  612. let obj = {
  613. name:self.checkedSubject.name + self.checkedSubject.subAddrr.room,
  614. videoType:"flv",
  615. divId:'divId'+i,
  616. url:res.data[i].result.body.data.ws_flv,
  617. }
  618. videoList.push(obj)
  619. }
  620. this.$set(this.checkedSubject,'videoData',videoList);
  621. if(this.rightButtonType == 3){
  622. setTimeout(function(){
  623. self.videoFunction();
  624. },1000);
  625. }
  626. }
  627. });
  628. }else{
  629. startUrl(obj).then(res => {
  630. if(res.code == 200){
  631. if(!res.data[0]){
  632. this.msgError("视频配置异常请联系管理员")
  633. return
  634. }
  635. let videoList = [];
  636. for(let i=0;i<res.data.length;i++){
  637. let text = localStorage.getItem('cameraUrl');
  638. let url = res.data[i].result.body.data.ws_flv;
  639. url = url.split("rtp/");
  640. let newUrl = text+'rtp/'+url[1];
  641. let obj = {
  642. name:self.checkedSubject.name + self.checkedSubject.subAddrr.room,
  643. videoType:"flv",
  644. divId:'divId'+i,
  645. url:newUrl,
  646. }
  647. videoList.push(obj)
  648. }
  649. this.$set(this.checkedSubject,'videoData',videoList);
  650. if(this.rightButtonType == 3){
  651. setTimeout(function(){
  652. self.videoFunction();
  653. },1000);
  654. }
  655. }
  656. });
  657. }
  658. }else{
  659. this.$set(this.checkedSubject,'videoData',[]);
  660. }
  661. }else{
  662. this.$set(this.checkedSubject,'videoData',[]);
  663. }
  664. }
  665. }
  666. },
  667. //选中实验室
  668. handleCurrentChange(val){
  669. let self = this;
  670. if(val.id != this.checkedSubject.id){
  671. this.videoOff();
  672. this.offMQTT();
  673. this.subjectInfo(val.id);
  674. this.subId = val.id;
  675. this.$set(this,'queryParamsTwo',{
  676. pageNum:1,
  677. pageSize:20,
  678. });
  679. this.getEnablelist();
  680. this.getHxpAlarmRecordNoAuthList();
  681. this.subscriptionMQTT();
  682. }
  683. },
  684. getDetalis(id){
  685. let obj = {
  686. subjectId:id
  687. }
  688. getDetalis(obj).then(response => {
  689. this.$set(this.checkedSubject,'doorList',response.rows);
  690. console.log('res',response);
  691. })
  692. },
  693. //获取实验室详情
  694. subjectInfo(id){
  695. let type = 1; //硬件 //0全部
  696. subjectInfo(id,type).then(response => {
  697. this.$set(this,'checkedSubject',response.data);
  698. this.$set(this.checkedSubject,'videoData',[]);
  699. this.getDetalis(id);
  700. this.rightButtonType = 1;
  701. })
  702. },
  703. //编辑按钮
  704. handleCommand(command, row){
  705. switch (command) {
  706. case "1":
  707. console.log('关联配置');
  708. this.clickPage(6,row);
  709. break;
  710. case "2":
  711. console.log('物联配置');
  712. subjectInfo(row.id,0).then(response => {
  713. this.clickPage(4,response.data);
  714. });
  715. break;
  716. case "3":
  717. console.log('准入配置');
  718. this.clickPage(5,row);
  719. break;
  720. case "4":
  721. console.log('编辑');
  722. this.clickPage(3,row);
  723. break;
  724. case "5":
  725. console.log('删除');
  726. break;
  727. default:
  728. break;
  729. }
  730. },
  731. //保存当前排序
  732. liveSort(row){
  733. console.log("row",row);
  734. let obj = {
  735. sort:row.diyOrder
  736. }
  737. this.sort = JSON.parse(JSON.stringify(obj));
  738. },
  739. //编辑排序
  740. editSort(row){
  741. let self = this;
  742. if(row.diyOrder != this.sort.sort){
  743. self.$confirm('是否确认修改排序?', "", {
  744. confirmButtonText: "确定",
  745. cancelButtonText: "取消",
  746. type: "warning"
  747. }).then(function() {
  748. let obj = {
  749. id:row.id,
  750. diyOrder:row.diyOrder,
  751. };
  752. updateSubject(obj).then(response => {
  753. self.msgSuccess("修改成功");
  754. self.getList();
  755. });
  756. }).then(() => {}).catch(() => {
  757. let obj = JSON.parse(JSON.stringify(self.sort));
  758. row.diyOrder = obj.sort
  759. });
  760. }
  761. },
  762. /** 搜索按钮操作 */
  763. handleQuery() {
  764. this.queryParams.pageNum = 1;
  765. this.getList();
  766. },
  767. /** 重置按钮操作 */
  768. resetQuery() {
  769. this.$set(this,'queryParams',{
  770. pageNum: 1,
  771. pageSize:20,
  772. deptId:"",
  773. name: '',
  774. });
  775. // this.resetForm("queryForm");
  776. this.handleQuery();
  777. },
  778. /** 查询实验室列表 */
  779. getList() {
  780. this.loading = true;
  781. // this.offMQTT();
  782. authListSubject(this.queryParams).then(response => {
  783. this.subjectList = response.rows;
  784. this.total = response.total;
  785. this.loading = false;
  786. if(response.rows[0]){
  787. this.$refs.multipleTable.setCurrentRow(response.rows[0]);
  788. this.subjectInfo(response.rows[0].id);
  789. }
  790. let idList = [];
  791. for(let i=0;i<response.rows.length;i++){
  792. idList.push(response.rows[i].id)
  793. }
  794. this.$set(this,'mqttIdList',idList);
  795. // this.subscriptionMQTT();
  796. });
  797. },
  798. /** 查询学院列表 */
  799. getDeptList() {
  800. listDepartments().then(response => {
  801. this.$set(this, 'deptOptions', response.data)
  802. });
  803. },
  804. //MQTT订阅
  805. subscriptionMQTT(){
  806. let self = this;
  807. this.client = mqtt.connect(localStorage.getItem('mqttUrl'), {
  808. username: localStorage.getItem('mqttUser'),
  809. password: localStorage.getItem('mqttPassword')
  810. });
  811. this.client.on("connect", e =>{
  812. // console.log("连接成功");
  813. this.client.subscribe(this.mtopic+self.subId, (err) => {
  814. if (!err) {
  815. // console.log("订阅成功:" + this.mtopic+self.subId);
  816. }
  817. });
  818. this.client.subscribe(this.mtopicOne+self.subId, (err) => {
  819. if (!err) {
  820. // console.log("订阅成功:" + this.mtopicOne+self.subId);
  821. }
  822. });
  823. });
  824. this.client.on("message", (topic, message) => {
  825. // console.log('message',message)
  826. if (message){
  827. let data = JSON.parse(message)
  828. // console.log("MQTT----message",data)
  829. if(data.data.subId){
  830. //传感器
  831. // console.log("传感器",data.data.subId,'---------',data);
  832. if(self.checkedSubject.id){
  833. if(data.data.subId&&data.data.subId == self.checkedSubject.id){
  834. self.$set(self.checkedSubject,'sensorFunctionStatusList',data.data.functionStatuses);
  835. self.$set(self.checkedSubject.sensorFunctionStatusList[0],'sendDate',data.sendDate);
  836. }
  837. }
  838. if(self.newData.id){
  839. if(data.data.subId&&data.data.subId == self.newData.id){
  840. self.$set(self.newData,'sensorFunctionStatusList',data.data.functionStatuses);
  841. self.$set(self.newData.sensorFunctionStatusList[0],'sendDate',data.sendDate);
  842. }
  843. }
  844. }else{
  845. //硬件
  846. // console.log("硬件",data);
  847. for (let i = 0; i < data.data.length; i++) {
  848. if (self.checkedSubject.labHardwareVOList) {
  849. for (let k = 0; k < self.checkedSubject.labHardwareVOList.length; k++) {
  850. if (self.checkedSubject.labHardwareVOList[k].id == data.data[i].num) {
  851. if (data.data[i].hardwareOperate == 'CLOSE') {
  852. self.checkedSubject.labHardwareVOList[k].state.code = 4;
  853. } else if (data.data[i].hardwareOperate == 'OPEN') {
  854. self.checkedSubject.labHardwareVOList[k].state.code = 3;
  855. } else if (data.data[i].hardwareOperate == 'OFFLINE') {
  856. self.checkedSubject.labHardwareVOList[k].state.code = 0;
  857. }
  858. }
  859. }
  860. }
  861. if(self.newData.labHardwareVOList){
  862. for(let k=0;k<self.newData.labHardwareVOList.length;k++){
  863. if(self.newData.labHardwareVOList[k].id == data.data[i].num){
  864. if(data.data[i].hardwareOperate == 'CLOSE'){
  865. self.newData.labHardwareVOList[k].state.code = 4;
  866. }else if(data.data[i].hardwareOperate == 'OPEN'){
  867. self.newData.labHardwareVOList[k].state.code = 3;
  868. }else if(data.data[i].hardwareOperate == 'OFFLINE'){
  869. self.newData.labHardwareVOList[k].state.code = 0;
  870. }
  871. }
  872. }
  873. }
  874. }
  875. }
  876. }
  877. });
  878. },
  879. //取消订阅关闭MQTT连接
  880. offMQTT(){
  881. let self = this;
  882. if (self.mqttIdList[0]){
  883. // for(let i=0;i<self.mqttIdList.length;i++){
  884. // self.client.unsubscribe(self.mtopic+self.mqttIdList[i], error => {
  885. // if (error) {
  886. // console.log('Unsubscribe error', error)
  887. // }
  888. // })
  889. // self.client.unsubscribe(self.mtopicOne+self.mqttIdList[i], error => {
  890. // if (error) {
  891. // console.log('Unsubscribe error', error)
  892. // }
  893. // })
  894. // }
  895. self.client.unsubscribe(self.mtopic+self.subId, error => {
  896. if (error) {
  897. console.log('Unsubscribe error', error)
  898. }
  899. })
  900. self.client.unsubscribe(self.mtopicOne+self.subId, error => {
  901. if (error) {
  902. console.log('Unsubscribe error', error)
  903. }
  904. })
  905. self.client.end();
  906. self.client = {};
  907. }
  908. },
  909. //视频方法
  910. videoFunction(){
  911. let self = this;
  912. // self.videoList = [];
  913. for(let i=0;i<self.checkedSubject.videoData.length;i++){
  914. let obj = {
  915. player :{},
  916. flvPlayer:{}
  917. };
  918. obj.player = document.getElementById(self.checkedSubject.videoData[i].divId);
  919. // if (flvjs.isSupported()) {
  920. obj.flvPlayer = flvjs.createPlayer(
  921. {
  922. // isLive: true, //=> 是否为直播流
  923. // hasAudio: false, //=> 是否开启声音
  924. type: self.checkedSubject.videoData[i].videoType, //媒体类型 flv 或 mp4
  925. url: self.checkedSubject.videoData[i].url //视频流地址
  926. },
  927. {
  928. enableStashBuffer: true,//启用 IO 存储缓冲区。 如果您需要实时流播放(最小延迟),请设置为 false,但如果存在网络抖动,则可能会停止。
  929. stashInitialSize: 128,//IO 存储缓冲区初始大小。 默认值为 384KB。 指示合适的大小可以改善视频加载/搜索时间。
  930. isLive: true,//是否是直播
  931. lazyLoadRecoverDuration: 30,//指示以秒为单位的lazyLoad 恢复时间边界。
  932. autoCleanupSourceBuffer: true,//进行自动清理
  933. autoCleanupMaxBackwardDuration: 3 * 60,//3 * 60 当向后缓冲持续时间超过这个值(以秒为单位)时,对 SourceBuffer 进行自动清理
  934. autoCleanupMinBackwardDuration: 2 * 60,//2 * 60 指示在执行自动清理时为后向缓冲区保留的持续时间(以秒为单位)。
  935. }
  936. );
  937. self.videoList.push(obj);
  938. // }
  939. console.log("i",i)
  940. }
  941. for(let i=0;i<self.videoList.length;i++){
  942. self.videoList[i].flvPlayer.attachMediaElement(self.videoList[i].player);
  943. self.videoList[i].flvPlayer.load(); //加载
  944. self.videoList[i].flvPlayer.play(); //加载
  945. }
  946. },
  947. //视屏全屏方法
  948. videoFullScreen(index){
  949. this.$refs.videoRef[index].webkitRequestFullScreen();
  950. },
  951. //断开视频流
  952. videoOff(){
  953. let self = this;
  954. if(self.videoList[0]){
  955. for(let i=0;i<self.videoList.length;i++){
  956. self.videoList[i].flvPlayer.pause();
  957. self.videoList[i].flvPlayer.unload();
  958. self.videoList[i].flvPlayer.detachMediaElement();
  959. self.videoList[i].flvPlayer.destroy();
  960. self.videoList[i].flvPlayer = null;
  961. }
  962. self.videoList = [];
  963. }
  964. },
  965. },
  966. beforeDestroy() {
  967. //清除定时器
  968. let self = this;
  969. self.videoOff();
  970. self.offMQTT();
  971. console.log("beforeDestroy");
  972. },
  973. }
  974. </script>
  975. <style scoped lang="scss">
  976. .subject{
  977. flex:1;
  978. display: flex!important;
  979. flex-direction: column;
  980. overflow: hidden;
  981. *{
  982. margin:0;
  983. }
  984. ::v-deep .el-table__row{
  985. td:nth-child(1){
  986. padding:0;
  987. }
  988. }
  989. .subject-page{
  990. flex:1;
  991. display: flex;
  992. flex-direction: column;
  993. padding:20px;
  994. overflow: hidden;
  995. border-radius:10px;
  996. margin:5px 20px 20px 10px;
  997. box-shadow: 0 0 8px 1px rgba(0, 0, 0, 0.1);
  998. .subject-page-min{
  999. flex:1;
  1000. display: flex;
  1001. overflow: hidden;
  1002. }
  1003. .left-subject-list{
  1004. flex:1;
  1005. display: flex;
  1006. flex-direction: column;
  1007. margin-right:20px;
  1008. overflow: hidden ;
  1009. }
  1010. .overflow-box{
  1011. overflow: hidden;
  1012. }
  1013. .right-subject-box{
  1014. width:514px;
  1015. display: flex;
  1016. flex-direction: column;
  1017. .top-button-box{
  1018. display: flex;
  1019. div{
  1020. padding:0 10px;
  1021. height:40px;
  1022. line-height:40px;
  1023. font-size:16px;
  1024. text-align: center;
  1025. border-top-right-radius: 10px;
  1026. border-top-left-radius: 10px;
  1027. margin-right:1px;
  1028. cursor: pointer;
  1029. font-weight: 500;
  1030. }
  1031. .buttonColorA{
  1032. color:#FFFFFF;
  1033. background:#0045AF ;
  1034. }
  1035. .buttonColorB{
  1036. color:#999999;
  1037. background:#E0E0E0 ;
  1038. }
  1039. }
  1040. .bottom-max-box{
  1041. font-weight:500;
  1042. flex:1;
  1043. display: flex;
  1044. flex-direction: column;
  1045. .bottom-sensor-box{
  1046. background: #fff;
  1047. width:510px;
  1048. border: 1px solid #E0E0E0;
  1049. border-radius: 0 10px 10px 10px;
  1050. .top-title{
  1051. line-height:18px;
  1052. font-size:16px;
  1053. margin:23px 10px;
  1054. }
  1055. .null-text-p{
  1056. text-align: center;
  1057. font-size:16px;
  1058. color:#999;
  1059. line-height:50px;
  1060. margin:0 30px;
  1061. }
  1062. .sensor-for-max-box{
  1063. .sensor-for-big-box{
  1064. display: inline-block;
  1065. width:158px;
  1066. height:60px;
  1067. margin:0 0 11px 8px;
  1068. border-radius: 10px;
  1069. .sensor-for-min-box{
  1070. display: flex;
  1071. img{
  1072. width:26px;
  1073. height:26px;
  1074. margin:17px 11px;
  1075. }
  1076. div{
  1077. margin:9px 0;
  1078. p{
  1079. color:#fff;
  1080. }
  1081. p:nth-child(1){
  1082. font-size:14px;
  1083. line-height:20px;
  1084. }
  1085. p:nth-child(2){
  1086. font-size:16px;
  1087. line-height:22px;
  1088. }
  1089. }
  1090. }
  1091. }
  1092. .sensor-color-a{
  1093. background: #FF7272;
  1094. color:#fff;
  1095. }
  1096. .sensor-color-b{
  1097. background: #E0E0E0;
  1098. color:#999999;
  1099. }
  1100. .sensor-color-c{
  1101. background: #80D164;
  1102. color:#fff;
  1103. }
  1104. }
  1105. .bottom-text{
  1106. line-height:18px;
  1107. font-size:14px;
  1108. color:#999999;
  1109. margin:40px 10px 15px;
  1110. }
  1111. }
  1112. .bottom-switch-box{
  1113. background: #fff;
  1114. width:510px;
  1115. border: 1px solid #E0E0E0;
  1116. border-radius: 0 10px 10px 10px;
  1117. .top-title{
  1118. line-height:18px;
  1119. font-size:16px;
  1120. margin:23px 10px;
  1121. }
  1122. .null-text-p{
  1123. text-align: center;
  1124. font-size:16px;
  1125. color:#999;
  1126. line-height:50px;
  1127. margin:0 30px;
  1128. }
  1129. .switch-for-max-box{
  1130. .switch-for-big-box{
  1131. display: inline-block;
  1132. .switch-for-min-box{
  1133. width:210px;
  1134. height:60px;
  1135. border:1px solid #E0E0E0;
  1136. border-radius: 10px;
  1137. margin:0 0 20px 30px;
  1138. display: flex;
  1139. .switch-for-min-title{
  1140. font-size:16px;
  1141. line-height:58px;
  1142. width:113px;
  1143. margin-left:12px;
  1144. display:block;
  1145. overflow:hidden;
  1146. text-overflow:ellipsis;
  1147. white-space:nowrap;
  1148. }
  1149. .switch{
  1150. margin-top:14px;
  1151. }
  1152. .switch-null-p{
  1153. font-size:16px;
  1154. line-height:58px;
  1155. color:#999;
  1156. }
  1157. .switch-for-min-button{
  1158. width:70px;
  1159. height:30px;
  1160. line-height:30px;
  1161. font-size:14px;
  1162. color:#0045AF;
  1163. border-radius:6px;
  1164. border: 1px solid #0045AF;
  1165. margin-top:14px;
  1166. text-align: center;
  1167. cursor: pointer;
  1168. }
  1169. }
  1170. }
  1171. }
  1172. }
  1173. .bottom-video-box{
  1174. background: #fff;
  1175. width:510px;
  1176. border: 1px solid #E0E0E0;
  1177. border-radius: 0 10px 10px 10px;
  1178. .top-title{
  1179. line-height:18px;
  1180. font-size:16px;
  1181. margin:23px 10px;
  1182. }
  1183. .null-text-p{
  1184. text-align: center;
  1185. font-size:16px;
  1186. color:#999;
  1187. line-height:50px;
  1188. margin:0 30px;
  1189. }
  1190. .video-for-max-box{
  1191. .switch-for-big-box{
  1192. width:490px;
  1193. height:262px;
  1194. margin:0 auto 14px;
  1195. position: relative;
  1196. .position-p{
  1197. width:42px;
  1198. height:42px;
  1199. text-align: center;
  1200. line-height:42px;
  1201. font-size:18px;
  1202. position: absolute;
  1203. top:0;
  1204. right:0;
  1205. color:#fff;
  1206. cursor: pointer;
  1207. }
  1208. }
  1209. }
  1210. }
  1211. .bottom-alarm-box{
  1212. flex:1;
  1213. display: flex;
  1214. flex-direction: column;
  1215. background: #fff;
  1216. width:510px;
  1217. overflow-x: hidden;
  1218. .alarm-max-box{
  1219. width:510px;
  1220. height:150px;
  1221. display: flex;
  1222. position:relative;
  1223. border: 1px solid #E0E0E0;
  1224. border-radius: 0 10px 10px 10px;
  1225. .alarm-img{
  1226. width:110px;
  1227. height:110px;
  1228. margin:20px;
  1229. }
  1230. .alarm-big-box{
  1231. p:nth-child(1){
  1232. font-size:14px;
  1233. margin:40px 0 25px 0;
  1234. }
  1235. p:nth-child(2){
  1236. width: 60px;
  1237. font-size:12px;
  1238. line-height:24px;
  1239. border-radius: 12px;
  1240. text-align: center;
  1241. }
  1242. .colorTypeA{
  1243. background: rgba(1,131,250,0.2);
  1244. color:#0183FA;
  1245. }
  1246. .colorTypeB{
  1247. background: #ECECEC;
  1248. color:#A2A2A2;
  1249. }
  1250. }
  1251. .alarm-position-box{
  1252. position:absolute;
  1253. bottom:20px;
  1254. right:15px;
  1255. width: 75px;
  1256. height: 30px;
  1257. }
  1258. }
  1259. .alarm-title-box{
  1260. display: flex;
  1261. p{
  1262. line-height:60px;
  1263. font-size:14px;
  1264. }
  1265. p:nth-child(1){
  1266. flex:1;
  1267. }
  1268. p:nth-child(2){
  1269. cursor: pointer;
  1270. }
  1271. }
  1272. }
  1273. .bottom-door-box{
  1274. background: #fff;
  1275. overflow: hidden;
  1276. width:510px;
  1277. overflow-x: hidden;
  1278. border: 1px solid #E0E0E0;
  1279. border-radius: 0 10px 10px 10px;
  1280. position: relative;
  1281. .for-door-box{
  1282. display: flex;
  1283. img{
  1284. width:110px;
  1285. height:110px;
  1286. margin:20px;
  1287. }
  1288. div{
  1289. flex:1;
  1290. p:nth-child(1){
  1291. margin-top:40px;
  1292. color:#3D3D3D;
  1293. font-size:14px;
  1294. line-height:24px;
  1295. }
  1296. p:nth-child(2){
  1297. width:60px;
  1298. line-height:24px;
  1299. border-radius:50px;
  1300. margin-top:20px;
  1301. font-size:12px;
  1302. text-align: center;
  1303. }
  1304. .colorTypeA{
  1305. background: rgba(1,131,250,0.2);
  1306. color:#0183FA;
  1307. }
  1308. .colorTypeB{
  1309. background: #ECECEC;
  1310. color:#A2A2A2;
  1311. }
  1312. }
  1313. }
  1314. .bottom-button-go-route{
  1315. position: absolute;
  1316. line-height:24px;
  1317. font-size:14px;
  1318. color:#0183FA;
  1319. bottom:10px;
  1320. right:15px;
  1321. cursor: pointer;
  1322. }
  1323. }
  1324. .null-data-img{
  1325. width:137px;
  1326. height:137px;
  1327. display: block;
  1328. margin:10px auto;
  1329. }
  1330. }
  1331. }
  1332. }
  1333. }
  1334. </style>
  1335. <style lang="scss">
  1336. .alarm-position-box{
  1337. .switch .el-switch__label {
  1338. position: absolute;
  1339. display: none;
  1340. color: #fff !important;
  1341. }
  1342. .switch .el-switch__label--right {
  1343. z-index: 1;
  1344. }
  1345. .switch .el-switch__label--right span{
  1346. margin-right: 9px;
  1347. }
  1348. .switch .el-switch__label--left {
  1349. z-index: 1;
  1350. }
  1351. .switch .el-switch__label--left span{
  1352. margin-left: 9px;
  1353. }
  1354. .switch .el-switch__label.is-active {
  1355. display: block;
  1356. }
  1357. .switch.el-switch .el-switch__core,
  1358. .el-switch .el-switch__label {
  1359. width: 80px !important;
  1360. height:30px!important;
  1361. line-height:30px!important;
  1362. -webkit-border-radius: 20px!important;
  1363. -moz-border-radius: 20px!important;
  1364. border-radius: 20px!important;
  1365. margin: 0;
  1366. position: absolute;
  1367. top: 0;
  1368. }
  1369. .switch .el-switch__label--left span{
  1370. margin-left:30px!important;
  1371. }
  1372. .switch .el-switch__label--right span{
  1373. margin-left:8px!important;
  1374. }
  1375. .el-switch__core:after{
  1376. height:24px!important;
  1377. width:24px!important;
  1378. top:2px!important;
  1379. }
  1380. .el-switch.is-checked .el-switch__core::after{
  1381. margin-left: -25px!important;
  1382. }
  1383. .el-switch{
  1384. margin:10px auto 0;
  1385. display: block;
  1386. width:80px!important;
  1387. height:4px!important;
  1388. }
  1389. }
  1390. </style>