index.vue 52 KB

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