Przeglądaj źródła

协作文件夹附属信息显示不正确bug解决

dev-version-manage
kim131 4 lat temu
rodzic
commit
c5c0977539
4 zmienionych plików z 149 dodań i 42 usunięć
  1. +2
    -1
      src/services/system.js
  2. +2
    -2
      src/views/main_web/workspace/components/file-item.vue
  3. +27
    -3
      src/views/main_web/workspace/components/folder-item.vue
  4. +118
    -36
      src/views/main_web/workspace/workspace.new.vue

+ 2
- 1
src/services/system.js Wyświetl plik

@@ -329,7 +329,7 @@ const system = {
projectId, projectName,
folderId, folderName, folderLevelId, distFileRelativePath = '',
fileName, fileExtension, sourceFilePath,
fileList, onSuccess: onSuccessHandler, onProgress: onProgressHandler = identity, onError: onErrorHandler = identity,
fileList, onSuccess: onSuccessHandler, onProgress: onProgressHandler = identity, onError: onErrorHandler = identity, successAllHandler,
totalReadyUploadNum
} = params;
let {tempNumWrap} = params;//已经完成的上传文件上传数量
@@ -451,6 +451,7 @@ const system = {
title:"文件上传成功",
message:`${uploadFile.ArchName}`
})
successAllHandler();
}
resolveSuccess(uploadFile);
} catch (e) {


+ 2
- 2
src/views/main_web/workspace/components/file-item.vue Wyświetl plik

@@ -543,10 +543,10 @@ export default {
.file-extension-tip {
position: absolute;
right: 32px;
top: 94px;
top: 98px;

color: rgba(50, 50, 60, 100);
font-size: 22px;
font-size: 18px;
text-align: right;
font-family: PingFangSC-Regular;
}


+ 27
- 3
src/views/main_web/workspace/components/folder-item.vue Wyświetl plik

@@ -13,7 +13,7 @@
>{{ folder.folderName }}</strong
>
<strong class="visontext"
>{{ folder.childCount + folder.fileCount }}个项目</strong>
>{{childNumUnderFolder}}个项目</strong>

<template v-if="isClient">
<!-- 绿色钩 -->
@@ -69,7 +69,26 @@ export default {
isWorkFolder: {
type: Boolean,
default: true
}
},
localFileHashMap: {
type: Object,
default() {
return {}
}
},
// 一个文件夹下的项目数量等于该文件夹下的文件数量加上文件夹的数量
filterFileList: {
type: Array,
default() {
return []
}
},
filterFolderList: {
type: Array,
default() {
return []
}
},
},
data(){
return {
@@ -82,6 +101,11 @@ export default {
folderItemEl: null,
}
},
computed: {
childNumUnderFolder() {
return this.filterFileList.length + this.filterFolderList.length;
}
},
methods: {
showRightMenu(e) {
this.rightMenuVisible = true;
@@ -129,7 +153,7 @@ export default {
deleteFolderClick() {
this.$emit('deleteFolderClick', this.folder.id);
this.closeRightMenu();
}
},
},
watch: {
rightMenuVisible(value) {


+ 118
- 36
src/views/main_web/workspace/workspace.new.vue Wyświetl plik

@@ -129,7 +129,8 @@
<div class="layout_content2" v-show="!showWorkline" v-loading="loading">
<section
id="workspace"
:class="`${closepageH} layerout_H2`"
class="layerout_H2"
:class="[`${closepageH} `, { 'set-workarea-height': isShowShadow && !closepageH}]"
@contextmenu.prevent="rightShowMenu($event, '新建文件夹', 4)"
>
<section class="yiyun_section_warp">
@@ -168,7 +169,7 @@
<div class="list-group" v-if="uploadFileList && uploadFileList.length > 0">
<FileItem
class="lisy-group-item"
v-for="file in filterFiles(uploadFileList)"
v-for="file in filterFilesInWork(uploadFileList)"
:key="file.id"
:file="file"
:clientDownLoad="clientDownLoad"
@@ -182,7 +183,7 @@
<div class="list-group" v-if="workFileList && workFileList.length > 0">
<FileItem
class="lisy-group-item"
v-for="file in filterFiles(workFileList)"
v-for="file in filterFilesInWork(workFileList)"
:key="file.id"
:file="file"
:clientDownLoad="clientDownLoad"
@@ -207,7 +208,7 @@
<!--显示文件夹组 -->
<div class="list-group">
<FolderItem
v-for="folder in filterFolders(subFolderList)"
v-for="folder in filterFoldersInWork(subFolderList)"
:key="folder.id"
:folder="folder"
:isLoading="localFolderLoadStateMap[folder.folderPath]"
@@ -216,7 +217,8 @@
:activeRightMenuId="tempRightFileId"
@dblclick.native="intoSubFolder(folder, 0)"
@commitFolder="commitFolder"

:filterFolderList="filterFoldersInTarget(subFolderList, folder)"
:filterFileList="filterFilesInTarget(workFileList, folder)"
/>
</div>
</div>
@@ -232,13 +234,13 @@
class="Cicon text_gray icon font_family icon-icon_zhankai"
title="展开面板"
v-show="isCollapse"
@click="openCopage"
@click.stop="openCopage"
></i>
<i
class="Cicon text_gray icon font_family icon-icon_shouqi"
title="折叠面板"
v-show="!isCollapse"
@click="closeCopage"
@click.stop="closeCopage"
></i>
</span>
@@ -316,8 +318,10 @@
@onRightMenuActive="oneFileRightBtnClick"
@onDownloadAll="downloadFolder"
:activeRightMenuId="tempRightFileId"
@dblclick.native="intoSubFolder(folder, 1)"
@dblclick.native.stop="intoSubFolder(folder, 1)"
@commitFolder="commitFolder"
:filterFolderList="filterFoldersInTarget(coopSubFolderList, folder, true)"
:filterFileList="filterFilesInTarget(cooperationFileList, folder, true)"
/>
</div>
</div>
@@ -332,8 +336,10 @@
@onRightMenuActive="oneFileRightBtnClick"
@onDownloadAll="downloadFolder"
:activeRightMenuId="tempRightFileId"
@dblclick.native="intoSubFolder(folder, 1), isShowStartNodeFolders = !isShowStartNodeFolders, topFolderInCoop = folder"
@dblclick.native.stop="intoSubFolder(folder, 1), isShowStartNodeFolders = !isShowStartNodeFolders, topFolderInCoop = folder"
@commitFolder="commitFolder"
:filterFolderList="getRealChildFolderLists(folder)"
:filterFileList="getRealChildFileLists(folder)"
/>
</div>
</div>
@@ -568,7 +574,9 @@ export default {
nodeFolders: [], // 节点文件夹
currentNodeFolder: {}, // 当前节点文件夹
currentFolder: {}, // 当前文件夹,可以是节点文件夹,可以是子文件夹

currentFolderInCoop: {},//协作文件下当前的文件夹

topFolderInCoop: {},//在协作文件中 点击的文件夹
/* 右键菜单 */
rightMenuvisible: false,
@@ -627,6 +635,8 @@ export default {
isfinishGetExchangeNodes: false,
allNodeFolders: [],//保存除去项目节点 公共文件夹后 的所有节点
exchangeNodeListsInCoop: [],//存储与当前节点具有交换关系的节点列表
exchangeNodeInfoMap: [],//有交换关系的节点映射 [节点id]: {文件数量 文件夹数量}

reverseLocalFileHashMap: {},//键名是 ipfscid 键值是localFileHashMap的键名
currentBtnIndex: 0,//0 是工作文件按钮 1是协作文件按钮
@@ -647,7 +657,7 @@ export default {
mounted: function () {
sessionStorage.pageTitle = '工作空间';
this.hackWorkLine = this.$refs.hackworkline;
window.addEventListener("scroll", this.onscroll, true);
// window.addEventListener("scroll", this.onscroll, true);

this.$nextTick(()=> {
this.listenBottomHeight();
@@ -677,7 +687,7 @@ export default {
this.timerIns = setTimeout(() => { this.intervalTask(); }, 3000);
},
destroyed: function () {
window.removeEventListener("scroll", this.onscroll);
// window.removeEventListener("scroll", this.onscroll);
// window.removeEventListener("resize", this.listenBottomHeight);
// window.removeEventListener("mouseenter", this.setIconMouseEnter);
@@ -717,6 +727,13 @@ export default {
}
},
methods: {
// 返回协作文件区域一开始入口的制定文件夹下的文件list
getRealChildFileLists(folder) {
return this.exchangeNodeInfoMap[folder.id] && this.exchangeNodeInfoMap[folder.id].realChildFileLists || [];
},
getRealChildFolderLists(folder) {
return this.exchangeNodeInfoMap[folder.id] && this.exchangeNodeInfoMap[folder.id].realChildFolderLists || [];
},
async getNestNode(id){
const res1 = await queryNestTemplateByTemplateId(id);
const temp = res1.Data || [];
@@ -972,11 +989,34 @@ export default {
this.getExchangeNodes();
},
// 协作文件一开始显示的文件夹要显示具有节点交换关系的文件夹 但是这个时候listShareFrom[1]还没有塞入值
getExchangeNodes() {
async getExchangeNodes() {
const froms = this.currentNodeFolder.listsShareFrom[1];
const tempMap = froms.map(f => f.id);
this.exchangeNodeListsInCoop = this.allNodeFolders.filter(folder => tempMap.includes(folder.id));
//注意: 这里的nodeFolders只会包含当前账户能看到的节点 不是全部的节点
this.getExchangeNodesChild();
},
//计算一开始协作文件区域入口文件夹的下项目的个数
getExchangeNodesChild() {
// 编辑判断一下这些节点下的文件数量以及文件夹数量
// 过滤与当前节点有文件交换关系的文件在不同顶级文件夹下的显示
let exchangeInfoMap = {};
this.exchangeNodeListsInCoop.forEach(async tfolder => {
let res = {};
res.realChildFileLists = [];
res.realChildFolderLists = [];
// 得到子文件夹的数量
res.realChildFolderLists = this.filterFoldersInTarget(this.coopSubFolderList, tfolder, tfolder, true);

// 得到子文件的数量 这里三个参数 fileList, targetFolder, isCoop = false
res.realChildFileLists = this.filterFilesInTarget(this.cooperationFileList, tfolder, tfolder, true);

exchangeInfoMap[tfolder.id] = res;

this.exchangeNodeInfoMap = exchangeInfoMap;
})
},
async fetchFoldersByProjId() {
const data = await this.$fetchApi('folder/queryNodeFolderListByProjectId', { projectId: sessionStorage.projId });
@@ -1008,24 +1048,48 @@ export default {
folderMap[relativePath].fileCount++;
}
});
this.coopSubFolderList = folderList;
return folderList;
},
// 接收到了一个文件的右键菜单点击事件
oneFileRightBtnClick(id) {
this.tempRightFileId = id;
this.rightMenuvisible = false;
},
// 文件展示过滤
filterFiles(fileList) {
// 工作文件文件展示过滤 targetFolder: currentFolder
filterFilesInWork(fileList) {
// 子文件会有这个属性,节点文件夹不会有
const { folderPath = '' } = this.currentFolder ;
const { folderPath = '' } = this.currentFolder;
return fileList.filter(file => {
if(file.relativePath !== folderPath) return false;
return true;
});
},
// 文件夹展示过滤
filterFolders(folderList) {
// 协作文件下的文件展示过滤 targetFolder:currentFolderInCoop topFolder: topFolderInCoop
filterFilesInCoop(fileList){
const { folderPath = '' } = this.currentFolderInCoop;
return fileList.filter(file=> {
if(file.relativePath == folderPath && file.folderId == this.topFolderInCoop.id) {
return true;
}
return false;
});
},
// targetFolder可以是 currentFolder 可以是currentFolderInCoop
filterFilesInTarget(fileList, targetFolder, topFolderInCoop = this.topFolderInCoop, isCoop = false){
const { folderPath = '' } = targetFolder;
return fileList.filter(file=> {
if(file.relativePath == folderPath) {
if(!isCoop) {
return true;
} else if(file.folderId == topFolderInCoop.id) {
return true;
}
}
return false;
});
},
// 文件夹展示过滤 targetFolder: currentFolder 或者是 currentFolderInCoop
filterFoldersInWork(folderList) {
// 子文件会有这个属性,节点文件夹不会有
const { folderPath = '' } = this.currentFolder;
return folderList.filter(folder => {
@@ -1033,29 +1097,30 @@ export default {
return true;
});
},
// 协作文件下的文件展示过滤
filterFilesInCoop(fileList){
filterFoldersInCoop(folderList) {
const { folderPath = '' } = this.currentFolderInCoop;
return fileList.filter(file=> {
if(file.relativePath !== folderPath) {
return false;
} else if(file.relativePath == folderPath && file.folderId == this.topFolderInCoop.id) {
return true;
}
return folderList.filter(folder => {
if(folder.parentFolderPath == folderPath && folder.topFolderId == this.topFolderInCoop.id) return true;
return false;
});
},
// 协作文件下的文件夹展示过滤
filterFoldersInCoop(folderList) {
const { folderPath = ''} = this.currentFolderInCoop;
// 查找指定文件夹下的子文件夹 targetFolder 可以是currentFolder 可以是currentFolderInCoop isCopp是否是协作类型的
filterFoldersInTarget(folderList, targetFolder, topFolderinCoop = this.topFolderInCoop , isCoop = false) {
const { folderPath = '' } = targetFolder;
return folderList.filter(folder => {
if(folder.parentFolderPath !== folderPath) {
return false;
} else if(folder.parentFolderPath == folderPath && folder.topFolderId == this.topFolderInCoop.id) {
return true;
if(folder.parentFolderPath == folderPath) {
if(!isCoop) {
return true;
} else if(folder.topFolderId == topFolderinCoop.id){
return true;
}
}
return false;
});
},



// removeMilestone(filesList){
// return filesList.filter(file=>{
// return file.milestone != 2;
@@ -1249,10 +1314,15 @@ export default {
}
this.currentFolder = this.currentNodeFolder;
this.currentFolderInCoop = this.currentNodeFolder;

this.breadcrumbFolderList = [];
this.breadcrumbFolderListInCoop = [];
this.fetchFolderFiles();
this.loadListTempFiles();

this.$nextTick(()=> {
this.listenBottomHeight();
})
},
/**
* 进入子文件夹
@@ -1262,7 +1332,6 @@ export default {
this.currentFolder = folder;
this.breadcrumbFolderList.push(folder);
} else if(flag == 1) {
// this.listenBottomHeight();
this.currentFolderInCoop = folder;
this.breadcrumbFolderListInCoop.push(folder);
this.$nextTick(()=> {
@@ -1331,7 +1400,9 @@ export default {
// resolve dupilicate folders
this.tempWorkSubFolderList = this.tempWorkSubFolderList.filter(tempFolder => !folderResInfo.folder.some(folder => folder.id === tempFolder.id));
this.cooperationFileList = folderResInfo.coordinationFiles;
this.dealWithCoopFiles(this.cooperationFileList);

this.coopSubFolderList = this.dealWithCoopFiles(this.cooperationFileList);
this.isShowStartNodeFolders && this.getExchangeNodesChild();
this.resolveUploadFileList(this.cooperationFileList);
}, 1000),
/**
@@ -1406,6 +1477,10 @@ export default {
// this.fetchFolderFiles();
// 重置面包屑导航数组
this.breadcrumbFolderListInCoop = this.breadcrumbFolderListInCoop.slice(0, breadFolderIdx + 1);
this.$nextTick(()=> {
this.listenBottomHeight();
})
}
},
@@ -1527,6 +1602,9 @@ export default {
this.removeFileLoadingState(upperFile.Id);
this.uploadFileList = this.uploadFileList.filter(iFile => iFile.id !== upperFile.Id);
},
successAllHandler: async ()=> {
await this.fetchFoldersByProjId();
}
}
// console.log(folderName, levelId, folderId);
@@ -2101,4 +2179,8 @@ export default {
.workspace-header .app-header-center {
-webkit-app-region: no-drag;
}

.set-workarea-height {
height: calc(100vh - 64px - 300px) !important;
}
</style>

Ładowanie…
Anuluj
Zapisz