index.vue 77 KB

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