index.vue 66 KB

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