diff --git a/src/views/main_web/workspace/components/file-explorer/index.vue b/src/views/main_web/workspace/components/file-explorer/index.vue index be59be0c..6d22d0bd 100644 --- a/src/views/main_web/workspace/components/file-explorer/index.vue +++ b/src/views/main_web/workspace/components/file-explorer/index.vue @@ -1102,18 +1102,11 @@ export default { // 对协作文件的relativePath处理 生成文件夹 - dealWithCoopFiles(fileList) { + dealWithCoopFiles(fileList, nestCoordinationFileList) { const folderList = []; const folderMap = {}; - - fileList.forEach(file => { - const relativePath = [file.nodeName, file.relativePath].filter(a => a).join('/'); - file.relativePath = relativePath; - // const nodeFolderName = file.nodeName; - // const nodeFolderId = file.folderId; - // const nodeFolder = new VirtualFolder(nodeFolderName, nodeFolderId); - // folderList.push(nodeFolder); - // folderMap[nodeFolderId] = nodeFolder; + const resolvefile = (file) => { + const relativePath = file.relativePath; const paths = relativePath.split('/'); paths.forEach((folderName, idx) => { const fullRelativePath = paths.slice(0, idx + 1).join('/'); @@ -1127,8 +1120,14 @@ export default { folderMap[parentRelativePath].childCount++; } }); - folderMap[relativePath].fileCount++; + // folderMap[relativePath].fileCount++; + } + fileList.forEach(file => { + const relativePath = [file.nodeName, file.relativePath].filter(a => a).join('/'); + file.relativePath = relativePath; + resolvefile(file); }); + nestCoordinationFileList.forEach(resolvefile); return folderList; }, // 接收到了一个文件的右键菜单点击事件 @@ -1467,9 +1466,9 @@ export default { // this.workSubFolderList = uniqBy(this.workSubFolderList.concat(folderResInfo.folder), folder => folder.id); // resolve dupilicate folders this.tempWorkSubFolderList = this.tempWorkSubFolderList.filter(tempFolder => !folderResInfo.folder.some(folder => folder.id === tempFolder.id)); - this.cooperationFileList = folderResInfo.coordinationFiles; + this.cooperationFileList = folderResInfo.coordinationFiles.concat(folderResInfo.nestCoordinationFiles); - this.coopSubFolderList = this.dealWithCoopFiles(this.cooperationFileList); + this.coopSubFolderList = this.dealWithCoopFiles(folderResInfo.coordinationFiles, folderResInfo.nestCoordinationFiles); // this.exchangeNodeListsInCoop = // this.isShowStartNodeFolders && this.getExchangeNodesChild(); this.resolveUploadFileList(this.cooperationFileList); diff --git a/src/views/main_web/workspace/service.js b/src/views/main_web/workspace/service.js index 40f064e1..8378187f 100644 --- a/src/views/main_web/workspace/service.js +++ b/src/views/main_web/workspace/service.js @@ -79,6 +79,7 @@ export async function fetchFolderFileList(folderId, userId, commonFolderId) { // myFile: (data.myFile || []).map(injectFileBasicValue), // workFile: (data.workFile || []).map(injectFileBasicValue), coordinationFiles: (data.coordinationFiles || []).map(firstCharToLowerCase), + nestCoordinationFiles: (data.nestCoordinationFiles || []).map(firstCharToLowerCase), // public: (data.public || []).map(firstCharToLowerCase), } return outputObj;