index.vue 53 KB

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