indexTwo.vue 50 KB

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