index.vue 50 KB

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