index.vue 66 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828
  1. <template>
  2. <div class="subject">
  3. <div class="subject-page" v-if="pageType == 1">
  4. <div class="subject-page-min">
  5. <div class="left-subject-list" >
  6. <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" style="border-bottom:1px solid #D8D8D8">
  7. <el-form-item label="学院" prop="deptId" label-width="60px">
  8. <el-select v-model="queryParams.deptId" placeholder="请选择学院" clearable size="small">
  9. <el-option
  10. v-for="dict in deptOptions"
  11. :key="dict.deptId"
  12. :label="dict.deptName"
  13. :value="dict.deptId"
  14. ></el-option>
  15. </el-select>
  16. </el-form-item>
  17. <el-form-item label="实验室名称" prop="name" label-width="100px">
  18. <el-input
  19. v-model="queryParams.name"
  20. placeholder="请输入实验室名称"
  21. clearable
  22. size="small"
  23. />
  24. </el-form-item>
  25. <el-form-item style="float: right;">
  26. <el-col :span="1.5" style="margin-bottom:26px;margin-right: 20px">
  27. <p class="add-button-one-120"
  28. @click="clickPage(2)"
  29. v-hasPermi="['laboratory:subject:add']"
  30. ><i class="el-icon-plus"></i>新增实验室</p>
  31. </el-col>
  32. </el-form-item>
  33. <el-form-item style="margin-right: 20px;">
  34. <p class="inquire-button-one" style="margin-left:20px;" @click="handleQuery">查询</p>
  35. <p class="reset-button-one" style="margin-left:20px;" @click="resetQuery">重置</p>
  36. </el-form-item>
  37. </el-form>
  38. <div class="table_border">
  39. <el-table ref="multipleTable" border :data="subjectList" highlight-current-row @current-change="handleCurrentChange" style="cursor: pointer;">
  40. <el-table-column label="排序" align="left" prop="id" width="80">
  41. <template slot-scope="scope">
  42. <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>
  43. </template>
  44. </el-table-column>
  45. <el-table-column label="实验室名称" align="left" prop="name" show-overflow-tooltip/>
  46. <el-table-column label="房间号" align="left" prop="room" width="120" show-overflow-tooltip/>
  47. <el-table-column label="分类/分级" align="left" prop="levelName" width="150" show-overflow-tooltip>
  48. <template slot-scope="scope">
  49. <span >{{scope.row.typeName}}/</span>
  50. <span :style="'color:'+scope.row.fiedColor+';'">{{scope.row.levelName}}</span>
  51. </template>
  52. </el-table-column>
  53. <el-table-column label="实验室责任人" align="left" prop="adminName" width="130" show-overflow-tooltip/>
  54. <el-table-column label="安全责任人" align="left" prop="safeUserName" width="200" show-overflow-tooltip/>
  55. <el-table-column label="操作" align="left" width="160">
  56. <template slot-scope="scope">
  57. <div style="display: flex;height:30px;">
  58. <p class="table-min-button" style="margin-right:10px;" v-hasPermi="['laboratory:subject:query']" @click="clickPage(7,scope.row)">详情</p>
  59. <el-dropdown trigger="click" size="mini" @command="(command) => handleCommand(command, scope.row)">
  60. <p class="table-min-button">更多<i class="el-icon-d-arrow-right"></i></p>
  61. <el-dropdown-menu slot="dropdown" style="margin:0!important;">
  62. <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>
  63. <el-dropdown-item style="height:36px;line-height:36px;width:90px;text-align: center" command="2">物联配置</el-dropdown-item>
  64. <el-dropdown-item style="height:36px;line-height:36px;width:90px;text-align: center" command="3" v-hasPermi="['laboratory:subjectmaterial:add']">准入配置</el-dropdown-item>
  65. <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>
  66. <!--<el-dropdown-item style="height:36px;line-height:36px;width:90px;text-align: center" command="5"-->
  67. <!--v-hasPermi="['laboratory:subject:remove']">删除</el-dropdown-item>-->
  68. </el-dropdown-menu>
  69. </el-dropdown>
  70. </div>
  71. </template>
  72. </el-table-column>
  73. </el-table>
  74. <pagination
  75. style="margin-top:10px;"
  76. v-show="total>0"
  77. :total="total"
  78. :page.sync="queryParams.pageNum"
  79. :limit.sync="queryParams.pageSize"
  80. @pagination="getList"
  81. />
  82. </div>
  83. </div>
  84. <div class="right-subject-box scrollbar-box" :class="rightButtonType == 4?'overflow-box':''" v-if="checkedSubject.id">
  85. <div class="top-button-box">
  86. <div :class="rightButtonType == 1 ? 'buttonColorA' : 'buttonColorB'" @click="rightButtonClick(1)">传感器监测</div>
  87. <div :class="rightButtonType == 2 ? 'buttonColorA' : 'buttonColorB'" @click="rightButtonClick(2)">物联控制</div>
  88. <div :class="rightButtonType == 3 ? 'buttonColorA' : 'buttonColorB'" @click="rightButtonClick(3)">视频监控</div>
  89. <div :class="rightButtonType == 4 ? 'buttonColorA' : 'buttonColorB'" @click="rightButtonClick(4)">声光报警</div>
  90. <!--<div :class="rightButtonType == 5 ? 'buttonColorA' : 'buttonColorB'" @click="rightButtonClick(5)">智能门禁</div>-->
  91. </div>
  92. <!--传感器-->
  93. <div class="bottom-max-box" :class="rightButtonType == 4?'overflow-box':''">
  94. <div class="bottom-sensor-box" v-if="rightButtonType == 1">
  95. <p class="top-title">
  96. <el-tooltip class="item" effect="dark" :content="checkedSubject.deptName" placement="bottom">
  97. <i>{{checkedSubject.deptName}}</i>
  98. </el-tooltip>
  99. <el-tooltip class="item" effect="dark" :content="checkedSubject.subAddrr.buildName+checkedSubject.subAddrr.floorName" placement="bottom">
  100. <i>当前位置:{{checkedSubject.subAddrr.buildName}}{{checkedSubject.subAddrr.floorName}}</i>
  101. </el-tooltip>
  102. </p>
  103. <div class="sensor-for-max-box scrollbar-box" v-if="checkedSubject.sensorFunctionStatusList[0]">
  104. <div class="sensor-for-big-box"
  105. :class="item.type == 1 ? 'sensor-color-a' : (item.type == 2 ? 'sensor-color-b' : 'sensor-color-c')"
  106. v-if="item.funNum != 'huoyan'"
  107. v-for="(item,index) in checkedSubject.sensorFunctionStatusList" :key="index">
  108. <div class="sensor-for-min-box">
  109. <img src="@/assets/ZDimages/subject/icon_bj_wd.png" v-if="item.funNum == 'wendu'">
  110. <img src="@/assets/ZDimages/subject/icon_bj_sd.png" v-if="item.funNum == 'shidu'">
  111. <img src="@/assets/ZDimages/subject/icon_bj_eyht.png" v-if="item.funNum == 'co'">
  112. <img src="@/assets/ZDimages/subject/icon_bj_jwnd.png" v-if="item.funNum == 'jiawan'">
  113. <img src="@/assets/ZDimages/subject/icon_sy_yqnd.png" v-if="item.funNum == 'o2'">
  114. <img src="@/assets/ZDimages/subject/icon_bj_yg.png" v-if="item.funNum == 'yanwu'">
  115. <img src="@/assets/ZDimages/subject/icon_sy_dqy.png" v-if="item.funNum == 'daqiya'">
  116. <img src="@/assets/ZDimages/subject/icon_syspz_voc.png" v-if="item.funNum == 'voc'">
  117. <img src="@/assets/ZDimages/subject/icon_syspz_tvoc.png" v-if="item.funNum == 'tvoc'">
  118. <img src="@/assets/ZDimages/subject/icon_sy_mcnd.png" v-if="item.funNum == 'so2'">
  119. <img src="@/assets/ZDimages/subject/icon_bj_yyhd.png" v-if="item.funNum == 'no1'">
  120. <img src="@/assets/ZDimages/subject/icon_bj_dqy.png" v-if="item.funNum == 'fenchen'">
  121. <img src="@/assets/ZDimages/subject/icon_bj_qq.png" v-if="item.funNum == 'H2'">
  122. <img src="@/assets/ZDimages/subject/guangqi.png" v-if="item.funNum == 'guangqi'">
  123. <img src="@/assets/ZDimages/subject/lvqi.png" v-if="item.funNum == 'lvqi'">
  124. <img src="@/assets/ZDimages/subject/icon_syspz_jiaquan.png" v-if="item.funNum == 'jiaquan'">
  125. <img src="@/assets/ZDimages/subject/icon_syspz_hwcw.png" v-if="item.funNum == 'hwcwy'">
  126. <div>
  127. <el-tooltip class="item" effect="dark" :content="item.describe" placement="bottom">
  128. <p>{{item.describe|ellipsis}}</p>
  129. </el-tooltip>
  130. <p>{{item.formatVal}}</p>
  131. </div>
  132. </div>
  133. </div>
  134. </div>
  135. <img class="null-data-img" src="@/assets/ZDimages/null-data.png" v-if="!checkedSubject.sensorFunctionStatusList[0]">
  136. <p class="null-text-p" v-if="!checkedSubject.sensorFunctionStatusList[0]">暂无环境监测信息,请在更多操作-物联设备配置中进行添加</p>
  137. <p class="bottom-text" v-if="checkedSubject.sensorFunctionStatusList[0]">数据上报时间:{{checkedSubject.sensorFunctionStatusList[0].sendDate}}</p>
  138. </div>
  139. <div class="bottom-switch-box" v-if="rightButtonType == 2">
  140. <p class="top-title">
  141. <el-tooltip class="item" effect="dark" :content="checkedSubject.deptName" placement="bottom">
  142. <i>{{checkedSubject.deptName}}</i>
  143. </el-tooltip>
  144. <el-tooltip class="item" effect="dark" :content="checkedSubject.subAddrr.buildName+checkedSubject.subAddrr.floorName" placement="bottom">
  145. <i>当前位置:{{checkedSubject.subAddrr.buildName}}{{checkedSubject.subAddrr.floorName}}</i>
  146. </el-tooltip>
  147. </p>
  148. <div class="switch-for-max-box scrollbar-box" v-show="checkedSubject.VOlist[0]" v-hasPermi="['laboratory:subcontrol:set']">
  149. <div class="switch-for-big-box" v-for="(item,index) in checkedSubject.VOlist" :key="index">
  150. <div class="switch-for-min-box" v-if="item.hardwareTypeEnum.enumName == 'SWITCH'">
  151. <div class="switch-for-min-box_t">
  152. <p class="switch-for-min-title">{{item.hardwareName}}</p>
  153. <p class="switch-null-p" v-if="item.state.code != 3 && item.state.code != 4" >{{item.state.name}}</p>
  154. </div>
  155. <div class="switch-for-min-box_b">
  156. <el-switch
  157. v-if="item.state.code == 3||item.state.code == 4"
  158. class="switch"
  159. @click.native="changeIsNeedCaptcha(item)"
  160. v-model="item.state.code"
  161. :active-value="3"
  162. :inactive-value="4"
  163. active-text="开启"
  164. inactive-text="关闭"
  165. disabled>
  166. </el-switch>
  167. </div>
  168. </div>
  169. <div class="switch-for-min-box" v-if="item.hardwareTypeEnum.enumName == 'AI_VENTILATION'">
  170. <div class="switch-for-min-box_t">
  171. <p class="switch-for-min-title">{{item.hardwareName}}</p>
  172. <p class="switch-null-p" v-if="item.state.code != 3 && item.state.code != 4 && item.pcType == 0">{{item.state.name}}</p>
  173. <p class="switch-pc-type-p" v-if="item.pcType == 1" @click="tableButton(item)">操作</p>
  174. </div>
  175. <div class="switch-for-min-box_b" v-if="item.pcType == 0">
  176. <p class="switch-null-ventilate" v-if="item.hardwareTypeEnum.hardwareTypeCode==2 && item.state.code==3">{{item.dictLabel}}</p>
  177. <el-switch
  178. v-if="item.state.code == 3||item.state.code == 4"
  179. class="switch"
  180. @click.native="changeIsNeedCaptcha(item)"
  181. v-model="item.state.code"
  182. :active-value="3"
  183. :inactive-value="4"
  184. active-text="开启"
  185. inactive-text="关闭"
  186. disabled>
  187. </el-switch>
  188. </div>
  189. </div>
  190. <div class="switch-for-min-box" v-if="item.hardwareTypeEnum.enumName == 'ONE_MACHINE'">
  191. <p class="switch-for-min-title">广播系统</p>
  192. <p class="switch-for-min-button" @click="handleAdd(item.subId)">播放文字</p>
  193. </div>
  194. </div>
  195. </div>
  196. <img class="null-data-img" src="@/assets/ZDimages/null-data.png" v-show="!checkedSubject.VOlist[0]">
  197. <p class="null-text-p" v-show="!checkedSubject.VOlist[0]">暂无物联控制信息,请在更多操作-物联设备配置中进行添加</p>
  198. </div>
  199. <div class="bottom-video-box" v-if="rightButtonType == 3">
  200. <p class="top-title">
  201. <el-tooltip class="item" effect="dark" :content="checkedSubject.deptName" placement="bottom">
  202. <i>{{checkedSubject.deptName}}</i>
  203. </el-tooltip>
  204. <el-tooltip class="item" effect="dark" :content="checkedSubject.subAddrr.buildName+checkedSubject.subAddrr.floorName" placement="bottom">
  205. <i>当前位置:{{checkedSubject.subAddrr.buildName}}{{checkedSubject.subAddrr.floorName}}</i>
  206. </el-tooltip>
  207. </p>
  208. <div class="video-for-max-box scrollbar-box" v-if="checkedSubject.videoData[0]">
  209. <div class="switch-for-big-box" v-for="(item,index) in checkedSubject.videoData" :key="index">
  210. <video :id="item.divId" ref="videoRef" autoplay controls muted width="490px" height="262px"></video>
  211. <p class="el-icon-full-screen position-p" @click="videoFullScreen(index)"></p>
  212. </div>
  213. </div>
  214. <img class="null-data-img" src="@/assets/ZDimages/null-data.png" v-if="!checkedSubject.videoData[0]">
  215. <p class="null-text-p" v-if="!checkedSubject.videoData[0]">暂无视频监控信息,请在更多操作-物联设备配置中进行添加</p>
  216. </div>
  217. <div class="bottom-alarm-box" v-if="rightButtonType == 4">
  218. <p class="top-title">
  219. <el-tooltip class="item" effect="dark" :content="checkedSubject.deptName" placement="bottom">
  220. <i>{{checkedSubject.deptName}}</i>
  221. </el-tooltip>
  222. <el-tooltip class="item" effect="dark" :content="checkedSubject.subAddrr.buildName+checkedSubject.subAddrr.floorName" placement="bottom">
  223. <i>当前位置:{{checkedSubject.subAddrr.buildName}}{{checkedSubject.subAddrr.floorName}}</i>
  224. </el-tooltip>
  225. </p>
  226. <div class="alarm-max-box" :class="hardwareData[0]?hardwareData[0].status==3||hardwareData[0].status==4?'BGcolorTypeA':'BGcolorTypeB':''">
  227. <img v-if="hardwareData[0]?hardwareData[0].status == 3:''" src="@/assets/ZDimages/medicUniversity-3_1/img_syslb_znsgbjzx.png" class="alarm-img">
  228. <div class="alarm-big-box" v-if="hardwareData[0]">
  229. <p>报警器编号:{{hardwareData[0].hardwareNum}}</p>
  230. <div class="alarm-position-box" >
  231. <el-switch
  232. v-if="hardwareData[0].status == 3"
  233. @click.native="changeIsNeedCaptchaAlarm(hardwareData[0])"
  234. class="switch captcha-img"
  235. :active-value="3"
  236. :inactive-value="4"
  237. active-color="#FF9900"
  238. inactive-color="#999"
  239. v-model="hardwareData[0].status"
  240. active-text="报警中"
  241. inactive-text="未报警"
  242. disabled
  243. ></el-switch>
  244. </div>
  245. <p :class="hardwareData[0].status==3||hardwareData[0].status==4?'colorTypeA':'colorTypeB'">{{hardwareData[0].status==3||hardwareData[0].status==4?'在线':'离线'}}</p>
  246. </div>
  247. <div class="alarm-big-box" v-if="!hardwareData[0]">
  248. <p>未绑定报警器</p>
  249. </div>
  250. </div>
  251. <div class="alarm-title-box">
  252. <p>报警记录</p>
  253. <p v-hasPermi="['chemical:hxpAlarmRecord:list']" @click="goAlarmRecord">更多>></p>
  254. </div>
  255. <el-table class="subject-alarm-time" style="margin-bottom:10px;" border :data="tableList" ref="multipleTable">
  256. <el-table-column label="报警时间" align="center" prop="alarmTime"/>
  257. <el-table-column label="处理状态" align="center" prop="operate" width="100"/>
  258. <el-table-column label="处理人" align="center" prop="handlingUserName" width="90"/>
  259. </el-table>
  260. <pagination
  261. v-show="totalTwo>0"
  262. :total="totalTwo"
  263. :page.sync="queryParamsTwo.pageNum"
  264. :limit.sync="queryParamsTwo.pageSize"
  265. @pagination="getHxpAlarmRecordNoAuthList"
  266. />
  267. </div>
  268. <div class="bottom-entrance-box" v-if="rightButtonType == 5">
  269. <p class="top-title">
  270. <el-tooltip class="item" effect="dark" :content="checkedSubject.deptName" placement="bottom">
  271. <i>{{checkedSubject.deptName}}</i>
  272. </el-tooltip>
  273. <el-tooltip class="item" effect="dark" :content="checkedSubject.subAddrr.buildName+checkedSubject.subAddrr.floorName" placement="bottom">
  274. <i>当前位置:{{checkedSubject.subAddrr.buildName}}{{checkedSubject.subAddrr.floorName}}</i>
  275. </el-tooltip>
  276. </p>
  277. <div class="entrance" :class="item.operate.code==2?'BGentrance_l_yes':'BGentrance_l_no'" v-for="(item,index) in entranceList" v-if="item.operate">
  278. <img class="entrance_c" v-if="item.operate.code==2" src="@/assets/ZDimages/icon_znmj_zx.png">
  279. <img class="entrance_c" v-if="item.operate.code!=2" src="@/assets/ZDimages/icon_znmj_lx.png">
  280. <div class="entrance_r">门禁编号:{{item.hardwareNum}}</div>
  281. <p :class="item.operate.code==2?'entrance_l_yes':'entrance_l_no'">{{item.operate.code==2?'在线':'离线'}}</p>
  282. </div>
  283. <img class="null-data-img" src="@/assets/ZDimages/null-data.png" v-if="entranceList.length<=0">
  284. <p class="null-text-p" v-if="entranceList.length<=0">暂无智能门禁信息,请在更多操作-物联设备配置中进行添加</p>
  285. </div>
  286. </div>
  287. </div>
  288. </div>
  289. </div>
  290. <add-subject v-if="pageType == 2" :subjectData="subjectData"></add-subject>
  291. <device-list v-if="pageType == 3" :subjectData="subjectData"></device-list>
  292. <admission-configuration v-if="pageType == 4" :subjectData="subjectData"></admission-configuration>
  293. <association-configuration v-if="pageType == 5" :subjectData="subjectData"></association-configuration>
  294. <info-page v-if="pageType == 6" :newData="newData"></info-page>
  295. <!--播放文字窗口-->
  296. <el-dialog title="广播系统" :visible.sync="open" width="500px" append-to-body>
  297. <el-form ref="form" :model="form" :rules="rules" label-width="80px">
  298. <el-form-item label="播放文字" prop="txt">
  299. <el-input v-model="form.txt" placeholder="请输入播放文字" />
  300. </el-form-item>
  301. <el-form-item label="播报方式" prop="type">
  302. <el-radio-group v-model="form.type">
  303. <el-radio :label="1">文字</el-radio>
  304. <el-radio :label="2">音频</el-radio>
  305. </el-radio-group>
  306. </el-form-item>
  307. </el-form>
  308. <div slot="footer" class="dialog-footer">
  309. <el-button @click="cancel">取 消</el-button>
  310. <el-button type="primary" @click="submitFormOne">确 定</el-button>
  311. </div>
  312. </el-dialog>
  313. </div>
  314. </template>
  315. <script>
  316. import { controlSwitch } from "@/api/laboratory/hardware";
  317. import mqtt from 'mqtt'
  318. import flvjs from 'flv.js'
  319. import { hardWareControl,alarmControl } from "@/api/laboratory/hardware";
  320. import {
  321. authListSubject,
  322. subjectInfo,
  323. updateSubject,
  324. mangerVoice,
  325. startUrl,
  326. queryHardByTypeList, subjectTriggerModes,
  327. } from '@/api/laboratory/subject'
  328. import { listData} from "@/api/system/dict/data";
  329. import { filterDept } from "@/api/medicUniversity-3_1/index";
  330. import addSubject from "./addSubject.vue";
  331. import deviceList from "./deviceList.vue";
  332. import admissionConfiguration from "./admissionConfiguration.vue";
  333. import associationConfiguration from "./associationConfiguration.vue";
  334. import infoPage from "./infoPage.vue";
  335. import { getHxpAlarmRecordNoAuthList,getEnablelist} from "@/api/medicUniversity-3_1/index";
  336. import store from '@/store'
  337. export default {
  338. filters:{
  339. ellipsis(value){
  340. if (!value) return '';
  341. if (value.length > 6) {
  342. return value.slice(0,6) + '...'
  343. }
  344. return value
  345. }
  346. },
  347. name: "subject",
  348. components: {
  349. addSubject,
  350. deviceList,
  351. admissionConfiguration,
  352. associationConfiguration,
  353. infoPage
  354. },
  355. data(){
  356. return{
  357. pageType:1,
  358. // 遮罩层
  359. loading: true,
  360. // 显示搜索条件
  361. showSearch: true,
  362. // 总条数
  363. total: 0,
  364. // 查询参数
  365. queryParams: {
  366. pageNum: 1,
  367. pageSize:20,
  368. name: null,
  369. floorId: null,
  370. room: null,
  371. deptId: null,
  372. deptName: null,
  373. adminId: null,
  374. isDel: null,
  375. userId: null,
  376. diyOrder: null
  377. },
  378. // 实验室表格数据
  379. subjectList: [],
  380. //学院列表
  381. deptOptions:[],
  382. //当前选中实验室
  383. checkedSubject:{},
  384. //当前选中右侧按钮
  385. rightButtonType:1,
  386. //编辑实验室数据
  387. subjectData:{},
  388. // 临时保存排序
  389. sort:"",
  390. //播放文字的实验室id
  391. subId:"",
  392. open:false,
  393. form:{},
  394. //智能门禁
  395. entranceList:[
  396. {
  397. status:1,
  398. name:'门禁名称',
  399. num:'XD12345678912'
  400. },
  401. {
  402. status:0,
  403. name:'门禁名称',
  404. num:'XD12345678912'
  405. }
  406. ],
  407. rules:{
  408. txt:[
  409. {required: true, message: '请输入播放文字', trigger: 'blur'},
  410. { required: true, message: "请输入播放文字", validator: this.spaceJudgment, trigger: "blur" }
  411. ],
  412. type:[
  413. {required: true, message: '请选择播报方式', trigger: 'blur'}
  414. ],
  415. },
  416. newData:{
  417. },
  418. //MQTT请求参数-传感器
  419. mtopic:"lab/function/data",
  420. //MQTT请求参数-硬件
  421. mtopicOne:"lab/hardware/data",
  422. //MQTT请求参数-传感器-预案
  423. mtopicTow:"lab/riskPlan/trigger/notice",
  424. msg:"",
  425. client:{},
  426. videoList:[],
  427. //警报数据
  428. totalTwo:0,
  429. tableList:[],
  430. queryParamsTwo:{
  431. pageNum:1,
  432. pageSize:20,
  433. },
  434. hardwareData:[],
  435. //mqtt实验室id
  436. mqttIdList:[],
  437. //字典排风扇数组
  438. fanList:[],
  439. selectTriggerList:[],//预案触发下,预案数据存储
  440. }
  441. },
  442. created() {
  443. },
  444. mounted(){
  445. this.getDeptList();
  446. // this.subscriptionMQTT();
  447. this.getList();
  448. this.getlistData();
  449. // this.queryHardByTypeList();
  450. },
  451. methods:{
  452. tableButton(row){
  453. let self = this;
  454. this.$confirm(`是否确认操作此设备`, "提示", {
  455. confirmButtonText: "确定",
  456. cancelButtonText: "取消",
  457. type: "warning"
  458. }).then(async () => {
  459. controlSwitch({id:row.id}).then(response => {
  460. self.msgSuccess(response.msg);
  461. });
  462. }).catch(() => {
  463. })
  464. },
  465. //查询当前用户下的预案触发数据
  466. selectTriggerFun(data){
  467. let self = this;
  468. let dataArr=data;
  469. let list=JSON.parse(localStorage.getItem('selectTriggerList'));
  470. for(let i=0;i<list.length;i++){
  471. if(self.subId==list[i].subId){//如果当前选中的实验室和预案触发的实验室id
  472. for(let b=0;b<dataArr.length;b++){
  473. if(list[i].funNum==dataArr[b].funNum){
  474. if(list[i].minMonitor<dataArr[b].roundVlue<list[i].maxMonitor){//传感器值正常
  475. dataArr[b].type=1
  476. }else{//传感器值异常
  477. }
  478. }
  479. }
  480. }
  481. }
  482. return dataArr;
  483. },
  484. /** 查询字典数据列表 */
  485. getlistData() {
  486. this.loading = true;
  487. listData({pageNum:1,pageSize:20,dictType:'trigger_modes'}).then(response => {
  488. this.fanList=response.rows
  489. });
  490. },
  491. goAlarmRecord(){
  492. this.$router.push({
  493. path: `/chemicalLibrary/alarmRecord`,
  494. })
  495. },
  496. //智能门禁
  497. queryHardByTypeList(){
  498. let _this=this;
  499. let obj={
  500. subjectId:this.subId,
  501. type:'HK_DOOR',
  502. }
  503. queryHardByTypeList(obj).then( response => {
  504. let res=response.data;
  505. _this.entranceList=res;
  506. });
  507. },
  508. //报警器开启关闭方法
  509. changeIsNeedCaptchaAlarm(row){
  510. let self = this;
  511. console.log(row.status)
  512. if(row.status!=3 && row.status!=4){
  513. return
  514. }
  515. let text = row.status==3?'关闭':(row.status==4?'开启':'')
  516. this.$confirm(`是否`+text+`此设备`, "提示", {
  517. confirmButtonText: "确定",
  518. cancelButtonText: "取消",
  519. type: "warning"
  520. }).then(async () => {
  521. self.alarmControl(row)
  522. }).catch(() => {
  523. })
  524. },
  525. //开关按钮
  526. alarmControl(row){
  527. let switchData = {
  528. id:row.id,
  529. switchVal:row.status==3?'close':(row.status==4?'open':'')
  530. };
  531. alarmControl(switchData).then(response => {
  532. if(response.code==200){
  533. row.status = row.status==3?4:(row.status==4?3:'')
  534. }
  535. });
  536. },
  537. //获取实验室绑定报警器设备数据
  538. getEnablelist(){
  539. let obj = {
  540. subjectId:this.subId,
  541. type:"AI_ALARM"
  542. }
  543. getEnablelist(obj).then(response => {
  544. this.hardwareData = response.rows;
  545. });
  546. },
  547. //获取实验室报警列表数据
  548. getHxpAlarmRecordNoAuthList(){
  549. this.queryParamsTwo.subId = this.subId;
  550. getHxpAlarmRecordNoAuthList(this.queryParamsTwo).then(response => {
  551. this.totalTwo = response.total;
  552. this.tableList = response.rows;
  553. });
  554. },
  555. //播放文字
  556. handleAdd(id) {
  557. this.open = true;
  558. this.subId = id;
  559. },
  560. // 取消按钮
  561. cancel() {
  562. this.form = {};
  563. this.open = false;
  564. },
  565. /*播放文字*/
  566. submitFormOne(){
  567. this.$refs["form"].validate(valid => {
  568. if (valid) {
  569. let id = this.subId;
  570. mangerVoice(this.form,id).then(response => {
  571. this.msgSuccess("播放成功");
  572. this.open = false;
  573. this.getList();
  574. });
  575. }
  576. });
  577. },
  578. // 页面切换
  579. clickPage(type,row){
  580. if(this.pageType != type){
  581. if(type == 1){
  582. //列表页面
  583. this.pageType = type;
  584. this.getList();
  585. this.$set(this,'subjectData',{})
  586. }else if(type == 2){
  587. //新增页面
  588. this.pageType = type;
  589. }else if(type == 3){
  590. //编辑页面
  591. //this.pageType = 2;
  592. this.editFun(row);
  593. //this.$set(this,'subjectData',row)
  594. }else if(type == 4){
  595. this.pageType = 3;
  596. this.$set(this,'subjectData',row)
  597. }else if(type == 5){
  598. this.pageType = 4;
  599. this.$set(this,'subjectData',row)
  600. }else if(type == 6){
  601. this.pageType = 5;
  602. this.$set(this,'subjectData',row)
  603. }else if(type == 7){
  604. this.subjectInfoTwo(row);
  605. // this.$set(this,'subjectData',row)
  606. }
  607. }
  608. },
  609. //实验室编辑
  610. editFun(row){
  611. let self = this;
  612. let type = 0; //硬件 //0全部
  613. subjectInfo(row.id,type).then(response => {
  614. console.log(response.data)
  615. this.$set(this,'subjectData',response.data)
  616. this.pageType = 2;
  617. })
  618. },
  619. //获取实验室详情
  620. subjectInfoTwo(row){
  621. let self = this;
  622. let type = 0; //硬件 //0全部
  623. subjectInfo(row.id,type).then(response => {
  624. // console.log("获取实验室详情",response.data)
  625. this.$set(this,'newData',response.data);
  626. if(response.data.safeUserName){
  627. this.$set(this.newData,'safeUserName',response.data.safeUserName.split(','));
  628. }
  629. if(response.data.safeUserPhone){
  630. this.$set(this.newData,'safeUserPhone',response.data.safeUserPhone.split(','));
  631. }
  632. if(response.data.safeSigns){
  633. this.$set(this.newData,'safeSigns',response.data.safeSigns.split(','));
  634. }
  635. if(response.data.hazardCategory){
  636. this.$set(this.newData,'hazardCategory',response.data.hazardCategory.split(','));
  637. }
  638. if(response.data.outfire){
  639. this.$set(this.newData,'outfire',response.data.outfire.split(','));
  640. }
  641. if(response.data.riskMeasure){
  642. this.$set(this.newData,'riskMeasure',response.data.riskMeasure.split(','));
  643. }
  644. let list = [];
  645. let listTwo = [];
  646. if (response.data.labHardwareVOList){
  647. for(let i=0;i<response.data.labHardwareVOList.length;i++){
  648. if(response.data.labHardwareVOList[i].hardwareTypeEnum.enumName == 'VIDEO_MONITOR'){
  649. list.push(response.data.labHardwareVOList[i].hardwareNUM);
  650. }
  651. // if(response.data.labHardwareVOList[i].hardwareTypeEnum.enumName == 'SWITCH' || response.data.labHardwareVOList[i].hardwareTypeEnum.enumName == 'AI_VENTILATION' || response.data.labHardwareVOList[i].hardwareTypeEnum.enumName == 'ONE_MACHINE'){
  652. if(response.data.labHardwareVOList[i].hardwareTypeEnum.enumName == 'SWITCH' || response.data.labHardwareVOList[i].hardwareTypeEnum.enumName == 'AI_VENTILATION'){
  653. listTwo.push(response.data.labHardwareVOList[i])
  654. }
  655. }
  656. }
  657. this.$set(this.newData,'labHardwareVOListTwo',listTwo);
  658. if(list[0]){
  659. let obj = {
  660. count:"100",
  661. deviceIds:list.join(),
  662. page:"1",
  663. };
  664. let urlText = window.location.href;
  665. if(urlText.indexOf(localStorage.getItem('ipIdentify')) != -1){
  666. startUrl(obj).then(res => {
  667. if(res.code == 200){
  668. if(!res.data[0]){
  669. this.msgError("视频配置异常请联系管理员")
  670. this.newData.videoData = [];
  671. this.pageType = 6;
  672. }else{
  673. let newData = res.data;
  674. let videoList = [];
  675. for(let i=0;i<newData.length;i++){
  676. let obj = {
  677. name:response.data.name + response.data.subAddrr.room,
  678. videoType:"flv",
  679. divId:'divId'+i,
  680. url:newData[i].ws_flv,
  681. }
  682. videoList.push(obj)
  683. }
  684. this.$set(this.newData,'videoData',videoList);
  685. this.pageType = 6;
  686. }
  687. }
  688. });
  689. }else{
  690. startUrl(obj).then(res => {
  691. if(res.code == 200){
  692. if(!res.data[0]){
  693. this.msgError("视频配置异常请联系管理员")
  694. this.newData.videoData = [];
  695. this.pageType = 6;
  696. }else{
  697. let newData = res.data;
  698. let videoList = [];
  699. for(let i=0;i<newData.length;i++){
  700. let text = localStorage.getItem('cameraUrl');
  701. let url = newData[i].ws_flv;
  702. url = url.split("rtp/");
  703. let newUrl = text+'rtp/'+url[1];
  704. let obj = {
  705. name:response.data.name + response.data.subAddrr.room,
  706. videoType:"flv",
  707. divId:'divId'+i,
  708. url:newUrl,
  709. }
  710. videoList.push(obj)
  711. }
  712. this.$set(this.newData,'videoData',videoList);
  713. this.pageType = 6;
  714. }
  715. }
  716. });
  717. }
  718. }else{
  719. this.$set(this.newData,'videoData',[]);
  720. this.pageType = 6;
  721. }
  722. })
  723. },
  724. // 开启关闭验证
  725. async changeIsNeedCaptcha (row) {
  726. let self = this;
  727. console.log(row)
  728. if(row.state.code!=3 && row.state.code!=4){
  729. return
  730. }
  731. let text = row.state.code==3?'关闭':(row.state.code==4?'开启':'')
  732. this.$confirm(`是否`+text+`此设备`, "提示", {
  733. confirmButtonText: "确定",
  734. cancelButtonText: "取消",
  735. type: "warning"
  736. }).then(async () => {
  737. self.switchChange(row)
  738. }).catch(() => {
  739. })
  740. },
  741. //点击开关按钮开启的时候充电调用硬件状态
  742. subjectTriggerModes(row){
  743. let self=this;
  744. subjectTriggerModes(row.id).then(response => {
  745. if(response.code==200){
  746. for(let b=0;b<self.fanList.length;b++){
  747. if(self.fanList[b].dictValue==response.data.triggerModes){
  748. for(let i=0;i<self.checkedSubject.VOlist.length;i++){
  749. if(row.id == self.checkedSubject.VOlist[i].id){
  750. this.$set(self.checkedSubject.VOlist[i],'dictLabel',self.fanList[b].dictLabel);
  751. this.$set(self.checkedSubject.VOlist[i],'triggerModes',response.data.triggerModes);
  752. }
  753. }
  754. }
  755. }
  756. }
  757. });
  758. },
  759. //开关按钮
  760. switchChange(row){
  761. let switchData = {
  762. id:row.id,
  763. switchVal:row.state.code==3?'close':(row.state.code==4?'open':'')
  764. };
  765. hardWareControl(switchData).then(response => {
  766. if(response.code==200){
  767. this.msgSuccess("操作成功")
  768. }
  769. });
  770. },
  771. //切换实验室展示数据
  772. rightButtonClick(type){
  773. let self = this;
  774. if(this.rightButtonType != type){
  775. this.rightButtonType = type;
  776. this.videoOff();
  777. if(type == 3){
  778. let self = this;
  779. let list = [];
  780. if(self.checkedSubject.labHardwareVOList){
  781. for(let i=0;i<self.checkedSubject.labHardwareVOList.length;i++){
  782. if(self.checkedSubject.labHardwareVOList[i].hardwareTypeEnum.enumName == 'VIDEO_MONITOR'){
  783. list.push(self.checkedSubject.labHardwareVOList[i].hardwareNUM);
  784. }
  785. }
  786. if(list[0]){
  787. let obj = {
  788. count:"100",
  789. deviceIds:list+'',
  790. page:"1",
  791. };
  792. let urlText = window.location.href;
  793. if(urlText.indexOf(localStorage.getItem('ipIdentify')) != -1){
  794. startUrl(obj).then(res => {
  795. if(res.code == 200){
  796. if(!res.data[0]){
  797. this.msgError("视频配置异常请联系管理员")
  798. return
  799. }
  800. let newData = res.data;
  801. let videoList = [];
  802. for(let i=0;i<newData.length;i++){
  803. let obj = {
  804. name:self.checkedSubject.name + self.checkedSubject.subAddrr.room,
  805. videoType:"flv",
  806. divId:'divId'+i,
  807. url:newData[i].ws_flv,
  808. }
  809. videoList.push(obj)
  810. }
  811. this.$set(this.checkedSubject,'videoData',videoList);
  812. if(this.rightButtonType == 3){
  813. setTimeout(function(){
  814. self.videoFunction();
  815. },1000);
  816. }
  817. }
  818. });
  819. }else{
  820. startUrl(obj).then(res => {
  821. if(res.code == 200){
  822. if(!res.data[0]){
  823. this.msgError("视频配置异常请联系管理员")
  824. return
  825. }
  826. let newData = res.data;
  827. let videoList = [];
  828. for(let i=0;i<newData.length;i++){
  829. let text = localStorage.getItem('cameraUrl');
  830. let url = newData[i].ws_flv;
  831. url = url.split("rtp/");
  832. let newUrl = text+'rtp/'+url[1];
  833. let obj = {
  834. name:self.checkedSubject.name + self.checkedSubject.subAddrr.room,
  835. videoType:"flv",
  836. divId:'divId'+i,
  837. url:newUrl,
  838. }
  839. videoList.push(obj)
  840. }
  841. this.$set(this.checkedSubject,'videoData',videoList);
  842. if(this.rightButtonType == 3){
  843. setTimeout(function(){
  844. self.videoFunction();
  845. },1000);
  846. }
  847. }
  848. });
  849. }
  850. }else{
  851. this.$set(this.checkedSubject,'videoData',[]);
  852. }
  853. }else{
  854. this.$set(this.checkedSubject,'videoData',[]);
  855. }
  856. }else if(type==2){
  857. for(let i=0;i<self.checkedSubject.VOlist.length;i++){
  858. if(self.checkedSubject.VOlist[i].hardwareTypeEnum.hardwareTypeCode == '2'){
  859. for(let b=0;b<self.fanList.length;b++){
  860. if(self.fanList[b].dictValue==self.checkedSubject.VOlist[i].triggerModes){
  861. self.checkedSubject.VOlist[i].dictLabel=self.fanList[b].dictLabel
  862. }
  863. }
  864. }
  865. }
  866. }else if(type==5){
  867. this.queryHardByTypeList();
  868. }
  869. }
  870. },
  871. //选中实验室
  872. handleCurrentChange(val){
  873. let self = this;
  874. if(val.id != this.checkedSubject.id){
  875. this.videoOff();
  876. this.offMQTT();
  877. this.subjectInfo(val.id);
  878. this.subId = val.id;
  879. this.$set(this,'queryParamsTwo',{
  880. pageNum:1,
  881. pageSize:20,
  882. });
  883. this.getEnablelist();
  884. this.getHxpAlarmRecordNoAuthList();
  885. this.subscriptionMQTT();
  886. }
  887. },
  888. //获取实验室详情
  889. subjectInfo(id){
  890. let type = 1; //硬件 //0全部
  891. subjectInfo(id,type).then(response => {
  892. let obj = JSON.parse(JSON.stringify(response.data));
  893. obj.VOlist = [];
  894. if(response.data.labHardwareVOList){
  895. for(let i=0;i<response.data.labHardwareVOList.length;i++){
  896. if(response.data.labHardwareVOList[i].hardwareTypeEnum.enumName == 'SWITCH'||
  897. response.data.labHardwareVOList[i].hardwareTypeEnum.enumName == 'AI_VENTILATION'){
  898. obj.VOlist.push(response.data.labHardwareVOList[i]);
  899. }
  900. }
  901. }
  902. //判断传感器是否在线如果不在线type为2
  903. if(response.data.sensorFunctionStatusList){
  904. obj.sensorFunctionStatusList.forEach(function(item) {
  905. if(item.formatVal.indexOf("--") != -1){
  906. item.type=2
  907. }
  908. })
  909. obj.sensorFunctionStatusList=this.selectTriggerFun(obj.sensorFunctionStatusList)
  910. }
  911. this.$set(this,'checkedSubject',obj);
  912. this.$set(this.checkedSubject,'videoData',[]);
  913. this.rightButtonType = 1;
  914. })
  915. },
  916. //编辑按钮
  917. handleCommand(command, row){
  918. switch (command) {
  919. case "1":
  920. console.log('关联配置');
  921. this.clickPage(6,row);
  922. break;
  923. case "2":
  924. console.log('物联配置');
  925. this.clickPage(4,row);
  926. break;
  927. case "3":
  928. console.log('准入配置');
  929. this.clickPage(5,row);
  930. break;
  931. case "4":
  932. console.log('编辑');
  933. this.clickPage(3,row);
  934. break;
  935. case "5":
  936. console.log('删除');
  937. break;
  938. default:
  939. break;
  940. }
  941. },
  942. //保存当前排序
  943. liveSort(row){
  944. let obj = {
  945. sort:row.diyOrder
  946. }
  947. this.sort = JSON.parse(JSON.stringify(obj));
  948. },
  949. //编辑排序
  950. editSort(row){
  951. let self = this;
  952. if(row.diyOrder != this.sort.sort){
  953. self.$confirm('是否确认修改排序?', "", {
  954. confirmButtonText: "确定",
  955. cancelButtonText: "取消",
  956. type: "warning"
  957. }).then(function() {
  958. let obj = {
  959. id:row.id,
  960. diyOrder:row.diyOrder,
  961. };
  962. updateSubject(obj).then(response => {
  963. self.msgSuccess("修改成功");
  964. self.getList();
  965. });
  966. }).then(() => {}).catch(() => {
  967. let obj = JSON.parse(JSON.stringify(self.sort));
  968. row.diyOrder = obj.sort
  969. });
  970. }
  971. },
  972. /** 搜索按钮操作 */
  973. handleQuery() {
  974. this.queryParams.pageNum = 1;
  975. this.getList();
  976. },
  977. /** 重置按钮操作 */
  978. resetQuery() {
  979. this.$set(this,'queryParams',{
  980. pageNum: 1,
  981. pageSize:20,
  982. deptId:"",
  983. name: '',
  984. });
  985. // this.resetForm("queryForm");
  986. this.handleQuery();
  987. },
  988. /** 查询实验室列表 */
  989. getList() {
  990. this.loading = true;
  991. // this.offMQTT();
  992. authListSubject(this.queryParams).then(response => {
  993. this.subjectList = response.rows;
  994. this.total = response.total;
  995. this.loading = false;
  996. if(response.rows[0]){
  997. this.$refs.multipleTable.setCurrentRow(response.rows[0]);
  998. this.subjectInfo(response.rows[0].id);
  999. }
  1000. let idList = [];
  1001. for(let i=0;i<response.rows.length;i++){
  1002. idList.push(response.rows[i].id)
  1003. }
  1004. this.$set(this,'mqttIdList',idList);
  1005. // this.subscriptionMQTT();
  1006. });
  1007. },
  1008. /** 查询学院列表 */
  1009. getDeptList() {
  1010. filterDept().then(response => {
  1011. this.$set(this, 'deptOptions', response.data)
  1012. });
  1013. },
  1014. //MQTT订阅
  1015. subscriptionMQTT(){
  1016. let self = this;
  1017. this.client = mqtt.connect(localStorage.getItem('mqttUrl'), {
  1018. username: localStorage.getItem('mqttUser'),
  1019. password:localStorage.getItem('mqttPassword')
  1020. });
  1021. this.client.on("connect", e =>{
  1022. console.log("连接成功");
  1023. this.client.subscribe(this.mtopic+self.subId, (err) => {
  1024. if (!err) {
  1025. console.log("订阅成功:" + this.mtopic+self.subId);
  1026. }
  1027. });
  1028. this.client.subscribe(this.mtopicOne+self.subId, (err) => {
  1029. if (!err) {
  1030. console.log("订阅成功:" + this.mtopicOne+self.subId);
  1031. }
  1032. });
  1033. // for(let i = 0; i< self.mqttIdList.length;i++){
  1034. // this.client.subscribe(this.mtopic+self.mqttIdList[i], (err) => {
  1035. // if (!err) {
  1036. // console.log("订阅成功:" + this.mtopic+self.mqttIdList[i]);
  1037. // }
  1038. // });
  1039. // this.client.subscribe(this.mtopicOne+self.mqttIdList[i], (err) => {
  1040. // if (!err) {
  1041. // console.log("订阅成功:" + this.mtopicOne+self.mqttIdList[i]);
  1042. // }
  1043. // });
  1044. // }
  1045. });
  1046. this.client.on("message", (topic, message) => {
  1047. // console.log('message',message)
  1048. if (message){
  1049. let data = JSON.parse(message)
  1050. //console.log("MQTT----message",data)
  1051. if(data.data.subId){
  1052. //传感器
  1053. // console.log("传感器",data.data.subId,'---------',data);
  1054. if(self.checkedSubject.id){
  1055. if(data.data.subId&&data.data.subId == self.checkedSubject.id){
  1056. self.$set(self.checkedSubject,'sensorFunctionStatusList',data.data.functionStatuses);
  1057. self.$set(self.checkedSubject.sensorFunctionStatusList[0],'sendDate',data.sendDate);
  1058. //判断传感器是否在线如果不在线type为2
  1059. self.checkedSubject.sensorFunctionStatusList.forEach(function(item) {
  1060. if(item.formatVal.indexOf("--") != -1){
  1061. item.type=2
  1062. }
  1063. })
  1064. self.checkedSubject.sensorFunctionStatusList=self.selectTriggerFun(self.checkedSubject.sensorFunctionStatusList)
  1065. }
  1066. }
  1067. if(self.newData.id){
  1068. if(data.data.subId&&data.data.subId == self.newData.id){
  1069. self.$set(self.newData,'sensorFunctionStatusList',data.data.functionStatuses);
  1070. self.$set(self.newData.sensorFunctionStatusList[0],'sendDate',data.sendDate);
  1071. }
  1072. }
  1073. }else{
  1074. //硬件
  1075. console.log("硬件",data);
  1076. for (let i = 0; i < data.data.length; i++) {
  1077. if (self.checkedSubject.VOlist) {
  1078. for (let k = 0; k < self.checkedSubject.VOlist.length; k++) {
  1079. if (self.checkedSubject.VOlist[k].id == data.data[i].num) {
  1080. if (data.data[i].hardwareOperate == 'CLOSE') {
  1081. self.checkedSubject.VOlist[k].state.code = 4;
  1082. } else if (data.data[i].hardwareOperate == 'OPEN') {
  1083. self.checkedSubject.VOlist[k].state.code = 3;
  1084. } else if (data.data[i].hardwareOperate == 'OFFLINE') {
  1085. self.checkedSubject.VOlist[k].state.code = 0;
  1086. }
  1087. if(self.checkedSubject.VOlist[k].hardwareTypeEnum.hardwareTypeCode == '2'&&
  1088. self.checkedSubject.VOlist[k].pcType == '0'){
  1089. self.subjectTriggerModes(self.checkedSubject.VOlist[k])
  1090. }
  1091. }
  1092. }
  1093. }
  1094. if(self.newData.labHardwareVOList){
  1095. for(let k=0;k<self.newData.labHardwareVOList.length;k++){
  1096. if(self.newData.labHardwareVOList[k].id == data.data[i].num){
  1097. if(data.data[i].hardwareOperate == 'CLOSE'){
  1098. self.newData.labHardwareVOList[k].state.code = 4;
  1099. }else if(data.data[i].hardwareOperate == 'OPEN'){
  1100. self.newData.labHardwareVOList[k].state.code = 3;
  1101. }else if(data.data[i].hardwareOperate == 'OFFLINE'){
  1102. self.newData.labHardwareVOList[k].state.code = 0;
  1103. }
  1104. }
  1105. }
  1106. }
  1107. }
  1108. }
  1109. }
  1110. });
  1111. },
  1112. //取消订阅关闭MQTT连接
  1113. offMQTT(){
  1114. let self = this;
  1115. if (self.mqttIdList[0]){
  1116. // for(let i=0;i<self.mqttIdList.length;i++){
  1117. // self.client.unsubscribe(self.mtopic+self.mqttIdList[i], error => {
  1118. // if (error) {
  1119. // console.log('Unsubscribe error', error)
  1120. // }
  1121. // })
  1122. // self.client.unsubscribe(self.mtopicOne+self.mqttIdList[i], error => {
  1123. // if (error) {
  1124. // console.log('Unsubscribe error', error)
  1125. // }
  1126. // })
  1127. // }
  1128. self.client.unsubscribe(self.mtopic+self.subId, error => {
  1129. if (error) {
  1130. console.log('Unsubscribe error', error)
  1131. }
  1132. })
  1133. self.client.unsubscribe(self.mtopicOne+self.subId, error => {
  1134. if (error) {
  1135. console.log('Unsubscribe error', error)
  1136. }
  1137. })
  1138. self.client.end();
  1139. self.client = {};
  1140. }
  1141. },
  1142. //视频方法
  1143. videoFunction(){
  1144. let self = this;
  1145. // self.videoList = [];
  1146. for(let i=0;i<self.checkedSubject.videoData.length;i++){
  1147. let obj = {
  1148. player :{},
  1149. flvPlayer:{}
  1150. };
  1151. obj.player = document.getElementById(self.checkedSubject.videoData[i].divId);
  1152. // if (flvjs.isSupported()) {
  1153. obj.flvPlayer = flvjs.createPlayer(
  1154. {
  1155. // isLive: true, //=> 是否为直播流
  1156. // hasAudio: false, //=> 是否开启声音
  1157. type: self.checkedSubject.videoData[i].videoType, //媒体类型 flv 或 mp4
  1158. url: self.checkedSubject.videoData[i].url //视频流地址
  1159. },
  1160. {
  1161. enableStashBuffer: true,//启用 IO 存储缓冲区。 如果您需要实时流播放(最小延迟),请设置为 false,但如果存在网络抖动,则可能会停止。
  1162. stashInitialSize: 128,//IO 存储缓冲区初始大小。 默认值为 384KB。 指示合适的大小可以改善视频加载/搜索时间。
  1163. isLive: true,//是否是直播
  1164. lazyLoadRecoverDuration: 30,//指示以秒为单位的lazyLoad 恢复时间边界。
  1165. autoCleanupSourceBuffer: true,//进行自动清理
  1166. autoCleanupMaxBackwardDuration: 3 * 60,//3 * 60 当向后缓冲持续时间超过这个值(以秒为单位)时,对 SourceBuffer 进行自动清理
  1167. autoCleanupMinBackwardDuration: 2 * 60,//2 * 60 指示在执行自动清理时为后向缓冲区保留的持续时间(以秒为单位)。
  1168. }
  1169. );
  1170. self.videoList.push(obj);
  1171. // }
  1172. console.log("i",i)
  1173. }
  1174. for(let i=0;i<self.videoList.length;i++){
  1175. self.videoList[i].flvPlayer.attachMediaElement(self.videoList[i].player);
  1176. self.videoList[i].flvPlayer.load(); //加载
  1177. self.videoList[i].flvPlayer.play(); //加载
  1178. }
  1179. },
  1180. //视屏全屏方法
  1181. videoFullScreen(index){
  1182. this.$refs.videoRef[index].webkitRequestFullScreen();
  1183. },
  1184. //断开视频流
  1185. videoOff(){
  1186. let self = this;
  1187. if(self.videoList[0]){
  1188. for(let i=0;i<self.videoList.length;i++){
  1189. self.videoList[i].flvPlayer.pause();
  1190. self.videoList[i].flvPlayer.unload();
  1191. self.videoList[i].flvPlayer.detachMediaElement();
  1192. self.videoList[i].flvPlayer.destroy();
  1193. self.videoList[i].flvPlayer = null;
  1194. }
  1195. self.videoList = [];
  1196. }
  1197. },
  1198. },
  1199. beforeDestroy() {
  1200. //清除定时器
  1201. let self = this;
  1202. self.videoOff();
  1203. self.offMQTT();
  1204. },
  1205. }
  1206. </script>
  1207. <style scoped lang="scss">
  1208. .subject{
  1209. flex:1;
  1210. display: flex!important;
  1211. flex-direction: column;
  1212. overflow: hidden;
  1213. *{
  1214. margin:0;
  1215. }
  1216. .subject-page{
  1217. flex:1;
  1218. display: flex;
  1219. flex-direction: column;
  1220. overflow: hidden;
  1221. border-radius:10px;
  1222. margin:5px 0 0 0;
  1223. //box-shadow: 0 0 8px 1px rgba(0, 0, 0, 0.1);
  1224. .subject-page-min{
  1225. flex:1;
  1226. display: flex;
  1227. overflow: hidden;
  1228. padding: 2px 0 10px 10px;
  1229. box-sizing: border-box;
  1230. }
  1231. .left-subject-list{
  1232. /*flex:1;*/
  1233. width:1143px;
  1234. display: flex;
  1235. flex-direction: column;
  1236. margin-right:6px;
  1237. overflow: hidden ;
  1238. box-shadow: 0px 2px 6px 0px rgba(0,0,0,0.2);
  1239. border-radius: 20px 20px 20px 20px;
  1240. padding-top: 24px;
  1241. margin-bottom:10px;
  1242. .table_border{
  1243. flex:1;
  1244. display: flex;
  1245. flex-direction: column;
  1246. padding: 20px 20px 10px;
  1247. box-sizing: border-box;
  1248. overflow: hidden;
  1249. }
  1250. }
  1251. .overflow-box{
  1252. overflow: hidden;
  1253. }
  1254. .right-subject-box{
  1255. /*width:440px;*/
  1256. flex:1;
  1257. display: flex;
  1258. flex-direction: column;
  1259. .top-button-box{
  1260. display: flex;
  1261. margin-left:6px;
  1262. div{
  1263. padding:0 10px;
  1264. height:40px;
  1265. line-height:40px;
  1266. font-size:14px;
  1267. text-align: center;
  1268. border-top-right-radius: 10px;
  1269. border-top-left-radius: 10px;
  1270. margin-right:1px;
  1271. cursor: pointer;
  1272. font-weight: 500;
  1273. }
  1274. .buttonColorA{
  1275. color:#0045AF;
  1276. background:#fff ;
  1277. border: 1px solid #E0E0E0;
  1278. border-bottom: 1px solid rgba(224,224,224,0.3);
  1279. }
  1280. .buttonColorB{
  1281. color:#333;
  1282. background:#E0E0E0 ;
  1283. border: 1px solid #E0E0E0;
  1284. border-bottom:none;
  1285. }
  1286. }
  1287. .bottom-max-box{
  1288. width:428px;
  1289. box-shadow: 0px 2px 6px 0px rgba(0,0,0,0.2);
  1290. border-radius: 0px 0px 20px 20px;
  1291. font-weight:500;
  1292. flex:1;
  1293. display: flex;
  1294. flex-direction: column;
  1295. margin-left:6px;
  1296. overflow: hidden;
  1297. margin-bottom:10px;
  1298. .bottom-sensor-box{
  1299. overflow: hidden;
  1300. display: flex;
  1301. flex-direction: column;
  1302. background: #fff;
  1303. width:424px;
  1304. flex:1;
  1305. position: relative;
  1306. // border: 1px solid #E0E0E0;
  1307. //border-radius: 0 10px 10px 10px;
  1308. .top-title{
  1309. margin:16px 26px;
  1310. display: flex;
  1311. justify-content: space-between;
  1312. >i{
  1313. font-style: normal;
  1314. line-height:18px;
  1315. font-size:16px;
  1316. color: #333;
  1317. overflow:hidden;
  1318. white-space: nowrap;
  1319. text-overflow: ellipsis;
  1320. }
  1321. }
  1322. .null-text-p{
  1323. text-align: center;
  1324. font-size:16px;
  1325. color:#999;
  1326. line-height:50px;
  1327. margin:0 30px;
  1328. }
  1329. .sensor-for-max-box{
  1330. .sensor-for-big-box{
  1331. display: inline-block;
  1332. width:180px;
  1333. height:60px;
  1334. margin:0 0 11px 22px;
  1335. border-radius: 10px;
  1336. .sensor-for-min-box{
  1337. display: flex;
  1338. img{
  1339. width:26px;
  1340. height:26px;
  1341. margin:17px 11px;
  1342. }
  1343. div{
  1344. margin:9px 0;
  1345. p{
  1346. color:#fff;
  1347. }
  1348. p:nth-child(1){
  1349. font-size:14px;
  1350. line-height:20px;
  1351. }
  1352. p:nth-child(2){
  1353. font-size:16px;
  1354. line-height:22px;
  1355. }
  1356. }
  1357. }
  1358. }
  1359. .sensor-color-a{
  1360. background: #FF7272;
  1361. color:#fff;
  1362. }
  1363. .sensor-color-b{
  1364. background: #E0E0E0;
  1365. color:#999999;
  1366. }
  1367. .sensor-color-c{
  1368. background: #80D164;
  1369. color:#fff;
  1370. }
  1371. }
  1372. .bottom-text{
  1373. line-height:18px;
  1374. font-size:14px;
  1375. color:#999999;
  1376. margin:0 0px 0px 26px;
  1377. position: absolute;
  1378. bottom: 22px;
  1379. }
  1380. }
  1381. .bottom-switch-box{
  1382. overflow: hidden;
  1383. display: flex;
  1384. flex-direction: column;
  1385. background: #fff;
  1386. width:424px;
  1387. flex: 1;
  1388. .top-title{
  1389. margin:16px 26px;
  1390. display: flex;
  1391. justify-content: space-between;
  1392. >i{
  1393. font-style: normal;
  1394. line-height:18px;
  1395. font-size:16px;
  1396. color: #333;
  1397. overflow:hidden;
  1398. white-space: nowrap;
  1399. text-overflow: ellipsis;
  1400. }
  1401. }
  1402. .null-text-p{
  1403. text-align: center;
  1404. font-size:16px;
  1405. color:#999;
  1406. line-height:50px;
  1407. margin:0 30px;
  1408. }
  1409. .switch-for-max-box{
  1410. width: 424px;
  1411. display: flex;
  1412. justify-content: flex-start;
  1413. flex-wrap: wrap;
  1414. .switch-for-big-box{
  1415. .switch-for-min-box{
  1416. width:180px;
  1417. height:70px;
  1418. margin:0 0 14px 20px;
  1419. background: rgba(1,131,250,0.1);
  1420. border-radius: 10px 10px 10px 10px;
  1421. padding: 10px;
  1422. box-sizing: border-box;
  1423. .switch-for-min-box_t{
  1424. width: 100%;
  1425. display: flex;
  1426. justify-content: space-between;
  1427. .switch-for-min-title{
  1428. font-size:14px;
  1429. line-height:24px;
  1430. width: 84px;
  1431. color: #333333;
  1432. display:block;
  1433. overflow:hidden;
  1434. text-overflow:ellipsis;
  1435. white-space:nowrap;
  1436. }
  1437. .switch-null-p{
  1438. font-size:14px;
  1439. line-height:24px;
  1440. color:#999;
  1441. }
  1442. .switch-pc-type-p{
  1443. font-size:14px;
  1444. line-height:24px;
  1445. color:#0183fa;
  1446. cursor: pointer;
  1447. }
  1448. }
  1449. .switch-for-min-box_b{
  1450. margin-top: 10px;
  1451. .switch-null-ventilate{
  1452. width: 62px;
  1453. height: 18px;
  1454. border-radius: 10px 10px 10px 10px;
  1455. opacity: 1;
  1456. border: 1px solid #0183FA;
  1457. font-size: 12px;
  1458. font-weight: 400;
  1459. color: #0183FA;
  1460. line-height: 15px;
  1461. text-align: center;
  1462. float: left;
  1463. }
  1464. .switch{
  1465. float: right;
  1466. }
  1467. }
  1468. .switch-for-min-button{
  1469. width:70px;
  1470. height:30px;
  1471. line-height:30px;
  1472. font-size:14px;
  1473. color:#0045AF;
  1474. border-radius:6px;
  1475. border: 1px solid #0045AF;
  1476. margin-top:14px;
  1477. text-align: center;
  1478. cursor: pointer;
  1479. }
  1480. }
  1481. }
  1482. }
  1483. }
  1484. .bottom-video-box{
  1485. overflow: hidden;
  1486. display: flex;
  1487. flex-direction: column;
  1488. background: #fff;
  1489. width:424px;
  1490. border-radius: 0 10px 10px 10px;
  1491. flex: 1;
  1492. .top-title{
  1493. margin:16px 26px;
  1494. display: flex;
  1495. justify-content: space-between;
  1496. >i{
  1497. font-style: normal;
  1498. line-height:18px;
  1499. font-size:16px;
  1500. color: #333;
  1501. overflow:hidden;
  1502. white-space: nowrap;
  1503. text-overflow: ellipsis;
  1504. }
  1505. }
  1506. .null-text-p{
  1507. text-align: center;
  1508. font-size:16px;
  1509. color:#999;
  1510. line-height:50px;
  1511. margin:0 30px;
  1512. }
  1513. .video-for-max-box{
  1514. .switch-for-big-box{
  1515. width:374px;
  1516. height:262px;
  1517. margin:0 auto 14px;
  1518. position: relative;
  1519. .position-p{
  1520. width:42px;
  1521. height:42px;
  1522. text-align: center;
  1523. line-height:42px;
  1524. font-size:18px;
  1525. position: absolute;
  1526. top:0;
  1527. right:0;
  1528. color:#fff;
  1529. cursor: pointer;
  1530. }
  1531. }
  1532. }
  1533. }
  1534. .bottom-alarm-box{
  1535. flex:1;
  1536. display: flex;
  1537. flex-direction: column;
  1538. background: #fff;
  1539. width:424px;
  1540. overflow-x: hidden;
  1541. padding: 0 27px 0 23px;
  1542. box-sizing: border-box;
  1543. .top-title{
  1544. margin:16px 0px;
  1545. display: flex;
  1546. justify-content: space-between;
  1547. >i{
  1548. font-style: normal;
  1549. line-height:18px;
  1550. font-size:16px;
  1551. color: #333;
  1552. overflow:hidden;
  1553. white-space: nowrap;
  1554. text-overflow: ellipsis;
  1555. }
  1556. }
  1557. .alarm-max-box{
  1558. width:374px;
  1559. height:60px;
  1560. display: flex;
  1561. position:relative;
  1562. background: #f5f5f5;
  1563. border-radius: 10px 10px 10px 10px;
  1564. margin: 10px 0 0 0;
  1565. .alarm-img{
  1566. width:30px;
  1567. height:30px;
  1568. margin:14px;
  1569. }
  1570. .alarm-big-box{
  1571. p:nth-of-type(1){
  1572. position:absolute;
  1573. top:18px;
  1574. left:64px;
  1575. font-size: 14px;
  1576. font-weight: 400;
  1577. color: #333333;
  1578. }
  1579. .alarm-position-box{
  1580. position:absolute;
  1581. top:8px;
  1582. left:260px;
  1583. }
  1584. p:nth-of-type(2){
  1585. position:absolute;
  1586. top:0px;
  1587. right:0px;
  1588. width: 50px;
  1589. height: 20px;
  1590. font-size:12px;
  1591. font-weight:700;
  1592. line-height:20px;
  1593. border-radius: 0px 10px 0px 10px;
  1594. text-align: center;
  1595. }
  1596. .colorTypeA{
  1597. background: rgba(1,131,250,0.2);
  1598. color:#0183FA;
  1599. }
  1600. .colorTypeB{
  1601. background: #ECECEC;
  1602. color:#A2A2A2;
  1603. }
  1604. }
  1605. }
  1606. .BGcolorTypeA{
  1607. width:374px;
  1608. height:60px;
  1609. display: flex;
  1610. position:relative;
  1611. background: rgba(1,131,250,0.1);
  1612. border-radius: 10px 10px 10px 10px;
  1613. margin: 10px 0 0 0;
  1614. }
  1615. .BGcolorTypeB{
  1616. width:374px;
  1617. height:60px;
  1618. display: flex;
  1619. position:relative;
  1620. background: #F5F5F5;
  1621. border-radius: 10px 10px 10px 10px;
  1622. margin: 10px 0 0 0;
  1623. }
  1624. .alarm-title-box{
  1625. display: flex;
  1626. p{
  1627. line-height:60px;
  1628. font-size:14px;
  1629. }
  1630. p:nth-child(1){
  1631. flex:1;
  1632. }
  1633. p:nth-child(2){
  1634. cursor: pointer;
  1635. }
  1636. }
  1637. }
  1638. /*智能门禁*/
  1639. .bottom-entrance-box{
  1640. flex: 1;
  1641. background: #fff;
  1642. width:424px;
  1643. border-radius: 0 10px 10px 10px;
  1644. .top-title{
  1645. margin:16px 26px;
  1646. display: flex;
  1647. justify-content: space-between;
  1648. >i{
  1649. font-style: normal;
  1650. line-height:18px;
  1651. font-size:16px;
  1652. color: #333;
  1653. overflow:hidden;
  1654. white-space: nowrap;
  1655. text-overflow: ellipsis;
  1656. }
  1657. }
  1658. .entrance{
  1659. width: 374px;
  1660. height: 60px;
  1661. display: flex;
  1662. justify-content: flex-start;
  1663. border-radius: 10px 10px 10px 10px;
  1664. margin: 10px 0 0 26px;
  1665. position: relative;
  1666. .entrance_c{
  1667. width: 30px;
  1668. height: 30px;
  1669. margin: 14px 20px 0px 14px;
  1670. }
  1671. .entrance_r{
  1672. font-size: 14px;
  1673. font-family: Microsoft YaHei-Regular, Microsoft YaHei;
  1674. font-weight: 400;
  1675. color: #333333;
  1676. line-height: 60px;
  1677. }
  1678. .entrance_l_yes{
  1679. width: 60px;
  1680. height: 30px;
  1681. background: #0183FA;
  1682. border-radius: 0px 10px 0px 10px;
  1683. font-size: 14px;
  1684. font-weight: 400;
  1685. color: #fff;
  1686. line-height: 30px;
  1687. text-align: center;
  1688. position: absolute;
  1689. top: 0;
  1690. right: 0;
  1691. }
  1692. .entrance_l_no{
  1693. width: 60px;
  1694. height: 30px;
  1695. background: #A2A2A2;
  1696. border-radius: 0px 10px 0px 10px;
  1697. font-size: 14px;
  1698. font-weight: 400;
  1699. color: #fff;
  1700. line-height: 30px;
  1701. text-align: center;
  1702. position: absolute;
  1703. top: 0;
  1704. right: 0;
  1705. }
  1706. }
  1707. .BGentrance_l_yes{
  1708. background: rgba(1,131,250,0.1);
  1709. }
  1710. .BGentrance_l_no{
  1711. background: #F5F5F5;
  1712. }
  1713. }
  1714. .null-data-img{
  1715. width:137px;
  1716. height:137px;
  1717. display: block;
  1718. margin:10px auto;
  1719. }
  1720. .null-text-p{
  1721. text-align: center;
  1722. font-size:16px;
  1723. color:#999;
  1724. line-height:50px;
  1725. margin:0 30px;
  1726. }
  1727. }
  1728. }
  1729. }
  1730. }
  1731. </style>
  1732. <style lang="scss">
  1733. .alarm-position-box{
  1734. .switch .el-switch__label {
  1735. position: absolute;
  1736. display: none;
  1737. color: #fff !important;
  1738. }
  1739. .switch .el-switch__label--right {
  1740. z-index: 1;
  1741. }
  1742. .switch .el-switch__label--right span{
  1743. margin-right: 9px;
  1744. }
  1745. .switch .el-switch__label--left {
  1746. z-index: 1;
  1747. }
  1748. .switch .el-switch__label--left span{
  1749. margin-left: 9px;
  1750. }
  1751. .switch .el-switch__label.is-active {
  1752. display: block;
  1753. }
  1754. .switch.el-switch .el-switch__core{
  1755. background-color: rgba(255,196,124)!important;
  1756. border-color: rgba(255,196,124)!important;
  1757. }
  1758. .switch.el-switch .el-switch__core,
  1759. .el-switch .el-switch__label {
  1760. width: 68px !important;
  1761. height:20px!important;
  1762. line-height:30px!important;
  1763. -webkit-border-radius: 20px!important;
  1764. -moz-border-radius: 20px!important;
  1765. border-radius: 20px!important;
  1766. margin: 0;
  1767. position: absolute;
  1768. top: 0;
  1769. }
  1770. .switch .el-switch__label--left span{
  1771. margin-left:22px!important;
  1772. font-size: 12px;
  1773. color: #fff;
  1774. line-height: 20px;
  1775. position: relative;
  1776. top: -5px;
  1777. }
  1778. .switch .el-switch__label--right span{
  1779. margin-left:5px!important;
  1780. font-size: 12px;
  1781. position: relative;
  1782. top: -5px;
  1783. }
  1784. .el-switch__core:after{
  1785. background: #FA8A01 !important;
  1786. height:16px!important;
  1787. width:16px!important;
  1788. top:1px!important;
  1789. }
  1790. .el-switch.is-checked .el-switch__core::after{
  1791. margin-left: -20px!important;
  1792. }
  1793. .el-switch{
  1794. margin:10px auto 0;
  1795. display: block;
  1796. width:80px!important;
  1797. height:4px!important;
  1798. }
  1799. }
  1800. .subject-alarm-time{
  1801. .el-table__empty-text{
  1802. background-size: 45%;
  1803. }
  1804. }
  1805. </style>