index.vue 52 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343
  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>{{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. let obj = {
  519. count:"100",
  520. deviceIds:list.join(),
  521. page:"1",
  522. };
  523. let urlText = window.location.href;
  524. if(urlText.indexOf("192.168") != -1){
  525. startUrl(obj).then(res => {
  526. if(res.code == 200){
  527. if(!res.data[0]){
  528. this.msgError("视频配置异常请联系管理员")
  529. this.newData.videoData = [];
  530. this.pageType = 6;
  531. }else{
  532. let videoList = [];
  533. for(let i=0;i<res.data.length;i++){
  534. let obj = {
  535. name:response.data.name + response.data.subAddrr.room,
  536. videoType:"flv",
  537. divId:'divId'+i,
  538. url:res.data[i].result.body.data.ws_flv,
  539. }
  540. videoList.push(obj)
  541. }
  542. this.$set(this.newData,'videoData',videoList);
  543. this.pageType = 6;
  544. }
  545. }
  546. });
  547. }else{
  548. startUrlJiNanDaXue(obj).then(res => {
  549. if(res.code == 200){
  550. if(!res.data[0]){
  551. this.msgError("视频配置异常请联系管理员")
  552. this.newData.videoData = [];
  553. this.pageType = 6;
  554. }else{
  555. let videoList = [];
  556. for(let i=0;i<res.data.length;i++){
  557. let text = 'ws://lab.sxitdlc.com/jinandaxue/stream/';
  558. let url = res.data[i].result.body.data.ws_flv;
  559. url = url.split("rtp/");
  560. let newUrl = text+'rtp/'+url[1];
  561. let obj = {
  562. name:response.data.name + response.data.subAddrr.room,
  563. videoType:"flv",
  564. divId:'divId'+i,
  565. url:newUrl,
  566. }
  567. videoList.push(obj)
  568. }
  569. this.$set(this.newData,'videoData',videoList);
  570. this.pageType = 6;
  571. }
  572. }
  573. });
  574. }
  575. })
  576. },
  577. // 开启关闭验证
  578. async changeIsNeedCaptcha (row) {
  579. let self = this;
  580. console.log(row)
  581. if(row.state.code!=3 && row.state.code!=4){
  582. return
  583. }
  584. let text = row.state.code==3?'关闭':(row.state.code==4?'开启':'')
  585. this.$confirm(`是否`+text+`此设备`, "提示", {
  586. confirmButtonText: "确定",
  587. cancelButtonText: "取消",
  588. type: "warning"
  589. }).then(async () => {
  590. self.switchChange(row)
  591. }).catch(() => {
  592. })
  593. },
  594. //开关按钮
  595. switchChange(row){
  596. let switchData = {
  597. id:row.id,
  598. switchVal:row.state.code==3?'close':(row.state.code==4?'open':'')
  599. };
  600. hardWareControl(switchData).then(response => {
  601. console.log(response);
  602. if(response.code==200){
  603. row.state.code = row.state.code==3?4:(row.state.code==4?3:'')
  604. this.msgSuccess("操作成功")
  605. }
  606. });
  607. },
  608. //切换实验室展示数据
  609. rightButtonClick(type){
  610. let self = this;
  611. if(this.rightButtonType != type){
  612. this.rightButtonType = type;
  613. this.videoOff();
  614. if(type == 3){
  615. let self = this;
  616. let list = [];
  617. if(self.checkedSubject.labHardwareVOList){
  618. for(let i=0;i<self.checkedSubject.labHardwareVOList.length;i++){
  619. if(self.checkedSubject.labHardwareVOList[i].hardwareTypeEnum.enumName == 'VIDEO_MONITOR'){
  620. list.push(self.checkedSubject.labHardwareVOList[i].hardwareNUM);
  621. }
  622. }
  623. if(list[0]){
  624. let obj = {
  625. count:"100",
  626. deviceIds:list+'',
  627. page:"1",
  628. };
  629. let urlText = window.location.href;
  630. if(urlText.indexOf("192.168") != -1){
  631. startUrl(obj).then(res => {
  632. if(res.code == 200){
  633. if(!res.data[0]){
  634. this.msgError("视频配置异常请联系管理员")
  635. return
  636. }
  637. let videoList = [];
  638. for(let i=0;i<res.data.length;i++){
  639. let obj = {
  640. name:self.checkedSubject.name + self.checkedSubject.subAddrr.room,
  641. videoType:"flv",
  642. divId:'divId'+i,
  643. url:res.data[i].result.body.data.ws_flv,
  644. }
  645. videoList.push(obj)
  646. }
  647. this.$set(this.checkedSubject,'videoData',videoList);
  648. if(this.rightButtonType == 3){
  649. setTimeout(function(){
  650. self.videoFunction();
  651. },1000);
  652. }
  653. }
  654. });
  655. }else{
  656. startUrlJiNanDaXue(obj).then(res => {
  657. if(res.code == 200){
  658. if(!res.data[0]){
  659. this.msgError("视频配置异常请联系管理员")
  660. return
  661. }
  662. let videoList = [];
  663. for(let i=0;i<res.data.length;i++){
  664. let text = 'ws://lab.sxitdlc.com/jinandaxue/stream/';
  665. let url = res.data[i].result.body.data.ws_flv;
  666. url = url.split("rtp/");
  667. let newUrl = text+'rtp/'+url[1];
  668. let obj = {
  669. name:self.checkedSubject.name + self.checkedSubject.subAddrr.room,
  670. videoType:"flv",
  671. divId:'divId'+i,
  672. url:newUrl,
  673. }
  674. videoList.push(obj)
  675. }
  676. this.$set(this.checkedSubject,'videoData',videoList);
  677. if(this.rightButtonType == 3){
  678. setTimeout(function(){
  679. self.videoFunction();
  680. },1000);
  681. }
  682. }
  683. });
  684. }
  685. }else{
  686. this.$set(this.checkedSubject,'videoData',[]);
  687. }
  688. }else{
  689. this.$set(this.checkedSubject,'videoData',[]);
  690. }
  691. }
  692. }
  693. },
  694. //选中实验室
  695. handleCurrentChange(val){
  696. let self = this;
  697. if(val.id != this.checkedSubject.id){
  698. this.videoOff();
  699. this.subjectInfo(val.id);
  700. this.subId = val.id;
  701. this.$set(this,'queryParamsTwo',{
  702. pageNum:1,
  703. pageSize:20,
  704. });
  705. this.getEnablelist();
  706. this.getHxpAlarmRecordNoAuthList();
  707. }
  708. },
  709. //获取实验室详情
  710. subjectInfo(id){
  711. let type = 1; //硬件 //0全部
  712. subjectInfo(id,type).then(response => {
  713. this.$set(this,'checkedSubject',response.data);
  714. this.$set(this.checkedSubject,'videoData',[]);
  715. this.rightButtonType = 1;
  716. })
  717. },
  718. //编辑按钮
  719. handleCommand(command, row){
  720. switch (command) {
  721. case "1":
  722. console.log('关联配置');
  723. this.clickPage(6,row);
  724. break;
  725. case "2":
  726. console.log('物联配置');
  727. this.clickPage(4,row);
  728. break;
  729. case "3":
  730. console.log('准入配置');
  731. this.clickPage(5,row);
  732. break;
  733. case "4":
  734. console.log('编辑');
  735. this.clickPage(3,row);
  736. break;
  737. case "5":
  738. console.log('删除');
  739. break;
  740. default:
  741. break;
  742. }
  743. },
  744. //保存当前排序
  745. liveSort(row){
  746. console.log("row",row);
  747. let obj = {
  748. sort:row.diyOrder
  749. }
  750. this.sort = JSON.parse(JSON.stringify(obj));
  751. },
  752. //编辑排序
  753. editSort(row){
  754. let self = this;
  755. if(row.diyOrder != this.sort.sort){
  756. self.$confirm('是否确认修改排序?', "", {
  757. confirmButtonText: "确定",
  758. cancelButtonText: "取消",
  759. type: "warning"
  760. }).then(function() {
  761. let obj = {
  762. id:row.id,
  763. diyOrder:row.diyOrder,
  764. };
  765. updateSubject(obj).then(response => {
  766. self.msgSuccess("修改成功");
  767. self.getList();
  768. });
  769. }).then(() => {}).catch(() => {
  770. let obj = JSON.parse(JSON.stringify(self.sort));
  771. row.diyOrder = obj.sort
  772. });
  773. }
  774. },
  775. /** 搜索按钮操作 */
  776. handleQuery() {
  777. this.queryParams.pageNum = 1;
  778. this.getList();
  779. },
  780. /** 重置按钮操作 */
  781. resetQuery() {
  782. this.$set(this,'queryParams',{
  783. pageNum: 1,
  784. pageSize:20,
  785. deptId:"",
  786. name: '',
  787. });
  788. // this.resetForm("queryForm");
  789. this.handleQuery();
  790. },
  791. /** 查询实验室列表 */
  792. getList() {
  793. this.loading = true;
  794. this.offMQTT();
  795. authListSubject(this.queryParams).then(response => {
  796. this.subjectList = response.rows;
  797. this.total = response.total;
  798. this.loading = false;
  799. if(response.rows[0]){
  800. this.$refs.multipleTable.setCurrentRow(response.rows[0]);
  801. this.subjectInfo(response.rows[0].id);
  802. }
  803. let idList = [];
  804. for(let i=0;i<response.rows.length;i++){
  805. idList.push(response.rows[i].id)
  806. }
  807. this.$set(this,'mqttIdList',idList);
  808. this.subscriptionMQTT();
  809. });
  810. },
  811. /** 查询学院列表 */
  812. getDeptList() {
  813. listDepartments().then(response => {
  814. this.$set(this, 'deptOptions', response.data)
  815. });
  816. },
  817. //MQTT订阅
  818. subscriptionMQTT(){
  819. let self = this;
  820. this.client = mqtt.connect(process.env.VUE_APP_BASE_MQTT_API, {
  821. username: process.env.VUE_APP_BASE_MQTT_USERNAME,
  822. password: process.env.VUE_APP_BASE_MQTT_PASSWORD
  823. });
  824. this.client.on("connect", e =>{
  825. console.log("连接成功");
  826. for(let i = 0; i< self.mqttIdList.length;i++){
  827. this.client.subscribe(this.mtopic+self.mqttIdList[i], (err) => {
  828. if (!err) {
  829. console.log("订阅成功:" + this.mtopic+self.mqttIdList[i]);
  830. }
  831. });
  832. this.client.subscribe(this.mtopicOne+self.mqttIdList[i], (err) => {
  833. if (!err) {
  834. console.log("订阅成功:" + this.mtopicOne+self.mqttIdList[i]);
  835. }
  836. });
  837. }
  838. });
  839. this.client.on("message", (topic, message) => {
  840. console.log('message',message)
  841. if (message){
  842. let data = JSON.parse(message)
  843. // console.log("MQTT----message",data)
  844. if(data.data.subId){
  845. //传感器
  846. // console.log("传感器",data.data.subId,'---------',data);
  847. if(self.checkedSubject.id){
  848. if(data.data.subId&&data.data.subId == self.checkedSubject.id){
  849. self.$set(self.checkedSubject,'sensorFunctionStatusList',data.data.functionStatuses);
  850. self.$set(self.checkedSubject.sensorFunctionStatusList[0],'sendDate',data.sendDate);
  851. }
  852. }
  853. if(self.newData.id){
  854. if(data.data.subId&&data.data.subId == self.newData.id){
  855. self.$set(self.newData,'sensorFunctionStatusList',data.data.functionStatuses);
  856. self.$set(self.newData.sensorFunctionStatusList[0],'sendDate',data.sendDate);
  857. }
  858. }
  859. }else{
  860. //硬件
  861. // console.log("硬件",data);
  862. for (let i = 0; i < data.data.length; i++) {
  863. if (self.checkedSubject.labHardwareVOList) {
  864. for (let k = 0; k < self.checkedSubject.labHardwareVOList.length; k++) {
  865. if (self.checkedSubject.labHardwareVOList[k].id == data.data[i].num) {
  866. if (data.data[i].hardwareOperate == 'CLOSE') {
  867. self.checkedSubject.labHardwareVOList[k].state.code = 4;
  868. } else if (data.data[i].hardwareOperate == 'OPEN') {
  869. self.checkedSubject.labHardwareVOList[k].state.code = 3;
  870. } else if (data.data[i].hardwareOperate == 'OFFLINE') {
  871. self.checkedSubject.labHardwareVOList[k].state.code = 0;
  872. }
  873. }
  874. }
  875. }
  876. if(self.newData.labHardwareVOList){
  877. for(let k=0;k<self.newData.labHardwareVOList.length;k++){
  878. if(self.newData.labHardwareVOList[k].id == data.data[i].num){
  879. if(data.data[i].hardwareOperate == 'CLOSE'){
  880. self.newData.labHardwareVOList[k].state.code = 4;
  881. }else if(data.data[i].hardwareOperate == 'OPEN'){
  882. self.newData.labHardwareVOList[k].state.code = 3;
  883. }else if(data.data[i].hardwareOperate == 'OFFLINE'){
  884. self.newData.labHardwareVOList[k].state.code = 0;
  885. }
  886. }
  887. }
  888. }
  889. }
  890. }
  891. }
  892. });
  893. },
  894. //取消订阅关闭MQTT连接
  895. offMQTT(){
  896. let self = this;
  897. if (self.mqttIdList[0]){
  898. for(let i=0;i<self.mqttIdList.length;i++){
  899. self.client.unsubscribe(self.mtopic+self.mqttIdList[i], error => {
  900. if (error) {
  901. console.log('Unsubscribe error', error)
  902. }
  903. })
  904. self.client.unsubscribe(self.mtopicOne+self.mqttIdList[i], error => {
  905. if (error) {
  906. console.log('Unsubscribe error', error)
  907. }
  908. })
  909. }
  910. self.client.end();
  911. self.client = {};
  912. }
  913. },
  914. //视频方法
  915. videoFunction(){
  916. let self = this;
  917. // self.videoList = [];
  918. for(let i=0;i<self.checkedSubject.videoData.length;i++){
  919. let obj = {
  920. player :{},
  921. flvPlayer:{}
  922. };
  923. obj.player = document.getElementById(self.checkedSubject.videoData[i].divId);
  924. // if (flvjs.isSupported()) {
  925. obj.flvPlayer = flvjs.createPlayer(
  926. {
  927. // isLive: true, //=> 是否为直播流
  928. // hasAudio: false, //=> 是否开启声音
  929. type: self.checkedSubject.videoData[i].videoType, //媒体类型 flv 或 mp4
  930. url: self.checkedSubject.videoData[i].url //视频流地址
  931. },
  932. {
  933. enableStashBuffer: true,//启用 IO 存储缓冲区。 如果您需要实时流播放(最小延迟),请设置为 false,但如果存在网络抖动,则可能会停止。
  934. stashInitialSize: 128,//IO 存储缓冲区初始大小。 默认值为 384KB。 指示合适的大小可以改善视频加载/搜索时间。
  935. isLive: true,//是否是直播
  936. lazyLoadRecoverDuration: 30,//指示以秒为单位的lazyLoad 恢复时间边界。
  937. autoCleanupSourceBuffer: true,//进行自动清理
  938. autoCleanupMaxBackwardDuration: 3 * 60,//3 * 60 当向后缓冲持续时间超过这个值(以秒为单位)时,对 SourceBuffer 进行自动清理
  939. autoCleanupMinBackwardDuration: 2 * 60,//2 * 60 指示在执行自动清理时为后向缓冲区保留的持续时间(以秒为单位)。
  940. }
  941. );
  942. self.videoList.push(obj);
  943. // }
  944. console.log("i",i)
  945. }
  946. for(let i=0;i<self.videoList.length;i++){
  947. self.videoList[i].flvPlayer.attachMediaElement(self.videoList[i].player);
  948. self.videoList[i].flvPlayer.load(); //加载
  949. self.videoList[i].flvPlayer.play(); //加载
  950. }
  951. },
  952. //视屏全屏方法
  953. videoFullScreen(index){
  954. this.$refs.videoRef[index].webkitRequestFullScreen();
  955. },
  956. //断开视频流
  957. videoOff(){
  958. let self = this;
  959. if(self.videoList[0]){
  960. for(let i=0;i<self.videoList.length;i++){
  961. self.videoList[i].flvPlayer.pause();
  962. self.videoList[i].flvPlayer.unload();
  963. self.videoList[i].flvPlayer.detachMediaElement();
  964. self.videoList[i].flvPlayer.destroy();
  965. self.videoList[i].flvPlayer = null;
  966. }
  967. self.videoList = [];
  968. }
  969. },
  970. },
  971. beforeDestroy() {
  972. //清除定时器
  973. let self = this;
  974. self.videoOff();
  975. self.offMQTT();
  976. console.log("beforeDestroy");
  977. },
  978. }
  979. </script>
  980. <style scoped lang="scss">
  981. .subject{
  982. flex:1;
  983. display: flex!important;
  984. flex-direction: column;
  985. overflow: hidden;
  986. *{
  987. margin:0;
  988. }
  989. .subject-page{
  990. flex:1;
  991. display: flex;
  992. flex-direction: column;
  993. padding:20px;
  994. overflow: hidden;
  995. border-radius:10px;
  996. margin:5px 20px 20px 10px;
  997. box-shadow: 0 0 8px 1px rgba(0, 0, 0, 0.1);
  998. .subject-page-min{
  999. flex:1;
  1000. display: flex;
  1001. overflow: hidden;
  1002. }
  1003. .left-subject-list{
  1004. flex:1;
  1005. display: flex;
  1006. flex-direction: column;
  1007. margin-right:20px;
  1008. overflow: hidden ;
  1009. }
  1010. .overflow-box{
  1011. overflow: hidden;
  1012. }
  1013. .right-subject-box{
  1014. width:514px;
  1015. display: flex;
  1016. flex-direction: column;
  1017. .top-button-box{
  1018. display: flex;
  1019. div{
  1020. width:110px;
  1021. height:40px;
  1022. line-height:40px;
  1023. font-size:16px;
  1024. text-align: center;
  1025. border-top-right-radius: 10px;
  1026. border-top-left-radius: 10px;
  1027. margin-right:1px;
  1028. cursor: pointer;
  1029. font-weight: 500;
  1030. }
  1031. .buttonColorA{
  1032. color:#FFFFFF;
  1033. background:#0045AF ;
  1034. }
  1035. .buttonColorB{
  1036. color:#999999;
  1037. background:#E0E0E0 ;
  1038. }
  1039. }
  1040. .bottom-max-box{
  1041. font-weight:500;
  1042. flex:1;
  1043. display: flex;
  1044. flex-direction: column;
  1045. .bottom-sensor-box{
  1046. background: #fff;
  1047. width:510px;
  1048. border: 1px solid #E0E0E0;
  1049. border-radius: 0 10px 10px 10px;
  1050. .top-title{
  1051. line-height:18px;
  1052. font-size:16px;
  1053. margin:23px 10px;
  1054. }
  1055. .null-text-p{
  1056. text-align: center;
  1057. font-size:16px;
  1058. color:#999;
  1059. line-height:50px;
  1060. margin:0 30px;
  1061. }
  1062. .sensor-for-max-box{
  1063. .sensor-for-big-box{
  1064. display: inline-block;
  1065. width:158px;
  1066. height:60px;
  1067. margin:0 0 11px 8px;
  1068. border-radius: 10px;
  1069. .sensor-for-min-box{
  1070. display: flex;
  1071. img{
  1072. width:26px;
  1073. height:26px;
  1074. margin:17px 11px;
  1075. }
  1076. div{
  1077. margin:9px 0;
  1078. p{
  1079. color:#fff;
  1080. }
  1081. p:nth-child(1){
  1082. font-size:14px;
  1083. line-height:20px;
  1084. }
  1085. p:nth-child(2){
  1086. font-size:16px;
  1087. line-height:22px;
  1088. }
  1089. }
  1090. }
  1091. }
  1092. .sensor-color-a{
  1093. background: #FF7272;
  1094. color:#fff;
  1095. }
  1096. .sensor-color-b{
  1097. background: #E0E0E0;
  1098. color:#999999;
  1099. }
  1100. .sensor-color-c{
  1101. background: #80D164;
  1102. color:#fff;
  1103. }
  1104. }
  1105. .bottom-text{
  1106. line-height:18px;
  1107. font-size:14px;
  1108. color:#999999;
  1109. margin:40px 10px 15px;
  1110. }
  1111. }
  1112. .bottom-switch-box{
  1113. background: #fff;
  1114. width:510px;
  1115. border: 1px solid #E0E0E0;
  1116. border-radius: 0 10px 10px 10px;
  1117. .top-title{
  1118. line-height:18px;
  1119. font-size:16px;
  1120. margin:23px 10px;
  1121. }
  1122. .null-text-p{
  1123. text-align: center;
  1124. font-size:16px;
  1125. color:#999;
  1126. line-height:50px;
  1127. margin:0 30px;
  1128. }
  1129. .switch-for-max-box{
  1130. .switch-for-big-box{
  1131. display: inline-block;
  1132. .switch-for-min-box{
  1133. width:210px;
  1134. height:60px;
  1135. border:1px solid #E0E0E0;
  1136. border-radius: 10px;
  1137. margin:0 0 20px 30px;
  1138. display: flex;
  1139. .switch-for-min-title{
  1140. font-size:16px;
  1141. line-height:58px;
  1142. width:113px;
  1143. margin-left:12px;
  1144. display:block;
  1145. overflow:hidden;
  1146. text-overflow:ellipsis;
  1147. white-space:nowrap;
  1148. }
  1149. .switch{
  1150. margin-top:14px;
  1151. }
  1152. .switch-null-p{
  1153. font-size:16px;
  1154. line-height:58px;
  1155. color:#999;
  1156. }
  1157. .switch-for-min-button{
  1158. width:70px;
  1159. height:30px;
  1160. line-height:30px;
  1161. font-size:14px;
  1162. color:#0045AF;
  1163. border-radius:6px;
  1164. border: 1px solid #0045AF;
  1165. margin-top:14px;
  1166. text-align: center;
  1167. cursor: pointer;
  1168. }
  1169. }
  1170. }
  1171. }
  1172. }
  1173. .bottom-video-box{
  1174. background: #fff;
  1175. width:510px;
  1176. border: 1px solid #E0E0E0;
  1177. border-radius: 0 10px 10px 10px;
  1178. .top-title{
  1179. line-height:18px;
  1180. font-size:16px;
  1181. margin:23px 10px;
  1182. }
  1183. .null-text-p{
  1184. text-align: center;
  1185. font-size:16px;
  1186. color:#999;
  1187. line-height:50px;
  1188. margin:0 30px;
  1189. }
  1190. .video-for-max-box{
  1191. .switch-for-big-box{
  1192. width:490px;
  1193. height:262px;
  1194. margin:0 auto 14px;
  1195. position: relative;
  1196. .position-p{
  1197. width:42px;
  1198. height:42px;
  1199. text-align: center;
  1200. line-height:42px;
  1201. font-size:18px;
  1202. position: absolute;
  1203. top:0;
  1204. right:0;
  1205. color:#fff;
  1206. cursor: pointer;
  1207. }
  1208. }
  1209. }
  1210. }
  1211. .bottom-alarm-box{
  1212. flex:1;
  1213. display: flex;
  1214. flex-direction: column;
  1215. background: #fff;
  1216. width:510px;
  1217. overflow-x: hidden;
  1218. .alarm-max-box{
  1219. width:510px;
  1220. height:150px;
  1221. display: flex;
  1222. position:relative;
  1223. border: 1px solid #E0E0E0;
  1224. border-radius: 0 10px 10px 10px;
  1225. .alarm-img{
  1226. width:110px;
  1227. height:110px;
  1228. margin:16px 24px 0 30px;
  1229. }
  1230. .alarm-big-box{
  1231. p:nth-child(1){
  1232. font-size:16px;
  1233. margin:40px 0 25px 0;
  1234. }
  1235. p:nth-child(2){
  1236. width: 60px;
  1237. font-size:12px;
  1238. font-weight:700;
  1239. line-height:24px;
  1240. background: rgba(204,230,254);
  1241. border-radius: 12px;
  1242. color: #0183FA;
  1243. text-align: center;
  1244. }
  1245. }
  1246. .alarm-position-box{
  1247. position:absolute;
  1248. bottom:20px;
  1249. right:15px;
  1250. width: 75px;
  1251. height: 30px;
  1252. }
  1253. }
  1254. .alarm-title-box{
  1255. display: flex;
  1256. p{
  1257. line-height:60px;
  1258. font-size:14px;
  1259. }
  1260. p:nth-child(1){
  1261. flex:1;
  1262. }
  1263. p:nth-child(2){
  1264. cursor: pointer;
  1265. }
  1266. }
  1267. }
  1268. .null-data-img{
  1269. width:137px;
  1270. height:137px;
  1271. display: block;
  1272. margin:10px auto;
  1273. }
  1274. }
  1275. }
  1276. }
  1277. }
  1278. </style>
  1279. <style lang="scss">
  1280. .alarm-position-box{
  1281. .switch .el-switch__label {
  1282. position: absolute;
  1283. display: none;
  1284. color: #fff !important;
  1285. }
  1286. .switch .el-switch__label--right {
  1287. z-index: 1;
  1288. }
  1289. .switch .el-switch__label--right span{
  1290. margin-right: 9px;
  1291. }
  1292. .switch .el-switch__label--left {
  1293. z-index: 1;
  1294. }
  1295. .switch .el-switch__label--left span{
  1296. margin-left: 9px;
  1297. }
  1298. .switch .el-switch__label.is-active {
  1299. display: block;
  1300. }
  1301. .switch.el-switch .el-switch__core,
  1302. .el-switch .el-switch__label {
  1303. width: 80px !important;
  1304. height:30px!important;
  1305. line-height:30px!important;
  1306. -webkit-border-radius: 20px!important;
  1307. -moz-border-radius: 20px!important;
  1308. border-radius: 20px!important;
  1309. margin: 0;
  1310. position: absolute;
  1311. top: 0;
  1312. }
  1313. .switch .el-switch__label--left span{
  1314. margin-left:30px!important;
  1315. }
  1316. .switch .el-switch__label--right span{
  1317. margin-left:8px!important;
  1318. }
  1319. .el-switch__core:after{
  1320. height:24px!important;
  1321. width:24px!important;
  1322. top:2px!important;
  1323. }
  1324. .el-switch.is-checked .el-switch__core::after{
  1325. margin-left: -25px!important;
  1326. }
  1327. .el-switch{
  1328. margin:10px auto 0;
  1329. display: block;
  1330. width:80px!important;
  1331. height:4px!important;
  1332. }
  1333. }
  1334. </style>