648540858
2024-04-30 2ae4226e89e21d998c78bd9859d6bc8ef1b5f713
web_src/src/components/CloudRecordDetail.vue
@@ -37,11 +37,11 @@
          <div class="record-list-box" :style="recordListStyle">
            <ul v-if="detailFiles.length >0" class="infinite-list record-list" v-infinite-scroll="infiniteScroll" >
              <li v-for="(item,index) in detailFiles" :key="index" class="infinite-list-item record-list-item" >
                <el-tag v-if="choosedFile !== item.filename" @click="chooseFile(item)">
                <el-tag v-if="choosedFile !== item.fileName" @click="chooseFile(item)">
                  <i class="el-icon-video-camera"  ></i>
                  {{ getFileShowName(item) }}
                </el-tag>
                <el-tag type="danger" v-if="choosedFile === item.filename">
                <el-tag type="danger" v-if="choosedFile === item.fileName">
                  <i class="el-icon-video-camera"  ></i>
                  {{ getFileShowName(item) }}
                </el-tag>
@@ -135,7 +135,7 @@
<script>
  // TODO 根据查询的时间列表设置滑轨的最大值与最小值,
   import uiHeader from '../layout/UiHeader.vue'
   import player from './dialog/easyPlayer.vue'
   import player from './common/easyPlayer.vue'
  import moment  from 'moment'
  import axios from "axios";
   export default {
@@ -230,9 +230,6 @@
      mounted() {
      this.recordListStyle.height = this.winHeight + "px";
      this.playerStyle["height"] = this.winHeight + "px";
      console.log(this.app)
      console.log(this.stream)
      console.log(this.mediaServerId)
      // 查询当年有视频的日期
      this.getDateInYear(()=>{
        if (Object.values(this.dateFilesObj).length > 0){
@@ -314,13 +311,34 @@
        });
      },
      chooseFile(file){
        console.log(file)
           if (file == null) {
          this.videoUrl = "";
          this.choosedFile = "";
        }else {
          this.choosedFile = file.fileName;
          this.videoUrl = `${this.getFileBasePath(file)}/download/${this.app}/${this.stream}/${this.chooseDate}/${file.fileName}`
          console.log(this.videoUrl)
          this.$axios({
            method: 'get',
            url: `/api/cloud/record/play/path`,
            params: {
              recordId: file.id,
            }
          }).then((res) => {
            console.log(res)
            if (res.data.code === 0) {
              if (location.protocol === "https:") {
                this.videoUrl = res.data.data.httpsPath;
              }else {
                this.videoUrl = res.data.data.httpPath;
              }
            }
          }).catch((error) => {
            console.log(error);
          });
          //
          //
          // this.videoUrl = `${this.getFileBasePath(file)}/download/${this.app}/${this.stream}/${this.chooseDate}/${file.fileName}`
          // console.log(this.videoUrl)
        }
      },
@@ -328,7 +346,7 @@
        this.$router.back()
      },
      getFileShowName(item) {
          return  moment.unix(item.startTime).format('HH:mm:ss') + "-" + moment.unix(item.endTime).format('HH:mm:ss')
          return  moment(item.startTime).format('HH:mm:ss') + "-" + moment(item.endTime).format('HH:mm:ss')
      },
      chooseMediaChange() {
@@ -480,12 +498,13 @@
        let that = this;
        this.$axios({
          method: 'get',
          url:`/record_proxy/${that.mediaServerId}/api/record/file/download/task/add`,
          url:`/api/cloud/record/task/add`,
          params: {
            app: that.app,
            stream: that.stream,
            startTime: moment(this.taskTimeRange[0]).format('YYYY-MM-DD HH:mm:ss'),
            endTime: moment(this.taskTimeRange[1]).format('YYYY-MM-DD HH:mm:ss'),
              app: this.app,
              stream: this.stream,
              mediaServerId: this.mediaServerId,
              startTime: moment(this.taskTimeRange[0]).format('YYYY-MM-DD HH:mm:ss'),
              endTime: moment(this.taskTimeRange[1]).format('YYYY-MM-DD HH:mm:ss'),
          }
        }).then(function (res) {
          if (res.data.code === 0 ) {
@@ -505,8 +524,9 @@
        let that = this;
        this.$axios({
          method: 'get',
          url:`/record_proxy/${that.mediaServerId}/api/record/file/download/task/list`,
          url:`/api/cloud/record/task/list`,
          params: {
            mediaServerId: this.mediaServerId,
            isEnd: isEnd,
          }
        }).then(function (res) {