indexTwo.vue 50 KB

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