|
@@ -0,0 +1,1117 @@
|
|
|
+<template>
|
|
|
+ <div class="app-container">
|
|
|
+ <!-- <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
|
|
|
+ <el-form-item label="摄像头名称" prop="cname">
|
|
|
+ <el-input
|
|
|
+ v-model="queryParams.cname"
|
|
|
+ placeholder="请输入摄像头名称"
|
|
|
+ clearable
|
|
|
+ size="small"
|
|
|
+ @keyup.enter.native="handleQuery"
|
|
|
+ />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="访问地址" prop="caddr">
|
|
|
+ <el-input
|
|
|
+ v-model="queryParams.caddr"
|
|
|
+ placeholder="请输入访问地址"
|
|
|
+ clearable
|
|
|
+ size="small"
|
|
|
+ @keyup.enter.native="handleQuery"
|
|
|
+ />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="状态" prop="cstatus">
|
|
|
+ <el-select v-model="queryParams.cstatus" placeholder="请选择状态" clearable size="small">
|
|
|
+ <el-option label="请选择字典生成" value="" />
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="创建时间" prop="createtime">
|
|
|
+ <el-date-picker clearable size="small"
|
|
|
+ v-model="queryParams.createtime"
|
|
|
+ type="date"
|
|
|
+ value-format="yyyy-MM-dd"
|
|
|
+ placeholder="选择创建时间">
|
|
|
+ </el-date-picker>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="单位id" prop="unitid">
|
|
|
+ <el-input
|
|
|
+ v-model="queryParams.unitid"
|
|
|
+ placeholder="请输入单位id"
|
|
|
+ clearable
|
|
|
+ size="small"
|
|
|
+ @keyup.enter.native="handleQuery"
|
|
|
+ />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="单位名称" prop="unitname">
|
|
|
+ <el-input
|
|
|
+ v-model="queryParams.unitname"
|
|
|
+ placeholder="请输入单位名称"
|
|
|
+ clearable
|
|
|
+ size="small"
|
|
|
+ @keyup.enter.native="handleQuery"
|
|
|
+ />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="存入菜单ID" prop="powerArea">
|
|
|
+ <el-input
|
|
|
+ v-model="queryParams.powerArea"
|
|
|
+ placeholder="请输入存入菜单ID"
|
|
|
+ clearable
|
|
|
+ size="small"
|
|
|
+ @keyup.enter.native="handleQuery"
|
|
|
+ />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item>
|
|
|
+ <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
|
|
+ <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
|
|
+ </el-form-item>
|
|
|
+ </el-form> -->
|
|
|
+
|
|
|
+ <!-- <el-row :gutter="10" class="mb8">
|
|
|
+ <el-col :span="1.5">
|
|
|
+ <el-button
|
|
|
+ type="primary"
|
|
|
+ plain
|
|
|
+ icon="el-icon-plus"
|
|
|
+ size="mini"
|
|
|
+ @click="handleAdd"
|
|
|
+ v-hasPermi="['monitoring:camera:add']"
|
|
|
+ >新增</el-button>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="1.5">
|
|
|
+ <el-button
|
|
|
+ type="success"
|
|
|
+ plain
|
|
|
+ icon="el-icon-edit"
|
|
|
+ size="mini"
|
|
|
+ :disabled="single"
|
|
|
+ @click="handleUpdate"
|
|
|
+ v-hasPermi="['monitoring:camera:edit']"
|
|
|
+ >修改</el-button>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="1.5">
|
|
|
+ <el-button
|
|
|
+ type="danger"
|
|
|
+ plain
|
|
|
+ icon="el-icon-delete"
|
|
|
+ size="mini"
|
|
|
+ :disabled="multiple"
|
|
|
+ @click="handleDelete"
|
|
|
+ v-hasPermi="['monitoring:camera:remove']"
|
|
|
+ >删除</el-button>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="1.5">
|
|
|
+ <el-button
|
|
|
+ type="warning"
|
|
|
+ plain
|
|
|
+ icon="el-icon-download"
|
|
|
+ size="mini"
|
|
|
+ :loading="exportLoading"
|
|
|
+ @click="handleExport"
|
|
|
+ v-hasPermi="['monitoring:camera:export']"
|
|
|
+ >导出</el-button>
|
|
|
+ </el-col>
|
|
|
+ <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
|
|
+ </el-row> -->
|
|
|
+ <!--
|
|
|
+ <el-table v-loading="loading" :data="cameraList" @selection-change="handleSelectionChange">
|
|
|
+ <el-table-column type="selection" width="55" align="center" />
|
|
|
+ <el-table-column label="存入菜单ID" align="center" prop="id" />
|
|
|
+ <el-table-column label="摄像头名称" align="center" prop="cname" />
|
|
|
+ <el-table-column label="访问地址" align="center" prop="caddr" />
|
|
|
+ <el-table-column label="状态" align="center" prop="cstatus" />
|
|
|
+ <el-table-column label="创建时间" align="center" prop="createtime" width="180">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <span>{{ parseTime(scope.row.createtime, '{y}-{m}-{d}') }}</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="单位id" align="center" prop="unitid" />
|
|
|
+ <el-table-column label="单位名称" align="center" prop="unitname" />
|
|
|
+ <el-table-column label="存入菜单ID" align="center" prop="powerArea" />
|
|
|
+ <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <el-button
|
|
|
+ size="mini"
|
|
|
+ type="text"
|
|
|
+ icon="el-icon-edit"
|
|
|
+ @click="handleUpdate(scope.row)"
|
|
|
+ v-hasPermi="['monitoring:camera:edit']"
|
|
|
+ >修改</el-button>
|
|
|
+ <el-button
|
|
|
+ size="mini"
|
|
|
+ type="text"
|
|
|
+ icon="el-icon-delete"
|
|
|
+ @click="handleDelete(scope.row)"
|
|
|
+ v-hasPermi="['monitoring:camera:remove']"
|
|
|
+ >删除</el-button>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ </el-table> -->
|
|
|
+
|
|
|
+ <!-- <pagination
|
|
|
+ v-show="total>0"
|
|
|
+ :total="total"
|
|
|
+ :page.sync="queryParams.pageNum"
|
|
|
+ :limit.sync="queryParams.pageSize"
|
|
|
+ @pagination="getList"
|
|
|
+ /> -->
|
|
|
+
|
|
|
+ <!-- 添加或修改安防监控对话框 -->
|
|
|
+ <!-- <el-dialog :title="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="cname">
|
|
|
+ <el-input v-model="form.cname" placeholder="请输入摄像头名称" />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="访问地址" prop="caddr">
|
|
|
+ <el-input v-model="form.caddr" placeholder="请输入访问地址" />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="状态">
|
|
|
+ <el-radio-group v-model="form.cstatus">
|
|
|
+ <el-radio label="1">请选择字典生成</el-radio>
|
|
|
+ </el-radio-group>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="单位id" prop="unitid">
|
|
|
+ <el-input v-model="form.unitid" placeholder="请输入单位id" />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="单位名称" prop="unitname">
|
|
|
+ <el-input v-model="form.unitname" placeholder="请输入单位名称" />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="存入菜单ID" prop="powerArea">
|
|
|
+ <el-input v-model="form.powerArea" placeholder="请输入存入菜单ID" />
|
|
|
+ </el-form-item>
|
|
|
+ </el-form>
|
|
|
+ <div slot="footer" class="dialog-footer">
|
|
|
+ <el-button type="primary" @click="submitForm">确 定</el-button>
|
|
|
+ <el-button @click="cancel">取 消</el-button>
|
|
|
+ </div>
|
|
|
+ </el-dialog> -->
|
|
|
+ <!-- 视频播放窗口 -->
|
|
|
+ <el-row>
|
|
|
+ <el-col :span="1.5" class="isSubmit">
|
|
|
+ <el-radio-group v-model="queryParams.type" @change="caoZuoTypefun">
|
|
|
+ <el-radio-button label="0">单屏</el-radio-button>
|
|
|
+ <el-radio-button label="1">四分屏</el-radio-button>
|
|
|
+ <el-radio-button label="2">九分屏</el-radio-button>
|
|
|
+ <el-radio-button label="3" class="allFlv1">十六分屏</el-radio-button>
|
|
|
+ <el-radio-button label="4" class="allFlv">全通道FLV</el-radio-button>
|
|
|
+ <el-radio-button label="5" class="fullscreen">全屏</el-radio-button>
|
|
|
+ </el-radio-group>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ <hr />
|
|
|
+ <el-row :gutter="20">
|
|
|
+ <el-col :span="5" :xs="24">
|
|
|
+ <div class="dadui">
|
|
|
+ <img
|
|
|
+ style="padding-top: 3px; margin-left: 15px"
|
|
|
+ src="../../../images/摄像头icon.png"
|
|
|
+ alt
|
|
|
+ />
|
|
|
+ 摄像头
|
|
|
+ </div>
|
|
|
+ <div class="tree">
|
|
|
+ <!-- <el-tree
|
|
|
+ class="userAgrees"
|
|
|
+ style="height: calc(100vh - 240px); overflow: auto"
|
|
|
+ :data="rtsplist"
|
|
|
+ :props="defaultProps"
|
|
|
+ @node-click="clickhandleitem(item,index)"
|
|
|
+ default-expand-all
|
|
|
+ highlight-current
|
|
|
+ :expand-on-click-node="false"
|
|
|
+ ></el-tree> -->
|
|
|
+ <div class="videolist">
|
|
|
+ <div class="userAgrees">
|
|
|
+ <ul style="height: calc(100vh - 240px); overflow: auto">
|
|
|
+ <li
|
|
|
+ v-for="(item, index) in rtsplist"
|
|
|
+ :key="index"
|
|
|
+ @click="clickhandleitem(item, index)"
|
|
|
+ >
|
|
|
+ <i class="el-icon-video-camera-solid"></i>
|
|
|
+ 摄像头{{ index }}
|
|
|
+ </li>
|
|
|
+ </ul>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </el-col>
|
|
|
+ <!-- </el-row> -->
|
|
|
+ <el-col :span="19" :xs="24">
|
|
|
+ <!-- 单屏播放 -->
|
|
|
+ <div style="position: relative" v-if="this.queryParams.type == 0">
|
|
|
+ <button
|
|
|
+ @click="chooselu"
|
|
|
+ style="position: absolute; z-index: 999"
|
|
|
+ class="choose"
|
|
|
+ >
|
|
|
+ 选择通道
|
|
|
+ </button>
|
|
|
+ <video
|
|
|
+ id="singleplay"
|
|
|
+ style="width: 100%; height: calc(100vh - 200px)"
|
|
|
+ autoplay
|
|
|
+ controls
|
|
|
+ @mouseover="choosebtn"
|
|
|
+ @mouseout="chooseleave"
|
|
|
+ ></video>
|
|
|
+ </div>
|
|
|
+ <!-- 四屏播放 -->
|
|
|
+ <div class="video1" v-if="this.queryParams.type == 1">
|
|
|
+ <div
|
|
|
+ v-for="(i, index) in 4"
|
|
|
+ :key="index"
|
|
|
+ style="
|
|
|
+ width: 49.5%;
|
|
|
+ height: calc(50vh - 106px);
|
|
|
+ margin-left: 5px;
|
|
|
+ margin-bottom: 5px;
|
|
|
+ position: relative;
|
|
|
+ "
|
|
|
+ >
|
|
|
+ <button
|
|
|
+ style="position: absolute; left: 5px; z-index: 999"
|
|
|
+ class="choose"
|
|
|
+ @click="chooselu"
|
|
|
+ >
|
|
|
+ 选择通道
|
|
|
+ </button>
|
|
|
+ <video
|
|
|
+ @mouseover="choosebtn"
|
|
|
+ @mouseout="chooseleave"
|
|
|
+ autoplay
|
|
|
+ controls
|
|
|
+ style="
|
|
|
+ width: 100%;
|
|
|
+ height: 100%;
|
|
|
+ margin-left: 5px;
|
|
|
+ margin-bottom: 5px;
|
|
|
+ position: relative;
|
|
|
+ "
|
|
|
+ :id="'videoElement' + i"
|
|
|
+ >
|
|
|
+ </video>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <!-- 九分屏幕 -->
|
|
|
+ <div class="video1" v-if="this.queryParams.type == 2">
|
|
|
+ <div
|
|
|
+ style="
|
|
|
+ width: 32%;
|
|
|
+ height: calc(37vh - 106px);
|
|
|
+ margin-left: 5px;
|
|
|
+ margin-bottom: 5px;
|
|
|
+ position: relative;
|
|
|
+ "
|
|
|
+ v-for="(i, index) in 9"
|
|
|
+ :key="index"
|
|
|
+ >
|
|
|
+ <button
|
|
|
+ style="position: absolute; left: 0px; z-index: 999"
|
|
|
+ class="choose"
|
|
|
+ @click="chooselu"
|
|
|
+ >
|
|
|
+ 选择通道
|
|
|
+ </button>
|
|
|
+ <video
|
|
|
+ @mouseover="choosebtn"
|
|
|
+ @mouseout="chooseleave"
|
|
|
+ autoplay
|
|
|
+ controls
|
|
|
+ style="width: 100%; height: 100%"
|
|
|
+ :id="'videoElement' + i"
|
|
|
+ ></video>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <!-- 十六分屏 -->
|
|
|
+ <div class="video1" v-if="this.queryParams.type == 3">
|
|
|
+ <div
|
|
|
+ v-for="(i, index) in 16"
|
|
|
+ :key="index"
|
|
|
+ style="
|
|
|
+ width: 24.5%;
|
|
|
+ height: calc(30vh - 105px);
|
|
|
+ margin-left: 5px;
|
|
|
+ margin-bottom: 5px;
|
|
|
+ position: relative;
|
|
|
+ "
|
|
|
+ >
|
|
|
+ <button
|
|
|
+ style="position: absolute; left: 0px; z-index: 999"
|
|
|
+ class="choose"
|
|
|
+ @click="chooselu"
|
|
|
+ >
|
|
|
+ 选择通道
|
|
|
+ </button>
|
|
|
+ <video
|
|
|
+ @mouseover="choosebtn"
|
|
|
+ @mouseout="chooseleave"
|
|
|
+ autoplay
|
|
|
+ controls
|
|
|
+ style="width: 100%; height: 100%"
|
|
|
+ :id="'videoElement' + i"
|
|
|
+ ></video>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <!-- 全通道FLV -->
|
|
|
+ <div class="video1" v-if="this.queryParams.type == 4">
|
|
|
+ <div
|
|
|
+ v-for="(i, index) in 16"
|
|
|
+ :key="index"
|
|
|
+ style="
|
|
|
+ width: 24.5%;
|
|
|
+ height: calc(30vh - 105px);
|
|
|
+ margin-left: 5px;
|
|
|
+ margin-bottom: 5px;
|
|
|
+ position: relative;
|
|
|
+ "
|
|
|
+ >
|
|
|
+ <button
|
|
|
+ style="position: absolute; left: 0px; z-index: 999"
|
|
|
+ class="choose"
|
|
|
+ @click="chooselu"
|
|
|
+ >
|
|
|
+ 选择通道
|
|
|
+ </button>
|
|
|
+ <video
|
|
|
+ @mouseover="choosebtn"
|
|
|
+ @mouseout="chooseleave"
|
|
|
+ autoplay
|
|
|
+ controls
|
|
|
+ style="width: 100%; height: 100%"
|
|
|
+ :id="'videoElement' + i"
|
|
|
+ ></video>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <!-- 选择通道弹框 -->
|
|
|
+ <el-dialog
|
|
|
+ :title="title"
|
|
|
+ :visible.sync="open"
|
|
|
+ width="1000px"
|
|
|
+ append-to-body
|
|
|
+ :close-on-click-modal="false"
|
|
|
+ >
|
|
|
+ <el-table
|
|
|
+ v-loading="loading"
|
|
|
+ :data="cameraList"
|
|
|
+ @selection-change="handleSelectionChange"
|
|
|
+ >
|
|
|
+ <!-- <el-table-column type="selection" width="55" align="center" /> -->
|
|
|
+ <!-- <el-table-column label="主键id" align="center" prop="id" /> -->
|
|
|
+ <el-table-column
|
|
|
+ label="序号"
|
|
|
+ type="index"
|
|
|
+ width="50"
|
|
|
+ align="center"
|
|
|
+ />
|
|
|
+ <el-table-column
|
|
|
+ label="拉流地址"
|
|
|
+ align="center"
|
|
|
+ prop="talkTheme"
|
|
|
+ width="600px"
|
|
|
+ show-overflow-tooltip
|
|
|
+ />
|
|
|
+ <el-table-column
|
|
|
+ label="拉流开关"
|
|
|
+ align="center"
|
|
|
+ prop="talkContent"
|
|
|
+ show-overflow-tooltip
|
|
|
+ >
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column
|
|
|
+ label="操作"
|
|
|
+ align="center"
|
|
|
+ class-name="small-padding fixed-width"
|
|
|
+ >
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <el-button
|
|
|
+ size="btk"
|
|
|
+ type="text"
|
|
|
+ @click="handlelook(scope.row)"
|
|
|
+ v-hasPermi="['thought:parliament:edit']"
|
|
|
+ >选择</el-button
|
|
|
+ >
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ </el-table>
|
|
|
+
|
|
|
+ <pagination
|
|
|
+ v-show="total > 0"
|
|
|
+ :total="total"
|
|
|
+ :page.sync="queryParams.pageNum"
|
|
|
+ :limit.sync="queryParams.pageSize"
|
|
|
+ @pagination="getList"
|
|
|
+ />
|
|
|
+
|
|
|
+ <div slot="footer" class="dialog-footer">
|
|
|
+ <el-button type="primary" @click="submitForm">确 定</el-button>
|
|
|
+ <el-button @click="cancel">取 消</el-button>
|
|
|
+ </div>
|
|
|
+ </el-dialog>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+
|
|
|
+ <div class="videobox">
|
|
|
+ <!-- <div class="videolist">
|
|
|
+ <div class="search">
|
|
|
+ <ul>
|
|
|
+ <li
|
|
|
+ v-for="(item, index) in rtsplist"
|
|
|
+ :key="index"
|
|
|
+ @click="clickhandleitem(item, index)"
|
|
|
+ >
|
|
|
+ <i class="el-icon-video-camera-solid"></i>
|
|
|
+ 列表{{ index }}
|
|
|
+ </li>
|
|
|
+ </ul>
|
|
|
+ </div>
|
|
|
+ </div> -->
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script>
|
|
|
+import flvjs from "flv.js";
|
|
|
+import {
|
|
|
+ listCamera,
|
|
|
+ getCamera,
|
|
|
+ delCamera,
|
|
|
+ addCamera,
|
|
|
+ updateCamera,
|
|
|
+ exportCamera,
|
|
|
+} from "@/api/monitoring/camera";
|
|
|
+export default {
|
|
|
+ name: "Camera",
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+ // 树形配置
|
|
|
+ defaultProps: {
|
|
|
+ children: "children",
|
|
|
+ label: "rtsp",
|
|
|
+ },
|
|
|
+ // 遮罩层
|
|
|
+ loading: true,
|
|
|
+ // 导出遮罩层
|
|
|
+ exportLoading: false,
|
|
|
+ // 选中数组
|
|
|
+ ids: [],
|
|
|
+ // 非单个禁用
|
|
|
+ single: true,
|
|
|
+ // 非多个禁用
|
|
|
+ multiple: true,
|
|
|
+ // 显示搜索条件
|
|
|
+ showSearch: true,
|
|
|
+ // 总条数
|
|
|
+ total: 0,
|
|
|
+ // 安防监控表格数据
|
|
|
+ cameraList: [],
|
|
|
+ // 弹出层标题
|
|
|
+ title: "",
|
|
|
+ // 是否显示弹出层
|
|
|
+ open: false,
|
|
|
+ // 查询参数
|
|
|
+ queryParams: {
|
|
|
+ pageNum: 1,
|
|
|
+ pageSize: 10,
|
|
|
+ cname: null,
|
|
|
+ caddr: null,
|
|
|
+ cstatus: null,
|
|
|
+ createtime: null,
|
|
|
+ unitid: null,
|
|
|
+ unitname: null,
|
|
|
+ powerArea: null,
|
|
|
+ },
|
|
|
+ // 表单参数
|
|
|
+ form: {},
|
|
|
+ // 表单校验
|
|
|
+ rules: {},
|
|
|
+ rtsplist: [
|
|
|
+ {
|
|
|
+ rtsp: "http://192.168.5.187/hdl/live/stream0.flv",
|
|
|
+ player: null,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ rtsp: "http://192.168.5.187/hdl/live/stream1.flv",
|
|
|
+ player: null,
|
|
|
+ },
|
|
|
+
|
|
|
+ {
|
|
|
+ rtsp: "http://192.168.5.187/hdl/live/stream1.flv",
|
|
|
+ player: null,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ rtsp: "http://192.168.5.187/hdl/live/stream1.flv",
|
|
|
+ player: null,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ rtsp: "http://192.168.5.187/hdl/live/stream1.flv",
|
|
|
+ player: null,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ rtsp: "http://192.168.5.187/hdl/live/stream1.flv",
|
|
|
+ player: null,
|
|
|
+ },
|
|
|
+
|
|
|
+ {
|
|
|
+ rtsp: "http://192.168.5.187/hdl/live/stream1.flv",
|
|
|
+ player: null,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ rtsp: "http://192.168.5.187/hdl/live/stream1.flv",
|
|
|
+ player: null,
|
|
|
+ },
|
|
|
+ ],
|
|
|
+ // 单视频
|
|
|
+ flvPlayer1: null,
|
|
|
+ flvPlayer: null,
|
|
|
+ inputvalue: "",
|
|
|
+ devicename: "60",
|
|
|
+ url: "",
|
|
|
+ list: [],
|
|
|
+ count: 1, // 当前点击标识
|
|
|
+ flvPlayerList: [],
|
|
|
+ datalist: [],
|
|
|
+ screen: 1,
|
|
|
+ // 单个视频播放
|
|
|
+ url1: "http://192.168.5.187/hdl/live/stream1.flv",
|
|
|
+ };
|
|
|
+ },
|
|
|
+ mounted() {
|
|
|
+ // 单个视频播放
|
|
|
+ this.$nextTick(() => {
|
|
|
+ this.singleplayvideo();
|
|
|
+ });
|
|
|
+ },
|
|
|
+ created() {
|
|
|
+ this.queryParams.type=0
|
|
|
+ this.getList();
|
|
|
+
|
|
|
+ },
|
|
|
+
|
|
|
+ methods: {
|
|
|
+ // 单视频播放
|
|
|
+ singleplayvideo() {
|
|
|
+ if (flvjs.isSupported()) {
|
|
|
+ let videoElement1 = document.getElementById("singleplay");
|
|
|
+ console.log(videoElement1);
|
|
|
+ let flvPlayer1 = flvjs.createPlayer({
|
|
|
+ type: "flv",
|
|
|
+ url: this.url1, //你的url地址
|
|
|
+ });
|
|
|
+ flvPlayer1.attachMediaElement(videoElement1);
|
|
|
+ flvPlayer1.load();
|
|
|
+ flvPlayer1.play();
|
|
|
+ }
|
|
|
+ },
|
|
|
+ // 鼠标滑过
|
|
|
+ choosebtn() {
|
|
|
+ // console.log(11)
|
|
|
+ $(".choose").show();
|
|
|
+ },
|
|
|
+ // 鼠标离开
|
|
|
+ chooseleave() {
|
|
|
+ $(".choose").hide();
|
|
|
+ },
|
|
|
+ // 选择通道弹框
|
|
|
+ chooselu() {
|
|
|
+ this.title = "选择通道";
|
|
|
+ this.open = true;
|
|
|
+ },
|
|
|
+
|
|
|
+ // 操作类型
|
|
|
+ caoZuoTypefun() {
|
|
|
+ // console.log(this.queryParams);
|
|
|
+ this.getList();
|
|
|
+ },
|
|
|
+ clickhandleitem(data, index) {
|
|
|
+ // console.log(this.rtsplist);
|
|
|
+ this.url = this.rtsplist[index].rtsp;
|
|
|
+ this.url1 = this.rtsplist[index].rtsp;
|
|
|
+ // console.log(this.url)
|
|
|
+ // console.log(this.flvPlayerList,'flvPlayerList')
|
|
|
+ if (this.flvPlayerList.length > 3) {
|
|
|
+ this.destoryVideo(this.flvPlayerList[0]);
|
|
|
+ this.flvPlayerList.shift();
|
|
|
+ }
|
|
|
+ this.createVideo();
|
|
|
+ // console.log(index)
|
|
|
+ this.count > 3 ? (this.count = 1) : this.count++;
|
|
|
+ // console.log(this.count)
|
|
|
+ },
|
|
|
+ createVideo() {
|
|
|
+ if (flvjs.isSupported()) {
|
|
|
+ var videoElement = document.getElementById("videoElement" + this.count);
|
|
|
+ // console.log(this.url)
|
|
|
+ this.flvPlayer = flvjs.createPlayer(
|
|
|
+ {
|
|
|
+ type: "flv",
|
|
|
+ isLive: true,
|
|
|
+ hasAudio: false,
|
|
|
+ url: this.url,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ enableWorker: false, //不启用分离线程
|
|
|
+ enableStashBuffer: false, //关闭IO隐藏缓冲区
|
|
|
+ reuseRedirectedURL: true, //重用301/302重定向url,用于随后的请求,如查找、重新连接等。
|
|
|
+ autoCleanupSourceBuffer: true, //自动清除缓存
|
|
|
+ }
|
|
|
+ );
|
|
|
+
|
|
|
+ this.flvPlayer.attachMediaElement(videoElement);
|
|
|
+ // this.flvPlayer.load();
|
|
|
+
|
|
|
+ if (this.url !== "" && this.url !== null) {
|
|
|
+ this.flvPlayer.load();
|
|
|
+ this.flvPlayer.play();
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ // 定时方法是为了用户离开页面视频是实时播放的,暂停按钮无用
|
|
|
+ setInterval(function () {
|
|
|
+ // console.log(videoElement.buffered,"idididid");
|
|
|
+ if (videoElement.buffered.length > 0) {
|
|
|
+ const end = videoElement.buffered.end(0); // 视频结尾时间
|
|
|
+ const current = videoElement.currentTime; // 视频当前时间
|
|
|
+ const diff = end - current; // 相差时间
|
|
|
+ // console.log(diff);
|
|
|
+ const diffCritical = 4; // 这里设定了超过4秒以上就进行跳转
|
|
|
+ const diffSpeedUp = 1; // 这里设置了超过1秒以上则进行视频加速播放
|
|
|
+ const maxPlaybackRate = 4; // 自定义设置允许的最大播放速度
|
|
|
+ let playbackRate = 1.0; // 播放速度
|
|
|
+ if (diff > diffCritical) {
|
|
|
+ // this.flvPlayer.load();
|
|
|
+ // console.log("相差超过4秒,进行跳转");
|
|
|
+ videoElement.currentTime = end - 1.5;
|
|
|
+ playbackRate = Math.max(1, Math.min(diffCritical, 16));
|
|
|
+ } else if (diff > diffSpeedUp) {
|
|
|
+ // console.log("相差超过1秒,进行加速");
|
|
|
+ playbackRate = Math.max(1, Math.min(diff, maxPlaybackRate, 16));
|
|
|
+ }
|
|
|
+ videoElement.playbackRate = playbackRate;
|
|
|
+ if (videoElement.paused) {
|
|
|
+ videoElement.play();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ // if (videoElement.buffered.length) {
|
|
|
+ // let end = this.flvPlayer.buffered.end(0);//获取当前buffered值
|
|
|
+ // let diff = end - this.flvPlayer.currentTime;//获取buffered与currentTime的差值
|
|
|
+ // if (diff >= 0.5) {//如果差值大于等于0.5 手动跳帧 这里可根据自身需求来定
|
|
|
+ // this.flvPlayer.currentTime = this.flvPlayer.buffered.end(0);//手动跳帧
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ }, 1000);
|
|
|
+
|
|
|
+ this.flvPlayer.on(flvjs.Events.ERROR, (errType, errDetail) => {
|
|
|
+ // alert("网络波动,正在尝试连接中...");
|
|
|
+ if (this.flvPlayer) {
|
|
|
+ this.reloadVideo(this.flvPlayer);
|
|
|
+ }
|
|
|
+ // errType是 NetworkError时,对应errDetail有:Exception、HttpStatusCodeInvalid、ConnectingTimeout、EarlyEof、UnrecoverableEarlyEof
|
|
|
+ // errType是 MediaError时,对应errDetail是MediaMSEError 或MEDIA_SOURCE_ENDED
|
|
|
+ });
|
|
|
+ this.flvPlayerList.push(this.flvPlayer);
|
|
|
+ },
|
|
|
+ reloadVideo(flvPlayer) {
|
|
|
+ this.destoryVideo(flvPlayer);
|
|
|
+ this.createVideo();
|
|
|
+ this.singleplayvideo();
|
|
|
+ },
|
|
|
+ destoryVideo(flvPlayer) {
|
|
|
+ flvPlayer.pause();
|
|
|
+ flvPlayer.unload();
|
|
|
+ flvPlayer.detachMediaElement();
|
|
|
+ flvPlayer.destroy();
|
|
|
+ flvPlayer = null;
|
|
|
+ },
|
|
|
+
|
|
|
+ /** 查询安防监控列表 */
|
|
|
+ getList() {
|
|
|
+ this.loading = true;
|
|
|
+ listCamera(this.queryParams).then((response) => {
|
|
|
+ this.cameraList = response.rows;
|
|
|
+ // console.log(this.cameraList)
|
|
|
+ this.total = response.total;
|
|
|
+ this.loading = false;
|
|
|
+ // this.queryParams.type==""
|
|
|
+ });
|
|
|
+ },
|
|
|
+ // 取消按钮
|
|
|
+ cancel() {
|
|
|
+ this.open = false;
|
|
|
+ this.reset();
|
|
|
+ },
|
|
|
+ // 表单重置
|
|
|
+ reset() {
|
|
|
+ this.form = {
|
|
|
+ id: null,
|
|
|
+ cname: null,
|
|
|
+ caddr: null,
|
|
|
+ cstatus: "0",
|
|
|
+ createtime: null,
|
|
|
+ unitid: null,
|
|
|
+ unitname: null,
|
|
|
+ powerArea: null,
|
|
|
+ };
|
|
|
+ this.resetForm("form");
|
|
|
+ },
|
|
|
+ /** 搜索按钮操作 */
|
|
|
+ handleQuery() {
|
|
|
+ this.queryParams.pageNum = 1;
|
|
|
+ this.getList();
|
|
|
+ },
|
|
|
+ /** 重置按钮操作 */
|
|
|
+ resetQuery() {
|
|
|
+ this.resetForm("queryForm");
|
|
|
+ this.handleQuery();
|
|
|
+ },
|
|
|
+ // 多选框选中数据
|
|
|
+ handleSelectionChange(selection) {
|
|
|
+ this.ids = selection.map((item) => item.id);
|
|
|
+ this.single = selection.length !== 1;
|
|
|
+ this.multiple = !selection.length;
|
|
|
+ },
|
|
|
+ /** 新增按钮操作 */
|
|
|
+ handleAdd() {
|
|
|
+ this.reset();
|
|
|
+ this.open = true;
|
|
|
+ this.title = "添加安防监控";
|
|
|
+ },
|
|
|
+ /** 修改按钮操作 */
|
|
|
+ handleUpdate(row) {
|
|
|
+ this.reset();
|
|
|
+ const id = row.id || this.ids;
|
|
|
+ getCamera(id).then((response) => {
|
|
|
+ this.form = response.data;
|
|
|
+ this.open = true;
|
|
|
+ this.title = "修改安防监控";
|
|
|
+ });
|
|
|
+ },
|
|
|
+ /** 提交按钮 */
|
|
|
+ submitForm() {
|
|
|
+ this.$refs["form"].validate((valid) => {
|
|
|
+ if (valid) {
|
|
|
+ if (this.form.id != null) {
|
|
|
+ updateCamera(this.form).then((response) => {
|
|
|
+ this.$modal.msgSuccess("修改成功");
|
|
|
+ this.open = false;
|
|
|
+ this.getList();
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ addCamera(this.form).then((response) => {
|
|
|
+ this.$modal.msgSuccess("新增成功");
|
|
|
+ this.open = false;
|
|
|
+ this.getList();
|
|
|
+ });
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
+ /** 删除按钮操作 */
|
|
|
+ handleDelete(row) {
|
|
|
+ const ids = row.id || this.ids;
|
|
|
+ this.$modal
|
|
|
+ .confirm('是否确认删除安防监控编号为"' + ids + '"的数据项?')
|
|
|
+ .then(function () {
|
|
|
+ return delCamera(ids);
|
|
|
+ })
|
|
|
+ .then(() => {
|
|
|
+ this.getList();
|
|
|
+ this.$modal.msgSuccess("删除成功");
|
|
|
+ })
|
|
|
+ .catch(() => {});
|
|
|
+ },
|
|
|
+ /** 导出按钮操作 */
|
|
|
+ handleExport() {
|
|
|
+ const queryParams = this.queryParams;
|
|
|
+ this.$modal
|
|
|
+ .confirm("是否确认导出所有安防监控数据项?")
|
|
|
+ .then(() => {
|
|
|
+ this.exportLoading = true;
|
|
|
+ return exportCamera(queryParams);
|
|
|
+ })
|
|
|
+ .then((response) => {
|
|
|
+ this.$download.name(response.msg);
|
|
|
+ this.exportLoading = false;
|
|
|
+ })
|
|
|
+ .catch(() => {});
|
|
|
+ },
|
|
|
+ },
|
|
|
+};
|
|
|
+</script>
|
|
|
+<style scoped>
|
|
|
+.isSubmit {
|
|
|
+ margin-left: 35% !important;
|
|
|
+ margin-right: 20%;
|
|
|
+ margin-bottom: 5px;
|
|
|
+ padding-bottom: 5px;
|
|
|
+}
|
|
|
+/* 按钮样式 */
|
|
|
+::v-deep .el-radio-button:first-child .el-radio-button__inner {
|
|
|
+ width: 82px;
|
|
|
+ height: 36px;
|
|
|
+ background: #196299;
|
|
|
+ border-radius: 8px 0px 0px 8px;
|
|
|
+ color: white;
|
|
|
+ border: none;
|
|
|
+ margin-right: 2px;
|
|
|
+ font-size: 14px;
|
|
|
+ font-family: Source Han Sans CN;
|
|
|
+ font-weight: 400;
|
|
|
+ color: #ffffff;
|
|
|
+}
|
|
|
+::v-deep .el-radio-button__orig-radio:checked + .el-radio-button__inner {
|
|
|
+ background: #006cff;
|
|
|
+}
|
|
|
+::v-deep .el-radio-button--medium .el-radio-button__inner {
|
|
|
+ width: 82px;
|
|
|
+ height: 36px;
|
|
|
+ background: #196299;
|
|
|
+ /* border-radius: 8px 0px 0px 8px; */
|
|
|
+ color: white;
|
|
|
+ border: none;
|
|
|
+ margin-right: 2px;
|
|
|
+ font-size: 14px;
|
|
|
+ font-family: Source Han Sans CN;
|
|
|
+ font-weight: 400;
|
|
|
+ color: #ffffff;
|
|
|
+}
|
|
|
+
|
|
|
+::v-deep .allFlv .el-radio-button__inner {
|
|
|
+ width: 82px;
|
|
|
+ height: 36px;
|
|
|
+ background: #196299;
|
|
|
+ padding-left: 10px !important;
|
|
|
+ font-size: 14px;
|
|
|
+ border-radius: 0px 8px 8px 0px;
|
|
|
+}
|
|
|
+
|
|
|
+::v-deep .allFlv1 .el-radio-button__inner {
|
|
|
+ width: 82px;
|
|
|
+ height: 36px;
|
|
|
+ background: #196299;
|
|
|
+ padding-left: 13px !important;
|
|
|
+ font-size: 14px;
|
|
|
+}
|
|
|
+
|
|
|
+/* 全屏按钮 */
|
|
|
+::v-deep .fullscreen .el-radio-button__inner {
|
|
|
+ margin-left: 10px;
|
|
|
+ background-image: url("../../../images/全屏 (1) 拷贝.png") !important;
|
|
|
+ background-repeat: no-repeat !important;
|
|
|
+ background-position: 17px 10px !important;
|
|
|
+ padding-left: 38px;
|
|
|
+ border-radius: 8px;
|
|
|
+}
|
|
|
+
|
|
|
+/* 水平线颜色 */
|
|
|
+hr {
|
|
|
+ background-color: #718a9d !important;
|
|
|
+}
|
|
|
+
|
|
|
+::v-deep .data .el-date-editor.el-input {
|
|
|
+ width: 100%;
|
|
|
+ border: none !important;
|
|
|
+}
|
|
|
+::v-deep .data .el-input__inner {
|
|
|
+ width: 100% !important;
|
|
|
+ border: none !important;
|
|
|
+}
|
|
|
+::v-deep .data .el-input--medium .el-input__icon {
|
|
|
+ line-height: 36px;
|
|
|
+ position: absolute;
|
|
|
+ right: -223px;
|
|
|
+ top: 2px;
|
|
|
+}
|
|
|
+::v-deep .data .el-input__inner {
|
|
|
+ background-color: transparent !important;
|
|
|
+ color: #fff;
|
|
|
+ text-align: center;
|
|
|
+ margin-top: 2px;
|
|
|
+}
|
|
|
+::v-deep .data .el-input__suffix {
|
|
|
+ position: absolute;
|
|
|
+ right: 281px;
|
|
|
+}
|
|
|
+.app-container .box-lfet .data {
|
|
|
+ height: 40px;
|
|
|
+ background: #003156;
|
|
|
+ margin-bottom: 12px;
|
|
|
+ color: #fff;
|
|
|
+ display: flex;
|
|
|
+ font-size: 13px;
|
|
|
+ line-height: 25px;
|
|
|
+ position: relative;
|
|
|
+}
|
|
|
+
|
|
|
+.box-lfet .data p {
|
|
|
+ position: absolute;
|
|
|
+ top: -5px;
|
|
|
+ left: 15px;
|
|
|
+}
|
|
|
+.box-lfet .data .a1 {
|
|
|
+ width: 128px;
|
|
|
+ height: 26px;
|
|
|
+ background: rgba(23, 74, 112, 0.4);
|
|
|
+ border-radius: 13px;
|
|
|
+ position: absolute;
|
|
|
+ top: 7px;
|
|
|
+ left: 60px;
|
|
|
+}
|
|
|
+::v-deep .data .el-date-editor.el-input {
|
|
|
+ width: 100%;
|
|
|
+ border: none;
|
|
|
+}
|
|
|
+::v-deep .data .el-input__inner {
|
|
|
+ width: 100% !important;
|
|
|
+ border: none;
|
|
|
+}
|
|
|
+::v-deep .data .el-input--medium .el-input__icon {
|
|
|
+ line-height: 36px;
|
|
|
+ position: absolute;
|
|
|
+ right: -223px;
|
|
|
+ top: 2px;
|
|
|
+}
|
|
|
+::v-deep .data .el-input__inner {
|
|
|
+ background-color: transparent;
|
|
|
+ color: #fff;
|
|
|
+ text-align: center;
|
|
|
+ margin-top: 2px;
|
|
|
+}
|
|
|
+::v-deep .data .el-input__suffix {
|
|
|
+ position: absolute;
|
|
|
+ right: 281px;
|
|
|
+}
|
|
|
+/* 头部样式 */
|
|
|
+.dadui {
|
|
|
+ height: 40px;
|
|
|
+ background: #003156;
|
|
|
+ /* border-bottom: 1px solid #718A9D ; */
|
|
|
+ background-image: url(../../../images/矩形底部边框.png);
|
|
|
+ background-repeat: no-repeat;
|
|
|
+ background-position: 0px 39px;
|
|
|
+ font-size: 16px;
|
|
|
+ color: #1d96ff;
|
|
|
+}
|
|
|
+.dadui img {
|
|
|
+ margin: 10px 10px 0px 10px;
|
|
|
+}
|
|
|
+
|
|
|
+.box-lfet .data p {
|
|
|
+ position: absolute;
|
|
|
+ top: -5px;
|
|
|
+ left: 15px;
|
|
|
+}
|
|
|
+.box-lfet .data .a1 {
|
|
|
+ width: 128px;
|
|
|
+ height: 26px;
|
|
|
+ background: rgba(23, 74, 112, 0.4);
|
|
|
+ border-radius: 13px;
|
|
|
+ position: absolute;
|
|
|
+ top: 7px;
|
|
|
+ left: 60px;
|
|
|
+}
|
|
|
+/* 划过效果 */
|
|
|
+::v-deep .el-tree-node__content:hover {
|
|
|
+ /* color: #fff; */
|
|
|
+ background-color: #003156;
|
|
|
+ background-image: url("../../../assets/images/选中.png");
|
|
|
+ background-size: 100% 100%;
|
|
|
+ background-repeat: no-repeat;
|
|
|
+}
|
|
|
+
|
|
|
+/* 左侧树状盒子 */
|
|
|
+.app-container .box-lfet {
|
|
|
+ width: 15%;
|
|
|
+ min-height: 740px;
|
|
|
+ /* background: #003156; */
|
|
|
+ /* padding: 10px; */
|
|
|
+ margin-right: 10px;
|
|
|
+ /* border: 1px solid white; */
|
|
|
+}
|
|
|
+/* 右侧内容盒子 */
|
|
|
+.app-container .box-right {
|
|
|
+ flex: 1;
|
|
|
+}
|
|
|
+.app-container .box-lfet .data {
|
|
|
+ height: 40px;
|
|
|
+ background: #003156;
|
|
|
+ margin-bottom: 12px;
|
|
|
+ color: #fff;
|
|
|
+ display: flex;
|
|
|
+ font-size: 13px;
|
|
|
+ line-height: 25px;
|
|
|
+ position: relative;
|
|
|
+}
|
|
|
+.el-tree {
|
|
|
+ background: #003156;
|
|
|
+ color: #fff;
|
|
|
+ margin-right: 2px;
|
|
|
+ padding-top: 7px;
|
|
|
+}
|
|
|
+::v-deep
|
|
|
+ .el-tree--highlight-current
|
|
|
+ .el-tree-node.is-current
|
|
|
+ > .el-tree-node__content {
|
|
|
+ background-color: #003156;
|
|
|
+ height: 32px;
|
|
|
+}
|
|
|
+::v-deep .el-tree-node__content {
|
|
|
+ height: 32px;
|
|
|
+}
|
|
|
+li {
|
|
|
+ list-style: none;
|
|
|
+}
|
|
|
+::v-deep ul {
|
|
|
+ /* height: 32px; */
|
|
|
+ background: #003156;
|
|
|
+}
|
|
|
+::v-deep li {
|
|
|
+ height: 32px;
|
|
|
+ color: white;
|
|
|
+}
|
|
|
+.tree {
|
|
|
+ margin-top: -15px;
|
|
|
+}
|
|
|
+video {
|
|
|
+ background-color: rgba(0, 160, 233, 0.11);
|
|
|
+}
|
|
|
+.video1 {
|
|
|
+ width: 100%;
|
|
|
+ height: 100%;
|
|
|
+ display: flex;
|
|
|
+ flex-wrap: wrap;
|
|
|
+}
|
|
|
+.app-container {
|
|
|
+ padding: 15px 15px 0px 15px !important;
|
|
|
+}
|
|
|
+/* 选择通道按钮 */
|
|
|
+.choose {
|
|
|
+ width: 86px;
|
|
|
+ height: 36px;
|
|
|
+ color: white;
|
|
|
+ background: #1d96ff;
|
|
|
+ border-radius: 4px;
|
|
|
+ border: none;
|
|
|
+ display: none;
|
|
|
+}
|
|
|
+.choose:focus {
|
|
|
+ outline: none;
|
|
|
+}
|
|
|
+
|
|
|
+/* 表格样式 */
|
|
|
+::v-deep .el-table .el-table__header-wrapper th {
|
|
|
+ background-color: #004d86 !important;
|
|
|
+ color: white;
|
|
|
+}
|
|
|
+/* 标题弹框 */
|
|
|
+::v-deep .el-dialog__title {
|
|
|
+ color: white;
|
|
|
+ /* border-bottom: 1px solid white; */
|
|
|
+}
|
|
|
+/* 标题下划线 */
|
|
|
+::v-deep .el-dialog__header {
|
|
|
+ border-bottom: 1px solid white;
|
|
|
+}
|
|
|
+::v-deep .el-dialog {
|
|
|
+ background-color: #004d86 !important;
|
|
|
+}
|
|
|
+</style>
|