index.vue 52 KB

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