index.vue 67 KB

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