liuQiang пре 2 година
родитељ
комит
1b87e384ce

+ 3 - 2
src/layout/indexCommon.vue

@@ -372,6 +372,7 @@ const clickPath = (index, items) => {
 const clickTab = (item) => {
   // console.log("item", toRaw(item));
   setTimeout(() => {
+    console.log('toFileData.value',toFileData.value);
     if (toFileData.value) {
       router.push({
         path: toFileData.value.path,
@@ -393,7 +394,7 @@ const clickTab = (item) => {
       const data = JSON.parse(toRaw(item));
       console.log("data", data);
       router.push({
-        path: "/fileEdit",
+        path: "/fileEdit"+data.docId,
         query: {
           clickRowId: data.docId,
           // copyRow: JSON.stringify(data),
@@ -404,7 +405,7 @@ const clickTab = (item) => {
         path: item,
       });
     }
-  }, 100);
+  }, 500);
 };
 const paneClick = (item) => {
   // 可以拿到当前的标签对象

+ 10 - 6
src/router/index.js

@@ -182,13 +182,17 @@ export const constantRoutes = [{
 				}
 			},{
 				path: "/fileEdit",
-				component: () => import("@/views/myfile/components/FileEdit.vue"),
 				name: "fileEdit",
-				meta: {
-					title: "文件预览",
-					icon: "department",
-					keepAlive: true
-				}
+				component: () => import("@/views/myfile/components/FileEdit.vue"),
+				children: [{
+					path: '/fileEdit:docId(\\d+)',
+					component: () => import("@/views/myfile/components/FileEdit.vue"),
+					name: 'fileEdit',
+					meta: {
+						title: '文件预览',
+						activeMenu: '/fileEdit'
+					}
+				}]
 			},{
 				path: "/allback",
 				component: () => import("@/views/highSearch/SupplierAllBack.vue"),

+ 17 - 8
src/views/myfile/MyFile.vue

@@ -1378,7 +1378,7 @@ export default {
         //点击收藏后刷新文件
         const refreshFile = ()=>{
             // console.log('ref',toRaw(thisFolder.value));
-            if(toRaw(thisFolder.value).isFavorite){//如果点开了文件夹
+            if(toRaw(thisFolder.value).dirId){//如果点开了文件夹
             // console.log(111);
                folderClick()
             }else{
@@ -1518,20 +1518,29 @@ export default {
             })
         }
         onMounted(() => {
-            getAllTop()
+            // if(!thisFolder.value){
+                getAllTop()
+            // }
             getSpaceList()
+            console.log('!thisFolder.value',thisFolder.value);
+                // refreshFile()
             // 添加监听,点击其他地方关闭文件夹右键菜单
             window.addEventListener("click", closeRMenu, true);
             window.addEventListener("click", mouseClick, true);
+            console.log('onMounted');
         })
         onActivated(()=>{
             // console.log('route.query',route.query);
-            if(route.query.row){
-            const newRow = JSON.parse(route.query.row)
-            console.log('newRow',newRow);
-            thisFolder.value = newRow
-            refreshFile()
-            }
+            loadingPreview.value = true
+            setTimeout(()=>{
+                if(route.query.row){
+                    const newRow = JSON.parse(route.query.row)
+                    console.log('newRow',newRow);
+                    thisFolder.value = newRow
+                    refreshFile()
+                    loadingPreview.value = false
+                }
+            },500)
 
         })
         return {

+ 1 - 0
src/views/myfile/components/FileEdit.vue

@@ -20,6 +20,7 @@ import {
   updateInfo,
 } from "@/api/biz/info";
 export default {
+  name:'fileEdit',
   props: {
     docId: {
       type: Number, // 这里的类型应该匹配你要传递的数据类型