|
@@ -1,253 +0,0 @@
|
|
|
-<template>
|
|
|
- <div class="videoControl-container">
|
|
|
- <div class="comm-panel">
|
|
|
- <div class="btn-box" v-for="item of commandConfig.direction" :key="item.type">
|
|
|
- <el-button
|
|
|
- type="primary"
|
|
|
- :icon="`el-icon-${item.type}`"
|
|
|
- size="mini"
|
|
|
- @mousedown.native="changePtzCommParam(item.command, false)"
|
|
|
- @mouseup.native="changePtzCommParam(item.command, true)"
|
|
|
- ></el-button>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- <div class="zoom-panel">
|
|
|
- <div class="btn-box" v-for="item of commandConfig.zoom" :key="item.type">
|
|
|
- <el-button
|
|
|
- type="primary"
|
|
|
- :icon="`el-icon-${item.type}`"
|
|
|
- size="mini"
|
|
|
- @mousedown.native="changePtzCommParam(item.command, false)"
|
|
|
- @mouseup.native="changePtzCommParam(item.command, true)"
|
|
|
- ></el-button>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- <div class="speed-panel">
|
|
|
- <span class="form-label">速度:</span>
|
|
|
- <el-select class="myInput" size="mini" v-model="speed" placeholder="请选择速度">
|
|
|
- <el-option
|
|
|
- v-for="item in Array.from({ length: 10 }, (item, index) => index + 1)"
|
|
|
- :key="item"
|
|
|
- :label="item"
|
|
|
- :value="item"
|
|
|
- ></el-option>
|
|
|
- </el-select>
|
|
|
- </div>
|
|
|
- <div class="preset-panel">
|
|
|
- <span class="form-label">预置点:</span>
|
|
|
- <el-select class="myInput" size="mini" v-model="presetIndex" placeholder="请选择预置点">
|
|
|
- <el-option
|
|
|
- v-for="item in Array.from({ length: 255 }, (item, index) => index + 1)"
|
|
|
- :key="item"
|
|
|
- :label="item"
|
|
|
- :value="item"
|
|
|
- ></el-option>
|
|
|
- </el-select>
|
|
|
- <el-button type="primary" size="mini" @click="changePtzPresetParam(8)">设置</el-button>
|
|
|
- <el-button type="primary" size="mini" @click="changePtzPresetParam(39)">转到</el-button>
|
|
|
- </div>
|
|
|
- <div class="playback-panel">
|
|
|
- <span class="form-label">时间:</span>
|
|
|
- <el-date-picker
|
|
|
- style="max-width: 170px"
|
|
|
- class="myInput"
|
|
|
- v-model="startTime"
|
|
|
- type="datetime"
|
|
|
- placeholder="选择回放开始时间"
|
|
|
- size="mini"
|
|
|
- ></el-date-picker>
|
|
|
- <el-button type="success" size="mini" @click="changePlayTypeParam(true)" :disabled="!startTime">回放</el-button>
|
|
|
- <el-button type="primary" size="mini" @click="changePlayTypeParam(false)" :disabled="!startTime">实时</el-button>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
-</template>
|
|
|
-
|
|
|
-<script>
|
|
|
-import Dayjs from "dayjs";
|
|
|
-export default {
|
|
|
- name: "VideoControl",
|
|
|
- props: {
|
|
|
- curVideoData: {
|
|
|
- type: Object,
|
|
|
- require: true,
|
|
|
- default: () => ({}),
|
|
|
- },
|
|
|
- },
|
|
|
- data() {
|
|
|
- return {
|
|
|
- // 视频控制相关 start
|
|
|
- commandConfig: {
|
|
|
- //视频控制开关配置
|
|
|
- direction: [
|
|
|
- //方向
|
|
|
- { type: "top-left", name: "左上", command: 25 },
|
|
|
- { type: "top", name: "上", command: 21 },
|
|
|
- { type: "top-right", name: "右上", command: 26 },
|
|
|
- { type: "back", name: "左", command: 23 },
|
|
|
- { type: "rank", name: "中", command: 0 },
|
|
|
- { type: "right", name: "右", command: 24 },
|
|
|
- { type: "bottom-left", name: "左下", command: 27 },
|
|
|
- { type: "bottom", name: "下", command: 22 },
|
|
|
- { type: "bottom-right", name: "右下", command: 28 },
|
|
|
- ],
|
|
|
- zoom: [
|
|
|
- //放大缩小
|
|
|
- { type: "zoom-in", name: "放大", command: 11 },
|
|
|
- { type: "zoom-out", name: "缩小", command: 12 },
|
|
|
- ],
|
|
|
- },
|
|
|
- startTime: null,
|
|
|
- speed: 5,
|
|
|
- presetIndex: 1,
|
|
|
- // 视频控制 end
|
|
|
- };
|
|
|
- },
|
|
|
- mounted() {
|
|
|
- console.log(this.curVideoData);
|
|
|
- },
|
|
|
- methods: {
|
|
|
- changePtzCommParam(comm, stop) {
|
|
|
- if (!comm) return;
|
|
|
- if (!this.curVideoData.id) {
|
|
|
- stop && this.$message.warning("请先选择视频窗口!");
|
|
|
- return;
|
|
|
- }
|
|
|
- let param = {
|
|
|
- id: this.curVideoData.id,
|
|
|
- ptzCommand: comm,
|
|
|
- ptzStop: stop,
|
|
|
- ptzSpeed: this.speed,
|
|
|
- canControl: this.curVideoData.ptzEnable,
|
|
|
- };
|
|
|
- this.$EventBus.$emit("updateSendParam", param);
|
|
|
- },
|
|
|
- changePtzPresetParam(comm) {
|
|
|
- if (!comm) return;
|
|
|
- if (!this.curVideoData.id) {
|
|
|
- this.$message.warning("请先选择视频窗口!");
|
|
|
- return;
|
|
|
- }
|
|
|
- let param = {
|
|
|
- id: this.curVideoData.id,
|
|
|
- ptzPreset: comm,
|
|
|
- ptzPresetIndex: this.presetIndex,
|
|
|
- canControl: this.curVideoData.ptzEnable,
|
|
|
- };
|
|
|
- this.$EventBus.$emit("updateSendParam", param);
|
|
|
- },
|
|
|
- /**
|
|
|
- * state true代表回放模式
|
|
|
- */
|
|
|
- changePlayTypeParam(state) {
|
|
|
- let param = { id: this.curVideoData.id };
|
|
|
- if (!this.curVideoData.id) {
|
|
|
- this.$message.warning("请先选择视频窗口!");
|
|
|
- return;
|
|
|
- }
|
|
|
- if (state) {
|
|
|
- if (!this.startTime) {
|
|
|
- this.$message.warning("请选择回放开始时间!");
|
|
|
- return;
|
|
|
- }
|
|
|
- param["startTime"] = Dayjs(this.startTime).format("YYYY-MM-DD HH:mm:ss");
|
|
|
- }
|
|
|
- this.$EventBus.$emit("updateSendParam", param, true);
|
|
|
- },
|
|
|
- },
|
|
|
-};
|
|
|
-</script>
|
|
|
-<style lang="less" scoped>
|
|
|
-.videoControl-container {
|
|
|
- display: flex;
|
|
|
- flex-direction: column;
|
|
|
- align-items: center;
|
|
|
- padding: 0 10px;
|
|
|
- .comm-panel {
|
|
|
- width: 180px;
|
|
|
- display: flex;
|
|
|
- flex-wrap: wrap;
|
|
|
- .el-button {
|
|
|
- background: #007ccc;
|
|
|
- border-color: #007ccc;
|
|
|
- }
|
|
|
- }
|
|
|
- .zoom-panel {
|
|
|
- width: 120px;
|
|
|
- display: flex;
|
|
|
- .el-button {
|
|
|
- background: #007ccc;
|
|
|
- border-color: #007ccc;
|
|
|
- }
|
|
|
- }
|
|
|
- .speed-panel {
|
|
|
- margin-top: 15px;
|
|
|
- display: flex;
|
|
|
- align-items: center;
|
|
|
- }
|
|
|
- .preset-panel {
|
|
|
- margin-top: 15px;
|
|
|
- display: flex;
|
|
|
- align-items: center;
|
|
|
- flex-wrap: wrap;
|
|
|
- .el-select {
|
|
|
- max-width: 170px;
|
|
|
- }
|
|
|
- .el-button {
|
|
|
- margin-top: 15px;
|
|
|
- background: rgba(0, 60, 57, 0.3);
|
|
|
- border: 1px solid #5bd6ff;
|
|
|
- color: #c9f1ff;
|
|
|
- }
|
|
|
- }
|
|
|
- .playback-panel {
|
|
|
- margin-top: 15px;
|
|
|
- display: flex;
|
|
|
- align-items: center;
|
|
|
- flex-wrap: wrap;
|
|
|
- .el-button {
|
|
|
- margin-top: 15px;
|
|
|
- background: rgba(0, 60, 57, 0.3);
|
|
|
- border: 1px solid #5bd6ff;
|
|
|
- color: #c9f1ff;
|
|
|
- }
|
|
|
- }
|
|
|
- .btn-box {
|
|
|
- flex-shrink: 0;
|
|
|
- width: 60px;
|
|
|
- height: 40px;
|
|
|
- display: flex;
|
|
|
- justify-content: center;
|
|
|
- align-items: center;
|
|
|
- }
|
|
|
- .form-label {
|
|
|
- color: #5bd6ff;
|
|
|
- display: inline-block;
|
|
|
- width: 50px;
|
|
|
- flex-shrink: 0;
|
|
|
- // text-align: right;
|
|
|
- }
|
|
|
- .myInput {
|
|
|
- ::v-deep .el-input__inner {
|
|
|
- // width: 110px;
|
|
|
- height: 30px;
|
|
|
- border-radius: 0;
|
|
|
- background: rgba(0, 20, 23, 0.2);
|
|
|
- border: 0.5px solid #007ccc;
|
|
|
- color: #5bd6ff;
|
|
|
- // padding-right: 35px;
|
|
|
- }
|
|
|
- ::v-deep .el-input__inner:focus {
|
|
|
- border: 0.5px solid #007ccc !important;
|
|
|
- }
|
|
|
- ::v-deep .el-input.is-focus .el-input__inner {
|
|
|
- border: 0.5px solid #007ccc !important;
|
|
|
- }
|
|
|
- ::v-deep .el-input__suffix {
|
|
|
- right: 5px;
|
|
|
- }
|
|
|
- ::v-deep .el-input__icon {
|
|
|
- line-height: 30px;
|
|
|
- }
|
|
|
- }
|
|
|
-}
|
|
|
-</style>
|