index.vue 49 KB

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