liuQiang 2 yıl önce
ebeveyn
işleme
c1b153492a

+ 7 - 2
src/components/LeftList/LeftList.vue

@@ -61,6 +61,10 @@ const props = defineProps({
     type: String,
     default: "",
   },
+  collectId: {
+    type: Number,
+    default: 0,
+  },
 });
 const emit = defineEmits(["listfolderClick", "treeRClick"]);
 const treeData = ref();
@@ -137,7 +141,8 @@ const getTopDir = async () => {
   const res = await documents.getTop(props.spaceType);
   // console.log("topres", res);
   curArr.value.push(res.dirId);
-  // console.log("curArr", curArr.value);
+  curArr.value.push(props.collectId);
+  console.log("curArr", curArr.value);
   topId.value = res.dirId;
   return;
 };
@@ -183,7 +188,7 @@ watch(
     } else {
       expandedNodes.push(topId.value);
     }
-    console.log("expandedNodes", expandedNodes);
+    // console.log("expandedNodes", expandedNodes);
     // 把这当从服务器拉取数据
     treeData.value = JSON.parse(JSON.stringify(newValue));
     // 更新数据后, 有过滤条件的执行过滤, 没有的还原之前的展开状态

+ 1 - 1
src/components/ListShow/ListShow.vue

@@ -398,7 +398,7 @@ watch(
   (newValue, oldValue) => {
     tableData.value = newValue;
     changeSearchType(searchType.value);
-    console.log("watchtableData", tableData.value);
+    // console.log("watchtableData", tableData.value);
   },
   {
     immediate: true,

+ 17 - 2
src/views/department/MyFile.vue

@@ -75,7 +75,7 @@
                             </div>
                         </template>
                     </div>
-                    <LeftList v-else :spaceType="2" :isDept="isDept" @treeRClick="treeRClick" :searchFolderTree="searchFolderTree" :ListtreeData="ListtreeData" @listfolderClick="listfolderClick"></LeftList>
+                    <LeftList v-else :spaceType="2" :collectId="collectId" :isDept="isDept" @treeRClick="treeRClick" :searchFolderTree="searchFolderTree" :ListtreeData="ListtreeData" @listfolderClick="listfolderClick"></LeftList>
                 </div>
                 <div class="expansion">
                     <div class="top_box">
@@ -776,6 +776,7 @@ export default {
         const searchFolderTree = ref()
         const showTreeMenu = ref(false)
         const noEdit = ref(false)//树形节点 右键是否可编辑
+        const collectId = ref()
         const changeSort = async () => {
            isAsc.value == "asc" ? (isAsc.value = "desc") : (isAsc.value = "asc")
         //    refreshFile()
@@ -2276,6 +2277,15 @@ export default {
                 }
                 clickPath(null,addData)
             }
+            if(leftShowList.value === 2){
+                console.log('toList');
+                 // 创建标签
+                const addData = {
+                    path: '/department',
+                    label: '部门文件'
+                }
+                clickPath(null,addData)
+            }
         }
         // 别处过来需要层层打开的文件夹
         const openFolderPath = ()=>{
@@ -2390,6 +2400,10 @@ export default {
         });
         onMounted(() => {
             const hasMsg = localStorage.getItem('leftShowList')
+            if (route.query.clickRowId) {
+                const newRow = JSON.parse(route.query.clickRowId)
+                collectId.value = newRow
+            }
             if(!hasMsg){
                 getConfigKey("dir.style.config").then(response => {
                 leftShowList.value = response.msg - 0;
@@ -2718,7 +2732,8 @@ export default {
             openFolderPath,
             delFolderMenu,
             noEdit,
-            delFileFn
+            delFileFn,
+            collectId
         }
     },
     watch: {

+ 18 - 2
src/views/myfile/MyFile.vue

@@ -71,7 +71,7 @@
                             </div>
                         </template>
                     </div>
-                    <LeftList v-else :spaceType="3" @treeRClick="treeRClick" :searchFolderTree="searchFolderTree" :ListtreeData="ListtreeData" @listfolderClick="listfolderClick"></LeftList>
+                    <LeftList v-else :spaceType="3" :collectId="collectId" @treeRClick="treeRClick" :searchFolderTree="searchFolderTree" :ListtreeData="ListtreeData" @listfolderClick="listfolderClick"></LeftList>
                 </div>
                 <div class="expansion">
                     <div class="top_box">
@@ -806,6 +806,7 @@ export default {
         const showTreeMenu = ref(false)
         const nowTime = ref(new Date().getTime())
         const showHis = ref(false)
+        const collectId = ref()
         const hisIfarmeData = ref({
             // src: `${window.location.origin}/fileEdit?clickRowId=7567&canEdit=0&canCopy=0&history=0&fileId=0`,
         })
@@ -2456,6 +2457,7 @@ export default {
             console.log('changeLeftShow-',leftShowList.value);
             if(leftShowList.value == 2){
                 getFirstFolder()
+
                 fileList.value = []
             }else{
                 refreshFile()
@@ -2471,6 +2473,15 @@ export default {
                 }
                 clickPath(null,addData)
             }
+            if(leftShowList.value === 2){
+                console.log('toList');
+                 // 创建标签
+                const addData = {
+                    path: '/myfile',
+                    label: '我的文件'
+                }
+                clickPath(null,addData)
+            }
         }
         // 别处过来需要层层打开的文件夹
         const openFolderPath = ()=>{
@@ -2587,6 +2598,10 @@ export default {
         onMounted(() => {
             // if(!thisFolder.value){
             const hasMsg = localStorage.getItem('leftShowList')
+            if (route.query.clickRowId) {
+                const newRow = JSON.parse(route.query.clickRowId)
+                collectId.value = newRow
+            }
             if(!hasMsg){
                 getConfigKey("dir.style.config").then(response => {
                 leftShowList.value = response.msg - 0;
@@ -2924,7 +2939,8 @@ export default {
             setHisData,
             closeHis,
             nowTime,
-            showHis
+            showHis,
+            collectId
         }
     },
     watch: {

+ 17 - 2
src/views/publicment/MyFile.vue

@@ -73,7 +73,7 @@
                             </div>
                         </template>
                     </div>
-                     <LeftList v-else :spaceType="1" @treeRClick="treeRClick" :searchFolderTree="searchFolderTree" :ListtreeData="ListtreeData" @listfolderClick="listfolderClick"></LeftList>
+                     <LeftList v-else :spaceType="1" :collectId="collectId" @treeRClick="treeRClick" :searchFolderTree="searchFolderTree" :ListtreeData="ListtreeData" @listfolderClick="listfolderClick"></LeftList>
                 </div>
                 <!-- <div class="expansion">
                     <div class="top_box">
@@ -772,6 +772,7 @@ export default {
         const searchFolderTree = ref()
         const showTreeMenu = ref(false)
         const noEdit = ref(false)//树形节点 右键是否可编辑
+        const collectId = ref()
         const changeSort = async () => {
            isAsc.value == "asc" ? (isAsc.value = "desc") : (isAsc.value = "asc")
         //    refreshFile()
@@ -2261,6 +2262,15 @@ export default {
                 }
                 clickPath(null,addData)
             }
+            if(leftShowList.value === 2){
+                console.log('toList');
+                 // 创建标签
+                const addData = {
+                    path: '/publicment',
+                    label: '公共文件'
+                }
+                clickPath(null,addData)
+            }
         }
         // 别处过来需要层层打开的文件夹
         const openFolderPath = ()=>{
@@ -2375,6 +2385,10 @@ export default {
         });
         onMounted(() => {
             const hasMsg = localStorage.getItem('leftShowList')
+            if (route.query.clickRowId) {
+                const newRow = JSON.parse(route.query.clickRowId)
+                collectId.value = newRow
+            }
             if(!hasMsg){
                 getConfigKey("dir.style.config").then(response => {
                 leftShowList.value = response.msg - 0;
@@ -2702,7 +2716,8 @@ export default {
             openFolderPath,
             delFolderMenu,
             noEdit,
-            delFileFn
+            delFileFn,
+            collectId
         }
     },
     watch: {