index.vue 54 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498
  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.VOlist[0]" v-hasPermi="['laboratory:subcontrol:set']">
  131. <div class="switch-for-big-box" v-for="(item,index) in checkedSubject.VOlist" :key="index">
  132. <div class="switch-for-min-box" v-if="item.hardwareTypeEnum.enumName == 'SWITCH'">
  133. <p class="switch-for-min-title">{{item.hardwareName}}</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">{{item.hardwareName}}</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.VOlist[0]">
  169. <p class="null-text-p" v-show="!checkedSubject.VOlist[0]">暂无物联控制信息,请在更多操作-物联设备配置中进行添加</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 "./deviceList.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:this.subId,
  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[0]){
  574. this.msgError("视频配置异常请联系管理员")
  575. this.newData.videoData = [];
  576. this.pageType = 6;
  577. }else{
  578. let newData = res.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[0]){
  598. this.msgError("视频配置异常请联系管理员")
  599. this.newData.videoData = [];
  600. this.pageType = 6;
  601. }else{
  602. let newData = res.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[0]){
  687. this.msgError("视频配置异常请联系管理员")
  688. return
  689. }
  690. let newData = res.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[0]){
  714. this.msgError("视频配置异常请联系管理员")
  715. return
  716. }
  717. let newData = res.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. }else if(type==5){
  748. this.queryHardByTypeList();
  749. }
  750. }
  751. },
  752. //选中实验室
  753. handleCurrentChange(val){
  754. let self = this;
  755. if(val.id != this.checkedSubject.id){
  756. this.videoOff();
  757. this.offMQTT();
  758. this.subjectInfo(val.id);
  759. this.subId = val.id;
  760. this.$set(this,'queryParamsTwo',{
  761. pageNum:1,
  762. pageSize:20,
  763. });
  764. this.getEnablelist();
  765. this.getHxpAlarmRecordNoAuthList();
  766. this.subscriptionMQTT();
  767. }
  768. },
  769. //获取实验室详情
  770. subjectInfo(id){
  771. let type = 1; //硬件 //0全部
  772. subjectInfo(id,type).then(response => {
  773. let obj = JSON.parse(JSON.stringify(response.data));
  774. obj.VOlist = [];
  775. if(response.data.labHardwareVOList){
  776. for(let i=0;i<response.data.labHardwareVOList.length;i++){
  777. if(response.data.labHardwareVOList[i].hardwareTypeEnum.enumName == 'SWITCH'||
  778. response.data.labHardwareVOList[i].hardwareTypeEnum.enumName == 'AI_VENTILATION'){
  779. obj.VOlist.push(response.data.labHardwareVOList[i]);
  780. }
  781. }
  782. }
  783. this.$set(this,'checkedSubject',obj);
  784. this.$set(this.checkedSubject,'videoData',[]);
  785. this.rightButtonType = 1;
  786. })
  787. },
  788. //编辑按钮
  789. handleCommand(command, row){
  790. switch (command) {
  791. case "1":
  792. console.log('关联配置');
  793. this.clickPage(6,row);
  794. break;
  795. case "2":
  796. console.log('物联配置');
  797. this.clickPage(4,row);
  798. break;
  799. case "3":
  800. console.log('准入配置');
  801. this.clickPage(5,row);
  802. break;
  803. case "4":
  804. console.log('编辑');
  805. this.clickPage(3,row);
  806. break;
  807. case "5":
  808. console.log('删除');
  809. break;
  810. default:
  811. break;
  812. }
  813. },
  814. //保存当前排序
  815. liveSort(row){
  816. console.log("row",row);
  817. let obj = {
  818. sort:row.diyOrder
  819. }
  820. this.sort = JSON.parse(JSON.stringify(obj));
  821. },
  822. //编辑排序
  823. editSort(row){
  824. let self = this;
  825. if(row.diyOrder != this.sort.sort){
  826. self.$confirm('是否确认修改排序?', "", {
  827. confirmButtonText: "确定",
  828. cancelButtonText: "取消",
  829. type: "warning"
  830. }).then(function() {
  831. let obj = {
  832. id:row.id,
  833. diyOrder:row.diyOrder,
  834. };
  835. updateSubject(obj).then(response => {
  836. self.msgSuccess("修改成功");
  837. self.getList();
  838. });
  839. }).then(() => {}).catch(() => {
  840. let obj = JSON.parse(JSON.stringify(self.sort));
  841. row.diyOrder = obj.sort
  842. });
  843. }
  844. },
  845. /** 搜索按钮操作 */
  846. handleQuery() {
  847. this.queryParams.pageNum = 1;
  848. this.getList();
  849. },
  850. /** 重置按钮操作 */
  851. resetQuery() {
  852. this.$set(this,'queryParams',{
  853. pageNum: 1,
  854. pageSize:20,
  855. deptId:"",
  856. name: '',
  857. });
  858. // this.resetForm("queryForm");
  859. this.handleQuery();
  860. },
  861. /** 查询实验室列表 */
  862. getList() {
  863. this.loading = true;
  864. // this.offMQTT();
  865. authListSubject(this.queryParams).then(response => {
  866. this.subjectList = response.rows;
  867. this.total = response.total;
  868. this.loading = false;
  869. if(response.rows[0]){
  870. this.$refs.multipleTable.setCurrentRow(response.rows[0]);
  871. this.subjectInfo(response.rows[0].id);
  872. }
  873. let idList = [];
  874. for(let i=0;i<response.rows.length;i++){
  875. idList.push(response.rows[i].id)
  876. }
  877. this.$set(this,'mqttIdList',idList);
  878. // this.subscriptionMQTT();
  879. });
  880. },
  881. /** 查询学院列表 */
  882. getDeptList() {
  883. filterDept().then(response => {
  884. this.$set(this, 'deptOptions', response.data)
  885. });
  886. },
  887. //MQTT订阅
  888. subscriptionMQTT(){
  889. let self = this;
  890. this.client = mqtt.connect(localStorage.getItem('mqttUrl'), {
  891. username: localStorage.getItem('mqttUser'),
  892. password:localStorage.getItem('mqttPassword')
  893. });
  894. this.client.on("connect", e =>{
  895. console.log("连接成功");
  896. this.client.subscribe(this.mtopic+self.subId, (err) => {
  897. if (!err) {
  898. console.log("订阅成功:" + this.mtopic+self.subId);
  899. }
  900. });
  901. this.client.subscribe(this.mtopicOne+self.subId, (err) => {
  902. if (!err) {
  903. console.log("订阅成功:" + this.mtopicOne+self.subId);
  904. }
  905. });
  906. // for(let i = 0; i< self.mqttIdList.length;i++){
  907. // this.client.subscribe(this.mtopic+self.mqttIdList[i], (err) => {
  908. // if (!err) {
  909. // console.log("订阅成功:" + this.mtopic+self.mqttIdList[i]);
  910. // }
  911. // });
  912. // this.client.subscribe(this.mtopicOne+self.mqttIdList[i], (err) => {
  913. // if (!err) {
  914. // console.log("订阅成功:" + this.mtopicOne+self.mqttIdList[i]);
  915. // }
  916. // });
  917. // }
  918. });
  919. this.client.on("message", (topic, message) => {
  920. // console.log('message',message)
  921. if (message){
  922. let data = JSON.parse(message)
  923. // console.log("MQTT----message",data)
  924. if(data.data.subId){
  925. //传感器
  926. // console.log("传感器",data.data.subId,'---------',data);
  927. if(self.checkedSubject.id){
  928. if(data.data.subId&&data.data.subId == self.checkedSubject.id){
  929. self.$set(self.checkedSubject,'sensorFunctionStatusList',data.data.functionStatuses);
  930. self.$set(self.checkedSubject.sensorFunctionStatusList[0],'sendDate',data.sendDate);
  931. }
  932. }
  933. if(self.newData.id){
  934. if(data.data.subId&&data.data.subId == self.newData.id){
  935. self.$set(self.newData,'sensorFunctionStatusList',data.data.functionStatuses);
  936. self.$set(self.newData.sensorFunctionStatusList[0],'sendDate',data.sendDate);
  937. }
  938. }
  939. }else{
  940. //硬件
  941. // console.log("硬件",data);
  942. for (let i = 0; i < data.data.length; i++) {
  943. if (self.checkedSubject.VOlist) {
  944. for (let k = 0; k < self.checkedSubject.VOlist.length; k++) {
  945. if (self.checkedSubject.VOlist[k].id == data.data[i].num) {
  946. if (data.data[i].hardwareOperate == 'CLOSE') {
  947. self.checkedSubject.VOlist[k].state.code = 4;
  948. } else if (data.data[i].hardwareOperate == 'OPEN') {
  949. self.checkedSubject.VOlist[k].state.code = 3;
  950. } else if (data.data[i].hardwareOperate == 'OFFLINE') {
  951. self.checkedSubject.VOlist[k].state.code = 0;
  952. }
  953. }
  954. }
  955. }
  956. if(self.newData.labHardwareVOList){
  957. for(let k=0;k<self.newData.labHardwareVOList.length;k++){
  958. if(self.newData.labHardwareVOList[k].id == data.data[i].num){
  959. if(data.data[i].hardwareOperate == 'CLOSE'){
  960. self.newData.labHardwareVOList[k].state.code = 4;
  961. }else if(data.data[i].hardwareOperate == 'OPEN'){
  962. self.newData.labHardwareVOList[k].state.code = 3;
  963. }else if(data.data[i].hardwareOperate == 'OFFLINE'){
  964. self.newData.labHardwareVOList[k].state.code = 0;
  965. }
  966. }
  967. }
  968. }
  969. }
  970. }
  971. }
  972. });
  973. },
  974. //取消订阅关闭MQTT连接
  975. offMQTT(){
  976. let self = this;
  977. if (self.mqttIdList[0]){
  978. // for(let i=0;i<self.mqttIdList.length;i++){
  979. // self.client.unsubscribe(self.mtopic+self.mqttIdList[i], error => {
  980. // if (error) {
  981. // console.log('Unsubscribe error', error)
  982. // }
  983. // })
  984. // self.client.unsubscribe(self.mtopicOne+self.mqttIdList[i], error => {
  985. // if (error) {
  986. // console.log('Unsubscribe error', error)
  987. // }
  988. // })
  989. // }
  990. self.client.unsubscribe(self.mtopic+self.subId, error => {
  991. if (error) {
  992. console.log('Unsubscribe error', error)
  993. }
  994. })
  995. self.client.unsubscribe(self.mtopicOne+self.subId, error => {
  996. if (error) {
  997. console.log('Unsubscribe error', error)
  998. }
  999. })
  1000. self.client.end();
  1001. self.client = {};
  1002. }
  1003. },
  1004. //视频方法
  1005. videoFunction(){
  1006. let self = this;
  1007. // self.videoList = [];
  1008. for(let i=0;i<self.checkedSubject.videoData.length;i++){
  1009. let obj = {
  1010. player :{},
  1011. flvPlayer:{}
  1012. };
  1013. obj.player = document.getElementById(self.checkedSubject.videoData[i].divId);
  1014. // if (flvjs.isSupported()) {
  1015. obj.flvPlayer = flvjs.createPlayer(
  1016. {
  1017. // isLive: true, //=> 是否为直播流
  1018. // hasAudio: false, //=> 是否开启声音
  1019. type: self.checkedSubject.videoData[i].videoType, //媒体类型 flv 或 mp4
  1020. url: self.checkedSubject.videoData[i].url //视频流地址
  1021. },
  1022. {
  1023. enableStashBuffer: true,//启用 IO 存储缓冲区。 如果您需要实时流播放(最小延迟),请设置为 false,但如果存在网络抖动,则可能会停止。
  1024. stashInitialSize: 128,//IO 存储缓冲区初始大小。 默认值为 384KB。 指示合适的大小可以改善视频加载/搜索时间。
  1025. isLive: true,//是否是直播
  1026. lazyLoadRecoverDuration: 30,//指示以秒为单位的lazyLoad 恢复时间边界。
  1027. autoCleanupSourceBuffer: true,//进行自动清理
  1028. autoCleanupMaxBackwardDuration: 3 * 60,//3 * 60 当向后缓冲持续时间超过这个值(以秒为单位)时,对 SourceBuffer 进行自动清理
  1029. autoCleanupMinBackwardDuration: 2 * 60,//2 * 60 指示在执行自动清理时为后向缓冲区保留的持续时间(以秒为单位)。
  1030. }
  1031. );
  1032. self.videoList.push(obj);
  1033. // }
  1034. console.log("i",i)
  1035. }
  1036. for(let i=0;i<self.videoList.length;i++){
  1037. self.videoList[i].flvPlayer.attachMediaElement(self.videoList[i].player);
  1038. self.videoList[i].flvPlayer.load(); //加载
  1039. self.videoList[i].flvPlayer.play(); //加载
  1040. }
  1041. },
  1042. //视屏全屏方法
  1043. videoFullScreen(index){
  1044. this.$refs.videoRef[index].webkitRequestFullScreen();
  1045. },
  1046. //断开视频流
  1047. videoOff(){
  1048. let self = this;
  1049. if(self.videoList[0]){
  1050. for(let i=0;i<self.videoList.length;i++){
  1051. self.videoList[i].flvPlayer.pause();
  1052. self.videoList[i].flvPlayer.unload();
  1053. self.videoList[i].flvPlayer.detachMediaElement();
  1054. self.videoList[i].flvPlayer.destroy();
  1055. self.videoList[i].flvPlayer = null;
  1056. }
  1057. self.videoList = [];
  1058. }
  1059. },
  1060. },
  1061. beforeDestroy() {
  1062. //清除定时器
  1063. let self = this;
  1064. self.videoOff();
  1065. self.offMQTT();
  1066. console.log("beforeDestroy");
  1067. },
  1068. }
  1069. </script>
  1070. <style scoped lang="scss">
  1071. .subject{
  1072. flex:1;
  1073. display: flex!important;
  1074. flex-direction: column;
  1075. overflow: hidden;
  1076. *{
  1077. margin:0;
  1078. }
  1079. .subject-page{
  1080. flex:1;
  1081. display: flex;
  1082. flex-direction: column;
  1083. padding:20px;
  1084. overflow: hidden;
  1085. border-radius:10px;
  1086. margin:5px 20px 20px 10px;
  1087. box-shadow: 0 0 8px 1px rgba(0, 0, 0, 0.1);
  1088. .subject-page-min{
  1089. flex:1;
  1090. display: flex;
  1091. overflow: hidden;
  1092. }
  1093. .left-subject-list{
  1094. flex:1;
  1095. display: flex;
  1096. flex-direction: column;
  1097. margin-right:20px;
  1098. overflow: hidden ;
  1099. }
  1100. .overflow-box{
  1101. overflow: hidden;
  1102. }
  1103. .right-subject-box{
  1104. width:514px;
  1105. display: flex;
  1106. flex-direction: column;
  1107. .top-button-box{
  1108. display: flex;
  1109. div{
  1110. padding:0 10px;
  1111. height:40px;
  1112. line-height:40px;
  1113. font-size:16px;
  1114. text-align: center;
  1115. border-top-right-radius: 10px;
  1116. border-top-left-radius: 10px;
  1117. margin-right:1px;
  1118. cursor: pointer;
  1119. font-weight: 500;
  1120. }
  1121. .buttonColorA{
  1122. color:#FFFFFF;
  1123. background:#0045AF ;
  1124. }
  1125. .buttonColorB{
  1126. color:#999999;
  1127. background:#E0E0E0 ;
  1128. }
  1129. }
  1130. .bottom-max-box{
  1131. font-weight:500;
  1132. flex:1;
  1133. display: flex;
  1134. flex-direction: column;
  1135. .bottom-sensor-box{
  1136. background: #fff;
  1137. width:510px;
  1138. border: 1px solid #E0E0E0;
  1139. border-radius: 0 10px 10px 10px;
  1140. .top-title{
  1141. line-height:18px;
  1142. font-size:16px;
  1143. margin:23px 10px;
  1144. }
  1145. .null-text-p{
  1146. text-align: center;
  1147. font-size:16px;
  1148. color:#999;
  1149. line-height:50px;
  1150. margin:0 30px;
  1151. }
  1152. .sensor-for-max-box{
  1153. .sensor-for-big-box{
  1154. display: inline-block;
  1155. width:158px;
  1156. height:60px;
  1157. margin:0 0 11px 8px;
  1158. border-radius: 10px;
  1159. .sensor-for-min-box{
  1160. display: flex;
  1161. img{
  1162. width:26px;
  1163. height:26px;
  1164. margin:17px 11px;
  1165. }
  1166. div{
  1167. margin:9px 0;
  1168. p{
  1169. color:#fff;
  1170. }
  1171. p:nth-child(1){
  1172. font-size:14px;
  1173. line-height:20px;
  1174. }
  1175. p:nth-child(2){
  1176. font-size:16px;
  1177. line-height:22px;
  1178. }
  1179. }
  1180. }
  1181. }
  1182. .sensor-color-a{
  1183. background: #FF7272;
  1184. color:#fff;
  1185. }
  1186. .sensor-color-b{
  1187. background: #E0E0E0;
  1188. color:#999999;
  1189. }
  1190. .sensor-color-c{
  1191. background: #80D164;
  1192. color:#fff;
  1193. }
  1194. }
  1195. .bottom-text{
  1196. line-height:18px;
  1197. font-size:14px;
  1198. color:#999999;
  1199. margin:40px 10px 15px;
  1200. }
  1201. }
  1202. .bottom-switch-box{
  1203. background: #fff;
  1204. width:510px;
  1205. border: 1px solid #E0E0E0;
  1206. border-radius: 0 10px 10px 10px;
  1207. .top-title{
  1208. line-height:18px;
  1209. font-size:16px;
  1210. margin:23px 10px;
  1211. }
  1212. .null-text-p{
  1213. text-align: center;
  1214. font-size:16px;
  1215. color:#999;
  1216. line-height:50px;
  1217. margin:0 30px;
  1218. }
  1219. .switch-for-max-box{
  1220. .switch-for-big-box{
  1221. display: inline-block;
  1222. .switch-for-min-box{
  1223. width:210px;
  1224. height:60px;
  1225. border:1px solid #E0E0E0;
  1226. border-radius: 10px;
  1227. margin:0 0 20px 30px;
  1228. display: flex;
  1229. .switch-for-min-title{
  1230. font-size:16px;
  1231. line-height:58px;
  1232. width:113px;
  1233. margin-left:12px;
  1234. display:block;
  1235. overflow:hidden;
  1236. text-overflow:ellipsis;
  1237. white-space:nowrap;
  1238. }
  1239. .switch{
  1240. margin-top:14px;
  1241. }
  1242. .switch-null-p{
  1243. font-size:16px;
  1244. line-height:58px;
  1245. color:#999;
  1246. }
  1247. .switch-for-min-button{
  1248. width:70px;
  1249. height:30px;
  1250. line-height:30px;
  1251. font-size:14px;
  1252. color:#0045AF;
  1253. border-radius:6px;
  1254. border: 1px solid #0045AF;
  1255. margin-top:14px;
  1256. text-align: center;
  1257. cursor: pointer;
  1258. }
  1259. }
  1260. }
  1261. }
  1262. }
  1263. .bottom-video-box{
  1264. background: #fff;
  1265. width:510px;
  1266. border: 1px solid #E0E0E0;
  1267. border-radius: 0 10px 10px 10px;
  1268. .top-title{
  1269. line-height:18px;
  1270. font-size:16px;
  1271. margin:23px 10px;
  1272. }
  1273. .null-text-p{
  1274. text-align: center;
  1275. font-size:16px;
  1276. color:#999;
  1277. line-height:50px;
  1278. margin:0 30px;
  1279. }
  1280. .video-for-max-box{
  1281. .switch-for-big-box{
  1282. width:490px;
  1283. height:262px;
  1284. margin:0 auto 14px;
  1285. position: relative;
  1286. .position-p{
  1287. width:42px;
  1288. height:42px;
  1289. text-align: center;
  1290. line-height:42px;
  1291. font-size:18px;
  1292. position: absolute;
  1293. top:0;
  1294. right:0;
  1295. color:#fff;
  1296. cursor: pointer;
  1297. }
  1298. }
  1299. }
  1300. }
  1301. .bottom-alarm-box{
  1302. flex:1;
  1303. display: flex;
  1304. flex-direction: column;
  1305. background: #fff;
  1306. width:510px;
  1307. overflow-x: hidden;
  1308. .alarm-max-box{
  1309. width:510px;
  1310. height:150px;
  1311. display: flex;
  1312. position:relative;
  1313. border: 1px solid #E0E0E0;
  1314. border-radius: 0 10px 10px 10px;
  1315. .alarm-img{
  1316. width:110px;
  1317. height:110px;
  1318. margin:20px;
  1319. }
  1320. .alarm-big-box{
  1321. p:nth-child(1){
  1322. font-size:14px;
  1323. margin:40px 0 25px 0;
  1324. }
  1325. p:nth-child(2){
  1326. width: 60px;
  1327. font-size:12px;
  1328. font-weight:700;
  1329. line-height:24px;
  1330. border-radius: 12px;
  1331. text-align: center;
  1332. }
  1333. .colorTypeA{
  1334. background: rgba(1,131,250,0.2);
  1335. color:#0183FA;
  1336. }
  1337. .colorTypeB{
  1338. background: #ECECEC;
  1339. color:#A2A2A2;
  1340. }
  1341. }
  1342. .alarm-position-box{
  1343. position:absolute;
  1344. bottom:20px;
  1345. right:15px;
  1346. width: 75px;
  1347. height: 30px;
  1348. }
  1349. }
  1350. .alarm-title-box{
  1351. display: flex;
  1352. p{
  1353. line-height:60px;
  1354. font-size:14px;
  1355. }
  1356. p:nth-child(1){
  1357. flex:1;
  1358. }
  1359. p:nth-child(2){
  1360. cursor: pointer;
  1361. }
  1362. }
  1363. }
  1364. /*智能门禁*/
  1365. .bottom-entrance-box{
  1366. background: #fff;
  1367. width:510px;
  1368. border: 1px solid #E0E0E0;
  1369. border-radius: 0 10px 10px 10px;
  1370. .entrance{
  1371. display: flex;
  1372. justify-content: flex-start;
  1373. border: 1px solid #E0E0E0;
  1374. .entrance_l_yes{
  1375. width: 60px;
  1376. height: 30px;
  1377. background: rgba(1,131,250,0.2);
  1378. border-radius: 0px 0px 20px 0px;
  1379. font-size: 14px;
  1380. font-weight: 400;
  1381. color: #0183FA;
  1382. line-height: 30px;
  1383. text-align: center;
  1384. }
  1385. .entrance_l_no{
  1386. width: 60px;
  1387. height: 30px;
  1388. background: rgba(224,224,224,0.2);
  1389. border-radius: 0px 0px 20px 0px;
  1390. font-size: 14px;
  1391. font-weight: 400;
  1392. color: #666666;
  1393. line-height: 30px;
  1394. text-align: center;
  1395. }
  1396. .entrance_c{
  1397. width: 50px;
  1398. height: 50px;
  1399. margin: 20px 0 8px 44px;
  1400. }
  1401. .entrance_r{
  1402. margin-left: 30px;
  1403. >p{
  1404. font-size: 12px;
  1405. font-weight: 400;
  1406. color: #333333;
  1407. line-height: 20px;
  1408. }
  1409. >p:nth-of-type(1){
  1410. margin: 20px 0 10px 0;
  1411. }
  1412. }
  1413. }
  1414. }
  1415. .null-data-img{
  1416. width:137px;
  1417. height:137px;
  1418. display: block;
  1419. margin:10px auto;
  1420. }
  1421. .null-text-p{
  1422. text-align: center;
  1423. font-size:16px;
  1424. color:#999;
  1425. line-height:50px;
  1426. margin:0 30px;
  1427. }
  1428. }
  1429. }
  1430. }
  1431. }
  1432. </style>
  1433. <style lang="scss">
  1434. .alarm-position-box{
  1435. .switch .el-switch__label {
  1436. position: absolute;
  1437. display: none;
  1438. color: #fff !important;
  1439. }
  1440. .switch .el-switch__label--right {
  1441. z-index: 1;
  1442. }
  1443. .switch .el-switch__label--right span{
  1444. margin-right: 9px;
  1445. }
  1446. .switch .el-switch__label--left {
  1447. z-index: 1;
  1448. }
  1449. .switch .el-switch__label--left span{
  1450. margin-left: 9px;
  1451. }
  1452. .switch .el-switch__label.is-active {
  1453. display: block;
  1454. }
  1455. .switch.el-switch .el-switch__core,
  1456. .el-switch .el-switch__label {
  1457. width: 80px !important;
  1458. height:30px!important;
  1459. line-height:30px!important;
  1460. -webkit-border-radius: 20px!important;
  1461. -moz-border-radius: 20px!important;
  1462. border-radius: 20px!important;
  1463. margin: 0;
  1464. position: absolute;
  1465. top: 0;
  1466. }
  1467. .switch .el-switch__label--left span{
  1468. margin-left:30px!important;
  1469. }
  1470. .switch .el-switch__label--right span{
  1471. margin-left:8px!important;
  1472. }
  1473. .el-switch__core:after{
  1474. height:24px!important;
  1475. width:24px!important;
  1476. top:2px!important;
  1477. }
  1478. .el-switch.is-checked .el-switch__core::after{
  1479. margin-left: -25px!important;
  1480. }
  1481. .el-switch{
  1482. margin:10px auto 0;
  1483. display: block;
  1484. width:80px!important;
  1485. height:4px!important;
  1486. }
  1487. }
  1488. </style>