indexOne.vue 51 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404
  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,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. })
  547. },
  548. // 开启关闭验证
  549. async changeIsNeedCaptcha (row) {
  550. let self = this;
  551. console.log(row)
  552. if(row.state.code!=3 && row.state.code!=4){
  553. return
  554. }
  555. let text = row.state.code==3?'关闭':(row.state.code==4?'开启':'')
  556. this.$confirm(`是否`+text+`此设备`, "提示", {
  557. confirmButtonText: "确定",
  558. cancelButtonText: "取消",
  559. type: "warning"
  560. }).then(async () => {
  561. self.switchChange(row)
  562. }).catch(() => {
  563. })
  564. },
  565. //开关按钮
  566. switchChange(row){
  567. let switchData = {
  568. id:row.id,
  569. switchVal:row.state.code==3?'close':(row.state.code==4?'open':'')
  570. };
  571. hardWareControl(switchData).then(response => {
  572. console.log(response);
  573. if(response.code==200){
  574. row.state.code = row.state.code==3?4:(row.state.code==4?3:'')
  575. this.msgSuccess("操作成功")
  576. }
  577. });
  578. },
  579. //切换实验室展示数据
  580. rightButtonClick(type){
  581. let self = this;
  582. if(this.rightButtonType != type){
  583. this.rightButtonType = type;
  584. this.videoOff();
  585. if(type == 3){
  586. let self = this;
  587. let list = [];
  588. if(self.checkedSubject.labHardwareVOList){
  589. for(let i=0;i<self.checkedSubject.labHardwareVOList.length;i++){
  590. if(self.checkedSubject.labHardwareVOList[i].hardwareTypeEnum.enumName == 'VIDEO_MONITOR'){
  591. list.push(self.checkedSubject.labHardwareVOList[i].hardwareNUM);
  592. }
  593. }
  594. if(list[0]){
  595. let obj = {
  596. count:"100",
  597. deviceIds:list+'',
  598. page:"1",
  599. };
  600. let urlText = window.location.href;
  601. if(urlText.indexOf(localStorage.getItem('ipIdentify')) != -1){
  602. startUrl(obj).then(res => {
  603. if(res.code == 200){
  604. if(!res.data[0]){
  605. this.msgError("视频配置异常请联系管理员")
  606. return
  607. }
  608. let videoList = [];
  609. for(let i=0;i<res.data.length;i++){
  610. let obj = {
  611. name:self.checkedSubject.name + self.checkedSubject.subAddrr.room,
  612. videoType:"flv",
  613. divId:'divId'+i,
  614. url:res.data[i].result.body.data.ws_flv,
  615. }
  616. videoList.push(obj)
  617. }
  618. this.$set(this.checkedSubject,'videoData',videoList);
  619. if(this.rightButtonType == 3){
  620. setTimeout(function(){
  621. self.videoFunction();
  622. },1000);
  623. }
  624. }
  625. });
  626. }else{
  627. startUrl(obj).then(res => {
  628. if(res.code == 200){
  629. if(!res.data[0]){
  630. this.msgError("视频配置异常请联系管理员")
  631. return
  632. }
  633. let videoList = [];
  634. for(let i=0;i<res.data.length;i++){
  635. let text = localStorage.getItem('cameraUrl');
  636. let url = res.data[i].result.body.data.ws_flv;
  637. url = url.split("rtp/");
  638. let newUrl = text+'rtp/'+url[1];
  639. let obj = {
  640. name:self.checkedSubject.name + self.checkedSubject.subAddrr.room,
  641. videoType:"flv",
  642. divId:'divId'+i,
  643. url:newUrl,
  644. }
  645. videoList.push(obj)
  646. }
  647. this.$set(this.checkedSubject,'videoData',videoList);
  648. if(this.rightButtonType == 3){
  649. setTimeout(function(){
  650. self.videoFunction();
  651. },1000);
  652. }
  653. }
  654. });
  655. }
  656. }else{
  657. this.$set(this.checkedSubject,'videoData',[]);
  658. }
  659. }else{
  660. this.$set(this.checkedSubject,'videoData',[]);
  661. }
  662. }
  663. }
  664. },
  665. //选中实验室
  666. handleCurrentChange(val){
  667. let self = this;
  668. if(val.id != this.checkedSubject.id){
  669. this.videoOff();
  670. this.offMQTT();
  671. this.subjectInfo(val.id);
  672. this.subId = val.id;
  673. this.$set(this,'queryParamsTwo',{
  674. pageNum:1,
  675. pageSize:20,
  676. });
  677. this.getEnablelist();
  678. this.getHxpAlarmRecordNoAuthList();
  679. this.subscriptionMQTT();
  680. }
  681. },
  682. getDetalis(id){
  683. let obj = {
  684. subjectId:id
  685. }
  686. getDetalis(obj).then(response => {
  687. this.$set(this.checkedSubject,'doorList',response.rows);
  688. console.log('res',response);
  689. })
  690. },
  691. //获取实验室详情
  692. subjectInfo(id){
  693. let type = 1; //硬件 //0全部
  694. subjectInfo(id,type).then(response => {
  695. this.$set(this,'checkedSubject',response.data);
  696. this.$set(this.checkedSubject,'videoData',[]);
  697. this.getDetalis(id);
  698. this.rightButtonType = 1;
  699. })
  700. },
  701. //编辑按钮
  702. handleCommand(command, row){
  703. switch (command) {
  704. case "1":
  705. console.log('关联配置');
  706. this.clickPage(6,row);
  707. break;
  708. case "2":
  709. console.log('物联配置');
  710. subjectInfo(row.id,0).then(response => {
  711. this.clickPage(4,response.data);
  712. });
  713. break;
  714. case "3":
  715. console.log('准入配置');
  716. this.clickPage(5,row);
  717. break;
  718. case "4":
  719. console.log('编辑');
  720. this.clickPage(3,row);
  721. break;
  722. case "5":
  723. console.log('删除');
  724. break;
  725. default:
  726. break;
  727. }
  728. },
  729. //保存当前排序
  730. liveSort(row){
  731. console.log("row",row);
  732. let obj = {
  733. sort:row.diyOrder
  734. }
  735. this.sort = JSON.parse(JSON.stringify(obj));
  736. },
  737. //编辑排序
  738. editSort(row){
  739. let self = this;
  740. if(row.diyOrder != this.sort.sort){
  741. self.$confirm('是否确认修改排序?', "", {
  742. confirmButtonText: "确定",
  743. cancelButtonText: "取消",
  744. type: "warning"
  745. }).then(function() {
  746. let obj = {
  747. id:row.id,
  748. diyOrder:row.diyOrder,
  749. };
  750. updateSubject(obj).then(response => {
  751. self.msgSuccess("修改成功");
  752. self.getList();
  753. });
  754. }).then(() => {}).catch(() => {
  755. let obj = JSON.parse(JSON.stringify(self.sort));
  756. row.diyOrder = obj.sort
  757. });
  758. }
  759. },
  760. /** 搜索按钮操作 */
  761. handleQuery() {
  762. this.queryParams.pageNum = 1;
  763. this.getList();
  764. },
  765. /** 重置按钮操作 */
  766. resetQuery() {
  767. this.$set(this,'queryParams',{
  768. pageNum: 1,
  769. pageSize:20,
  770. deptId:"",
  771. name: '',
  772. });
  773. // this.resetForm("queryForm");
  774. this.handleQuery();
  775. },
  776. /** 查询实验室列表 */
  777. getList() {
  778. this.loading = true;
  779. // this.offMQTT();
  780. authListSubject(this.queryParams).then(response => {
  781. this.subjectList = response.rows;
  782. this.total = response.total;
  783. this.loading = false;
  784. if(response.rows[0]){
  785. this.$refs.multipleTable.setCurrentRow(response.rows[0]);
  786. this.subjectInfo(response.rows[0].id);
  787. }
  788. let idList = [];
  789. for(let i=0;i<response.rows.length;i++){
  790. idList.push(response.rows[i].id)
  791. }
  792. this.$set(this,'mqttIdList',idList);
  793. // this.subscriptionMQTT();
  794. });
  795. },
  796. /** 查询学院列表 */
  797. getDeptList() {
  798. filterDept().then(response => {
  799. this.$set(this, 'deptOptions', response.data)
  800. });
  801. },
  802. //MQTT订阅
  803. subscriptionMQTT(){
  804. let self = this;
  805. this.client = mqtt.connect(localStorage.getItem('mqttUrl'), {
  806. username: localStorage.getItem('mqttUser'),
  807. password: localStorage.getItem('mqttPassword')
  808. });
  809. this.client.on("connect", e =>{
  810. console.log("连接成功");
  811. this.client.subscribe(this.mtopic+self.subId, (err) => {
  812. if (!err) {
  813. console.log("订阅成功:" + this.mtopic+self.subId);
  814. }
  815. });
  816. this.client.subscribe(this.mtopicOne+self.subId, (err) => {
  817. if (!err) {
  818. console.log("订阅成功:" + this.mtopicOne+self.subId);
  819. }
  820. });
  821. // for(let i = 0; i< self.mqttIdList.length;i++){
  822. // this.client.subscribe(this.mtopic+self.mqttIdList[i], (err) => {
  823. // if (!err) {
  824. // console.log("订阅成功:" + this.mtopic+self.mqttIdList[i]);
  825. // }
  826. // });
  827. // this.client.subscribe(this.mtopicOne+self.mqttIdList[i], (err) => {
  828. // if (!err) {
  829. // console.log("订阅成功:" + this.mtopicOne+self.mqttIdList[i]);
  830. // }
  831. // });
  832. // }
  833. });
  834. this.client.on("message", (topic, message) => {
  835. // console.log('message',message)
  836. if (message){
  837. let data = JSON.parse(message)
  838. // console.log("MQTT----message",data)
  839. if(data.data.subId){
  840. //传感器
  841. // console.log("传感器",data.data.subId,'---------',data);
  842. if(self.checkedSubject.id){
  843. if(data.data.subId&&data.data.subId == self.checkedSubject.id){
  844. self.$set(self.checkedSubject,'sensorFunctionStatusList',data.data.functionStatuses);
  845. self.$set(self.checkedSubject.sensorFunctionStatusList[0],'sendDate',data.sendDate);
  846. }
  847. }
  848. if(self.newData.id){
  849. if(data.data.subId&&data.data.subId == self.newData.id){
  850. self.$set(self.newData,'sensorFunctionStatusList',data.data.functionStatuses);
  851. self.$set(self.newData.sensorFunctionStatusList[0],'sendDate',data.sendDate);
  852. }
  853. }
  854. }else{
  855. //硬件
  856. // console.log("硬件",data);
  857. for (let i = 0; i < data.data.length; i++) {
  858. if (self.checkedSubject.labHardwareVOList) {
  859. for (let k = 0; k < self.checkedSubject.labHardwareVOList.length; k++) {
  860. if (self.checkedSubject.labHardwareVOList[k].id == data.data[i].num) {
  861. if (data.data[i].hardwareOperate == 'CLOSE') {
  862. self.checkedSubject.labHardwareVOList[k].state.code = 4;
  863. } else if (data.data[i].hardwareOperate == 'OPEN') {
  864. self.checkedSubject.labHardwareVOList[k].state.code = 3;
  865. } else if (data.data[i].hardwareOperate == 'OFFLINE') {
  866. self.checkedSubject.labHardwareVOList[k].state.code = 0;
  867. }
  868. }
  869. }
  870. }
  871. if(self.newData.labHardwareVOList){
  872. for(let k=0;k<self.newData.labHardwareVOList.length;k++){
  873. if(self.newData.labHardwareVOList[k].id == data.data[i].num){
  874. if(data.data[i].hardwareOperate == 'CLOSE'){
  875. self.newData.labHardwareVOList[k].state.code = 4;
  876. }else if(data.data[i].hardwareOperate == 'OPEN'){
  877. self.newData.labHardwareVOList[k].state.code = 3;
  878. }else if(data.data[i].hardwareOperate == 'OFFLINE'){
  879. self.newData.labHardwareVOList[k].state.code = 0;
  880. }
  881. }
  882. }
  883. }
  884. }
  885. }
  886. }
  887. });
  888. },
  889. //取消订阅关闭MQTT连接
  890. offMQTT(){
  891. let self = this;
  892. if (self.mqttIdList[0]){
  893. // for(let i=0;i<self.mqttIdList.length;i++){
  894. // self.client.unsubscribe(self.mtopic+self.mqttIdList[i], error => {
  895. // if (error) {
  896. // console.log('Unsubscribe error', error)
  897. // }
  898. // })
  899. // self.client.unsubscribe(self.mtopicOne+self.mqttIdList[i], error => {
  900. // if (error) {
  901. // console.log('Unsubscribe error', error)
  902. // }
  903. // })
  904. // }
  905. self.client.unsubscribe(self.mtopic+self.subId, error => {
  906. if (error) {
  907. console.log('Unsubscribe error', error)
  908. }
  909. })
  910. self.client.unsubscribe(self.mtopicOne+self.subId, error => {
  911. if (error) {
  912. console.log('Unsubscribe error', error)
  913. }
  914. })
  915. self.client.end();
  916. self.client = {};
  917. }
  918. },
  919. //视频方法
  920. videoFunction(){
  921. let self = this;
  922. // self.videoList = [];
  923. for(let i=0;i<self.checkedSubject.videoData.length;i++){
  924. let obj = {
  925. player :{},
  926. flvPlayer:{}
  927. };
  928. obj.player = document.getElementById(self.checkedSubject.videoData[i].divId);
  929. // if (flvjs.isSupported()) {
  930. obj.flvPlayer = flvjs.createPlayer(
  931. {
  932. // isLive: true, //=> 是否为直播流
  933. // hasAudio: false, //=> 是否开启声音
  934. type: self.checkedSubject.videoData[i].videoType, //媒体类型 flv 或 mp4
  935. url: self.checkedSubject.videoData[i].url //视频流地址
  936. },
  937. {
  938. enableStashBuffer: true,//启用 IO 存储缓冲区。 如果您需要实时流播放(最小延迟),请设置为 false,但如果存在网络抖动,则可能会停止。
  939. stashInitialSize: 128,//IO 存储缓冲区初始大小。 默认值为 384KB。 指示合适的大小可以改善视频加载/搜索时间。
  940. isLive: true,//是否是直播
  941. lazyLoadRecoverDuration: 30,//指示以秒为单位的lazyLoad 恢复时间边界。
  942. autoCleanupSourceBuffer: true,//进行自动清理
  943. autoCleanupMaxBackwardDuration: 3 * 60,//3 * 60 当向后缓冲持续时间超过这个值(以秒为单位)时,对 SourceBuffer 进行自动清理
  944. autoCleanupMinBackwardDuration: 2 * 60,//2 * 60 指示在执行自动清理时为后向缓冲区保留的持续时间(以秒为单位)。
  945. }
  946. );
  947. self.videoList.push(obj);
  948. // }
  949. console.log("i",i)
  950. }
  951. for(let i=0;i<self.videoList.length;i++){
  952. self.videoList[i].flvPlayer.attachMediaElement(self.videoList[i].player);
  953. self.videoList[i].flvPlayer.load(); //加载
  954. self.videoList[i].flvPlayer.play(); //加载
  955. }
  956. },
  957. //视屏全屏方法
  958. videoFullScreen(index){
  959. this.$refs.videoRef[index].webkitRequestFullScreen();
  960. },
  961. //断开视频流
  962. videoOff(){
  963. let self = this;
  964. if(self.videoList[0]){
  965. for(let i=0;i<self.videoList.length;i++){
  966. self.videoList[i].flvPlayer.pause();
  967. self.videoList[i].flvPlayer.unload();
  968. self.videoList[i].flvPlayer.detachMediaElement();
  969. self.videoList[i].flvPlayer.destroy();
  970. self.videoList[i].flvPlayer = null;
  971. }
  972. self.videoList = [];
  973. }
  974. },
  975. },
  976. beforeDestroy() {
  977. //清除定时器
  978. let self = this;
  979. self.videoOff();
  980. self.offMQTT();
  981. console.log("beforeDestroy");
  982. },
  983. }
  984. </script>
  985. <style scoped lang="scss">
  986. .subject{
  987. flex:1;
  988. display: flex!important;
  989. flex-direction: column;
  990. overflow: hidden;
  991. *{
  992. margin:0;
  993. }
  994. .subject-page{
  995. flex:1;
  996. display: flex;
  997. flex-direction: column;
  998. padding:20px;
  999. overflow: hidden;
  1000. border-radius:10px;
  1001. margin:5px 20px 20px 10px;
  1002. box-shadow: 0 0 8px 1px rgba(0, 0, 0, 0.1);
  1003. .subject-page-min{
  1004. flex:1;
  1005. display: flex;
  1006. overflow: hidden;
  1007. }
  1008. .left-subject-list{
  1009. flex:1;
  1010. display: flex;
  1011. flex-direction: column;
  1012. margin-right:20px;
  1013. overflow: hidden ;
  1014. }
  1015. .overflow-box{
  1016. overflow: hidden;
  1017. }
  1018. .right-subject-box{
  1019. width:514px;
  1020. display: flex;
  1021. flex-direction: column;
  1022. .top-button-box{
  1023. display: flex;
  1024. div{
  1025. padding:0 10px;
  1026. height:40px;
  1027. line-height:40px;
  1028. font-size:16px;
  1029. text-align: center;
  1030. border-top-right-radius: 10px;
  1031. border-top-left-radius: 10px;
  1032. margin-right:1px;
  1033. cursor: pointer;
  1034. font-weight: 500;
  1035. }
  1036. .buttonColorA{
  1037. color:#FFFFFF;
  1038. background:#0045AF ;
  1039. }
  1040. .buttonColorB{
  1041. color:#999999;
  1042. background:#E0E0E0 ;
  1043. }
  1044. }
  1045. .bottom-max-box{
  1046. font-weight:500;
  1047. flex:1;
  1048. display: flex;
  1049. flex-direction: column;
  1050. .bottom-sensor-box{
  1051. background: #fff;
  1052. width:510px;
  1053. border: 1px solid #E0E0E0;
  1054. border-radius: 0 10px 10px 10px;
  1055. .top-title{
  1056. line-height:18px;
  1057. font-size:16px;
  1058. margin:23px 10px;
  1059. }
  1060. .null-text-p{
  1061. text-align: center;
  1062. font-size:16px;
  1063. color:#999;
  1064. line-height:50px;
  1065. margin:0 30px;
  1066. }
  1067. .sensor-for-max-box{
  1068. .sensor-for-big-box{
  1069. display: inline-block;
  1070. width:158px;
  1071. height:60px;
  1072. margin:0 0 11px 8px;
  1073. border-radius: 10px;
  1074. .sensor-for-min-box{
  1075. display: flex;
  1076. img{
  1077. width:26px;
  1078. height:26px;
  1079. margin:17px 11px;
  1080. }
  1081. div{
  1082. margin:9px 0;
  1083. p{
  1084. color:#fff;
  1085. }
  1086. p:nth-child(1){
  1087. font-size:14px;
  1088. line-height:20px;
  1089. }
  1090. p:nth-child(2){
  1091. font-size:16px;
  1092. line-height:22px;
  1093. }
  1094. }
  1095. }
  1096. }
  1097. .sensor-color-a{
  1098. background: #FF7272;
  1099. color:#fff;
  1100. }
  1101. .sensor-color-b{
  1102. background: #E0E0E0;
  1103. color:#999999;
  1104. }
  1105. .sensor-color-c{
  1106. background: #80D164;
  1107. color:#fff;
  1108. }
  1109. }
  1110. .bottom-text{
  1111. line-height:18px;
  1112. font-size:14px;
  1113. color:#999999;
  1114. margin:40px 10px 15px;
  1115. }
  1116. }
  1117. .bottom-switch-box{
  1118. background: #fff;
  1119. width:510px;
  1120. border: 1px solid #E0E0E0;
  1121. border-radius: 0 10px 10px 10px;
  1122. .top-title{
  1123. line-height:18px;
  1124. font-size:16px;
  1125. margin:23px 10px;
  1126. }
  1127. .null-text-p{
  1128. text-align: center;
  1129. font-size:16px;
  1130. color:#999;
  1131. line-height:50px;
  1132. margin:0 30px;
  1133. }
  1134. .switch-for-max-box{
  1135. .switch-for-big-box{
  1136. display: inline-block;
  1137. .switch-for-min-box{
  1138. width:210px;
  1139. height:60px;
  1140. border:1px solid #E0E0E0;
  1141. border-radius: 10px;
  1142. margin:0 0 20px 30px;
  1143. display: flex;
  1144. .switch-for-min-title{
  1145. font-size:16px;
  1146. line-height:58px;
  1147. width:113px;
  1148. margin-left:12px;
  1149. display:block;
  1150. overflow:hidden;
  1151. text-overflow:ellipsis;
  1152. white-space:nowrap;
  1153. }
  1154. .switch{
  1155. margin-top:14px;
  1156. }
  1157. .switch-null-p{
  1158. font-size:16px;
  1159. line-height:58px;
  1160. color:#999;
  1161. }
  1162. .switch-for-min-button{
  1163. width:70px;
  1164. height:30px;
  1165. line-height:30px;
  1166. font-size:14px;
  1167. color:#0045AF;
  1168. border-radius:6px;
  1169. border: 1px solid #0045AF;
  1170. margin-top:14px;
  1171. text-align: center;
  1172. cursor: pointer;
  1173. }
  1174. }
  1175. }
  1176. }
  1177. }
  1178. .bottom-video-box{
  1179. background: #fff;
  1180. width:510px;
  1181. border: 1px solid #E0E0E0;
  1182. border-radius: 0 10px 10px 10px;
  1183. .top-title{
  1184. line-height:18px;
  1185. font-size:16px;
  1186. margin:23px 10px;
  1187. }
  1188. .null-text-p{
  1189. text-align: center;
  1190. font-size:16px;
  1191. color:#999;
  1192. line-height:50px;
  1193. margin:0 30px;
  1194. }
  1195. .video-for-max-box{
  1196. .switch-for-big-box{
  1197. width:490px;
  1198. height:262px;
  1199. margin:0 auto 14px;
  1200. position: relative;
  1201. .position-p{
  1202. width:42px;
  1203. height:42px;
  1204. text-align: center;
  1205. line-height:42px;
  1206. font-size:18px;
  1207. position: absolute;
  1208. top:0;
  1209. right:0;
  1210. color:#fff;
  1211. cursor: pointer;
  1212. }
  1213. }
  1214. }
  1215. }
  1216. .bottom-alarm-box{
  1217. flex:1;
  1218. display: flex;
  1219. flex-direction: column;
  1220. background: #fff;
  1221. width:510px;
  1222. overflow-x: hidden;
  1223. .alarm-max-box{
  1224. width:510px;
  1225. height:150px;
  1226. display: flex;
  1227. position:relative;
  1228. border: 1px solid #E0E0E0;
  1229. border-radius: 0 10px 10px 10px;
  1230. .alarm-img{
  1231. width:110px;
  1232. height:110px;
  1233. margin:20px;
  1234. }
  1235. .alarm-big-box{
  1236. p:nth-child(1){
  1237. font-size:14px;
  1238. margin:40px 0 25px 0;
  1239. }
  1240. p:nth-child(2){
  1241. width: 60px;
  1242. font-size:12px;
  1243. line-height:24px;
  1244. border-radius: 12px;
  1245. text-align: center;
  1246. }
  1247. .colorTypeA{
  1248. background: rgba(1,131,250,0.2);
  1249. color:#0183FA;
  1250. }
  1251. .colorTypeB{
  1252. background: #ECECEC;
  1253. color:#A2A2A2;
  1254. }
  1255. }
  1256. .alarm-position-box{
  1257. position:absolute;
  1258. bottom:20px;
  1259. right:15px;
  1260. width: 75px;
  1261. height: 30px;
  1262. }
  1263. }
  1264. .alarm-title-box{
  1265. display: flex;
  1266. p{
  1267. line-height:60px;
  1268. font-size:14px;
  1269. }
  1270. p:nth-child(1){
  1271. flex:1;
  1272. }
  1273. p:nth-child(2){
  1274. cursor: pointer;
  1275. }
  1276. }
  1277. }
  1278. .bottom-door-box{
  1279. background: #fff;
  1280. overflow: hidden;
  1281. width:510px;
  1282. overflow-x: hidden;
  1283. border: 1px solid #E0E0E0;
  1284. border-radius: 0 10px 10px 10px;
  1285. position: relative;
  1286. .for-door-box{
  1287. display: flex;
  1288. img{
  1289. width:110px;
  1290. height:110px;
  1291. margin:20px;
  1292. }
  1293. div{
  1294. flex:1;
  1295. p:nth-child(1){
  1296. margin-top:40px;
  1297. color:#3D3D3D;
  1298. font-size:14px;
  1299. line-height:24px;
  1300. }
  1301. p:nth-child(2){
  1302. width:60px;
  1303. line-height:24px;
  1304. border-radius:50px;
  1305. margin-top:20px;
  1306. font-size:12px;
  1307. text-align: center;
  1308. }
  1309. .colorTypeA{
  1310. background: rgba(1,131,250,0.2);
  1311. color:#0183FA;
  1312. }
  1313. .colorTypeB{
  1314. background: #ECECEC;
  1315. color:#A2A2A2;
  1316. }
  1317. }
  1318. }
  1319. .bottom-button-go-route{
  1320. position: absolute;
  1321. line-height:24px;
  1322. font-size:14px;
  1323. color:#0183FA;
  1324. bottom:10px;
  1325. right:15px;
  1326. cursor: pointer;
  1327. }
  1328. }
  1329. .null-data-img{
  1330. width:137px;
  1331. height:137px;
  1332. display: block;
  1333. margin:10px auto;
  1334. }
  1335. }
  1336. }
  1337. }
  1338. }
  1339. </style>
  1340. <style lang="scss">
  1341. .alarm-position-box{
  1342. .switch .el-switch__label {
  1343. position: absolute;
  1344. display: none;
  1345. color: #fff !important;
  1346. }
  1347. .switch .el-switch__label--right {
  1348. z-index: 1;
  1349. }
  1350. .switch .el-switch__label--right span{
  1351. margin-right: 9px;
  1352. }
  1353. .switch .el-switch__label--left {
  1354. z-index: 1;
  1355. }
  1356. .switch .el-switch__label--left span{
  1357. margin-left: 9px;
  1358. }
  1359. .switch .el-switch__label.is-active {
  1360. display: block;
  1361. }
  1362. .switch.el-switch .el-switch__core,
  1363. .el-switch .el-switch__label {
  1364. width: 80px !important;
  1365. height:30px!important;
  1366. line-height:30px!important;
  1367. -webkit-border-radius: 20px!important;
  1368. -moz-border-radius: 20px!important;
  1369. border-radius: 20px!important;
  1370. margin: 0;
  1371. position: absolute;
  1372. top: 0;
  1373. }
  1374. .switch .el-switch__label--left span{
  1375. margin-left:30px!important;
  1376. }
  1377. .switch .el-switch__label--right span{
  1378. margin-left:8px!important;
  1379. }
  1380. .el-switch__core:after{
  1381. height:24px!important;
  1382. width:24px!important;
  1383. top:2px!important;
  1384. }
  1385. .el-switch.is-checked .el-switch__core::after{
  1386. margin-left: -25px!important;
  1387. }
  1388. .el-switch{
  1389. margin:10px auto 0;
  1390. display: block;
  1391. width:80px!important;
  1392. height:4px!important;
  1393. }
  1394. }
  1395. </style>