indexKDNH.vue 53 KB

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