index.vue 52 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341
  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="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,startUrlJiNanDaXue } 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. startUrlJiNanDaXue(obj).then(res => {
  548. if(res.code == 200){
  549. if(!res.data[0]){
  550. this.msgError("视频配置异常请联系管理员")
  551. this.newData.videoData = [];
  552. this.pageType = 6;
  553. }else{
  554. let videoList = [];
  555. for(let i=0;i<res.data.length;i++){
  556. let text = 'ws://lab.sxitdlc.com/jinandaxue/stream/';
  557. let url = res.data[i].result.body.data.ws_flv;
  558. url = url.split("rtp/");
  559. let newUrl = text+'rtp/'+url[1];
  560. let obj = {
  561. name:response.data.name + response.data.subAddrr.room,
  562. videoType:"flv",
  563. divId:'divId'+i,
  564. url:newUrl,
  565. }
  566. videoList.push(obj)
  567. }
  568. this.$set(this.newData,'videoData',videoList);
  569. this.pageType = 6;
  570. }
  571. }
  572. });
  573. }
  574. })
  575. },
  576. // 开启关闭验证
  577. async changeIsNeedCaptcha (row) {
  578. let self = this;
  579. console.log(row)
  580. if(row.state.code!=3 && row.state.code!=4){
  581. return
  582. }
  583. let text = row.state.code==3?'关闭':(row.state.code==4?'开启':'')
  584. this.$confirm(`是否`+text+`此设备`, "提示", {
  585. confirmButtonText: "确定",
  586. cancelButtonText: "取消",
  587. type: "warning"
  588. }).then(async () => {
  589. self.switchChange(row)
  590. }).catch(() => {
  591. })
  592. },
  593. //开关按钮
  594. switchChange(row){
  595. let switchData = {
  596. id:row.id,
  597. switchVal:row.state.code==3?'close':(row.state.code==4?'open':'')
  598. };
  599. hardWareControl(switchData).then(response => {
  600. console.log(response);
  601. if(response.code==200){
  602. row.state.code = row.state.code==3?4:(row.state.code==4?3:'')
  603. this.msgSuccess("操作成功")
  604. }
  605. });
  606. },
  607. //切换实验室展示数据
  608. rightButtonClick(type){
  609. let self = this;
  610. if(this.rightButtonType != type){
  611. this.rightButtonType = type;
  612. this.videoOff();
  613. if(type == 3){
  614. let self = this;
  615. let list = [];
  616. if(self.checkedSubject.labHardwareVOList){
  617. for(let i=0;i<self.checkedSubject.labHardwareVOList.length;i++){
  618. if(self.checkedSubject.labHardwareVOList[i].hardwareTypeEnum.enumName == 'VIDEO_MONITOR'){
  619. list.push(self.checkedSubject.labHardwareVOList[i].hardwareNUM);
  620. }
  621. }
  622. if(list[0]){
  623. let obj = {
  624. count:"100",
  625. deviceIds:list+'',
  626. page:"1",
  627. };
  628. let urlText = window.location.href;
  629. if(urlText.indexOf("192.168") != -1){
  630. startUrl(obj).then(res => {
  631. if(res.code == 200){
  632. if(!res.data[0]){
  633. this.msgError("视频配置异常请联系管理员")
  634. return
  635. }
  636. let videoList = [];
  637. for(let i=0;i<res.data.length;i++){
  638. let obj = {
  639. name:self.checkedSubject.name + self.checkedSubject.subAddrr.room,
  640. videoType:"flv",
  641. divId:'divId'+i,
  642. url:res.data[i].result.body.data.ws_flv,
  643. }
  644. videoList.push(obj)
  645. }
  646. this.$set(this.checkedSubject,'videoData',videoList);
  647. if(this.rightButtonType == 3){
  648. setTimeout(function(){
  649. self.videoFunction();
  650. },1000);
  651. }
  652. }
  653. });
  654. }else{
  655. startUrlJiNanDaXue(obj).then(res => {
  656. if(res.code == 200){
  657. if(!res.data[0]){
  658. this.msgError("视频配置异常请联系管理员")
  659. return
  660. }
  661. let videoList = [];
  662. for(let i=0;i<res.data.length;i++){
  663. let text = 'ws://lab.sxitdlc.com/jinandaxue/stream/';
  664. let url = res.data[i].result.body.data.ws_flv;
  665. url = url.split("rtp/");
  666. let newUrl = text+'rtp/'+url[1];
  667. let obj = {
  668. name:self.checkedSubject.name + self.checkedSubject.subAddrr.room,
  669. videoType:"flv",
  670. divId:'divId'+i,
  671. url:newUrl,
  672. }
  673. videoList.push(obj)
  674. }
  675. this.$set(this.checkedSubject,'videoData',videoList);
  676. if(this.rightButtonType == 3){
  677. setTimeout(function(){
  678. self.videoFunction();
  679. },1000);
  680. }
  681. }
  682. });
  683. }
  684. }else{
  685. this.$set(this.checkedSubject,'videoData',[]);
  686. }
  687. }else{
  688. this.$set(this.checkedSubject,'videoData',[]);
  689. }
  690. }
  691. }
  692. },
  693. //选中实验室
  694. handleCurrentChange(val){
  695. let self = this;
  696. if(val.id != this.checkedSubject.id){
  697. this.videoOff();
  698. this.subjectInfo(val.id);
  699. this.subId = val.id;
  700. this.$set(this,'queryParamsTwo',{
  701. pageNum:1,
  702. pageSize:20,
  703. });
  704. this.getEnablelist();
  705. this.getHxpAlarmRecordNoAuthList();
  706. }
  707. },
  708. //获取实验室详情
  709. subjectInfo(id){
  710. let type = 1; //硬件 //0全部
  711. subjectInfo(id,type).then(response => {
  712. this.$set(this,'checkedSubject',response.data);
  713. this.$set(this.checkedSubject,'videoData',[]);
  714. this.rightButtonType = 1;
  715. })
  716. },
  717. //编辑按钮
  718. handleCommand(command, row){
  719. switch (command) {
  720. case "1":
  721. console.log('关联配置');
  722. this.clickPage(6,row);
  723. break;
  724. case "2":
  725. console.log('物联配置');
  726. this.clickPage(4,row);
  727. break;
  728. case "3":
  729. console.log('准入配置');
  730. this.clickPage(5,row);
  731. break;
  732. case "4":
  733. console.log('编辑');
  734. this.clickPage(3,row);
  735. break;
  736. case "5":
  737. console.log('删除');
  738. break;
  739. default:
  740. break;
  741. }
  742. },
  743. //保存当前排序
  744. liveSort(row){
  745. console.log("row",row);
  746. let obj = {
  747. sort:row.diyOrder
  748. }
  749. this.sort = JSON.parse(JSON.stringify(obj));
  750. },
  751. //编辑排序
  752. editSort(row){
  753. let self = this;
  754. if(row.diyOrder != this.sort.sort){
  755. self.$confirm('是否确认修改排序?', "", {
  756. confirmButtonText: "确定",
  757. cancelButtonText: "取消",
  758. type: "warning"
  759. }).then(function() {
  760. let obj = {
  761. id:row.id,
  762. diyOrder:row.diyOrder,
  763. };
  764. updateSubject(obj).then(response => {
  765. self.msgSuccess("修改成功");
  766. self.getList();
  767. });
  768. }).then(() => {}).catch(() => {
  769. let obj = JSON.parse(JSON.stringify(self.sort));
  770. row.diyOrder = obj.sort
  771. });
  772. }
  773. },
  774. /** 搜索按钮操作 */
  775. handleQuery() {
  776. this.queryParams.pageNum = 1;
  777. this.getList();
  778. },
  779. /** 重置按钮操作 */
  780. resetQuery() {
  781. this.$set(this,'queryParams',{
  782. pageNum: 1,
  783. pageSize:20,
  784. deptId:"",
  785. name: '',
  786. });
  787. // this.resetForm("queryForm");
  788. this.handleQuery();
  789. },
  790. /** 查询实验室列表 */
  791. getList() {
  792. this.loading = true;
  793. this.offMQTT();
  794. authListSubject(this.queryParams).then(response => {
  795. this.subjectList = response.rows;
  796. this.total = response.total;
  797. this.loading = false;
  798. if(response.rows[0]){
  799. this.$refs.multipleTable.setCurrentRow(response.rows[0]);
  800. this.subjectInfo(response.rows[0].id);
  801. }
  802. let idList = [];
  803. for(let i=0;i<response.rows.length;i++){
  804. idList.push(response.rows[i].id)
  805. }
  806. this.$set(this,'mqttIdList',idList);
  807. this.subscriptionMQTT();
  808. });
  809. },
  810. /** 查询学院列表 */
  811. getDeptList() {
  812. listDepartments().then(response => {
  813. this.$set(this, 'deptOptions', response.data)
  814. });
  815. },
  816. //MQTT订阅
  817. subscriptionMQTT(){
  818. let self = this;
  819. this.client = mqtt.connect(process.env.VUE_APP_BASE_MQTT_API, {
  820. username: process.env.VUE_APP_BASE_MQTT_USERNAME,
  821. password: process.env.VUE_APP_BASE_MQTT_PASSWORD
  822. });
  823. this.client.on("connect", e =>{
  824. console.log("连接成功");
  825. for(let i = 0; i< self.mqttIdList.length;i++){
  826. this.client.subscribe(this.mtopic+self.mqttIdList[i], (err) => {
  827. if (!err) {
  828. console.log("订阅成功:" + this.mtopic+self.mqttIdList[i]);
  829. }
  830. });
  831. this.client.subscribe(this.mtopicOne+self.mqttIdList[i], (err) => {
  832. if (!err) {
  833. console.log("订阅成功:" + this.mtopicOne+self.mqttIdList[i]);
  834. }
  835. });
  836. }
  837. });
  838. this.client.on("message", (topic, message) => {
  839. if (message){
  840. let data = JSON.parse(message)
  841. // console.log("MQTT----message",data)
  842. if(data.data.subId){
  843. //传感器
  844. // console.log("传感器",data.data.subId,'---------',data);
  845. if(self.checkedSubject.id){
  846. if(data.data.subId&&data.data.subId == self.checkedSubject.id){
  847. self.$set(self.checkedSubject,'sensorFunctionStatusList',data.data.functionStatuses);
  848. self.$set(self.checkedSubject.sensorFunctionStatusList[0],'sendDate',data.sendDate);
  849. }
  850. }
  851. if(self.newData.id){
  852. if(data.data.subId&&data.data.subId == self.newData.id){
  853. self.$set(self.newData,'sensorFunctionStatusList',data.data.functionStatuses);
  854. self.$set(self.newData.sensorFunctionStatusList[0],'sendDate',data.sendDate);
  855. }
  856. }
  857. }else{
  858. //硬件
  859. // console.log("硬件",data);
  860. for (let i = 0; i < data.data.length; i++) {
  861. if (self.checkedSubject.labHardwareVOList) {
  862. for (let k = 0; k < self.checkedSubject.labHardwareVOList.length; k++) {
  863. if (self.checkedSubject.labHardwareVOList[k].id == data.data[i].num) {
  864. if (data.data[i].hardwareOperate == 'CLOSE') {
  865. self.checkedSubject.labHardwareVOList[k].state.code = 4;
  866. } else if (data.data[i].hardwareOperate == 'OPEN') {
  867. self.checkedSubject.labHardwareVOList[k].state.code = 3;
  868. } else if (data.data[i].hardwareOperate == 'OFFLINE') {
  869. self.checkedSubject.labHardwareVOList[k].state.code = 0;
  870. }
  871. }
  872. }
  873. }
  874. if(self.newData.labHardwareVOList){
  875. for(let k=0;k<self.newData.labHardwareVOList.length;k++){
  876. if(self.newData.labHardwareVOList[k].id == data.data[i].num){
  877. if(data.data[i].hardwareOperate == 'CLOSE'){
  878. self.newData.labHardwareVOList[k].state.code = 4;
  879. }else if(data.data[i].hardwareOperate == 'OPEN'){
  880. self.newData.labHardwareVOList[k].state.code = 3;
  881. }else if(data.data[i].hardwareOperate == 'OFFLINE'){
  882. self.newData.labHardwareVOList[k].state.code = 0;
  883. }
  884. }
  885. }
  886. }
  887. }
  888. }
  889. }
  890. });
  891. },
  892. //取消订阅关闭MQTT连接
  893. offMQTT(){
  894. let self = this;
  895. if (self.mqttIdList[0]){
  896. for(let i=0;i<self.mqttIdList.length;i++){
  897. self.client.unsubscribe(self.mtopic+self.mqttIdList[i], error => {
  898. if (error) {
  899. console.log('Unsubscribe error', error)
  900. }
  901. })
  902. self.client.unsubscribe(self.mtopicOne+self.mqttIdList[i], error => {
  903. if (error) {
  904. console.log('Unsubscribe error', error)
  905. }
  906. })
  907. }
  908. self.client.end();
  909. self.client = {};
  910. }
  911. },
  912. //视频方法
  913. videoFunction(){
  914. let self = this;
  915. // self.videoList = [];
  916. for(let i=0;i<self.checkedSubject.videoData.length;i++){
  917. let obj = {
  918. player :{},
  919. flvPlayer:{}
  920. };
  921. obj.player = document.getElementById(self.checkedSubject.videoData[i].divId);
  922. // if (flvjs.isSupported()) {
  923. obj.flvPlayer = flvjs.createPlayer(
  924. {
  925. // isLive: true, //=> 是否为直播流
  926. // hasAudio: false, //=> 是否开启声音
  927. type: self.checkedSubject.videoData[i].videoType, //媒体类型 flv 或 mp4
  928. url: self.checkedSubject.videoData[i].url //视频流地址
  929. },
  930. {
  931. enableStashBuffer: true,//启用 IO 存储缓冲区。 如果您需要实时流播放(最小延迟),请设置为 false,但如果存在网络抖动,则可能会停止。
  932. stashInitialSize: 128,//IO 存储缓冲区初始大小。 默认值为 384KB。 指示合适的大小可以改善视频加载/搜索时间。
  933. isLive: true,//是否是直播
  934. lazyLoadRecoverDuration: 30,//指示以秒为单位的lazyLoad 恢复时间边界。
  935. autoCleanupSourceBuffer: true,//进行自动清理
  936. autoCleanupMaxBackwardDuration: 3 * 60,//3 * 60 当向后缓冲持续时间超过这个值(以秒为单位)时,对 SourceBuffer 进行自动清理
  937. autoCleanupMinBackwardDuration: 2 * 60,//2 * 60 指示在执行自动清理时为后向缓冲区保留的持续时间(以秒为单位)。
  938. }
  939. );
  940. self.videoList.push(obj);
  941. // }
  942. console.log("i",i)
  943. }
  944. for(let i=0;i<self.videoList.length;i++){
  945. self.videoList[i].flvPlayer.attachMediaElement(self.videoList[i].player);
  946. self.videoList[i].flvPlayer.load(); //加载
  947. self.videoList[i].flvPlayer.play(); //加载
  948. }
  949. },
  950. //视屏全屏方法
  951. videoFullScreen(index){
  952. this.$refs.videoRef[index].webkitRequestFullScreen();
  953. },
  954. //断开视频流
  955. videoOff(){
  956. let self = this;
  957. if(self.videoList[0]){
  958. for(let i=0;i<self.videoList.length;i++){
  959. self.videoList[i].flvPlayer.pause();
  960. self.videoList[i].flvPlayer.unload();
  961. self.videoList[i].flvPlayer.detachMediaElement();
  962. self.videoList[i].flvPlayer.destroy();
  963. self.videoList[i].flvPlayer = null;
  964. }
  965. self.videoList = [];
  966. }
  967. },
  968. },
  969. beforeDestroy() {
  970. //清除定时器
  971. let self = this;
  972. self.videoOff();
  973. self.offMQTT();
  974. console.log("beforeDestroy");
  975. },
  976. }
  977. </script>
  978. <style scoped lang="scss">
  979. .subject{
  980. flex:1;
  981. display: flex!important;
  982. flex-direction: column;
  983. overflow: hidden;
  984. *{
  985. margin:0;
  986. }
  987. .subject-page{
  988. flex:1;
  989. display: flex;
  990. flex-direction: column;
  991. padding:20px;
  992. overflow: hidden;
  993. border-radius:10px;
  994. margin:5px 20px 20px 10px;
  995. box-shadow: 0 0 8px 1px rgba(0, 0, 0, 0.1);
  996. .subject-page-min{
  997. flex:1;
  998. display: flex;
  999. overflow: hidden;
  1000. }
  1001. .left-subject-list{
  1002. flex:1;
  1003. display: flex;
  1004. flex-direction: column;
  1005. margin-right:20px;
  1006. overflow: hidden;
  1007. }
  1008. .overflow-box{
  1009. overflow: hidden;
  1010. }
  1011. .right-subject-box{
  1012. width:514px;
  1013. display: flex;
  1014. flex-direction: column;
  1015. .top-button-box{
  1016. display: flex;
  1017. div{
  1018. width:110px;
  1019. height:40px;
  1020. line-height:40px;
  1021. font-size:16px;
  1022. text-align: center;
  1023. border-top-right-radius: 10px;
  1024. border-top-left-radius: 10px;
  1025. margin-right:1px;
  1026. cursor: pointer;
  1027. font-weight: 500;
  1028. }
  1029. .buttonColorA{
  1030. color:#FFFFFF;
  1031. background:#0045AF ;
  1032. }
  1033. .buttonColorB{
  1034. color:#999999;
  1035. background:#E0E0E0 ;
  1036. }
  1037. }
  1038. .bottom-max-box{
  1039. font-weight:500;
  1040. flex:1;
  1041. display: flex;
  1042. flex-direction: column;
  1043. .bottom-sensor-box{
  1044. background: #fff;
  1045. width:510px;
  1046. border: 1px solid #E0E0E0;
  1047. border-radius: 0 10px 10px 10px;
  1048. .top-title{
  1049. line-height:18px;
  1050. font-size:16px;
  1051. margin:23px 10px;
  1052. }
  1053. .null-text-p{
  1054. text-align: center;
  1055. font-size:16px;
  1056. color:#999;
  1057. line-height:50px;
  1058. margin:0 30px;
  1059. }
  1060. .sensor-for-max-box{
  1061. .sensor-for-big-box{
  1062. display: inline-block;
  1063. width:158px;
  1064. height:60px;
  1065. margin:0 0 11px 8px;
  1066. border-radius: 10px;
  1067. .sensor-for-min-box{
  1068. display: flex;
  1069. img{
  1070. width:26px;
  1071. height:26px;
  1072. margin:17px 11px;
  1073. }
  1074. div{
  1075. margin:9px 0;
  1076. p{
  1077. color:#fff;
  1078. }
  1079. p:nth-child(1){
  1080. font-size:14px;
  1081. line-height:20px;
  1082. }
  1083. p:nth-child(2){
  1084. font-size:16px;
  1085. line-height:22px;
  1086. }
  1087. }
  1088. }
  1089. }
  1090. .sensor-color-a{
  1091. background: #FF7272;
  1092. color:#fff;
  1093. }
  1094. .sensor-color-b{
  1095. background: #E0E0E0;
  1096. color:#999999;
  1097. }
  1098. .sensor-color-c{
  1099. background: #80D164;
  1100. color:#fff;
  1101. }
  1102. }
  1103. .bottom-text{
  1104. line-height:18px;
  1105. font-size:14px;
  1106. color:#999999;
  1107. margin:40px 10px 15px;
  1108. }
  1109. }
  1110. .bottom-switch-box{
  1111. background: #fff;
  1112. width:510px;
  1113. border: 1px solid #E0E0E0;
  1114. border-radius: 0 10px 10px 10px;
  1115. .top-title{
  1116. line-height:18px;
  1117. font-size:16px;
  1118. margin:23px 10px;
  1119. }
  1120. .null-text-p{
  1121. text-align: center;
  1122. font-size:16px;
  1123. color:#999;
  1124. line-height:50px;
  1125. margin:0 30px;
  1126. }
  1127. .switch-for-max-box{
  1128. .switch-for-big-box{
  1129. display: inline-block;
  1130. .switch-for-min-box{
  1131. width:210px;
  1132. height:60px;
  1133. border:1px solid #E0E0E0;
  1134. border-radius: 10px;
  1135. margin:0 0 20px 30px;
  1136. display: flex;
  1137. .switch-for-min-title{
  1138. font-size:16px;
  1139. line-height:58px;
  1140. width:113px;
  1141. margin-left:12px;
  1142. display:block;
  1143. overflow:hidden;
  1144. text-overflow:ellipsis;
  1145. white-space:nowrap;
  1146. }
  1147. .switch{
  1148. margin-top:14px;
  1149. }
  1150. .switch-null-p{
  1151. font-size:16px;
  1152. line-height:58px;
  1153. color:#999;
  1154. }
  1155. .switch-for-min-button{
  1156. width:70px;
  1157. height:30px;
  1158. line-height:30px;
  1159. font-size:14px;
  1160. color:#0045AF;
  1161. border-radius:6px;
  1162. border: 1px solid #0045AF;
  1163. margin-top:14px;
  1164. text-align: center;
  1165. cursor: pointer;
  1166. }
  1167. }
  1168. }
  1169. }
  1170. }
  1171. .bottom-video-box{
  1172. background: #fff;
  1173. width:510px;
  1174. border: 1px solid #E0E0E0;
  1175. border-radius: 0 10px 10px 10px;
  1176. .top-title{
  1177. line-height:18px;
  1178. font-size:16px;
  1179. margin:23px 10px;
  1180. }
  1181. .null-text-p{
  1182. text-align: center;
  1183. font-size:16px;
  1184. color:#999;
  1185. line-height:50px;
  1186. margin:0 30px;
  1187. }
  1188. .video-for-max-box{
  1189. .switch-for-big-box{
  1190. width:490px;
  1191. height:262px;
  1192. margin:0 auto 14px;
  1193. position: relative;
  1194. .position-p{
  1195. width:42px;
  1196. height:42px;
  1197. text-align: center;
  1198. line-height:42px;
  1199. font-size:18px;
  1200. position: absolute;
  1201. top:0;
  1202. right:0;
  1203. color:#fff;
  1204. cursor: pointer;
  1205. }
  1206. }
  1207. }
  1208. }
  1209. .bottom-alarm-box{
  1210. flex:1;
  1211. display: flex;
  1212. flex-direction: column;
  1213. background: #fff;
  1214. width:510px;
  1215. overflow-x: hidden;
  1216. .alarm-max-box{
  1217. width:510px;
  1218. height:150px;
  1219. display: flex;
  1220. position:relative;
  1221. border: 1px solid #E0E0E0;
  1222. border-radius: 0 10px 10px 10px;
  1223. .alarm-img{
  1224. width:110px;
  1225. height:110px;
  1226. margin:16px 24px 0 30px;
  1227. }
  1228. .alarm-big-box{
  1229. p:nth-child(1){
  1230. font-size:16px;
  1231. margin:40px 0 25px 0;
  1232. }
  1233. p:nth-child(2){
  1234. width: 60px;
  1235. font-size:12px;
  1236. font-weight:700;
  1237. line-height:24px;
  1238. background: rgba(204,230,254);
  1239. border-radius: 12px;
  1240. color: #0183FA;
  1241. text-align: center;
  1242. }
  1243. }
  1244. .alarm-position-box{
  1245. position:absolute;
  1246. bottom:20px;
  1247. right:15px;
  1248. width: 75px;
  1249. height: 30px;
  1250. }
  1251. }
  1252. .alarm-title-box{
  1253. display: flex;
  1254. p{
  1255. line-height:60px;
  1256. font-size:14px;
  1257. }
  1258. p:nth-child(1){
  1259. flex:1;
  1260. }
  1261. p:nth-child(2){
  1262. cursor: pointer;
  1263. }
  1264. }
  1265. }
  1266. .null-data-img{
  1267. width:137px;
  1268. height:137px;
  1269. display: block;
  1270. margin:10px auto;
  1271. }
  1272. }
  1273. }
  1274. }
  1275. }
  1276. </style>
  1277. <style lang="scss">
  1278. .alarm-position-box{
  1279. .switch .el-switch__label {
  1280. position: absolute;
  1281. display: none;
  1282. color: #fff !important;
  1283. }
  1284. .switch .el-switch__label--right {
  1285. z-index: 1;
  1286. }
  1287. .switch .el-switch__label--right span{
  1288. margin-right: 9px;
  1289. }
  1290. .switch .el-switch__label--left {
  1291. z-index: 1;
  1292. }
  1293. .switch .el-switch__label--left span{
  1294. margin-left: 9px;
  1295. }
  1296. .switch .el-switch__label.is-active {
  1297. display: block;
  1298. }
  1299. .switch.el-switch .el-switch__core,
  1300. .el-switch .el-switch__label {
  1301. width: 80px !important;
  1302. height:30px!important;
  1303. line-height:30px!important;
  1304. -webkit-border-radius: 20px!important;
  1305. -moz-border-radius: 20px!important;
  1306. border-radius: 20px!important;
  1307. margin: 0;
  1308. position: absolute;
  1309. top: 0;
  1310. }
  1311. .switch .el-switch__label--left span{
  1312. margin-left:30px!important;
  1313. }
  1314. .switch .el-switch__label--right span{
  1315. margin-left:8px!important;
  1316. }
  1317. .el-switch__core:after{
  1318. height:24px!important;
  1319. width:24px!important;
  1320. top:2px!important;
  1321. }
  1322. .el-switch.is-checked .el-switch__core::after{
  1323. margin-left: -25px!important;
  1324. }
  1325. .el-switch{
  1326. margin:10px auto 0;
  1327. display: block;
  1328. width:80px!important;
  1329. height:4px!important;
  1330. }
  1331. }
  1332. </style>