index.vue 52 KB

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