Browse Source

修改bug宫格视图

“yueshang” 1 year ago
parent
commit
27b5d05771

+ 1 - 1
src/api/document/document.js

@@ -2,7 +2,7 @@ import request from '../../utils/request'
 function getTop(data){
     return request({
         url:`/biz/dir/top-dir/${data}`,
-        method:"get",
+        method:"get"
     })
 }
 // 获取所有文件夹列表

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

@@ -13,6 +13,13 @@ function getById(num) {
         method: "get",
     })
 }
+function getByIdgrid(num,data) {
+    return request({
+        url: `/biz/info/list/`+num,
+        method: "get",
+        params: data
+    })
+}
 // 新增
 function addNewMenu(data) {
     return request({
@@ -119,5 +126,6 @@ export default {
     uploadFileMany,
     fileType,
     getById,
-    getDir
+    getDir,
+    getByIdgrid
 }

+ 9 - 0
src/assets/styles/my-common.scss

@@ -251,3 +251,12 @@
   display: flex;
   align-items: center;
 }
+.none-data{
+  height: 250px; 
+  overflow: auto;
+  display: flex;
+  justify-content: center;
+  align-items: center;
+  color: #909399;
+  font-size: 14px;   
+}

+ 5 - 9
src/layout/indexCommon.vue

@@ -516,7 +516,6 @@ const clickPath = (index, items) => {
 };
 const clickTab = (item) => {
   let url = toRaw(item)
-  console.log("item", url);
   setTimeout(() => {
     console.log("toFileData.value", toFileData.value);
     if (toFileData.value) {
@@ -700,7 +699,6 @@ const addTab = (data) => {
   }
 };
 const addFolderAdd = (data) => {
-  console.log("data", data);
   const arr = toRaw(editableTabs.value);
   if (!arr.some((item) => item.label == data.clickRowId.dirName || item.label == data.name)) {
     editableTabs.value.push({
@@ -742,7 +740,6 @@ const closeFileTab = (item, index, e) => {
   e.preventDefault();
   e.stopPropagation();
   const data = toRaw(item);
-  console.log("closeFileTab", data);
   let arr = iFrameData.value.map((par) => {
     if (par.id === data.id) {
       par.src = "";
@@ -753,11 +750,10 @@ const closeFileTab = (item, index, e) => {
     return toRaw(par);
   });
   if (data.id == editableTabsValue.value) {
-    console.log('data.id', data.id);
     let isLeft = true
     //如果不是第一个就左移
     for (let thisId = data.id; thisId > 0; thisId--) {
-      console.log(arr[thisId - 1].id, arr[thisId - 1].src);
+      // console.log(arr[thisId - 1].id, arr[thisId - 1].src);
       if (arr[thisId - 1].src) {
         arr[thisId - 1].show = true
         isLeft = false
@@ -771,21 +767,21 @@ const closeFileTab = (item, index, e) => {
       const num = toRaw(editableTabs.value).length - 1
       const nextTab = editableTabs.value[num]
       paneClick(toRaw(nextTab));
-      console.log('left', nextTab);
+      // console.log('left', nextTab);
     }
     // isAlive.value = true;
   }
   iFrameData.value = arr;
   // console.log("index", index);
-  console.log("iFrameData", iFrameData.value);
+  // console.log("iFrameData", iFrameData.value);
 };
 // 控制iframe大小
 const iframeSize = (id) => {
   const outIframe = document.getElementById("iframe" + id);
   const inIframe =
     outIframe.contentDocument.getElementsByTagName("iframe")[0];
-  console.log('outIframe', outIframe.parentElement);
-  console.error(outIframe.parentElement);
+  // console.log('outIframe', outIframe.parentElement);
+  // console.error(outIframe.parentElement);
   inIframe.style.height = outIframe.style.height =
     outIframe.parentElement.offsetHeight + "px";
   inIframe.style.width = outIframe.style.width =

+ 35 - 21
src/views/department/MyFile.vue

@@ -154,7 +154,22 @@
                         <!-- 右侧 -->
                         <div>
                             <img :src="sort" alt="">
-                            <img :src="squre" alt="" @click="gridChange" class="shouzhi">
+                            <!-- //控制宫格展示 -->
+                            <img
+                              v-if="isList"
+                              src="@/assets/images/squre.png"
+                              class="shouzhi palace-grid"
+                              alt=""
+                              @click="changeShow(true)"
+                            />
+                            <img
+                              v-else
+                              src="@/assets/images/Frame_187.png"
+                              class="shouzhi palace-grid"
+                              alt=""
+                              @click="changeShow(false)"
+                            />
+                            <!-- <img :src="squre" alt="" @click="gridChange" class="shouzhi"> -->
                         </div>
                     </div>
                 <!-- </div> -->
@@ -209,8 +224,8 @@
                                 </el-table-column>
 
                                 </el-table>
-                                <PlaceGridFolder v-else :folderClick="folderClick" :restName="restName"
-                                    :collectFolder="collectFolder" :getAllTop="getAllTop" @folderBack="folderBack">
+                                <PlaceGridFolder v-else @folderClick="folderClick" :restName="restName"
+                                    :collectFolder="collectFolder" :getAllTop="getAllTop" @folderBack="folderBack"  :thisFolder="thisFolder" :impDirId="impDirId">
                                 </PlaceGridFolder>
                             </el-collapse-item>
                         </el-collapse>
@@ -260,7 +275,6 @@
                                                     <!-- <template #content> {{ scope.row.encryptLevel == 'L1'?'敏感':(scope.row.encryptLevel == 'L2'?'涉密':(scope.row.encryptLevel == 'L3'?'机密':'绝密')) }} </template> -->
                                                     <span class="shouzhi">{{ scope.row.fileName }}</span>
                                                     </el-tooltip>
-
                                         </span>
                                         </template>
                                     </el-table-column>
@@ -275,7 +289,7 @@
                                     </el-table-column>
                                 </el-table>
                                 <PalaceGridFile v-else @showFile="showFile" :getAllTop="getAllTop" @navBack="navBack"
-                                    @lastBB="lastBB" @onlineCase="onlineCase" @shareBack="shareBack"></PalaceGridFile>
+                                    @lastBB="lastBB" @onlineCase="onlineCase" @shareBack="shareBack"  :thisFolder="thisFolder" :fileList="fileList"></PalaceGridFile>
                             </el-collapse-item>
                         </el-collapse>
                         <div :class="{'setCli':!noMenuItem}" v-if="cliCC" :style="{ left: xz + 'px', top: yz -100 + 'px' }">
@@ -638,10 +652,16 @@ export default {
         const tableTotal = ref(0)//表格数据总数
         const spaceName = ref()
         const isDept = ref(false)// 是否管理员
+        //控制宫格展示
+        const isList = ref(false); //控制显示方式
+        const changeShow = (fileGrids) => {
+          isList.value = !isList.value;
+          fileGrid.value = fileGrids
+          folderGrid.value = fileGrids;
+        };
         // 获取文件夹,中栏,文件
         function getAllTop() {
             documents.getTop(2).then(res => {
-                console.log('getAllTopres',res);
                 let userMe = [res]
                 impDirId.value = userMe[0].dirId//固定
                 impSpaceId.value = userMe[0].spaceId//固定
@@ -692,7 +712,7 @@ export default {
                 name:row.dirName,
                 clickRowId:toRaw(row)
             }
-            addFolderAdd(addData)
+            // addFolderAdd(addData) //加了这句代码界面会渲染两次
             thisFolder.value = row
             console.log('row2',row);
             topPath.value = row.dirPath
@@ -1384,18 +1404,6 @@ export default {
                 }
             }
         }
-        function gridChange() {
-            if (fileGrid.value) {
-                fileGrid.value = false
-            } else {
-                fileGrid.value = true
-            }
-            if (folderGrid.value) {
-                folderGrid.value = false
-            } else {
-                folderGrid.value = true
-            }
-        }
         //点击收藏后刷新文件
         const refreshFile = ()=>{
             // console.log('ref',toRaw(thisFolder.value));
@@ -1763,7 +1771,6 @@ export default {
             copySpaceCup,
             fileGrid,
             folderGrid,
-            gridChange,
             collectFolder,
             arrowLift,
             formatStorage,
@@ -1804,7 +1811,10 @@ export default {
             spaceName,
             getUserInfo,
             isDept,
-            upFirstFoler
+            upFirstFoler,
+            //控制宫格展示
+            changeShow,
+            isList
         }
     },
     watch: {
@@ -2189,4 +2199,8 @@ p {
     padding-left: 10px;
     box-sizing: border-box;
 }
+.palace-grid{
+    margin-left: 4px;
+    margin-right: 20px;
+}
 </style>

+ 32 - 21
src/views/department/components/PalaceGridFile.vue

@@ -1,8 +1,8 @@
 <template>
     <div>
         <!-- flex盒子 -->
-        <div class="bigBox">
-            <template v-for="(item, index) in fileList">
+        <div class="bigBox" style="height: 250px; overflow: auto;" v-if="fileList?.length">
+            <template v-for="(item, index) in fileList" :key="index">
                 <!-- 循环盒子 -->
                 <div class="flexBox" @contextmenu="rightClick(item, $event)">
                     <!-- 图片 -->
@@ -16,7 +16,7 @@
                 </div>
             </template>
             <div class="setCli" v-if="cliCC" :style="{ left: xz + 'px', top: (yz - 330) + 'px' }">
-                <template v-for="(item, index) in filterMouseCli()">
+                <template v-for="(item, index) in filterMouseCli()" :key="index">
                     <p @click="chooseSet(item, index, 1)" class="chooseSet">
                         <img :src="item.img" alt="">
                         {{ item.name }}
@@ -53,6 +53,7 @@
                     :copyFileId="copyFileId" :isFolder="isFolder" :clickRow="clickRow"></FileCollect>
             </div>
         </div>
+        <div v-else  class="none-data">暂无数据</div>
     </div>
 </template>
 
@@ -77,6 +78,14 @@ export default {
             type: Function,
             required: true
         },
+        thisFolder: {
+            type: Object,
+            required: true
+        },
+        fileList:{
+            type:Array,
+            require:true
+        }
     },
     setup(props, { emit }) {
         let impDirId = ref(0)
@@ -84,7 +93,7 @@ export default {
         let newSpaceId = ref(0)
         let newDirId = ref(0)
         let topPath = ref("")
-        let fileList = ref([])
+        let fileListGrid = ref([])
         let folderList = ref([])
         let fileTotal = ref(0)
         let fileMenu = ref([])
@@ -172,7 +181,7 @@ export default {
         ])
         // 获取文件夹,中栏,文件
         function getAllTop() {
-            documents.getTop(3).then(res => {
+            documents.getTop(2).then(res => {
                 let userMe = [res]
                 impDirId.value = userMe[0].dirId//固定
                 impSpaceId.value = userMe[0].spaceId//固定
@@ -183,25 +192,27 @@ export default {
                     pageNum: 1,
                     pageSize: 10
                 }
-                documents.getALLdocument({ parentId: userMe[0].dirId - 0, spaceId: userMe[0].spaceId, pageNum: obj.pageNum, pageSize: obj.pageSize }).then(res => {
-                    fileMenu.value = res.data
-                    folderList.value = res.data
-                })
-                myfile.getById(userMe[0].dirId - 0, obj).then(res => {
+                console.log('userMe===========', userMe)
+                // documents.getALLdocument({ parentId: userMe[0].dirId - 0, spaceId: userMe[0].spaceId, pageNum: obj.pageNum, pageSize: obj.pageSize }).then(res => {
+                //     fileMenu.value = res.data
+                //     folderList.value = res.data
+                // })
+                const fileId =props.thisFolder.dirId?props.thisFolder.dirId:userMe[0].dirId - 0
+                myfile.getById(fileId, obj).then(res => {
                     if (res.code === 200) {
-                        fileList.value = res.rows
+                        fileListGrid.value = res.rows
                         fileTotal.value = res.total
                         if (fileTotal.value / 10 != 1) {
                             let x = Math.trunc(fileTotal.value / 10) + 1
                             for (var i = 1; i <= x; i++) {
                                 obj.pageNum = i
-                                myfile.getById(userMe[0].dirId - 0, obj).then(res => {
-                                    fileList.value = fileList.value.concat(res.rows)
-                                    const uniqueFileList = Array.from(new Set(fileList.value.map(item => item.docId)))
-                                        .map(docId => fileList.value.find(item => item.docId === docId));
-                                    // 合并数组并更新 fileList.value
-                                    fileList.value = uniqueFileList
-                                    console.log(fileList.value, 'iiii');
+                                myfile.getById(fileId, obj).then(res => {
+                                    fileListGrid.value = fileListGrid.value.concat(res.rows)
+                                    const uniquefileListGrid = Array.from(new Set(fileListGrid.value.map(item => item.docId)))
+                                        .map(docId => fileListGrid.value.find(item => item.docId === docId));
+                                    // 合并数组并更新 fileListGrid.value
+                                    fileListGrid.value = uniquefileListGrid
+                                    console.log(fileListGrid.value, 'iiii');
                                 })
                             }
                         }
@@ -425,7 +436,7 @@ export default {
             impSpaceId,
             newDirId,
             newSpaceId,
-            fileList,
+            fileListGrid,
             fileMenu,
             folderList,
             fileTotal,
@@ -483,8 +494,8 @@ export default {
 }
 </script>
 
-<style scoped>
-.bigBox {
+<style scoped lang="scss">
+@import "@/assets/styles/my-common.scss";.bigBox {
     width: 100%;
     height: 100%;
     display: flex;

+ 43 - 29
src/views/department/components/PlaceGridFolder.vue

@@ -2,10 +2,10 @@
     <div>
         <div>
             <!-- flex盒子 -->
-            <div class="bigBox">
-                <template v-for="(item, index) in folderList">
+            <div class="bigBox" style="height: 250px; overflow: auto;" v-if="folderListGrid?.length">
+                <template v-for="(item, index) in folderListGrid" :key="index">
                     <!-- 循环盒子 -->
-                    <div class="flexBox" @contextmenu="rightClick(item, index, $event)">
+                    <div class="flexBox" @contextmenu="rightClick(item, index, $event)" @click="folderClickGrid(item)">
                         <!-- 图片 -->
                         <div class="imgBox">
                             <img src="../../../assets/images/folderBig.png" alt="" style="vertical-align: middle;">
@@ -33,6 +33,7 @@
                     </div>
                 </div>
             </div>
+            <div v-else  class="none-data">暂无数据</div>
         </div>
     </div>
 </template>
@@ -62,6 +63,10 @@ export default {
             type: Function,
             required: true
         },
+        thisFolder: {
+            type: Object,
+            required: true
+        }
 
     },
     setup(props, { emit }) {
@@ -71,7 +76,7 @@ export default {
         let newDirId = ref(0)
         let topPath = ref("")
         let fileList = ref([])
-        let folderList = ref([])
+        let folderListGrid = ref([])
         let fileTotal = ref(0)
         let fileMenu = ref([])
         let folderleft = ref(0)
@@ -83,7 +88,7 @@ export default {
         let copyFir = ref("")
         // 获取文件夹,中栏,文件
         function getAllTop() {
-            documents.getTop(3).then(res => {
+            documents.getTop(2).then(res => {
                 let userMe = [res]
                 impDirId.value = userMe[0].dirId//固定
                 impSpaceId.value = userMe[0].spaceId//固定
@@ -94,29 +99,31 @@ export default {
                     pageNum: 1,
                     pageSize: 10
                 }
-                documents.getALLdocument({ parentId: userMe[0].dirId - 0, spaceId: userMe[0].spaceId, pageNum: obj.pageNum, pageSize: obj.pageSize }).then(res => {
+                const fileId =props.thisFolder.dirId?props.thisFolder.dirId:userMe[0].dirId - 0
+                documents.getALLdocumentByType({ parentId:fileId, spaceId: userMe[0].spaceId, pageNum: obj.pageNum, pageSize: obj.pageSize },2).then(res => {
+                    console.log('res.data', res.data)
                     fileMenu.value = res.data
-                    folderList.value = res.data
-                })
-                myfile.getById(userMe[0].dirId - 0, obj).then(res => {
-                    if (res.code === 200) {
-                        fileList.value = res.rows
-                        fileTotal.value = res.total
-                        if (fileTotal.value / 10 != 1) {
-                            let x = Math.trunc(fileTotal.value / 10) + 1
-                            for (var i = 1; i <= x; i++) {
-                                obj.pageNum = i
-                                myfile.getById(userMe[0].dirId - 0, obj).then(res => {
-                                    fileList.value = fileList.value.concat(res.rows)
-                                    const uniqueFileList = Array.from(new Set(fileList.value.map(item => item.docId)))
-                                        .map(docId => fileList.value.find(item => item.docId === docId));
-                                    // 合并数组并更新 fileList.value
-                                    fileList.value = uniqueFileList
-                                })
-                            }
-                        }
-                    }
+                    folderListGrid.value = res.data
                 })
+                // myfile.getById(userMe[0].dirId - 0, obj).then(res => {
+                //     if (res.code === 200) {
+                //         fileList.value = res.rows
+                //         fileTotal.value = res.total
+                //         if (fileTotal.value / 10 != 1) {
+                //             let x = Math.trunc(fileTotal.value / 10) + 1
+                //             for (var i = 1; i <= x; i++) {
+                //                 obj.pageNum = i
+                //                 myfile.getById(userMe[0].dirId - 0, obj).then(res => {
+                //                     fileList.value = fileList.value.concat(res.rows)
+                //                     const uniqueFileList = Array.from(new Set(fileList.value.map(item => item.docId)))
+                //                         .map(docId => fileList.value.find(item => item.docId === docId));
+                //                     // 合并数组并更新 fileList.value
+                //                     fileList.value = uniqueFileList
+                //                 })
+                //             }
+                //         }
+                //     }
+                // })
             })
         }
         function rightClick(row, num, eve) {
@@ -142,7 +149,7 @@ export default {
                 parentId: copyDir.value - 0,
                 spaceId: copySpa.value - 0
             }).then(res => {
-                folderList.value = res.data
+                folderListGrid.value = res.data
                 if (res.data.length === 0) {
                     myfile.getById(copyDir.value).then(res => {
                         if (res.code === 200) {
@@ -166,11 +173,17 @@ export default {
             props.restName(a, b)
             emit('folderBack', copyDir.value, copySpa.value, copyNma.value)
         }
+        const folderClickGrid = (item) => {
+            getAllTop()
+            emit("folderClick", item)
+           console.log('item', item)
+        }
         onMounted(() => {
             getAllTop()
             window.addEventListener("click", mouseClick, true);
         })
         return {
+            folderClickGrid,
             getAllTop,
             impDirId,
             impSpaceId,
@@ -178,7 +191,7 @@ export default {
             newSpaceId,
             fileList,
             fileMenu,
-            folderList,
+            folderListGrid,
             fileTotal,
             rightClick,
             folderleft,
@@ -200,7 +213,8 @@ export default {
 }
 </script>
 
-<style scoped>
+<style scoped lang="scss">
+@import "@/assets/styles/my-common.scss";
 .bigBox {
     width: 100%;
     height: 100%;

+ 40 - 42
src/views/myfile/MyFile.vue

@@ -184,7 +184,22 @@
                         <!-- 右侧 -->
                         <div>
                             <img :src="sort" alt="">
-                            <img :src="squre" alt="" @click="gridChange" class="shouzhi">
+                            <!-- //控制宫格展示 -->
+                            <img
+                              v-if="isList"
+                              src="@/assets/images/squre.png"
+                              class="shouzhi palace-grid"
+                              alt=""
+                              @click="changeShow(true)"
+                            />
+                            <img
+                              v-else
+                              src="@/assets/images/Frame_187.png"
+                              class="shouzhi palace-grid"
+                              alt=""
+                              @click="changeShow(false)"
+                            />
+                            <!-- <img :src="squre" alt="" @click="gridChange" class="shouzhi"> -->
                         </div>
                     </div>
                 <!-- </div> -->
@@ -210,17 +225,6 @@
                                                 <img v-else @click.stop="delCollect(scope.row,true)" src="../../assets/images/yellowstar.png" alt="">
                                                 <img src="../../assets/images/fileBox.png" style="width: 20px;height: 24px;margin-right: 5px;"
                                                     alt="">
-                                                    <!-- <el-tooltip
-                                                        class="box-item"
-                                                        effect="dark"
-                                                        :content="scope.row.dirName"
-                                                        placement="top"
-                                                        :show-after="1000"
-                                                        v-if="scope.row.encryptLevel"
-                                                    >
-                                                    <template #content> {{ scope.row.encryptLevel == 'L1'?'敏感':(scope.row.encryptLevel == 'L2'?'涉密':(scope.row.encryptLevel == 'L3'?'机密':'绝密')) }} </template>
-                                                    <span class="shouzhi">{{ scope.row.dirName }}</span>
-                                                    </el-tooltip> -->
                                                     <span class="shouzhi">{{ scope.row.dirName }}</span>
                                                 </span>
                                             </template>
@@ -238,10 +242,9 @@
                                                 </span>
                                             </template>
                                         </el-table-column>
-
                                     </el-table>
-                                    <PlaceGridFolder v-else :folderClick="folderClick" :restName="restName"
-                                        :collectFolder="collectFolder" :getAllTop="getAllTop" @folderBack="folderBack">
+                                    <PlaceGridFolder v-else @folderClick="folderClick" :restName="restName"
+                                        :collectFolder="collectFolder" :getAllTop="getAllTop" @folderBack="folderBack" :thisFolder="thisFolder">
                                     </PlaceGridFolder>
                                 </el-collapse-item>
                             </el-collapse>
@@ -255,7 +258,7 @@
                                 <div class="menu_item" @click="restName(null, null)">
                                     <img src="@/assets/images/textbox.png" alt="" />
                                     <span>重命名</span>
-                                </div>
+                                </div>shareBack
                                 <div class="menu_item" @click="collectFolder">
                                     <img src="@/assets/images/collect.png" alt="" />
                                     <span>收藏</span>
@@ -265,7 +268,7 @@
                         <!-- 文件 -->
                         <div class="fileTable">
                             <el-collapse v-model="files">
-                                <el-collapse-item name="folder" class="custom-collapse-item">
+                                <el-collapse-item name="2" class="custom-collapse-item">
                                     <template #title>
                                        <span class="file-title">文件</span>
                                     </template>
@@ -307,8 +310,8 @@
                                             </template>
                                         </el-table-column>
                                     </el-table>
-                                    <PalaceGridFile v-else @showFile="showFile" :getAllTop="getAllTop" @navBack="navBack"
-                                        @lastBB="lastBB" @onlineCase="onlineCase" @shareBack="shareBack"></PalaceGridFile>
+                                    <PalaceGridFile v-else :getAllTop="getAllTop" @navBack="navBack"
+                                        @lastBB="lastBB" @onlineCase="onlineCase" @shareBack="shareBack" :thisFolder="thisFolder" :fileList="fileList"></PalaceGridFile>
                                 </el-collapse-item>
                             </el-collapse>
                             <div class="setCli" v-if="cliCC" :style="{ left: xz + 'px', top: yz - 260 + 'px' }">
@@ -674,7 +677,14 @@ export default {
         const tableBeEnd = ref(true)//控制下拉是否到底
         const tableTotal = ref(0)//表格数据总数
         const clickFileData = ref(null);
-        let fileBig = ref(0)
+        let fileBig = ref(0);
+         //控制宫格展示
+        const isList = ref(false); //控制显示方式
+        const changeShow = (fileGrids) => {
+          isList.value = !isList.value;
+          fileGrid.value = fileGrids
+          folderGrid.value = fileGrids;
+        };
         // 获取文件夹,中栏,文件
         function getAllTop() {
             documents.getTop(3).then(res => {
@@ -725,13 +735,12 @@ export default {
         }
         function changeFile(row, num) {
             // 创建标签
-
             const addData = {
                 path: '/myfile' + row.dirId,
                 name: row.dirName,
                 clickRowId: toRaw(row)
             }
-            addFolderAdd(addData)
+            // addFolderAdd(addData)   //加了这句代码界面会渲染两次
             thisFolder.value = row
             console.log('row2', row);
             topPath.value = row.dirPath
@@ -1278,9 +1287,7 @@ export default {
             } else {
                 thisFolderRole.value = null
             }
-            // console.log('row1', toRaw(row));
             topPath.value = row.dirPath
-            // console.log('topPath',toRaw(topPath.value));
             newDirId.value = row.dirId
             newSpaceId.value = row.spaceId
             clickFileData.value = row
@@ -1303,7 +1310,6 @@ export default {
                     })
                 } else {
                     myfile.getById(query).then(res => {
-                        console.log('folerFile', res);
                         if (res.code === 200) {
                             tableTotal.value = res.total
                             if (res.rows.length < res.total) {
@@ -1311,7 +1317,6 @@ export default {
                                 tableBeEnd.value = false
                             }
                             fileList.value = JSON.parse(JSON.stringify(res.rows))
-                            // console.log('fileList',toRaw(fileList.value));
                         }
                     })
                 }
@@ -1363,7 +1368,6 @@ export default {
             thanks.value = data
         }
         function getChildrenC(data) {
-            console.log('data====', data)
             folderCase.value = data
         }
         function getCollects(data) {
@@ -1545,18 +1549,7 @@ export default {
                 }
             }
         }
-        function gridChange() {
-            if (fileGrid.value) {
-                fileGrid.value = false
-            } else {
-                fileGrid.value = true
-            }
-            if (folderGrid.value) {
-                folderGrid.value = false
-            } else {
-                folderGrid.value = true
-            }
-        }
+
         //点击收藏后刷新文件
         const refreshFile = () => {
             if (toRaw(thisFolder.value).dirId && !leftNewFile.value) {//如果点开了文件夹
@@ -1771,7 +1764,6 @@ export default {
             if (to.name == 'myfile') {
                 loadingPreview.value = true
                 const thisdirId = to.params.dirId
-                console.log('thisdirId', thisdirId);
                 setTimeout(() => {
                     if (thisdirId) {
                         myfile.getDir(thisdirId).then(res => {
@@ -1925,7 +1917,6 @@ export default {
             copySpaceCup,
             fileGrid,
             folderGrid,
-            gridChange,
             collectFolder,
             arrowLift,
             formatStorage,
@@ -1968,7 +1959,10 @@ export default {
             fileBlur,
             fileBig,
             loadingUpload,
-            closeUpload
+            closeUpload,
+            //控制宫格展示
+            changeShow,
+            isList
         }
     },
     watch: {
@@ -2360,4 +2354,8 @@ p {
   color: #2e6bc8;
   right: 97%;
 }
+.palace-grid{
+    margin-left: 4px;
+    margin-right: 20px;
+}
 </style>

+ 35 - 20
src/views/myfile/components/PalaceGridFile.vue

@@ -1,8 +1,8 @@
 <template>
     <div>
         <!-- flex盒子 -->
-        <div class="bigBox">
-            <template v-for="(item, index) in fileList">
+        <div class="bigBox" style="height: 250px; overflow: auto;" v-if="fileList?.length">
+            <template v-for="(item, index) in fileList" :key="index">
                 <!-- 循环盒子 -->
                 <div class="flexBox" @contextmenu="rightClick(item, $event)">
                     <!-- 图片 -->
@@ -16,7 +16,7 @@
                 </div>
             </template>
             <div class="setCli" v-if="cliCC" :style="{ left: xz + 'px', top: (yz - 330) + 'px' }">
-                <template v-for="(item, index) in filterMouseCli()">
+                <template v-for="(item, index) in filterMouseCli()" :key="index">
                     <p @click="chooseSet(item, index, 1)" class="chooseSet">
                         <img :src="item.img" alt="">
                         {{ item.name }}
@@ -53,6 +53,7 @@
                     :copyFileId="copyFileId" :isFolder="isFolder" :clickRow="clickRow"></FileCollect>
             </div>
         </div>
+        <div v-else  class="none-data">暂无数据</div>
     </div>
 </template>
 
@@ -77,6 +78,14 @@ export default {
             type: Function,
             required: true
         },
+        thisFolder: {
+            type: Object,
+            required: true
+        },
+        fileList:{
+            type:Array,
+            require:true
+        }
     },
     setup(props, { emit }) {
         let impDirId = ref(0)
@@ -84,7 +93,7 @@ export default {
         let newSpaceId = ref(0)
         let newDirId = ref(0)
         let topPath = ref("")
-        let fileList = ref([])
+        let fileListGrid = ref()
         let folderList = ref([])
         let fileTotal = ref(0)
         let fileMenu = ref([])
@@ -170,7 +179,7 @@ export default {
                 name: "删除"
             }
         ])
-        // 获取文件夹,中栏,文件
+        // 获取文件夹,中栏,文件    这串代码也许是未使用的,直接父组件获取值后传过来即可
         function getAllTop() {
             documents.getTop(3).then(res => {
                 let userMe = [res]
@@ -183,32 +192,37 @@ export default {
                     pageNum: 1,
                     pageSize: 10
                 }
-                documents.getALLdocument({ parentId: userMe[0].dirId - 0, spaceId: userMe[0].spaceId, pageNum: obj.pageNum, pageSize: obj.pageSize }).then(res => {
-                    fileMenu.value = res.data
-                    folderList.value = res.data
-                })
-                myfile.getById(userMe[0].dirId - 0, obj).then(res => {
+                //修改userMe[0].dirId为props.thisFolder.dirId
+                // documents.getALLdocument({ parentId: userMe[0].dirId - 0, spaceId: userMe[0].spaceId, pageNum: obj.pageNum, pageSize: obj.pageSize }).then(res => {
+                //     fileMenu.value = res.data
+                //     folderList.value = res.data
+                // })
+                const fileId =props.thisFolder.dirId?props.thisFolder.dirId:userMe[0].dirId - 0
+                myfile.getById(fileId,obj).then(res => {
+
                     if (res.code === 200) {
-                        fileList.value = res.rows
+                        fileListGrid.value = res.rows
                         fileTotal.value = res.total
                         if (fileTotal.value / 10 != 1) {
                             let x = Math.trunc(fileTotal.value / 10) + 1
                             for (var i = 1; i <= x; i++) {
                                 obj.pageNum = i
-                                myfile.getById(userMe[0].dirId - 0, obj).then(res => {
-                                    fileList.value = fileList.value.concat(res.rows)
-                                    const uniqueFileList = Array.from(new Set(fileList.value.map(item => item.docId)))
-                                        .map(docId => fileList.value.find(item => item.docId === docId));
-                                    // 合并数组并更新 fileList.value
-                                    fileList.value = uniqueFileList
-                                    console.log(fileList.value, 'iiii');
+                                myfile.getById(fileId, obj).then(res => {
+                                    fileListGrid.value = fileListGrid.value.concat(res.rows)
+                                    const uniquefileListGrid = Array.from(new Set(fileListGrid.value.map(item => item.docId)))
+                                        .map(docId => fileListGrid.value.find(item => item.docId === docId));
+                                    // 合并数组并更新 fileListGrid.value
+                                    fileListGrid.value = uniquefileListGrid
+                                    console.log(fileListGrid.value, 'iiii');
                                 })
                             }
                         }
                     }
+                }).catch((err)=>{
                 })
 
             })
+
         }
         // 筛选后缀图片
         function getImage(file) {
@@ -425,7 +439,7 @@ export default {
             impSpaceId,
             newDirId,
             newSpaceId,
-            fileList,
+            fileListGrid,
             fileMenu,
             folderList,
             fileTotal,
@@ -483,7 +497,8 @@ export default {
 }
 </script>
 
-<style scoped>
+<style scoped lang="scss">
+@import "@/assets/styles/my-common.scss";
 .bigBox {
     width: 100%;
     height: 100%;

+ 43 - 29
src/views/myfile/components/PlaceGridFolder.vue

@@ -2,10 +2,10 @@
     <div>
         <div>
             <!-- flex盒子 -->
-            <div class="bigBox">
-                <template v-for="(item, index) in folderList">
+            <div class="bigBox" style="height: 250px; overflow: auto;" v-if="folderListGrid?.length">
+                <template v-for="(item, index) in folderListGrid" :key="index">
                     <!-- 循环盒子 -->
-                    <div class="flexBox" @contextmenu="rightClick(item, index, $event)">
+                    <div class="flexBox" @contextmenu="rightClick(item, index, $event)" @click="folderClickGrid(item)">
                         <!-- 图片 -->
                         <div class="imgBox">
                             <img src="../../../assets/images/folderBig.png" alt="" style="vertical-align: middle;">
@@ -29,7 +29,9 @@
                     </div>
                 </div>
             </div>
+            <div v-else  class="none-data">暂无数据</div>
         </div>
+
     </div>
 </template>
 
@@ -58,7 +60,10 @@ export default {
             type: Function,
             required: true
         },
-
+        thisFolder: {
+            type: Object,
+            required: true
+        }
     },
     setup(props, { emit }) {
         let impDirId = ref(0)
@@ -67,7 +72,7 @@ export default {
         let newDirId = ref(0)
         let topPath = ref("")
         let fileList = ref([])
-        let folderList = ref([])
+        let folderListGrid = ref([])
         let fileTotal = ref(0)
         let fileMenu = ref([])
         let folderleft = ref(0)
@@ -90,32 +95,34 @@ export default {
                     pageNum: 1,
                     pageSize: 10
                 }
-                documents.getALLdocument({ parentId: userMe[0].dirId - 0, spaceId: userMe[0].spaceId, pageNum: obj.pageNum, pageSize: obj.pageSize }).then(res => {
+                const fileId =props.thisFolder.dirId?props.thisFolder.dirId:userMe[0].dirId - 0
+                documents.getALLdocument({ parentId:fileId, spaceId: userMe[0].spaceId, pageNum: obj.pageNum, pageSize: obj.pageSize }).then(res => {
                     fileMenu.value = res.data
-                    folderList.value = res.data
-                })
-                myfile.getById(userMe[0].dirId - 0, obj).then(res => {
-                    if (res.code === 200) {
-                        fileList.value = res.rows
-                        fileTotal.value = res.total
-                        if (fileTotal.value / 10 != 1) {
-                            let x = Math.trunc(fileTotal.value / 10) + 1
-                            for (var i = 1; i <= x; i++) {
-                                obj.pageNum = i
-                                myfile.getById(userMe[0].dirId - 0, obj).then(res => {
-                                    fileList.value = fileList.value.concat(res.rows)
-                                    const uniqueFileList = Array.from(new Set(fileList.value.map(item => item.docId)))
-                                        .map(docId => fileList.value.find(item => item.docId === docId));
-                                    // 合并数组并更新 fileList.value
-                                    fileList.value = uniqueFileList
-                                })
-                            }
-                        }
-                    }
+                    folderListGrid.value = res.data
                 })
+                // myfile.getById(userMe[0].dirId - 0, obj).then(res => {
+                //     if (res.code === 200) {
+                //         fileList.value = res.rows
+                //         fileTotal.value = res.total
+                //         if (fileTotal.value / 10 != 1) {
+                //             let x = Math.trunc(fileTotal.value / 10) + 1
+                //             for (var i = 1; i <= x; i++) {
+                //                 obj.pageNum = i
+                //                 myfile.getById(userMe[0].dirId - 0, obj).then(res => {
+                //                     fileList.value = fileList.value.concat(res.rows)
+                //                     const uniqueFileList = Array.from(new Set(fileList.value.map(item => item.docId)))
+                //                         .map(docId => fileList.value.find(item => item.docId === docId));
+                //                     // 合并数组并更新 fileList.value
+                //                     fileList.value = uniqueFileList
+                //                 })
+                //             }
+                //         }
+                //     }
+                // })
             })
         }
         function rightClick(row, num, eve) {
+            console.log('row=====', row,num,eve)
             eve.preventDefault();
             eve.stopPropagation();
             folderleft.value = eve.pageX
@@ -138,7 +145,7 @@ export default {
                 parentId: copyDir.value - 0,
                 spaceId: copySpa.value - 0
             }).then(res => {
-                folderList.value = res.data
+                folderListGrid.value = res.data
                 if (res.data.length === 0) {
                     myfile.getById(copyDir.value).then(res => {
                         if (res.code === 200) {
@@ -162,6 +169,11 @@ export default {
             props.restName(a, b)
             emit('folderBack', copyDir.value, copySpa.value, copyNma.value)
         }
+        const folderClickGrid = (item) => {
+            getAllTop()
+            emit("folderClick", item)
+           console.log('item', item)
+        }
         onMounted(() => {
             getAllTop()
             window.addEventListener("click", mouseClick, true);
@@ -174,7 +186,7 @@ export default {
             newSpaceId,
             fileList,
             fileMenu,
-            folderList,
+            folderListGrid,
             fileTotal,
             rightClick,
             folderleft,
@@ -188,6 +200,7 @@ export default {
             copySpa,
             copyNma,
             copyFir,
+            folderClickGrid
         }
     },
     components:{
@@ -196,7 +209,8 @@ export default {
 }
 </script>
 
-<style scoped>
+<style scoped lang="scss">
+@import "@/assets/styles/my-common.scss";
 .bigBox {
     width: 100%;
     height: 100%;

+ 37 - 19
src/views/publicment/MyFile.vue

@@ -153,7 +153,22 @@
                         <!-- 右侧 -->
                         <div>
                             <img :src="sort" alt="">
-                            <img :src="squre" alt="" @click="gridChange" class="shouzhi">
+                            <!-- //控制宫格展示 -->
+                            <img
+                              v-if="isList"
+                              src="@/assets/images/squre.png"
+                              class="shouzhi palace-grid"
+                              alt=""
+                              @click="changeShow(true)"
+                            />
+                            <img
+                              v-else
+                              src="@/assets/images/Frame_187.png"
+                              class="shouzhi palace-grid"
+                              alt=""
+                              @click="changeShow(false)"
+                            />
+                            <!-- <img :src="squre" alt="" @click="gridChange" class="shouzhi"> -->
                         </div>
                     </div>
                 <!-- </div> -->
@@ -162,7 +177,7 @@
                 <!-- 文件夹 -->
                 <div class="detailBox file-jia" @click="mouseClick">
                     <el-collapse v-model="folder">
-                        <el-collapse-item name="1" class="custom-collapse-item">
+                            <el-collapse-item name="1" class="custom-collapse-item">
                             <template #title>
                                <span class="file-title">文件夹</span>
                             </template>
@@ -179,16 +194,6 @@
                                             <img v-else @click.stop="delCollect(scope.row,true)" src="../../assets/images/yellowstar.png" alt="" class="juli">
                                             <img src="../../assets/images/fileBox.png" style="width: 20px;height: 24px;"
                                                 alt="" class="juli">
-                                                 <!-- <el-tooltip
-                                                    class="box-item"
-                                                    effect="dark"
-                                                    placement="top"
-                                                    :show-after="1000"
-                                                    v-if="scope.row.encryptLevel"
-                                                >
-                                                <template #content> {{ scope.row.encryptLevel == 'L1'?'敏感':(scope.row.encryptLevel == 'L2'?'涉密':(scope.row.encryptLevel == 'L3'?'机密':'绝密')) }} </template>
-                                                  <span class="shouzhi"> {{ scope.row.dirName }}</span>
-                                                </el-tooltip> -->
                                                 <span class="shouzhi">{{ scope.row.dirName }}</span>
                                         </span>
                                     </template>
@@ -208,11 +213,11 @@
                                 </el-table-column>
 
                                 </el-table>
-                                <PlaceGridFolder v-else :folderClick="folderClick" :restName="restName"
-                                    :collectFolder="collectFolder" :getAllTop="getAllTop" @folderBack="folderBack">
+                                <PlaceGridFolder v-else  @folderClick="folderClick" :restName="restName"
+                                    :collectFolder="collectFolder" :getAllTop="getAllTop" @folderBack="folderBack" :thisFolder="thisFolder">
                                 </PlaceGridFolder>
                             </el-collapse-item>
-                        </el-collapse>
+                    </el-collapse>
                         <!-- 右键唤出的菜单 -->
                         <div class="right_menu" v-if="folderVisible"
                             :style="{ left: folderleft + 'px', top: foldertop + 'px' }">
@@ -273,7 +278,7 @@
                                     </el-table-column>
                                 </el-table>
                                 <PalaceGridFile v-else @showFile="showFile" :getAllTop="getAllTop" @navBack="navBack"
-                                    @lastBB="lastBB" @onlineCase="onlineCase" @shareBack="shareBack"></PalaceGridFile>
+                                    @lastBB="lastBB" @onlineCase="onlineCase" @shareBack="shareBack" :thisFolder="thisFolder" :fileList="fileList"></PalaceGridFile>
                             </el-collapse-item>
                         </el-collapse>
                         <div :class="{'setCli':!noMenuItem}" v-if="cliCC" :style="{ left: xz + 'px', top: yz -100 + 'px' }">
@@ -647,6 +652,13 @@ export default {
         const tableBeEnd = ref(true)//控制下拉是否到底
         const tableTotal = ref(0)//表格数据总数
         const isDept = ref(false)// 是否管理员
+        //控制宫格展示
+        const isList = ref(false); //控制显示方式
+        const changeShow = (fileGrids) => {
+          isList.value = !isList.value;
+          fileGrid.value = fileGrids
+          folderGrid.value = fileGrids;
+        };
         // 获取文件夹,中栏,文件
         function getAllTop() {
             documents.getTop(1).then(res => {
@@ -705,7 +717,7 @@ export default {
                 name:row.dirName,
                 clickRowId:toRaw(row)
             }
-            addFolderAdd(addData)
+            addFolderAdd(addData) //加了这句代码界面会渲染两次
             thisFolder.value = row
             // console.log('row2',row);
              topPath.value = row.dirPath
@@ -1772,7 +1784,6 @@ export default {
             copySpaceCup,
             fileGrid,
             folderGrid,
-            gridChange,
             collectFolder,
             arrowLift,
             formatStorage,
@@ -1813,7 +1824,10 @@ export default {
             spaceName,
             getUserInfo,
             isDept,
-            upFirstFoler
+            upFirstFoler,
+            //控制宫格展示
+            changeShow,
+            isList
         }
     },
     watch: {
@@ -2187,4 +2201,8 @@ p {
     padding-left: 10px;
     box-sizing: border-box;
 }
+.palace-grid{
+    margin-left: 4px;
+    margin-right: 20px;
+}
 </style>

+ 29 - 18
src/views/publicment/components/PalaceGridFile.vue

@@ -1,7 +1,7 @@
 <template>
     <div>
         <!-- flex盒子 -->
-        <div class="bigBox">
+        <div class="bigBox" style="height: 250px; overflow: auto;"  v-if="fileList?.length">
             <template v-for="(item, index) in fileList">
                 <!-- 循环盒子 -->
                 <div class="flexBox" @contextmenu="rightClick(item, $event)">
@@ -53,6 +53,7 @@
                     :copyFileId="copyFileId" :isFolder="isFolder" :clickRow="clickRow"></FileCollect>
             </div>
         </div>
+        <div v-else  class="none-data">暂无数据</div>
     </div>
 </template>
 
@@ -77,6 +78,14 @@ export default {
             type: Function,
             required: true
         },
+        thisFolder: {
+            type: Object,
+            required: true
+        },
+        fileList:{
+            type:Array,
+            require:true
+        }
     },
     setup(props, { emit }) {
         let impDirId = ref(0)
@@ -84,7 +93,7 @@ export default {
         let newSpaceId = ref(0)
         let newDirId = ref(0)
         let topPath = ref("")
-        let fileList = ref([])
+        let fileListGrid = ref([])
         let folderList = ref([])
         let fileTotal = ref(0)
         let fileMenu = ref([])
@@ -172,7 +181,7 @@ export default {
         ])
         // 获取文件夹,中栏,文件
         function getAllTop() {
-            documents.getTop(3).then(res => {
+            documents.getTop(1).then(res => {
                 let userMe = [res]
                 impDirId.value = userMe[0].dirId//固定
                 impSpaceId.value = userMe[0].spaceId//固定
@@ -183,25 +192,26 @@ export default {
                     pageNum: 1,
                     pageSize: 10
                 }
-                documents.getALLdocument({ parentId: userMe[0].dirId - 0, spaceId: userMe[0].spaceId, pageNum: obj.pageNum, pageSize: obj.pageSize }).then(res => {
-                    fileMenu.value = res.data
-                    folderList.value = res.data
-                })
-                myfile.getById(userMe[0].dirId - 0, obj).then(res => {
+                // documents.getALLdocument({ parentId: userMe[0].dirId - 0, spaceId: userMe[0].spaceId, pageNum: obj.pageNum, pageSize: obj.pageSize }).then(res => {
+                //     fileMenu.value = res.data
+                //     folderList.value = res.data
+                // })
+                const fileId =props.thisFolder.dirId?props.thisFolder.dirId:userMe[0].dirId - 0
+                myfile.getById(fileId, obj).then(res => {
                     if (res.code === 200) {
-                        fileList.value = res.rows
+                        fileListGrid.value = res.rows
                         fileTotal.value = res.total
                         if (fileTotal.value / 10 != 1) {
                             let x = Math.trunc(fileTotal.value / 10) + 1
                             for (var i = 1; i <= x; i++) {
                                 obj.pageNum = i
-                                myfile.getById(userMe[0].dirId - 0, obj).then(res => {
-                                    fileList.value = fileList.value.concat(res.rows)
-                                    const uniqueFileList = Array.from(new Set(fileList.value.map(item => item.docId)))
-                                        .map(docId => fileList.value.find(item => item.docId === docId));
-                                    // 合并数组并更新 fileList.value
-                                    fileList.value = uniqueFileList
-                                    console.log(fileList.value, 'iiii');
+                                myfile.getById(fileId, obj).then(res => {
+                                    fileListGrid.value = fileListGrid.value.concat(res.rows)
+                                    const uniquefileListGrid = Array.from(new Set(fileListGrid.value.map(item => item.docId)))
+                                        .map(docId => fileListGrid.value.find(item => item.docId === docId));
+                                    // 合并数组并更新 fileListGrid.value
+                                    fileListGrid.value = uniquefileListGrid
+                                    console.log(fileListGrid.value, 'iiii');
                                 })
                             }
                         }
@@ -425,7 +435,7 @@ export default {
             impSpaceId,
             newDirId,
             newSpaceId,
-            fileList,
+            fileListGrid,
             fileMenu,
             folderList,
             fileTotal,
@@ -483,7 +493,8 @@ export default {
 }
 </script>
 
-<style scoped>
+<style scoped lang="scss">
+@import "@/assets/styles/my-common.scss";
 .bigBox {
     width: 100%;
     height: 100%;

+ 42 - 30
src/views/publicment/components/PlaceGridFolder.vue

@@ -2,10 +2,10 @@
     <div>
         <div>
             <!-- flex盒子 -->
-            <div class="bigBox">
-                <template v-for="(item, index) in folderList">
+            <div class="bigBox" style="height: 250px; overflow: auto;" v-if="folderListGrid?.length">
+                <template v-for="(item, index) in folderListGrid" :key="index">
                     <!-- 循环盒子 -->
-                    <div class="flexBox" @contextmenu="rightClick(item, index, $event)">
+                    <div class="flexBox" @contextmenu="rightClick(item, index, $event)" @click="folderClickGrid(item)">
                         <!-- 图片 -->
                         <div class="imgBox">
                             <img src="../../../assets/images/folderBig.png" alt="" style="vertical-align: middle;">
@@ -33,6 +33,7 @@
                     </div>
                 </div>
             </div>
+            <div v-else  class="none-data">暂无数据</div>
         </div>
     </div>
 </template>
@@ -62,6 +63,10 @@ export default {
             type: Function,
             required: true
         },
+        thisFolder: {
+            type: Object,
+            required: true
+        }
 
     },
     setup(props, { emit }) {
@@ -71,7 +76,7 @@ export default {
         let newDirId = ref(0)
         let topPath = ref("")
         let fileList = ref([])
-        let folderList = ref([])
+        let folderListGrid = ref([])
         let fileTotal = ref(0)
         let fileMenu = ref([])
         let folderleft = ref(0)
@@ -83,7 +88,7 @@ export default {
         let copyFir = ref("")
         // 获取文件夹,中栏,文件
         function getAllTop() {
-            documents.getTop(3).then(res => {
+            documents.getTop(1).then(res => {
                 let userMe = [res]
                 impDirId.value = userMe[0].dirId//固定
                 impSpaceId.value = userMe[0].spaceId//固定
@@ -94,29 +99,30 @@ export default {
                     pageNum: 1,
                     pageSize: 10
                 }
-                documents.getALLdocument({ parentId: userMe[0].dirId - 0, spaceId: userMe[0].spaceId, pageNum: obj.pageNum, pageSize: obj.pageSize }).then(res => {
+                const fileId =props.thisFolder.dirId?props.thisFolder.dirId:userMe[0].dirId - 0
+                documents.getALLdocument({ parentId: fileId, spaceId: userMe[0].spaceId, pageNum: obj.pageNum, pageSize: obj.pageSize }).then(res => {
                     fileMenu.value = res.data
-                    folderList.value = res.data
-                })
-                myfile.getById(userMe[0].dirId - 0, obj).then(res => {
-                    if (res.code === 200) {
-                        fileList.value = res.rows
-                        fileTotal.value = res.total
-                        if (fileTotal.value / 10 != 1) {
-                            let x = Math.trunc(fileTotal.value / 10) + 1
-                            for (var i = 1; i <= x; i++) {
-                                obj.pageNum = i
-                                myfile.getById(userMe[0].dirId - 0, obj).then(res => {
-                                    fileList.value = fileList.value.concat(res.rows)
-                                    const uniqueFileList = Array.from(new Set(fileList.value.map(item => item.docId)))
-                                        .map(docId => fileList.value.find(item => item.docId === docId));
-                                    // 合并数组并更新 fileList.value
-                                    fileList.value = uniqueFileList
-                                })
-                            }
-                        }
-                    }
+                    folderListGrid.value = res.data
                 })
+                // myfile.getById(userMe[0].dirId - 0, obj).then(res => {
+                //     if (res.code === 200) {
+                //         fileList.value = res.rows
+                //         fileTotal.value = res.total
+                //         if (fileTotal.value / 10 != 1) {
+                //             let x = Math.trunc(fileTotal.value / 10) + 1
+                //             for (var i = 1; i <= x; i++) {
+                //                 obj.pageNum = i
+                //                 myfile.getById(userMe[0].dirId - 0, obj).then(res => {
+                //                     fileList.value = fileList.value.concat(res.rows)
+                //                     const uniqueFileList = Array.from(new Set(fileList.value.map(item => item.docId)))
+                //                         .map(docId => fileList.value.find(item => item.docId === docId));
+                //                     // 合并数组并更新 fileList.value
+                //                     fileList.value = uniqueFileList
+                //                 })
+                //             }
+                //         }
+                //     }
+                // })
             })
         }
         function rightClick(row, num, eve) {
@@ -142,7 +148,7 @@ export default {
                 parentId: copyDir.value - 0,
                 spaceId: copySpa.value - 0
             }).then(res => {
-                folderList.value = res.data
+                folderListGrid.value = res.data
                 if (res.data.length === 0) {
                     myfile.getById(copyDir.value).then(res => {
                         if (res.code === 200) {
@@ -166,11 +172,17 @@ export default {
             props.restName(a, b)
             emit('folderBack', copyDir.value, copySpa.value, copyNma.value)
         }
+        const folderClickGrid = (item) => {
+            getAllTop()
+            emit("folderClick", item)
+           console.log('item', item)
+        }
         onMounted(() => {
             getAllTop()
             window.addEventListener("click", mouseClick, true);
         })
         return {
+            folderClickGrid,
             getAllTop,
             impDirId,
             impSpaceId,
@@ -178,7 +190,7 @@ export default {
             newSpaceId,
             fileList,
             fileMenu,
-            folderList,
+            folderListGrid,
             fileTotal,
             rightClick,
             folderleft,
@@ -199,8 +211,8 @@ export default {
     }
 }
 </script>
-
-<style scoped>
+<style scoped lang="scss">
+@import "@/assets/styles/my-common.scss";
 .bigBox {
     width: 100%;
     height: 100%;