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