index.vue 52 KB

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