liyangzheng vor 2 Jahren
Ursprung
Commit
9827d69d4b
2 geänderte Dateien mit 31 neuen und 31 gelöschten Zeilen
  1. 8 1
      src/api/myfile/myfile.js
  2. 23 30
      src/views/myfile/MyFile.vue

+ 8 - 1
src/api/myfile/myfile.js

@@ -79,6 +79,12 @@ function fileDown(data){
         method:"get"
     })
 }
+function fileType(data){
+    return request({
+        url:`/biz/space/info/${data}`,
+        method:"get",
+    })
+}
 export default {
     getAllFileMenu,
     addNewMenu,
@@ -89,5 +95,6 @@ export default {
     fileChangeName,
     editNewMenu,
     fileDown,
-    uploadFileMany
+    uploadFileMany,
+    fileType,
 }

+ 23 - 30
src/views/myfile/MyFile.vue

@@ -97,23 +97,8 @@
                                 <img src="../../assets/images/upload.png" style="width: 24px;height: 24px;" alt="">
                             </div>
                             <div style="margin-left: 5px;">
-                                <el-dropdown trigger="click">
-                                    <span style="color: black;cursor: pointer;">上传
-                                        <el-icon>
-                                            <arrow-down />
-                                        </el-icon>
-                                    </span>
-                                    <template #dropdown>
-                                        <el-dropdown-menu>
-                                            <template v-for="(item, index) in arrorMenu">
-                                                <el-dropdown-item @click="arrowClick(item, index)">
-                                                    <img :src="item.img" alt="">
-                                                    <span>{{ item.name }}</span>
-                                                </el-dropdown-item>
-                                            </template>
-                                        </el-dropdown-menu>
-                                    </template>
-                                </el-dropdown>
+                                <span style="color: black;cursor: pointer;" @click="uploadModal = true">上传
+                                </span>
                             </div>
                         </div>
                     </div>
@@ -634,8 +619,12 @@ export default {
         }
         // 获取所有中栏
         function getAllMiddle() {
-            fileSpace.getFileSpace({}).then(res => {
-                fileMenu.value = res.rows
+            // fileSpace.getFileSpace({spaceId:directoryId.value}).then(res => {
+            //     fileMenu.value = res.rows
+            // })
+            myfile.fileType(3).then(res => {
+                fileMenu.value = [res.data]
+                directoryId.value = res.data.spaceId
             })
         }
         // 获取用户树
@@ -699,7 +688,6 @@ export default {
         }
         // 文件名表格每一行点击事件
         function handleRowClick(row) {
-            console.log(row, '888');
             clickRowId.value = row.docId
             copyDirId.value = row.dirId
             copySpaceId.value = row.spaceId
@@ -785,6 +773,7 @@ export default {
                         })
                     }
                 })
+                // location.href = `${import.meta.env.VITE_APP_BASE_API}/biz/info/download/${copyFileId.value}`;
             }
             if (row.name === '收藏') {
                 collectForm.value.name = nameForm.value.name
@@ -810,7 +799,7 @@ export default {
                 // "dirType": boserForm.value.dirType,
                 // "parentId": boserForm.value.parentId,
                 // "remark": boserForm.value.remark,
-                // "spaceId": boserForm.value.spaceId,
+                "spaceId": directoryId.value,
             }).then(res => {
                 if (res.code === 200) {
                     ElMessage({
@@ -920,7 +909,6 @@ export default {
             }
             if (val.length === 1) {
                 folderId.value = val[0].dirId
-                console.log(folderId.value, '666');
             }
         }
         // 重命名
@@ -1087,6 +1075,17 @@ export default {
             })
             tagCollect.value = false
         }
+        // 判断id
+        function isId() {
+            if (this.directoryId === '') {
+                this.directoryId = 0
+                this.getAllText()
+            }
+            if (this.folderId === '') {
+                this.folderId = 0
+                this.getAll()
+            }
+        }
         return {
             allBag,
             folderList,//文件夹的数据
@@ -1192,23 +1191,17 @@ export default {
             collectChange,
             sortNum,
             needBag,
+            isId,
         }
     },
     created() {
-        if (this.directoryId === '') {
-            this.directoryId = 0
-            this.getAllText()
-        }
-        if (this.folderId === '') {
-            this.folderId = 0
-            this.getAll()
-        }
         this.getAll();
         this.getSpace()
         this.getAllText()
         this.getAllMiddle()
         this.getAllUser()
         this.getAllCollect()
+        this.isId()
     },
     watch: {
     },