scorpio 2 年之前
父节点
当前提交
2de0d41af1
共有 3 个文件被更改,包括 39 次插入8 次删除
  1. 11 0
      src/api/store/index.js
  2. 3 6
      src/views/home/component/folder_list.vue
  3. 25 2
      src/views/store/component/info3.vue

+ 11 - 0
src/api/store/index.js

@@ -90,5 +90,16 @@ export default {
       '/blade-project-manage-v2/project-dispatch/v2/handle-warning',
       params
     )
+  },
+  /**
+   * 获取要素
+   * @param params
+   * @returns {Promise<unknown>}
+   */
+  showDetail(params) {
+    return fetch(
+      '/blade-project-manage-v2/project-dispatch/v2/pre-storage-key-detail',
+      params
+    )
   }
 }

+ 3 - 6
src/views/home/component/folder_list.vue

@@ -318,12 +318,9 @@ export default {
         }
         let dispatchQuery = {}
         if (this.dispatchParams) {
-          dispatchQuery = {
-            dispatchType: this.dispatchParams.dispatchType,
-            type: this.dispatchParams.type,
-            year: this.dispatchParams.year,
-            month: this.dispatchParams.month
-          }
+          dispatchQuery = this.dispatchParams
+          console.log(this.dispatchParams)
+          delete dispatchQuery.id
         }
         this.$router.push({
           path: '/home/files',

+ 25 - 2
src/views/store/component/info3.vue

@@ -55,7 +55,7 @@
               type="primary"
               size="mini"
               text
-              @click="show = true"
+              @click="showDetail(row)"
               >查 看
             </el-button>
             <el-button
@@ -220,7 +220,11 @@ export default {
     onLoad() {
       const data = Object.assign(this.page, { id: this.pid })
       this.$api.store.fileList(data).then(res => {
-        if (res.code === 200 && res.data.files.length > 0) {
+        if (res.code === 200) {
+          if (res.data.files.length === 0) {
+            this.data.length = 0
+            return
+          }
           this.data = res.data.files.map(ele => {
             delete ele.fileId
             const tmp = ele.fileFolder
@@ -331,6 +335,25 @@ export default {
           })
         }
       })
+    },
+    /**
+     * 查看 文件要素
+     * @param row
+     */
+    showDetail(row) {
+      this.$api.store
+        .showDetail({ fileId: row.fileId, projectId: row.projectId })
+        .then(res => {
+          if (res.code === 200) {
+            if (Object.keys(res.data).length === 0) {
+              this.$message.error('文件正在解析中或者文件解析失败,暂无数据')
+            } else {
+              this.show = true
+            }
+          } else {
+            this.$message.error(res.msg)
+          }
+        })
     }
   }
 }