indexOne.vue 54 KB

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