index.vue 66 KB

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