src/pages/cameraAccess/components/DataStackInfo.vue
@@ -50,7 +50,7 @@
              <li>
                <info-card
                  style="width: 100%;min-width: 440px"
                  :realtime="PollData.RealTimeSum"
                  :realtime="PollData.RealTimeValidCount"
                  :polling="PollData.PollValidCount"
                  :dataStack="PollData.stackChannelCount"
                ></info-card>
@@ -105,15 +105,20 @@
        </el-tooltip>
        <!-- 文件上传 -->
        <el-button
          type="primary"
          size="small"
          :disabled="!DataStackPool.selectedDir.id"
          @click="handleUpload"
        >
          上传
          <i class="el-icon-upload el-icon--right"></i>
        </el-button>
        <template v-for="stack in DataStackPool.dirs">
          <el-button
            :class="`uploader_${stack.id}`"
            :key="stack.id"
            type="primary"
            size="small"
            v-show="stack.id == DataStackPool.selectedDir.id"
            :disabled="!DataStackPool.selectedDir.id"
            @click="handleUpload"
          >
            上传
            <i class="el-icon-upload el-icon--right"></i>
          </el-button>
        </template>
      </div>
    </div>
@@ -128,7 +133,7 @@
      @select="handleSelect"
      @select-all="handleSelect"
    >
      <el-table-column type="selection" width="50" align="center" :selectable="isSelectable"></el-table-column>
      <el-table-column type="selection" align="center" :selectable="isSelectable"></el-table-column>
      <el-table-column prop="name" label="文件名">
        <template slot-scope="{row}">
          <div :class="snapshotClass">
@@ -143,7 +148,7 @@
            </el-image>
            <el-image
              v-if="row.type==2"
              style="width: 30x; height: 30px"
              style="width: 30x; height: 30px;background:#fff;"
              :src="`/files/${row.path.substr(row.path.lastIndexOf('/')+1)}`"
              fit="fill"
              :preview-src-list="[`/files/${row.path.substr(row.path.lastIndexOf('/')+1)}`]"
@@ -167,7 +172,7 @@
          >{{row.name}}</a>
        </template>
      </el-table-column>
      <el-table-column prop="fileSize" label="大小" width="120">
      <el-table-column prop="fileSize" label="大小" >
        <template slot-scope="scope">{{scope.row.size | readFileSizeUnit}}</template>
      </el-table-column>
      <el-table-column prop="duration" label="时长" show-overflow-tooltip align="center"></el-table-column>
@@ -252,10 +257,11 @@
    <!-- 分页 -->
    <div class="pagination">
      <el-pagination
        v-show="activeName=='uploaded'"
        @size-change="handleSizeChange"
        @current-change="handleRefrashFileList"
        :current-page="page"
        :page-sizes="[5, 10, 15, 20]"
        :page-sizes="[10, 20, 50, 100]"
        :page-size="size"
        style="position:absolute;right:10px;bottom:5px"
        :total="total"
@@ -263,10 +269,11 @@
      ></el-pagination>
    </div>
    <!-- 文件上传组件 -->
    <!-- <file-uploader ref="uploader" v-show="activeName === 'uploading'" :attrs="attrs" /> -->
    <file-uploader ref="uploader" v-show="activeName === 'uploading'" />
    <template v-for="stack in DataStackPool.dirs">
      <!-- 文件上传组件 -->
      <file-uploader :ref="`uploader_${stack.id}`" :key="stack.id" v-show="activeName === 'uploading' && stack.id == DataStackPool.selectedDir.id" :attrs="attrs" />
      <!-- <file-uploader ref="uploader" v-show="activeName === 'uploading'" /> -->
    </template>
    <!-- 文件预览 -->
    <el-dialog title="查看文件" :visible.sync="previewDialog" width="500px">
      <video v-if="videoUrl" :src="videoUrl" controls style="margin-top: 12px;">您的浏览器不支持 video 标签。</video>
@@ -427,7 +434,6 @@
      handler (n, o) {
        //数据栈文件数量变更
        //更新独立场景数据栈文件
        console.log(this.$root.$children[0].$children[1].$refs['sepRule']);
        this.$root.$children[0].$children[1].$refs['sepRule'].getStackFiles();
      }
    },
@@ -437,9 +443,9 @@
        if (n == 1) {
          //仅支持上传视频
          this.$set(this.attrs, 'accept', ".mp4");
        }else if (n == 2) {
        } else if (n == 2) {
          //图片
          this.$set(this.attrs, 'accept', "image/jpg,image/jpeg,image/png");
          this.$set(this.attrs, 'accept', ".jpg,.jpeg,.png");
        }
      }
    }
@@ -521,7 +527,7 @@
    },
    fetchFileList () {
      findAllFileByStackId({ name: this.searchInput, stackId: this.form.id, page: this.page, size: this.size, type: 0 }).then(rsp => {
        if (rsp && rsp.success && rsp.data.total > 0) {
        if (rsp && rsp.success && rsp.data.total >= 0) {
          this.fileList = rsp.data.dataList;
          this.total = rsp.data.total;
@@ -605,10 +611,9 @@
      this.multipleSelection = [];
    },
    handleUpload () {
      console.log(this.DataStackPool.selectedDir.id)
      console.log(this.$refs.uploader.$refs.button.attrs)
      console.log(this.$refs.uploader.$refs.button.$refs.btn.click())
      debugger
      console.log(this.$refs[`uploader_${this.DataStackPool.selectedDir.id}`][0].$refs.button.$refs.btn.click())
    },
    handleRefrashFileList (val) {
      this.page = val;