From 1acb2169d78d74e347bdfc2e962a88e6cb585bb7 Mon Sep 17 00:00:00 2001
From: hanbaoshan <hanbaoshan@aiotlink.com>
Date: 星期五, 30 十月 2020 14:22:34 +0800
Subject: [PATCH] 修复数据栈文件删除列表仍有遗留的bug

---
 src/pages/cameraAccess/components/DataStackInfo.vue |   49 +++++++++++++++++++++++++++----------------------
 1 files changed, 27 insertions(+), 22 deletions(-)

diff --git a/src/pages/cameraAccess/components/DataStackInfo.vue b/src/pages/cameraAccess/components/DataStackInfo.vue
index fffe4d0..cad4022 100644
--- a/src/pages/cameraAccess/components/DataStackInfo.vue
+++ b/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>
 
@@ -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)}`]"
@@ -252,6 +257,7 @@
     <!-- 鍒嗛〉 -->
     <div class="pagination">
       <el-pagination
+        v-show="activeName=='uploaded'"
         @size-change="handleSizeChange"
         @current-change="handleRefrashFileList"
         :current-page="page"
@@ -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;

--
Gitblit v1.8.0