index.vue 66 KB

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