indexOne.vue 52 KB

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