indexTwo.vue 50 KB

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