瀏覽代碼

默认收藏便签

liuQiang 2 年之前
父節點
當前提交
82d8ffa4b6
共有 2 個文件被更改,包括 20 次插入18 次删除
  1. 18 16
      src/views/collect/index.vue
  2. 2 2
      src/views/myfile/modalComponebts/FileCollect.vue

+ 18 - 16
src/views/collect/index.vue

@@ -270,8 +270,7 @@ const tabName = ref(""); //新增的标签名
 const changeTabName = ref(""); //修改的标签名
 const tabList = ref([]);
 const isAsc = ref("asc");
-const tableData = [
-];
+const tableData = [];
 const visible = ref(false); //显示右键菜单
 const top = ref(0);
 const left = ref(0);
@@ -281,15 +280,15 @@ const folderArr = ref(); //文件夹数组
 const fileArr = ref(); //文件数组
 const isList = ref(false); //控制显示方式
 //----引入图片----
-import file_DOC from "../../assets/images/fileType/file_DOC.png"
-import file_pdf from "../../assets/images/fileType/file_pdf.png"
-import file_PPT from "../../assets/images/fileType/file_PPT.png"
-import file_TXT from "../../assets/images/fileType/file_TXT.png"
-import file_XLSX from "../../assets/images/fileType/file_XLSX.png"
-import file_pic from "../../assets/images/fileType/file_pic.png"
-import file_audio from "../../assets/images/fileType/file_audio.png"
-import file_video from "../../assets/images/fileType/file_video.png"
-import file_zip from "../../assets/images/fileType/file_zip.png"
+import file_DOC from "../../assets/images/fileType/file_DOC.png";
+import file_pdf from "../../assets/images/fileType/file_pdf.png";
+import file_PPT from "../../assets/images/fileType/file_PPT.png";
+import file_TXT from "../../assets/images/fileType/file_TXT.png";
+import file_XLSX from "../../assets/images/fileType/file_XLSX.png";
+import file_pic from "../../assets/images/fileType/file_pic.png";
+import file_audio from "../../assets/images/fileType/file_audio.png";
+import file_video from "../../assets/images/fileType/file_video.png";
+import file_zip from "../../assets/images/fileType/file_zip.png";
 // -------
 onMounted(async () => {
   await getList();
@@ -447,13 +446,16 @@ const tabchange = async (labelId) => {
     isAsc: isAsc.value,
     orderByColumn: "createTime",
   };
+  let res
   if (labelId === "second") {
-    const res = await listFavoriteById(-1);
+     res = await listFavoriteById(-1);
     console.log("res", res);
-    return
+    // return;
+  } else {
+    // 获取当前标签下的数据
+     res = await listFavoriteById(labelId);
   }
-  // 获取当前标签下的数据
-  const res = await listFavoriteById(labelId);
+
   // console.log("----res", res);
   folderArr.value = res.filter((item) => item.isFolder === "Y");
   fileArr.value = res.filter((item) => item.isFolder === "N");
@@ -486,7 +488,7 @@ const sortArr = (field) => {
   };
 };
 
- const setIcon = (fileType) => {
+const setIcon = (fileType) => {
   switch (fileType) {
     case ".docx":
       return file_DOC;

+ 2 - 2
src/views/myfile/modalComponebts/FileCollect.vue

@@ -118,13 +118,13 @@ export default {
                 query = {
                     "isFolder":props.isFolder,
                     "relaId": props.clickRow.dirId,
-                    "labelId": collectForm.value.folders - 0,
+                    "labelId": collectForm.value.folders - 0 || null,
                 }
             }else{
                 query = {
                     "isFolder":props.isFolder,
                     "relaId": props.clickRow.docId,
-                    "labelId": collectForm.value.folders - 0,
+                    "labelId": collectForm.value.folders - 0 || null,
                 }
             }
             collect.addCollect(query).then(res => {