1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774 |
- <template>
- <div class="subject">
- <div class="subject-page" v-if="pageType == 1">
- <div class="subject-page-min">
- <div class="left-subject-list" >
- <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" style="border-bottom:1px solid #D8D8D8">
- <el-form-item label="学院" prop="deptId" label-width="60px">
- <el-select v-model="queryParams.deptId" placeholder="请选择学院" clearable size="small">
- <el-option
- v-for="dict in deptOptions"
- :key="dict.deptId"
- :label="dict.deptName"
- :value="dict.deptId"
- ></el-option>
- </el-select>
- </el-form-item>
- <el-form-item label="实验室名称" prop="name" label-width="100px">
- <el-input
- v-model="queryParams.name"
- placeholder="请输入实验室名称"
- clearable
- size="small"
- />
- </el-form-item>
- <el-form-item style="float: right;">
- <el-col :span="1.5" style="margin-bottom:26px;margin-right: 20px">
- <p class="add-button-one-120"
- @click="clickPage(2)"
- v-hasPermi="['laboratory:subject:add']"
- ><i class="el-icon-plus"></i>新增实验室</p>
- </el-col>
- </el-form-item>
- <el-form-item style="margin-right: 20px;">
- <p class="inquire-button-one" style="margin-left:20px;" @click="handleQuery">查询</p>
- <p class="reset-button-one" style="margin-left:20px;" @click="resetQuery">重置</p>
- </el-form-item>
- </el-form>
- <div class="table_border">
- <el-table ref="multipleTable" border :data="subjectList" highlight-current-row @current-change="handleCurrentChange" style="cursor: pointer;">
- <el-table-column label="排序" align="left" prop="id" width="80">
- <template slot-scope="scope">
- <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>
- </template>
- </el-table-column>
- <el-table-column label="实验室名称" align="left" prop="name" show-overflow-tooltip/>
- <el-table-column label="房间号" align="left" prop="room" width="120" show-overflow-tooltip/>
- <el-table-column label="分类/分级" align="left" prop="levelName" width="150" show-overflow-tooltip>
- <template slot-scope="scope">
- <span >{{scope.row.typeName}}/</span>
- <span :style="'color:'+scope.row.fiedColor+';'">{{scope.row.levelName}}</span>
- </template>
- </el-table-column>
- <el-table-column label="实验室责任人" align="left" prop="adminName" width="130" show-overflow-tooltip/>
- <el-table-column label="安全责任人" align="left" prop="safeUserName" width="200" show-overflow-tooltip/>
- <el-table-column label="操作" align="left" width="160">
- <template slot-scope="scope">
- <div style="display: flex;height:30px;">
- <p class="table-min-button" style="margin-right:10px;" v-hasPermi="['laboratory:subject:query']" @click="clickPage(7,scope.row)">详情</p>
- <el-dropdown trigger="click" size="mini" @command="(command) => handleCommand(command, scope.row)">
- <p class="table-min-button">更多<i class="el-icon-d-arrow-right"></i></p>
- <el-dropdown-menu slot="dropdown" style="margin:0!important;">
- <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>
- <el-dropdown-item style="height:36px;line-height:36px;width:90px;text-align: center" command="2">物联配置</el-dropdown-item>
- <el-dropdown-item style="height:36px;line-height:36px;width:90px;text-align: center" command="3" v-hasPermi="['laboratory:subjectmaterial:add']">准入配置</el-dropdown-item>
- <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>
- <!--<el-dropdown-item style="height:36px;line-height:36px;width:90px;text-align: center" command="5"-->
- <!--v-hasPermi="['laboratory:subject:remove']">删除</el-dropdown-item>-->
- </el-dropdown-menu>
- </el-dropdown>
- </div>
- </template>
- </el-table-column>
- </el-table>
- <pagination
- style="margin-top:10px;"
- v-show="total>0"
- :total="total"
- :page.sync="queryParams.pageNum"
- :limit.sync="queryParams.pageSize"
- @pagination="getList"
- />
- </div>
- </div>
- <div class="right-subject-box scrollbar-box" :class="rightButtonType == 4?'overflow-box':''" v-if="checkedSubject.id">
- <div class="top-button-box">
- <div :class="rightButtonType == 1 ? 'buttonColorA' : 'buttonColorB'" @click="rightButtonClick(1)">传感器监测</div>
- <div :class="rightButtonType == 2 ? 'buttonColorA' : 'buttonColorB'" @click="rightButtonClick(2)">物联控制</div>
- <div :class="rightButtonType == 3 ? 'buttonColorA' : 'buttonColorB'" @click="rightButtonClick(3)">视频监控</div>
- <div :class="rightButtonType == 4 ? 'buttonColorA' : 'buttonColorB'" @click="rightButtonClick(4)">声光报警</div>
- <div :class="rightButtonType == 5 ? 'buttonColorA' : 'buttonColorB'" @click="rightButtonClick(5)">智能门禁</div>
- </div>
- <!--传感器-->
- <div class="bottom-max-box" :class="rightButtonType == 4?'overflow-box':''">
- <div class="bottom-sensor-box" v-if="rightButtonType == 1">
- <p class="top-title"><i>{{checkedSubject.deptName}}</i><i>当前位置:{{checkedSubject.subAddrr.buildName}}{{checkedSubject.subAddrr.floorName}}</i></p>
- <div class="sensor-for-max-box scrollbar-box" v-if="checkedSubject.sensorFunctionStatusList[0]">
- <div class="sensor-for-big-box"
- :class="item.type == 1 ? 'sensor-color-a' : (item.type == 2 ? 'sensor-color-b' : 'sensor-color-c')"
- v-for="(item,index) in checkedSubject.sensorFunctionStatusList" :key="index">
- <div class="sensor-for-min-box">
- <img src="@/assets/ZDimages/subject/icon_bj_wd.png" v-if="item.funNum == 'wendu'">
- <img src="@/assets/ZDimages/subject/icon_bj_wd.png" v-if="item.funNum == 'fbwendu'">
- <img src="@/assets/ZDimages/subject/icon_bj_sd.png" v-if="item.funNum == 'shidu'">
- <img src="@/assets/ZDimages/subject/icon_bj_sd.png" v-if="item.funNum == 'fbshidu'">
- <img src="@/assets/ZDimages/subject/icon_bj_eyht.png" v-if="item.funNum == 'co'">
- <img src="@/assets/ZDimages/subject/icon_bj_eyht.png" v-if="item.funNum == 'fbco'">
- <img src="@/assets/ZDimages/subject/icon_bj_jwnd.png" v-if="item.funNum == 'jiawan'">
- <img src="@/assets/ZDimages/subject/icon_sy_yqnd.png" v-if="item.funNum == 'o2'">
- <img src="@/assets/ZDimages/subject/icon_sy_yqnd.png" v-if="item.funNum == 'fbo2'">
- <img src="@/assets/ZDimages/subject/icon_bj_yg.png" v-if="item.funNum == 'yanwu'">
- <img src="@/assets/ZDimages/subject/icon_sy_dqy.png" v-if="item.funNum == 'daqiya'">
- <img src="@/assets/ZDimages/subject/icon_syspz_voc.png" v-if="item.funNum == 'voc'">
- <img src="@/assets/ZDimages/subject/icon_syspz_voc.png" v-if="item.funNum == 'fbvoc'">
- <img src="@/assets/ZDimages/subject/icon_syspz_tvoc.png" v-if="item.funNum == 'tvoc'">
- <img src="@/assets/ZDimages/subject/icon_sy_mcnd.png" v-if="item.funNum == 'so2'">
- <img src="@/assets/ZDimages/subject/icon_bj_yyhd.png" v-if="item.funNum == 'no1'">
- <img src="@/assets/ZDimages/subject/icon_bj_dqy.png" v-if="item.funNum == 'fenchen'">
- <img src="@/assets/ZDimages/subject/icon_bj_qq.png" v-if="item.funNum == 'H2'">
- <img src="@/assets/ZDimages/subject/guangqi.png" v-if="item.funNum == 'guangqi'">
- <img src="@/assets/ZDimages/subject/lvqi.png" v-if="item.funNum == 'lvqi'">
- <img src="@/assets/ZDimages/subject/icon_syspz_jiaquan.png" v-if="item.funNum == 'jiaquan'">
- <img src="@/assets/ZDimages/subject/icon_syspz_hwcw.png" v-if="item.funNum == 'hwcwy'">
- <div>
- <el-tooltip class="item" effect="dark" :content="item.describe" placement="bottom">
- <p>{{item.describe|ellipsis}}</p>
- </el-tooltip>
- <p>{{item.formatVal}}</p>
- </div>
- </div>
- </div>
- </div>
- <img class="null-data-img" src="@/assets/ZDimages/null-data.png" v-if="!checkedSubject.sensorFunctionStatusList[0]">
- <p class="null-text-p" v-if="!checkedSubject.sensorFunctionStatusList[0]">暂无环境监测信息,请在更多操作-物联设备配置中进行添加</p>
- <p class="bottom-text" v-if="checkedSubject.sensorFunctionStatusList[0]">数据上报时间:{{checkedSubject.sensorFunctionStatusList[0].sendDate}}</p>
- </div>
- <div class="bottom-switch-box" v-if="rightButtonType == 2">
- <p class="top-title"><i>{{checkedSubject.deptName}}</i><i>当前位置:{{checkedSubject.subAddrr.buildName}}{{checkedSubject.subAddrr.floorName}}</i></p>
- <div class="switch-for-max-box" v-show="checkedSubject.VOlist[0]" v-hasPermi="['laboratory:subcontrol:set']">
- <div class="switch-for-big-box" v-for="(item,index) in checkedSubject.VOlist" :key="index">
- <div class="switch-for-min-box" v-if="item.hardwareTypeEnum.enumName == 'SWITCH'">
- <div class="switch-for-min-box_t">
- <p class="switch-for-min-title">{{item.hardwareName}}</p>
- <p class="switch-null-p" v-if="item.state.code != 3 && item.state.code != 4" >{{item.state.name}}</p>
- </div>
- <div class="switch-for-min-box_b">
- <p class="switch-null-ventilate" v-if="item.hardwareTypeEnum.hardwareTypeCode==2 && item.state.code==3">{{item.dictLabel}}</p>
- <el-switch
- v-if="item.state.code == 3||item.state.code == 4"
- class="switch"
- @click.native="changeIsNeedCaptcha(item)"
- v-model="item.state.code"
- :active-value="3"
- :inactive-value="4"
- active-text="开启"
- inactive-text="关闭"
- disabled>
- </el-switch>
- </div>
- </div>
- <div class="switch-for-min-box" v-if="item.hardwareTypeEnum.enumName == 'AI_VENTILATION'">
- <div class="switch-for-min-box_t">
- <p class="switch-for-min-title">{{item.hardwareName}}</p>
- <p class="switch-null-p" v-if="item.state.code != 3 && item.state.code != 4">{{item.state.name}}</p>
- </div>
- <div class="switch-for-min-box_b">
- <p class="switch-null-ventilate" v-if="item.hardwareTypeEnum.hardwareTypeCode==2 && item.state.code==3">{{item.dictLabel}}</p>
- <el-switch
- v-if="item.state.code == 3||item.state.code == 4"
- class="switch"
- @click.native="changeIsNeedCaptcha(item)"
- v-model="item.state.code"
- :active-value="3"
- :inactive-value="4"
- active-text="开启"
- inactive-text="关闭"
- disabled>
- </el-switch>
- </div>
- </div>
- <div class="switch-for-min-box" v-if="item.hardwareTypeEnum.enumName == 'ONE_MACHINE'">
- <p class="switch-for-min-title">广播系统</p>
- <p class="switch-for-min-button" @click="handleAdd(item.subId)">播放文字</p>
- </div>
- </div>
- </div>
- <img class="null-data-img" src="@/assets/ZDimages/null-data.png" v-show="!checkedSubject.VOlist[0]">
- <p class="null-text-p" v-show="!checkedSubject.VOlist[0]">暂无物联控制信息,请在更多操作-物联设备配置中进行添加</p>
- </div>
- <div class="bottom-video-box" v-if="rightButtonType == 3">
- <p class="top-title"><i>{{checkedSubject.deptName}}</i><i>当前位置:{{checkedSubject.subAddrr.buildName}}{{checkedSubject.subAddrr.floorName}}</i></p>
- <div class="video-for-max-box" v-if="checkedSubject.videoData[0]">
- <div class="switch-for-big-box" v-for="(item,index) in checkedSubject.videoData" :key="index">
- <video :id="item.divId" ref="videoRef" autoplay controls muted width="490px" height="262px"></video>
- <p class="el-icon-full-screen position-p" @click="videoFullScreen(index)"></p>
- </div>
- </div>
- <img class="null-data-img" src="@/assets/ZDimages/null-data.png" v-if="!checkedSubject.videoData[0]">
- <p class="null-text-p" v-if="!checkedSubject.videoData[0]">暂无视频监控信息,请在更多操作-物联设备配置中进行添加</p>
- </div>
- <div class="bottom-alarm-box" v-if="rightButtonType == 4">
- <p class="top-title"><i>{{checkedSubject.deptName}}</i><i>当前位置:{{checkedSubject.subAddrr.buildName}}{{checkedSubject.subAddrr.floorName}}</i></p>
- <div class="alarm-max-box" :class="hardwareData[0]?hardwareData[0].status==3||hardwareData[0].status==4?'BGcolorTypeA':'BGcolorTypeB':''">
- <img v-if="hardwareData[0]?hardwareData[0].status == 3:''" src="@/assets/ZDimages/medicUniversity-3_1/img_syslb_znsgbjzx.png" class="alarm-img">
- <div class="alarm-big-box" v-if="hardwareData[0]">
- <p>报警器编号:{{hardwareData[0].hardwareNum}}</p>
- <div class="alarm-position-box" >
- <el-switch
- v-if="hardwareData[0].status == 3"
- @click.native="changeIsNeedCaptchaAlarm(hardwareData[0])"
- class="switch captcha-img"
- :active-value="3"
- :inactive-value="4"
- active-color="#FF9900"
- inactive-color="#999"
- v-model="hardwareData[0].status"
- active-text="报警中"
- inactive-text="未报警"
- disabled
- ></el-switch>
- </div>
- <p :class="hardwareData[0].status==3||hardwareData[0].status==4?'colorTypeA':'colorTypeB'">{{hardwareData[0].status==3||hardwareData[0].status==4?'在线':'离线'}}</p>
- </div>
- <div class="alarm-big-box" v-if="!hardwareData[0]">
- <p>未绑定报警器</p>
- </div>
- </div>
- <div class="alarm-title-box">
- <p>报警记录</p>
- <p v-hasPermi="['chemical:hxpAlarmRecord:list']" @click="goAlarmRecord">更多>></p>
- </div>
- <el-table class="subject-alarm-time" style="margin-bottom:10px;" border :data="tableList" ref="multipleTable">
- <el-table-column label="报警时间" align="center" prop="alarmTime"/>
- <el-table-column label="处理状态" align="center" prop="operate" width="100"/>
- <el-table-column label="处理人" align="center" prop="handlingUserName" width="90"/>
- </el-table>
- <pagination
- v-show="totalTwo>0"
- :total="totalTwo"
- :page.sync="queryParamsTwo.pageNum"
- :limit.sync="queryParamsTwo.pageSize"
- @pagination="getHxpAlarmRecordNoAuthList"
- />
- </div>
- <div class="bottom-entrance-box" v-if="rightButtonType == 5">
- <p class="top-title"><i>{{checkedSubject.deptName}}</i><i>当前位置:{{checkedSubject.subAddrr.buildName}}{{checkedSubject.subAddrr.floorName}}</i></p>
- <div class="entrance" :class="item.operate.code==2?'BGentrance_l_yes':'BGentrance_l_no'" v-for="(item,index) in entranceList" v-if="item.operate">
- <img class="entrance_c" v-if="item.operate.code==2" src="@/assets/ZDimages/icon_znmj_zx.png">
- <img class="entrance_c" v-if="item.operate.code!=2" src="@/assets/ZDimages/icon_znmj_lx.png">
- <div class="entrance_r">门禁编号:{{item.hardwareNum}}</div>
- <p :class="item.operate.code==2?'entrance_l_yes':'entrance_l_no'">{{item.operate.code==2?'在线':'离线'}}</p>
- </div>
- <img class="null-data-img" src="@/assets/ZDimages/null-data.png" v-if="entranceList.length<=0">
- <p class="null-text-p" v-if="entranceList.length<=0">暂无智能门禁信息,请在更多操作-物联设备配置中进行添加</p>
- </div>
- </div>
- </div>
- </div>
- </div>
- <add-subject v-if="pageType == 2" :subjectData="subjectData"></add-subject>
- <device-list v-if="pageType == 3" :subjectData="subjectData"></device-list>
- <admission-configuration v-if="pageType == 4" :subjectData="subjectData"></admission-configuration>
- <association-configuration v-if="pageType == 5" :subjectData="subjectData"></association-configuration>
- <info-page v-if="pageType == 6" :newData="newData"></info-page>
- <!--播放文字窗口-->
- <el-dialog title="广播系统" :visible.sync="open" width="500px" append-to-body>
- <el-form ref="form" :model="form" :rules="rules" label-width="80px">
- <el-form-item label="播放文字" prop="txt">
- <el-input v-model="form.txt" placeholder="请输入播放文字" />
- </el-form-item>
- <el-form-item label="播报方式" prop="type">
- <el-radio-group v-model="form.type">
- <el-radio :label="1">文字</el-radio>
- <el-radio :label="2">音频</el-radio>
- </el-radio-group>
- </el-form-item>
- </el-form>
- <div slot="footer" class="dialog-footer">
- <el-button @click="cancel">取 消</el-button>
- <el-button type="primary" @click="submitFormOne">确 定</el-button>
- </div>
- </el-dialog>
- </div>
- </template>
- <script>
- import mqtt from 'mqtt'
- import flvjs from 'flv.js'
- import { hardWareControl,alarmControl } from "@/api/laboratory/hardware";
- import {
- authListSubject,
- subjectInfo,
- updateSubject,
- mangerVoice,
- startUrl,
- queryHardByTypeList, getHaikangUserList, subjectTriggerModes, subjectEditSort, laboratorySubjectEditSort
- } from '@/api/laboratory/subject'
- import { listData} from "@/api/system/dict/data";
- import { filterDept } from "@/api/medicUniversity-3_1/index";
- import addSubject from "./addSubject.vue";
- import deviceList from "./deviceList.vue";
- import admissionConfiguration from "./admissionConfiguration.vue";
- import associationConfiguration from "./associationConfiguration.vue";
- import infoPage from "./infoPage.vue";
- import { getHxpAlarmRecordNoAuthList,getEnablelist} from "@/api/medicUniversity-3_1/index";
- import store from '@/store'
- export default {
- filters:{
- ellipsis(value){
- if (!value) return '';
- if (value.length > 6) {
- return value.slice(0,6) + '...'
- }
- return value
- }
- },
- name: "subject",
- components: {
- addSubject,
- deviceList,
- admissionConfiguration,
- associationConfiguration,
- infoPage
- },
- data(){
- return{
- pageType:1,
- // 遮罩层
- loading: true,
- // 显示搜索条件
- showSearch: true,
- // 总条数
- total: 0,
- // 查询参数
- queryParams: {
- pageNum: 1,
- pageSize:20,
- name: null,
- floorId: null,
- room: null,
- deptId: null,
- deptName: null,
- adminId: null,
- isDel: null,
- userId: null,
- diyOrder: null
- },
- // 实验室表格数据
- subjectList: [],
- //学院列表
- deptOptions:[],
- //当前选中实验室
- checkedSubject:{},
- //当前选中右侧按钮
- rightButtonType:1,
- //编辑实验室数据
- subjectData:{},
- // 临时保存排序
- sort:"",
- //播放文字的实验室id
- subId:"",
- open:false,
- form:{},
- //智能门禁
- entranceList:[
- {
- status:1,
- name:'门禁名称',
- num:'XD12345678912'
- },
- {
- status:0,
- name:'门禁名称',
- num:'XD12345678912'
- }
- ],
- rules:{
- txt:[
- {required: true, message: '请输入播放文字', trigger: 'blur'},
- { required: true, message: "请输入播放文字", validator: this.spaceJudgment, trigger: "blur" }
- ],
- type:[
- {required: true, message: '请选择播报方式', trigger: 'blur'}
- ],
- },
- newData:{
- },
- //MQTT请求参数-传感器
- mtopic:"lab/function/data",
- //MQTT请求参数-硬件
- mtopicOne:"lab/hardware/data",
- //MQTT请求参数-传感器-预案
- mtopicTow:"lab/riskPlan/trigger/notice",
- msg:"",
- client:{},
- videoList:[],
- //警报数据
- totalTwo:0,
- tableList:[],
- queryParamsTwo:{
- pageNum:1,
- pageSize:20,
- },
- hardwareData:[],
- //mqtt实验室id
- mqttIdList:[],
- //字典排风扇数组
- fanList:[],
- selectTriggerList:[],//预案触发下,预案数据存储
- hardwareTypeCode:'',
- triggerModes:'',
- }
- },
- created() {
- },
- mounted(){
- this.getDeptList();
- // this.subscriptionMQTT();
- this.getList();
- this.getlistData();
- // this.queryHardByTypeList();
- },
- methods:{
- //查询当前用户下的预案触发数据
- selectTriggerFun(data){
- let self = this;
- let dataArr=data;
- let list=JSON.parse(localStorage.getItem('selectTriggerList'));
- for(let i=0;i<list.length;i++){
- if(self.subId==list[i].subId){//如果当前选中的实验室和预案触发的实验室id
- for(let b=0;b<dataArr.length;b++){
- if(list[i].funNum==dataArr[b].funNum){
- if(list[i].minMonitor<dataArr[b].roundVlue<list[i].maxMonitor){//传感器值正常
- dataArr[b].type=1
- }else{//传感器值异常
- }
- }
- }
- }
- }
- return dataArr;
- },
- /** 查询字典数据列表 */
- getlistData() {
- this.loading = true;
- listData({pageNum:1,pageSize:20,dictType:'trigger_modes'}).then(response => {
- this.fanList=response.rows
- });
- },
- goAlarmRecord(){
- this.$router.push({
- path: `/chemicalLibrary/alarmRecord`,
- })
- },
- //智能门禁
- queryHardByTypeList(){
- let _this=this;
- let obj={
- subjectId:this.subId,
- type:'HK_DOOR',
- }
- queryHardByTypeList(obj).then( response => {
- let res=response.data;
- _this.entranceList=res;
- });
- },
- //报警器开启关闭方法
- changeIsNeedCaptchaAlarm(row){
- let self = this;
- console.log(row.status)
- if(row.status!=3 && row.status!=4){
- return
- }
- let text = row.status==3?'关闭':(row.status==4?'开启':'')
- this.$confirm(`是否`+text+`此设备`, "提示", {
- confirmButtonText: "确定",
- cancelButtonText: "取消",
- type: "warning"
- }).then(async () => {
- self.alarmControl(row)
- }).catch(() => {
- })
- },
- //开关按钮
- alarmControl(row){
- let switchData = {
- id:row.id,
- switchVal:row.status==3?'close':(row.status==4?'open':'')
- };
- alarmControl(switchData).then(response => {
- if(response.code==200){
- row.status = row.status==3?4:(row.status==4?3:'')
- }
- });
- },
- //获取实验室绑定报警器设备数据
- getEnablelist(){
- let obj = {
- subjectId:this.subId,
- type:"AI_ALARM"
- }
- getEnablelist(obj).then(response => {
- this.hardwareData = response.rows;
- });
- },
- //获取实验室报警列表数据
- getHxpAlarmRecordNoAuthList(){
- this.queryParamsTwo.subId = this.subId;
- getHxpAlarmRecordNoAuthList(this.queryParamsTwo).then(response => {
- this.totalTwo = response.total;
- this.tableList = response.rows;
- });
- },
- //播放文字
- handleAdd(id) {
- this.open = true;
- this.subId = id;
- },
- // 取消按钮
- cancel() {
- this.form = {};
- this.open = false;
- },
- /*播放文字*/
- submitFormOne(){
- this.$refs["form"].validate(valid => {
- if (valid) {
- let id = this.subId;
- mangerVoice(this.form,id).then(response => {
- this.msgSuccess("播放成功");
- this.open = false;
- this.getList();
- });
- }
- });
- },
- // 页面切换
- clickPage(type,row){
- if(this.pageType != type){
- if(type == 1){
- //列表页面
- this.pageType = type;
- this.getList();
- this.$set(this,'subjectData',{})
- }else if(type == 2){
- //新增页面
- this.pageType = type;
- }else if(type == 3){
- //编辑页面
- //this.pageType = 2;
- this.editFun(row);
- //this.$set(this,'subjectData',row)
- }else if(type == 4){
- this.pageType = 3;
- this.$set(this,'subjectData',row)
- }else if(type == 5){
- this.pageType = 4;
- this.$set(this,'subjectData',row)
- }else if(type == 6){
- this.pageType = 5;
- this.$set(this,'subjectData',row)
- }else if(type == 7){
- this.subjectInfoTwo(row);
- // this.$set(this,'subjectData',row)
- }
- }
- },
- //实验室编辑
- editFun(row){
- let self = this;
- let type = 0; //硬件 //0全部
- subjectInfo(row.id,type).then(response => {
- console.log(response.data)
- this.$set(this,'subjectData',response.data)
- this.pageType = 2;
- })
- },
- //获取实验室详情
- subjectInfoTwo(row){
- let self = this;
- let type = 0; //硬件 //0全部
- subjectInfo(row.id,type).then(response => {
- // console.log("获取实验室详情",response.data)
- this.$set(this,'newData',response.data);
- if(response.data.safeUserName){
- this.$set(this.newData,'safeUserName',response.data.safeUserName.split(','));
- }
- if(response.data.safeUserPhone){
- this.$set(this.newData,'safeUserPhone',response.data.safeUserPhone.split(','));
- }
- if(response.data.safeSigns){
- this.$set(this.newData,'safeSigns',response.data.safeSigns.split(','));
- }
- if(response.data.hazardCategory){
- this.$set(this.newData,'hazardCategory',response.data.hazardCategory.split(','));
- }
- if(response.data.outfire){
- this.$set(this.newData,'outfire',response.data.outfire.split(','));
- }
- if(response.data.riskMeasure){
- this.$set(this.newData,'riskMeasure',response.data.riskMeasure.split(','));
- }
- let list = [];
- let listTwo = [];
- if (response.data.labHardwareVOList){
- for(let i=0;i<response.data.labHardwareVOList.length;i++){
- if(response.data.labHardwareVOList[i].hardwareTypeEnum.enumName == 'VIDEO_MONITOR'){
- list.push(response.data.labHardwareVOList[i].hardwareNUM);
- }
- // if(response.data.labHardwareVOList[i].hardwareTypeEnum.enumName == 'SWITCH' || response.data.labHardwareVOList[i].hardwareTypeEnum.enumName == 'AI_VENTILATION' || response.data.labHardwareVOList[i].hardwareTypeEnum.enumName == 'ONE_MACHINE'){
- if(response.data.labHardwareVOList[i].hardwareTypeEnum.enumName == 'SWITCH' || response.data.labHardwareVOList[i].hardwareTypeEnum.enumName == 'AI_VENTILATION'){
- listTwo.push(response.data.labHardwareVOList[i])
- }
- }
- }
- this.$set(this.newData,'labHardwareVOListTwo',listTwo);
- if(list[0]){
- let obj = {
- count:"100",
- deviceIds:list.join(),
- page:"1",
- };
- let urlText = window.location.href;
- if(urlText.indexOf(localStorage.getItem('ipIdentify')) != -1){
- startUrl(obj).then(res => {
- if(res.code == 200){
- if(!res.data[0]){
- this.msgError("视频配置异常请联系管理员")
- this.newData.videoData = [];
- this.pageType = 6;
- }else{
- let newData = res.data;
- let videoList = [];
- for(let i=0;i<newData.length;i++){
- let obj = {
- name:response.data.name + response.data.subAddrr.room,
- videoType:"flv",
- divId:'divId'+i,
- url:newData[i].ws_flv,
- }
- videoList.push(obj)
- }
- this.$set(this.newData,'videoData',videoList);
- this.pageType = 6;
- }
- }
- });
- }else{
- startUrl(obj).then(res => {
- if(res.code == 200){
- if(!res.data[0]){
- this.msgError("视频配置异常请联系管理员")
- this.newData.videoData = [];
- this.pageType = 6;
- }else{
- let newData = res.data;
- let videoList = [];
- for(let i=0;i<newData.length;i++){
- let text = localStorage.getItem('cameraUrl');
- let url = newData[i].ws_flv;
- url = url.split("rtp/");
- let newUrl = text+'rtp/'+url[1];
- let obj = {
- name:response.data.name + response.data.subAddrr.room,
- videoType:"flv",
- divId:'divId'+i,
- url:newUrl,
- }
- videoList.push(obj)
- }
- this.$set(this.newData,'videoData',videoList);
- this.pageType = 6;
- }
- }
- });
- }
- }else{
- this.$set(this.newData,'videoData',[]);
- this.pageType = 6;
- }
- })
- },
- // 开启关闭验证
- async changeIsNeedCaptcha (row) {
- let self = this;
- console.log(row)
- if(row.state.code!=3 && row.state.code!=4){
- return
- }
- let text = row.state.code==3?'关闭':(row.state.code==4?'开启':'')
- this.$confirm(`是否`+text+`此设备`, "提示", {
- confirmButtonText: "确定",
- cancelButtonText: "取消",
- type: "warning"
- }).then(async () => {
- //如果是开启的时候调用
- if(row.state.code==4 && row.hardwareTypeEnum.hardwareTypeCode==2){
- self.subjectTriggerModes(row)
- }else{
- self.switchChange(row)
- }
- }).catch(() => {
- })
- },
- //点击开关按钮开启的时候充电调用硬件状态
- subjectTriggerModes(row){
- let self=this;
- subjectTriggerModes(row.id).then(response => {
- if(response.code==200){
- self.hardwareTypeCode=response.data.hardwareType.hardwareTypeCode
- self.triggerModes=response.data.triggerModes
- self.switchChange(row)
- }
- });
- },
- //开关按钮
- switchChange(row){
- let self=this;
- let switchData = {
- id:row.id,
- switchVal:row.state.code==3?'close':(row.state.code==4?'open':'')
- };
- hardWareControl(switchData).then(response => {
- if(response.code==200){
- row.state.code = row.state.code==3?4:(row.state.code==4?3:'')
- if(self.hardwareTypeCode){
- row.hardwareTypeEnum.hardwareTypeCode=self.hardwareTypeCode
- row.triggerModes=self.triggerModes
- for(let b=0;b<self.fanList.length;b++){
- if(self.fanList[b].dictValue==row.triggerModes){
- row.dictLabel=self.fanList[b].dictLabel
- }
- }
- }
- this.msgSuccess("操作成功")
- }
- });
- },
- //切换实验室展示数据
- rightButtonClick(type){
- let self = this;
- if(this.rightButtonType != type){
- this.rightButtonType = type;
- this.videoOff();
- if(type == 3){
- let self = this;
- let list = [];
- if(self.checkedSubject.labHardwareVOList){
- for(let i=0;i<self.checkedSubject.labHardwareVOList.length;i++){
- if(self.checkedSubject.labHardwareVOList[i].hardwareTypeEnum.enumName == 'VIDEO_MONITOR'){
- list.push(self.checkedSubject.labHardwareVOList[i].hardwareNUM);
- }
- }
- if(list[0]){
- let obj = {
- count:"100",
- deviceIds:list+'',
- page:"1",
- };
- let urlText = window.location.href;
- if(urlText.indexOf(localStorage.getItem('ipIdentify')) != -1){
- startUrl(obj).then(res => {
- if(res.code == 200){
- if(!res.data[0]){
- this.msgError("视频配置异常请联系管理员")
- return
- }
- let newData = res.data;
- let videoList = [];
- for(let i=0;i<newData.length;i++){
- let obj = {
- name:self.checkedSubject.name + self.checkedSubject.subAddrr.room,
- videoType:"flv",
- divId:'divId'+i,
- url:newData[i].ws_flv,
- }
- videoList.push(obj)
- }
- this.$set(this.checkedSubject,'videoData',videoList);
- if(this.rightButtonType == 3){
- setTimeout(function(){
- self.videoFunction();
- },1000);
- }
- }
- });
- }else{
- startUrl(obj).then(res => {
- if(res.code == 200){
- if(!res.data[0]){
- this.msgError("视频配置异常请联系管理员")
- return
- }
- let newData = res.data;
- let videoList = [];
- for(let i=0;i<newData.length;i++){
- let text = localStorage.getItem('cameraUrl');
- let url = newData[i].ws_flv;
- url = url.split("rtp/");
- let newUrl = text+'rtp/'+url[1];
- let obj = {
- name:self.checkedSubject.name + self.checkedSubject.subAddrr.room,
- videoType:"flv",
- divId:'divId'+i,
- url:newUrl,
- }
- videoList.push(obj)
- }
- this.$set(this.checkedSubject,'videoData',videoList);
- if(this.rightButtonType == 3){
- setTimeout(function(){
- self.videoFunction();
- },1000);
- }
- }
- });
- }
- }else{
- this.$set(this.checkedSubject,'videoData',[]);
- }
- }else{
- this.$set(this.checkedSubject,'videoData',[]);
- }
- }else if(type==2){
- for(let i=0;i<self.checkedSubject.VOlist.length;i++){
- if(self.checkedSubject.VOlist[i].hardwareTypeEnum.hardwareTypeCode == '2'){
- for(let b=0;b<self.fanList.length;b++){
- if(self.fanList[b].dictValue==self.checkedSubject.VOlist[i].triggerModes){
- self.checkedSubject.VOlist[i].dictLabel=self.fanList[b].dictLabel
- }
- }
- }
- }
- }else if(type==5){
- this.queryHardByTypeList();
- }
- }
- },
- //选中实验室
- handleCurrentChange(val){
- let self = this;
- if(val.id != this.checkedSubject.id){
- this.videoOff();
- this.offMQTT();
- this.subjectInfo(val.id);
- this.subId = val.id;
- this.$set(this,'queryParamsTwo',{
- pageNum:1,
- pageSize:20,
- });
- this.getEnablelist();
- this.getHxpAlarmRecordNoAuthList();
- this.subscriptionMQTT();
- }
- },
- //获取实验室详情
- subjectInfo(id){
- let type = 1; //硬件 //0全部
- subjectInfo(id,type).then(response => {
- let obj = JSON.parse(JSON.stringify(response.data));
- obj.VOlist = [];
- if(response.data.labHardwareVOList){
- for(let i=0;i<response.data.labHardwareVOList.length;i++){
- if(response.data.labHardwareVOList[i].hardwareTypeEnum.enumName == 'SWITCH'||
- response.data.labHardwareVOList[i].hardwareTypeEnum.enumName == 'AI_VENTILATION'){
- if( response.data.labHardwareVOList[i].isPcfire == 0 ){
- obj.VOlist.push(response.data.labHardwareVOList[i]);
- }
- }
- }
- }
- //判断传感器是否在线如果不在线type为2
- if(response.data.sensorFunctionStatusList){
- obj.sensorFunctionStatusList.forEach(function(item) {
- if(item.formatVal.indexOf("--") != -1){
- item.type=2
- }
- })
- obj.sensorFunctionStatusList=this.selectTriggerFun(obj.sensorFunctionStatusList)
- }
- this.$set(this,'checkedSubject',obj);
- this.$set(this.checkedSubject,'videoData',[]);
- this.rightButtonType = 1;
- })
- },
- //编辑按钮
- handleCommand(command, row){
- switch (command) {
- case "1":
- console.log('关联配置');
- this.clickPage(6,row);
- break;
- case "2":
- console.log('物联配置');
- this.clickPage(4,row);
- break;
- case "3":
- console.log('准入配置');
- this.clickPage(5,row);
- break;
- case "4":
- console.log('编辑');
- this.clickPage(3,row);
- break;
- case "5":
- console.log('删除');
- break;
- default:
- break;
- }
- },
- //保存当前排序
- liveSort(row){
- let obj = {
- sort:row.diyOrder
- }
- this.sort = JSON.parse(JSON.stringify(obj));
- },
- //编辑排序
- editSort(row){
- let self = this;
- if(row.diyOrder != this.sort.sort){
- self.$confirm('是否确认修改排序?', "", {
- confirmButtonText: "确定",
- cancelButtonText: "取消",
- type: "warning"
- }).then(function() {
- let obj = {
- id:row.id,
- diyOrder:row.diyOrder,
- };
- laboratorySubjectEditSort(obj).then(response => {
- self.msgSuccess("修改成功");
- self.getList();
- });
- }).then(() => {}).catch(() => {
- let obj = JSON.parse(JSON.stringify(self.sort));
- row.diyOrder = obj.sort
- });
- }
- },
- /** 搜索按钮操作 */
- handleQuery() {
- this.queryParams.pageNum = 1;
- this.getList();
- },
- /** 重置按钮操作 */
- resetQuery() {
- this.$set(this,'queryParams',{
- pageNum: 1,
- pageSize:20,
- deptId:"",
- name: '',
- });
- // this.resetForm("queryForm");
- this.handleQuery();
- },
- /** 查询实验室列表 */
- getList() {
- this.loading = true;
- // this.offMQTT();
- authListSubject(this.queryParams).then(response => {
- this.subjectList = response.rows;
- this.total = response.total;
- this.loading = false;
- if(response.rows[0]){
- this.$refs.multipleTable.setCurrentRow(response.rows[0]);
- this.subjectInfo(response.rows[0].id);
- }
- let idList = [];
- for(let i=0;i<response.rows.length;i++){
- idList.push(response.rows[i].id)
- }
- this.$set(this,'mqttIdList',idList);
- // this.subscriptionMQTT();
- });
- },
- /** 查询学院列表 */
- getDeptList() {
- filterDept().then(response => {
- this.$set(this, 'deptOptions', response.data)
- });
- },
- //MQTT订阅
- subscriptionMQTT(){
- let self = this;
- this.client = mqtt.connect(localStorage.getItem('mqttUrl'), {
- username: localStorage.getItem('mqttUser'),
- password:localStorage.getItem('mqttPassword')
- });
- this.client.on("connect", e =>{
- console.log("连接成功");
- this.client.subscribe(this.mtopic+self.subId, (err) => {
- if (!err) {
- console.log("订阅成功:" + this.mtopic+self.subId);
- }
- });
- this.client.subscribe(this.mtopicOne+self.subId, (err) => {
- if (!err) {
- console.log("订阅成功:" + this.mtopicOne+self.subId);
- }
- });
- // for(let i = 0; i< self.mqttIdList.length;i++){
- // this.client.subscribe(this.mtopic+self.mqttIdList[i], (err) => {
- // if (!err) {
- // console.log("订阅成功:" + this.mtopic+self.mqttIdList[i]);
- // }
- // });
- // this.client.subscribe(this.mtopicOne+self.mqttIdList[i], (err) => {
- // if (!err) {
- // console.log("订阅成功:" + this.mtopicOne+self.mqttIdList[i]);
- // }
- // });
- // }
- });
- this.client.on("message", (topic, message) => {
- // console.log('message',message)
- if (message){
- let data = JSON.parse(message)
- //console.log("MQTT----message",data)
- if(data.data.subId){
- //传感器
- // console.log("传感器",data.data.subId,'---------',data);
- if(self.checkedSubject.id){
- if(data.data.subId&&data.data.subId == self.checkedSubject.id){
- self.$set(self.checkedSubject,'sensorFunctionStatusList',data.data.functionStatuses);
- self.$set(self.checkedSubject.sensorFunctionStatusList[0],'sendDate',data.sendDate);
- //判断传感器是否在线如果不在线type为2
- self.checkedSubject.sensorFunctionStatusList.forEach(function(item) {
- if(item.formatVal.indexOf("--") != -1){
- item.type=2
- }
- })
- self.checkedSubject.sensorFunctionStatusList=self.selectTriggerFun(self.checkedSubject.sensorFunctionStatusList)
- }
- }
- if(self.newData.id){
- if(data.data.subId&&data.data.subId == self.newData.id){
- self.$set(self.newData,'sensorFunctionStatusList',data.data.functionStatuses);
- self.$set(self.newData.sensorFunctionStatusList[0],'sendDate',data.sendDate);
- }
- }
- }else{
- //硬件
- //console.log("硬件",data);
- for (let i = 0; i < data.data.length; i++) {
- if (self.checkedSubject.VOlist) {
- for (let k = 0; k < self.checkedSubject.VOlist.length; k++) {
- if (self.checkedSubject.VOlist[k].id == data.data[i].num) {
- if (data.data[i].hardwareOperate == 'CLOSE') {
- self.checkedSubject.VOlist[k].state.code = 4;
- } else if (data.data[i].hardwareOperate == 'OPEN') {
- self.checkedSubject.VOlist[k].state.code = 3;
- } else if (data.data[i].hardwareOperate == 'OFFLINE') {
- self.checkedSubject.VOlist[k].state.code = 0;
- }
- }
- if(self.checkedSubject.VOlist[k].hardwareTypeEnum.hardwareTypeCode == '2'){
- for(let b=0;b<self.fanList.length;b++){
- if(self.fanList[b].dictValue==self.checkedSubject.VOlist[k].triggerModes){
- self.checkedSubject.VOlist[k].dictLabel=self.fanList[b].dictLabel
- }
- }
- }
- }
- }
- if(self.newData.labHardwareVOList){
- for(let k=0;k<self.newData.labHardwareVOList.length;k++){
- if(self.newData.labHardwareVOList[k].id == data.data[i].num){
- if(data.data[i].hardwareOperate == 'CLOSE'){
- self.newData.labHardwareVOList[k].state.code = 4;
- }else if(data.data[i].hardwareOperate == 'OPEN'){
- self.newData.labHardwareVOList[k].state.code = 3;
- }else if(data.data[i].hardwareOperate == 'OFFLINE'){
- self.newData.labHardwareVOList[k].state.code = 0;
- }
- }
- }
- }
- }
- }
- }
- });
- },
- //取消订阅关闭MQTT连接
- offMQTT(){
- let self = this;
- if (self.mqttIdList[0]){
- // for(let i=0;i<self.mqttIdList.length;i++){
- // self.client.unsubscribe(self.mtopic+self.mqttIdList[i], error => {
- // if (error) {
- // console.log('Unsubscribe error', error)
- // }
- // })
- // self.client.unsubscribe(self.mtopicOne+self.mqttIdList[i], error => {
- // if (error) {
- // console.log('Unsubscribe error', error)
- // }
- // })
- // }
- self.client.unsubscribe(self.mtopic+self.subId, error => {
- if (error) {
- console.log('Unsubscribe error', error)
- }
- })
- self.client.unsubscribe(self.mtopicOne+self.subId, error => {
- if (error) {
- console.log('Unsubscribe error', error)
- }
- })
- self.client.end();
- self.client = {};
- }
- },
- //视频方法
- videoFunction(){
- let self = this;
- // self.videoList = [];
- for(let i=0;i<self.checkedSubject.videoData.length;i++){
- let obj = {
- player :{},
- flvPlayer:{}
- };
- obj.player = document.getElementById(self.checkedSubject.videoData[i].divId);
- // if (flvjs.isSupported()) {
- obj.flvPlayer = flvjs.createPlayer(
- {
- // isLive: true, //=> 是否为直播流
- // hasAudio: false, //=> 是否开启声音
- type: self.checkedSubject.videoData[i].videoType, //媒体类型 flv 或 mp4
- url: self.checkedSubject.videoData[i].url //视频流地址
- },
- {
- enableStashBuffer: true,//启用 IO 存储缓冲区。 如果您需要实时流播放(最小延迟),请设置为 false,但如果存在网络抖动,则可能会停止。
- stashInitialSize: 128,//IO 存储缓冲区初始大小。 默认值为 384KB。 指示合适的大小可以改善视频加载/搜索时间。
- isLive: true,//是否是直播
- lazyLoadRecoverDuration: 30,//指示以秒为单位的lazyLoad 恢复时间边界。
- autoCleanupSourceBuffer: true,//进行自动清理
- autoCleanupMaxBackwardDuration: 3 * 60,//3 * 60 当向后缓冲持续时间超过这个值(以秒为单位)时,对 SourceBuffer 进行自动清理
- autoCleanupMinBackwardDuration: 2 * 60,//2 * 60 指示在执行自动清理时为后向缓冲区保留的持续时间(以秒为单位)。
- }
- );
- self.videoList.push(obj);
- // }
- console.log("i",i)
- }
- for(let i=0;i<self.videoList.length;i++){
- self.videoList[i].flvPlayer.attachMediaElement(self.videoList[i].player);
- self.videoList[i].flvPlayer.load(); //加载
- self.videoList[i].flvPlayer.play(); //加载
- }
- },
- //视屏全屏方法
- videoFullScreen(index){
- this.$refs.videoRef[index].webkitRequestFullScreen();
- },
- //断开视频流
- videoOff(){
- let self = this;
- if(self.videoList[0]){
- for(let i=0;i<self.videoList.length;i++){
- self.videoList[i].flvPlayer.pause();
- self.videoList[i].flvPlayer.unload();
- self.videoList[i].flvPlayer.detachMediaElement();
- self.videoList[i].flvPlayer.destroy();
- self.videoList[i].flvPlayer = null;
- }
- self.videoList = [];
- }
- },
- },
- beforeDestroy() {
- //清除定时器
- let self = this;
- self.videoOff();
- self.offMQTT();
- },
- }
- </script>
- <style scoped lang="scss">
- .subject{
- flex:1;
- display: flex!important;
- flex-direction: column;
- overflow: hidden;
- *{
- margin:0;
- }
- .subject-page{
- flex:1;
- display: flex;
- flex-direction: column;
- overflow: hidden;
- border-radius:10px;
- margin:5px 0 0 0;
- //box-shadow: 0 0 8px 1px rgba(0, 0, 0, 0.1);
- .subject-page-min{
- flex:1;
- display: flex;
- overflow: hidden;
- padding: 2px 0 10px 10px;
- box-sizing: border-box;
- }
- .left-subject-list{
- /*flex:1;*/
- width:1143px;
- display: flex;
- flex-direction: column;
- margin-right:6px;
- overflow: hidden ;
- box-shadow: 0px 2px 6px 0px rgba(0,0,0,0.2);
- border-radius: 20px 20px 20px 20px;
- padding-top: 24px;
- margin-bottom:10px;
- .table_border{
- flex:1;
- display: flex;
- flex-direction: column;
- padding: 20px 20px 10px;
- box-sizing: border-box;
- overflow: hidden;
- }
- }
- .overflow-box{
- overflow: hidden;
- }
- .right-subject-box{
- /*width:440px;*/
- flex:1;
- display: flex;
- flex-direction: column;
- .top-button-box{
- display: flex;
- margin-left:6px;
- div{
- padding:0 10px;
- height:40px;
- line-height:40px;
- font-size:14px;
- text-align: center;
- border-top-right-radius: 10px;
- border-top-left-radius: 10px;
- margin-right:1px;
- cursor: pointer;
- font-weight: 500;
- }
- .buttonColorA{
- color:#0045AF;
- background:#fff ;
- border: 1px solid #E0E0E0;
- border-bottom: 1px solid rgba(224,224,224,0.3);
- }
- .buttonColorB{
- color:#333;
- background:#E0E0E0 ;
- border: 1px solid #E0E0E0;
- border-bottom:none;
- }
- }
- .bottom-max-box{
- width:428px;
- box-shadow: 0px 2px 6px 0px rgba(0,0,0,0.2);
- border-radius: 0px 0px 20px 20px;
- font-weight:500;
- flex:1;
- display: flex;
- flex-direction: column;
- margin-left:6px;
- overflow: hidden;
- margin-bottom:10px;
- .bottom-sensor-box{
- overflow: hidden;
- display: flex;
- flex-direction: column;
- background: #fff;
- width:424px;
- flex:1;
- position: relative;
- // border: 1px solid #E0E0E0;
- //border-radius: 0 10px 10px 10px;
- .top-title{
- margin:16px 26px;
- display: flex;
- justify-content: space-between;
- >i{
- font-style: normal;
- line-height:18px;
- font-size:16px;
- color: #333;
- }
- }
- .null-text-p{
- text-align: center;
- font-size:16px;
- color:#999;
- line-height:50px;
- margin:0 30px;
- }
- .sensor-for-max-box{
- .sensor-for-big-box{
- display: inline-block;
- width:180px;
- height:60px;
- margin:0 0 11px 22px;
- border-radius: 10px;
- .sensor-for-min-box{
- display: flex;
- img{
- width:26px;
- height:26px;
- margin:17px 11px;
- }
- div{
- margin:9px 0;
- p{
- color:#fff;
- }
- p:nth-child(1){
- font-size:14px;
- line-height:20px;
- }
- p:nth-child(2){
- font-size:16px;
- line-height:22px;
- }
- }
- }
- }
- .sensor-color-a{
- background: #FF7272;
- color:#fff;
- }
- .sensor-color-b{
- background: #E0E0E0;
- color:#999999;
- }
- .sensor-color-c{
- background: #80D164;
- color:#fff;
- }
- }
- .bottom-text{
- line-height:18px;
- font-size:14px;
- color:#999999;
- margin:0 0px 0px 26px;
- position: absolute;
- bottom: 22px;
- }
- }
- .bottom-switch-box{
- background: #fff;
- width:424px;
- flex: 1;
- .top-title{
- margin:16px 26px;
- display: flex;
- justify-content: space-between;
- >i{
- font-style: normal;
- line-height:18px;
- font-size:16px;
- color: #333;
- }
- }
- .null-text-p{
- text-align: center;
- font-size:16px;
- color:#999;
- line-height:50px;
- margin:0 30px;
- }
- .switch-for-max-box{
- width: 424px;
- display: flex;
- justify-content: flex-start;
- flex-wrap: wrap;
- .switch-for-big-box{
- .switch-for-min-box{
- width:180px;
- height:70px;
- margin:0 0 14px 20px;
- background: rgba(1,131,250,0.1);
- border-radius: 10px 10px 10px 10px;
- padding: 10px;
- box-sizing: border-box;
- .switch-for-min-box_t{
- width: 100%;
- display: flex;
- justify-content: space-between;
- .switch-for-min-title{
- font-size:14px;
- line-height:24px;
- width: 84px;
- color: #333333;
- display:block;
- overflow:hidden;
- text-overflow:ellipsis;
- white-space:nowrap;
- }
- .switch-null-p{
- font-size:14px;
- line-height:24px;
- color:#999;
- }
- }
- .switch-for-min-box_b{
- margin-top: 10px;
- .switch-null-ventilate{
- width: 62px;
- height: 18px;
- border-radius: 10px 10px 10px 10px;
- opacity: 1;
- border: 1px solid #0183FA;
- font-size: 12px;
- font-weight: 400;
- color: #0183FA;
- line-height: 15px;
- text-align: center;
- float: left;
- }
- .switch{
- float: right;
- }
- }
- .switch-for-min-button{
- width:70px;
- height:30px;
- line-height:30px;
- font-size:14px;
- color:#0045AF;
- border-radius:6px;
- border: 1px solid #0045AF;
- margin-top:14px;
- text-align: center;
- cursor: pointer;
- }
- }
- }
- }
- }
- .bottom-video-box{
- background: #fff;
- width:424px;
- border-radius: 0 10px 10px 10px;
- flex: 1;
- .top-title{
- margin:16px 26px;
- display: flex;
- justify-content: space-between;
- >i{
- font-style: normal;
- line-height:18px;
- font-size:16px;
- color: #333;
- }
- }
- .null-text-p{
- text-align: center;
- font-size:16px;
- color:#999;
- line-height:50px;
- margin:0 30px;
- }
- .video-for-max-box{
- .switch-for-big-box{
- width:374px;
- height:262px;
- margin:0 auto 14px;
- position: relative;
- .position-p{
- width:42px;
- height:42px;
- text-align: center;
- line-height:42px;
- font-size:18px;
- position: absolute;
- top:0;
- right:0;
- color:#fff;
- cursor: pointer;
- }
- }
- }
- }
- .bottom-alarm-box{
- flex:1;
- display: flex;
- flex-direction: column;
- background: #fff;
- width:424px;
- overflow-x: hidden;
- padding: 0 27px 0 23px;
- box-sizing: border-box;
- .top-title{
- margin:16px 0px;
- display: flex;
- justify-content: space-between;
- >i{
- font-style: normal;
- line-height:18px;
- font-size:16px;
- color: #333;
- }
- }
- .alarm-max-box{
- width:374px;
- height:60px;
- display: flex;
- position:relative;
- background: #f5f5f5;
- border-radius: 10px 10px 10px 10px;
- margin: 10px 0 0 0;
- .alarm-img{
- width:30px;
- height:30px;
- margin:14px;
- }
- .alarm-big-box{
- p:nth-of-type(1){
- position:absolute;
- top:18px;
- left:64px;
- font-size: 14px;
- font-weight: 400;
- color: #333333;
- }
- .alarm-position-box{
- position:absolute;
- top:8px;
- left:260px;
- }
- p:nth-of-type(2){
- position:absolute;
- top:0px;
- right:0px;
- width: 50px;
- height: 20px;
- font-size:12px;
- font-weight:700;
- line-height:20px;
- border-radius: 0px 10px 0px 10px;
- text-align: center;
- }
- .colorTypeA{
- background: rgba(1,131,250,0.2);
- color:#0183FA;
- }
- .colorTypeB{
- background: #ECECEC;
- color:#A2A2A2;
- }
- }
- }
- .BGcolorTypeA{
- width:374px;
- height:60px;
- display: flex;
- position:relative;
- background: rgba(1,131,250,0.1);
- border-radius: 10px 10px 10px 10px;
- margin: 10px 0 0 0;
- }
- .BGcolorTypeB{
- width:374px;
- height:60px;
- display: flex;
- position:relative;
- background: #F5F5F5;
- border-radius: 10px 10px 10px 10px;
- margin: 10px 0 0 0;
- }
- .alarm-title-box{
- display: flex;
- p{
- line-height:60px;
- font-size:14px;
- }
- p:nth-child(1){
- flex:1;
- }
- p:nth-child(2){
- cursor: pointer;
- }
- }
- }
- /*智能门禁*/
- .bottom-entrance-box{
- flex: 1;
- background: #fff;
- width:424px;
- border-radius: 0 10px 10px 10px;
- .top-title{
- margin:16px 26px;
- display: flex;
- justify-content: space-between;
- >i{
- font-style: normal;
- line-height:18px;
- font-size:16px;
- color: #333;
- }
- }
- .entrance{
- width: 374px;
- height: 60px;
- display: flex;
- justify-content: flex-start;
- border-radius: 10px 10px 10px 10px;
- margin: 10px 0 0 26px;
- position: relative;
- .entrance_c{
- width: 30px;
- height: 30px;
- margin: 14px 20px 0px 14px;
- }
- .entrance_r{
- font-size: 14px;
- font-family: Microsoft YaHei-Regular, Microsoft YaHei;
- font-weight: 400;
- color: #333333;
- line-height: 60px;
- }
- .entrance_l_yes{
- width: 60px;
- height: 30px;
- background: #0183FA;
- border-radius: 0px 10px 0px 10px;
- font-size: 14px;
- font-weight: 400;
- color: #fff;
- line-height: 30px;
- text-align: center;
- position: absolute;
- top: 0;
- right: 0;
- }
- .entrance_l_no{
- width: 60px;
- height: 30px;
- background: #A2A2A2;
- border-radius: 0px 10px 0px 10px;
- font-size: 14px;
- font-weight: 400;
- color: #fff;
- line-height: 30px;
- text-align: center;
- position: absolute;
- top: 0;
- right: 0;
- }
- }
- .BGentrance_l_yes{
- background: rgba(1,131,250,0.1);
- }
- .BGentrance_l_no{
- background: #F5F5F5;
- }
- }
- .null-data-img{
- width:137px;
- height:137px;
- display: block;
- margin:10px auto;
- }
- .null-text-p{
- text-align: center;
- font-size:16px;
- color:#999;
- line-height:50px;
- margin:0 30px;
- }
- }
- }
- }
- }
- </style>
- <style lang="scss">
- .alarm-position-box{
- .switch .el-switch__label {
- position: absolute;
- display: none;
- color: #fff !important;
- }
- .switch .el-switch__label--right {
- z-index: 1;
- }
- .switch .el-switch__label--right span{
- margin-right: 9px;
- }
- .switch .el-switch__label--left {
- z-index: 1;
- }
- .switch .el-switch__label--left span{
- margin-left: 9px;
- }
- .switch .el-switch__label.is-active {
- display: block;
- }
- .switch.el-switch .el-switch__core{
- background-color: rgba(255,196,124)!important;
- border-color: rgba(255,196,124)!important;
- }
- .switch.el-switch .el-switch__core,
- .el-switch .el-switch__label {
- width: 68px !important;
- height:20px!important;
- line-height:30px!important;
- -webkit-border-radius: 20px!important;
- -moz-border-radius: 20px!important;
- border-radius: 20px!important;
- margin: 0;
- position: absolute;
- top: 0;
- }
- .switch .el-switch__label--left span{
- margin-left:22px!important;
- font-size: 12px;
- color: #fff;
- line-height: 20px;
- position: relative;
- top: -5px;
- }
- .switch .el-switch__label--right span{
- margin-left:5px!important;
- font-size: 12px;
- position: relative;
- top: -5px;
- }
- .el-switch__core:after{
- background: #FA8A01 !important;
- height:16px!important;
- width:16px!important;
- top:1px!important;
- }
- .el-switch.is-checked .el-switch__core::after{
- margin-left: -20px!important;
- }
- .el-switch{
- margin:10px auto 0;
- display: block;
- width:80px!important;
- height:4px!important;
- }
- }
- .subject-alarm-time{
- .el-table__empty-text{
- background-size: 45%;
- }
- }
- </style>
|