Ver código fonte

协作文件以文件夹形式展示

dev-remain
kim131 4 anos atrás
pai
commit
3018048952
5 arquivos alterados com 317 adições e 40 exclusões
  1. +15
    -10
      public/static/css/main.css
  2. +5
    -0
      src/App.vue
  3. +9
    -0
      src/views/main_web/workspace/components/folder-item.vue
  4. +17
    -5
      src/views/main_web/workspace/components/workLine.vue
  5. +271
    -25
      src/views/main_web/workspace/workspace.new.vue

+ 15
- 10
public/static/css/main.css Ver arquivo

@@ -4368,8 +4368,10 @@ button:focus {
} }
/* 协作文件超出部分滚动条 */ /* 协作文件超出部分滚动条 */
.fifleBox{ .fifleBox{
min-height: 215px;
max-height: 215px;
min-height: 204px;
max-height: 204px;
/* min-height: 215px;
max-height: 215px; */
/* max-height: 255px; */ /* max-height: 255px; */
/* max-height: 275px; */ /* max-height: 275px; */
overflow-y: scroll; overflow-y: scroll;
@@ -4379,8 +4381,8 @@ button:focus {
background-color: #adadad; background-color: #adadad;
} }
.neibianju1 .fifleBox{ .neibianju1 .fifleBox{
height: calc(100vh - 210px);
max-height: calc(100vh - 210px);
height: calc(100vh - 236px);
max-height: calc(100vh - 236px);
overflow-y: auto; overflow-y: auto;
} }
.yiyun_title_label{ .yiyun_title_label{
@@ -4680,7 +4682,7 @@ button:focus {
left: -30px; left: -30px;
} }
.layerout_H2{ .layerout_H2{
height: calc(100vh - 364px);
height: calc(100vh - 368px);
overflow-y: auto; overflow-y: auto;
transition: ease all 0.5s; transition: ease all 0.5s;
background-color: #f6f6f6; background-color: #f6f6f6;
@@ -5336,6 +5338,9 @@ div.textlabelgray .el-form-item__content{
position: relative; position: relative;
} }
/*边距*/ /*边距*/
.ml-8 {
margin-left: 8px;
}
.mt-10{ .mt-10{
margin-top: 10px; margin-top: 10px;
} }
@@ -5380,7 +5385,7 @@ div.textlabelgray .el-form-item__content{
} }
/* 滚动条 */ /* 滚动条 */
.flex_right_pain_body::-webkit-scrollbar ,.largecontentBox::-webkit-scrollbar,.scollbarBox::-webkit-scrollbar,.middiaHeight::-webkit-scrollbar, .flex_right_pain_body::-webkit-scrollbar ,.largecontentBox::-webkit-scrollbar,.scollbarBox::-webkit-scrollbar,.middiaHeight::-webkit-scrollbar,
.tankuangaodu::-webkit-scrollbar,.listfilewarp::-webkit-scrollbar,.jsmind-inner::-webkit-scrollbar,.newfiledialog::-webkit-scrollbar,.scollBar::-webkit-scrollbar,.fixtable::-webkit-scrollbar
.tankuangaodu::-webkit-scrollbar,.jsmind-inner::-webkit-scrollbar,.newfiledialog::-webkit-scrollbar,.scollBar::-webkit-scrollbar,.fixtable::-webkit-scrollbar
,.worklink::-webkit-scrollbar,#bigbody::-webkit-scrollbar,.fulldialog::-webkit-scrollbar,.appiframebox::-webkit-scrollbar,.appiframebox::-webkit-scrollbar,.listfilewarp1::-webkit-scrollbar{ ,.worklink::-webkit-scrollbar,#bigbody::-webkit-scrollbar,.fulldialog::-webkit-scrollbar,.appiframebox::-webkit-scrollbar,.appiframebox::-webkit-scrollbar,.listfilewarp1::-webkit-scrollbar{
width: 8px; width: 8px;
height: 8px; height: 8px;
@@ -5390,7 +5395,7 @@ div.textlabelgray .el-form-item__content{
height:8px; height:8px;
} }
.flex_right_pain_body::-webkit-scrollbar-track ,.largecontentBox::-webkit-scrollbar-track,.scollbarBox::-webkit-scrollbar-track,.middiaHeight::-webkit-scrollbar-track, .flex_right_pain_body::-webkit-scrollbar-track ,.largecontentBox::-webkit-scrollbar-track,.scollbarBox::-webkit-scrollbar-track,.middiaHeight::-webkit-scrollbar-track,
.tankuangaodu::-webkit-scrollbar-track,.listfilewarp::-webkit-scrollbar-track,.jsmind-inner::-webkit-scrollbar-track,.newfiledialog::-webkit-scrollbar-track,.scollBar::-webkit-scrollbar-track,.fixtable::-webkit-scrollbar-track
.tankuangaodu::-webkit-scrollbar-track,.jsmind-inner::-webkit-scrollbar-track,.newfiledialog::-webkit-scrollbar-track,.scollBar::-webkit-scrollbar-track,.fixtable::-webkit-scrollbar-track
,.worklink::-webkit-scrollbar-track,#bigbody::-webkit-scrollbar-track,.fulldialog::-webkit-scrollbar-track,.appiframebox::-webkit-scrollbar-track,.appiframebox::-webkit-scrollbar-track,.listfilewarp1::-webkit-scrollbar-track{ ,.worklink::-webkit-scrollbar-track,#bigbody::-webkit-scrollbar-track,.fulldialog::-webkit-scrollbar-track,.appiframebox::-webkit-scrollbar-track,.appiframebox::-webkit-scrollbar-track,.listfilewarp1::-webkit-scrollbar-track{
background-color:transparent; background-color:transparent;
-webkit-border-radius: 2em; -webkit-border-radius: 2em;
@@ -5398,7 +5403,7 @@ div.textlabelgray .el-form-item__content{
border-radius:2em; border-radius:2em;
} }
.flex_right_pain_body::-webkit-scrollbar-thumb,.largecontentBox::-webkit-scrollbar-thumb,.scollbarBox::-webkit-scrollbar-thumb,.middiaHeight::-webkit-scrollbar-thumb, .flex_right_pain_body::-webkit-scrollbar-thumb,.largecontentBox::-webkit-scrollbar-thumb,.scollbarBox::-webkit-scrollbar-thumb,.middiaHeight::-webkit-scrollbar-thumb,
.tankuangaodu::-webkit-scrollbar-thumb,.listfilewarp::-webkit-scrollbar-thumb,.jsmind-inner::-webkit-scrollbar-thumb,.newfiledialog::-webkit-scrollbar-thumb,.scollBar::-webkit-scrollbar-thumb,.fixtable::-webkit-scrollbar-thumb
.tankuangaodu::-webkit-scrollbar-thumb,.jsmind-inner::-webkit-scrollbar-thumb,.newfiledialog::-webkit-scrollbar-thumb,.scollBar::-webkit-scrollbar-thumb,.fixtable::-webkit-scrollbar-thumb
,.worklink::-webkit-scrollbar-thumb,#bigbody::-webkit-scrollbar-thumb,.fulldialog::-webkit-scrollbar-thumb,.appiframebox::-webkit-scrollbar-thumb,.appiframebox::-webkit-scrollbar-thumb,.listfilewarp1::-webkit-scrollbar-thumb{ ,.worklink::-webkit-scrollbar-thumb,#bigbody::-webkit-scrollbar-thumb,.fulldialog::-webkit-scrollbar-thumb,.appiframebox::-webkit-scrollbar-thumb,.appiframebox::-webkit-scrollbar-thumb,.listfilewarp1::-webkit-scrollbar-thumb{
background-color:#adadad; background-color:#adadad;
-webkit-border-radius: 2em; -webkit-border-radius: 2em;
@@ -7386,8 +7391,8 @@ border-radius:2em;
} }
.DevtopIcon{ .DevtopIcon{
position: absolute; position: absolute;
left: 0px;
top: 6px;
left: 30px;
top: 17px;
} }
.orginoverflow{ .orginoverflow{
overflow: inherit; overflow: inherit;


+ 5
- 0
src/App.vue Ver arquivo

@@ -30,6 +30,7 @@
--> -->
<router-view <router-view
ref="mainpage" ref="mainpage"
:class="{'workspace-bigbody': $route.path.indexOf('/workspace') >=0}"
id="bigbody" id="bigbody"
class="mt-48" class="mt-48"
></router-view> ></router-view>
@@ -161,4 +162,8 @@ jmnode {
color: #333; color: #333;
} }
} }

.workspace-bigbody {
overflow: hidden !important;
}
</style> </style>

+ 9
- 0
src/views/main_web/workspace/components/folder-item.vue Ver arquivo

@@ -41,6 +41,7 @@
:style="{ top: rightMenuTop + 'px', left: rightMenuLeft + 'px'}" :style="{ top: rightMenuTop + 'px', left: rightMenuLeft + 'px'}"
> >
<ul class="rightMenu folderRightMenu"> <ul class="rightMenu folderRightMenu">
<!-- <li v-if="isWorkFolder" @click.stop="deleteFolderClick">移动到回收站</li> -->
<li v-if="isClient" @click.stop="downloadFolder">从云端更新</li> <li v-if="isClient" @click.stop="downloadFolder">从云端更新</li>
</ul> </ul>
</div> </div>
@@ -64,6 +65,10 @@ export default {
type: Boolean, type: Boolean,
default: false, default: false,
}, },
isWorkFolder: {
type: Boolean,
default: true
}
}, },
data(){ data(){
return { return {
@@ -96,6 +101,10 @@ export default {
e.preventDefault(); e.preventDefault();
this.$emit('commitFolder', this.folder); this.$emit('commitFolder', this.folder);
}, },
deleteFolderClick() {
this.$emit('deleteFolderClick', this.folder.id);
this.closeRightMenu();
}
}, },
watch: { watch: {
rightMenuVisible(value) { rightMenuVisible(value) {


+ 17
- 5
src/views/main_web/workspace/components/workLine.vue Ver arquivo

@@ -116,7 +116,7 @@
@click="showNewAppManagement(from)" @click="showNewAppManagement(from)"
> >
<i class="leftline"></i> <i class="leftline"></i>
<span class="worllistt2" :title="from">{{from}}</span>
<span class="worllistt2" :title="from">{{from.nodeName }}</span>
</div> </div>
</div> </div>
<div <div
@@ -161,7 +161,7 @@
> >
<i class="leftline"></i> <i class="leftline"></i>
<span class="worllistt2" :title="share">{{ <span class="worllistt2" :title="share">{{
share
share.nodeName
}}</span> }}</span>
</div> </div>
<div class="outLine"> <div class="outLine">
@@ -337,7 +337,10 @@ export default {
const data=await this.$fetchApi('folder/queryNodeFolderListByProjectId', { projectId: sessionStorage.projId }); const data=await this.$fetchApi('folder/queryNodeFolderListByProjectId', { projectId: sessionStorage.projId });
var folderList=data.Data.folder; var folderList=data.Data.folder;
const temp=folderList.reduce((h,folder)=>{ const temp=folderList.reduce((h,folder)=>{
h[folder.NodeId]=folder.FolderName;
h[folder.NodeId] = {};
h[folder.NodeId].nodeName = folder.FolderName;
h[folder.NodeId].nodeId = folder.Id;
//h[folder.NodeId]=folder.FolderName;
return h; return h;
},{}); },{});
var templateId=this.listUserFolders[0].templateId; var templateId=this.listUserFolders[0].templateId;
@@ -350,7 +353,7 @@ export default {
this.getNestItem(nodeLists,nestNodeIdLists,parentNodeId); this.getNestItem(nodeLists,nestNodeIdLists,parentNodeId);
var headNode={nodeId:null,parentNodeId:templateId}; var headNode={nodeId:null,parentNodeId:templateId};
nestNodeIdLists.unshift(headNode); nestNodeIdLists.unshift(headNode);
nestNodeIdLists.forEach(async node=>{ nestNodeIdLists.forEach(async node=>{
const Res=await queryFileExchange(templateId,node.parentNodeId,node.nodeId); const Res=await queryFileExchange(templateId,node.parentNodeId,node.nodeId);
this.listUserFolders.forEach(item=>{ this.listUserFolders.forEach(item=>{
@@ -364,6 +367,7 @@ export default {
) )
}) })
}) })

}, },




@@ -389,6 +393,11 @@ export default {
}, },




},
computed: {
nowFolderShareNodesLen() {
return this.listUserFolders[this.nowFolderIndex] ? this.listUserFolders[this.nowFolderIndex].listsShareFrom[1].length : 0;
}
}, },
watch: { watch: {
isShowlink(data) { isShowlink(data) {
@@ -398,7 +407,10 @@ export default {
}, },
listUserFolders() { listUserFolders() {
this.getFileExchange(); this.getFileExchange();
}
},
nowFolderShareNodesLen() {
this.$emit('finishGetExchangeNodes');
},
}, },
}; };
</script> </script>

+ 271
- 25
src/views/main_web/workspace/workspace.new.vue Ver arquivo

@@ -29,10 +29,12 @@
@showWorklinkPage="showWorklinkPage" @showWorklinkPage="showWorklinkPage"
@nowFolderClick="nowFolderClick" @nowFolderClick="nowFolderClick"
@hideWorklinkPage="hideWorklinkPage" @hideWorklinkPage="hideWorklinkPage"
@finishGetExchangeNodes="finishGetExchangeNodes"
/> />
<div class="layout_content2" v-show="!showWorkline" v-loading="loading"> <div class="layout_content2" v-show="!showWorkline" v-loading="loading">
<section <section
id="workspace" id="workspace"
ref="workfilescrollbar"
:class="`${closepageH} layerout_H2`" :class="`${closepageH} layerout_H2`"
@contextmenu.prevent="rightShowMenu($event, '新建文件夹', 4)" @contextmenu.prevent="rightShowMenu($event, '新建文件夹', 4)"
> >
@@ -44,14 +46,14 @@
class="section_item section_item_aside_fl" class="section_item section_item_aside_fl"
> >
<span <span
class="yiyun_text-title-workspace mr-20"
class="yiyun_text-title-workspace mr-20 ml-8"
> >
<el-breadcrumb class="folder_breadcrumb" separator-class="el-icon-arrow-right"> <el-breadcrumb class="folder_breadcrumb" separator-class="el-icon-arrow-right">
<el-breadcrumb-item @click.native="clickBreadcrumb(-1)">工作文件</el-breadcrumb-item>
<el-breadcrumb-item @click.native="clickBreadcrumb(-1, 0)">工作文件</el-breadcrumb-item>
<el-breadcrumb-item <el-breadcrumb-item
v-for="(breadFolder, breadIdx) in breadcrumbFolderList" v-for="(breadFolder, breadIdx) in breadcrumbFolderList"
:key="breadFolder.id" :key="breadFolder.id"
@click.native="clickBreadcrumb(breadIdx)"
@click.native="clickBreadcrumb(breadIdx, 0)"
>{{breadFolder.folderName}}</el-breadcrumb-item> >{{breadFolder.folderName}}</el-breadcrumb-item>
</el-breadcrumb> </el-breadcrumb>
</span> </span>
@@ -59,7 +61,7 @@


<!-- 工作列表主体 --> <!-- 工作列表主体 -->
<div <div
class="yiyun_row scollbarBox nobianju py-x-22 my_scrollbar_style"
class="yiyun_row scollbarBox nobianju py-x-22"
> >
<AddFileButton <AddFileButton
v-if="isClient" v-if="isClient"
@@ -114,8 +116,9 @@
@onRightMenuActive="oneFileRightBtnClick" @onRightMenuActive="oneFileRightBtnClick"
@onDownloadAll="downloadFolder" @onDownloadAll="downloadFolder"
:activeRightMenuId="tempRightFileId" :activeRightMenuId="tempRightFileId"
@dblclick.native="intoSubFolder(folder)"
@dblclick.native="intoSubFolder(folder, 0)"
@commitFolder="commitFolder" @commitFolder="commitFolder"

/> />
</div> </div>
</div> </div>
@@ -126,11 +129,26 @@


<div :class="neibianju" id="bottomBox"> <div :class="neibianju" id="bottomBox">
<div class="titleBox"> <div class="titleBox">
<span class="yiyun_zhediebtn DevtopIcon">
<i
class="Cicon text_gray icon font_family icon-icon_zhankai"
title="展开面板"
v-show="isShowpageIcon"
@click="openCopage"
></i>
<i
class="Cicon text_gray icon font_family icon-icon_shouqi"
title="折叠面板"
v-show="!isShowpageIcon"
@click="closeCopage"
></i>
</span>
<div class="title_warp"> <div class="title_warp">
<div class="yiyun_section_top orginoverflow" id="bignav"> <div class="yiyun_section_top orginoverflow" id="bignav">
<!-- 系统时间? -->
<div class="section_item fl section_item_aside_fl xiangdui"> <div class="section_item fl section_item_aside_fl xiangdui">
<span class="yiyun_zhediebtn DevtopIcon">
<!-- <span class="yiyun_zhediebtn DevtopIcon">
<i <i
class="Cicon text_gray icon font_family icon-icon_zhankai" class="Cicon text_gray icon font_family icon-icon_zhankai"
title="展开面板" title="展开面板"
@@ -143,11 +161,27 @@
v-show="!isShowpageIcon" v-show="!isShowpageIcon"
@click="closeCopage" @click="closeCopage"
></i> ></i>
</span>
</span> -->
<div class="tabtltlebox"> <div class="tabtltlebox">
<h3 class="defualth3" >
<!-- <h3 class="defualth3" >
协作文件 协作文件
</h3>
</h3> -->
<div
class="section_item section_item_aside_fl"
>
<span
class="yiyun_text-title-workspace mr-20 ml-8"
>
<el-breadcrumb class="folder_breadcrumb" separator-class="el-icon-arrow-right">
<el-breadcrumb-item @click.native="clickBreadcrumb(-1, 1)">协作文件</el-breadcrumb-item>
<el-breadcrumb-item
v-for="(breadFolder, breadIdx) in breadcrumbFolderListInCoop"
:key="breadFolder.id"
@click.native="clickBreadcrumb(breadIdx, 1)"
>{{breadFolder.folderName}}</el-breadcrumb-item>
</el-breadcrumb>
</span>
</div>
</div> </div>
</div> </div>
<div class="section_item fr section_item_aside_fr"> <div class="section_item fr section_item_aside_fr">
@@ -166,12 +200,12 @@
<!-- 文件大box --> <!-- 文件大box -->
<div class="yinyong_warpBox"> <div class="yinyong_warpBox">
<!-- 协作文件 --> <!-- 协作文件 -->
<div>
<div v-if="!isShowStartNodeFolders">
<div <div
class="py-x-22 mt-12" class="py-x-22 mt-12"
> >
<FileItem <FileItem
v-for="file in cooperationFileList"
v-for="file in filterFilesInCoop(cooperationFileList)"
:key="file.id" :key="file.id"
:file="file" :file="file"
:tempRightFileId="tempRightFileId" :tempRightFileId="tempRightFileId"
@@ -187,6 +221,37 @@
draggable draggable
/> />
</div> </div>
<!-- 协作文件以文件夹的形式展示 -->
<div class="list-group">
<FolderItem
v-for="folder in filterFoldersInCoop(coopSubFolderList)"
:key="folder.id"
:folder="folder"
:isWorkFolder=false
:isLoading="localFolderLoadStateMap[folder.folderPath]"
@onRightMenuActive="oneFileRightBtnClick"
@onDownloadAll="downloadFolder"
:activeRightMenuId="tempRightFileId"
@dblclick.native="intoSubFolder(folder, 1)"
@commitFolder="commitFolder"
/>
</div>
</div>
<div v-else>
<div class="list-group">
<FolderItem
v-for="folder in exchangeNodeListsInCoop"
:key="folder.id"
:folder="folder"
:isWorkFolder=false
:isLoading="localFolderLoadStateMap[folder.folderPath]"
@onRightMenuActive="oneFileRightBtnClick"
@onDownloadAll="downloadFolder"
:activeRightMenuId="tempRightFileId"
@dblclick.native="intoSubFolder(folder, 1), isShowStartNodeFolders = !isShowStartNodeFolders"
@commitFolder="commitFolder"
/>
</div>
</div> </div>
</div> </div>
</div> </div>
@@ -337,6 +402,7 @@ export default {
nodeFolders: [], // 节点文件夹 nodeFolders: [], // 节点文件夹
currentNodeFolder: {}, // 当前节点文件夹 currentNodeFolder: {}, // 当前节点文件夹
currentFolder: {}, // 当前文件夹,可以是节点文件夹,可以是子文件夹 currentFolder: {}, // 当前文件夹,可以是节点文件夹,可以是子文件夹
currentFolderInCoop: {},//协作文件下当前的文件夹
/* 右键菜单 */ /* 右键菜单 */
rightMenuvisible: false, rightMenuvisible: false,
rightMenuleft: 0, rightMenuleft: 0,
@@ -351,9 +417,13 @@ export default {
subFolderMap: {}, // 子文件夹哈希: { [folderPath]: VirtualFolder } subFolderMap: {}, // 子文件夹哈希: { [folderPath]: VirtualFolder }


breadcrumbFolderList: [], // 面包屑导航对应的文件夹队列 breadcrumbFolderList: [], // 面包屑导航对应的文件夹队列
breadcrumbFolderListInCoop: [],//协作文件夹对应额面包屑导航

uploadFileList: [], // 上传文件的队列 uploadFileList: [], // 上传文件的队列
workFileList: [], // 工作文件队列 workFileList: [], // 工作文件队列

workSubFolderList: [], // 工作文件夹队列 workSubFolderList: [], // 工作文件夹队列
coopSubFolderList: [],//协作文件夹队列
tempWorkSubFolderList: [], // 临时的工作文件夹队列 tempWorkSubFolderList: [], // 临时的工作文件夹队列
cooperationFileList: [], // 协作文件队列 cooperationFileList: [], // 协作文件队列


@@ -382,6 +452,11 @@ export default {
localFolderLoadStateMap: {}, localFolderLoadStateMap: {},


tempRightFileId: "", // 存储点击了右键菜单的id tempRightFileId: "", // 存储点击了右键菜单的id
workFileScrollBar: null,
isShowStartNodeFolders: true,//协作文件是否显示一开始的节点文件夹
isfinishGetExchangeNodes: false,
exchangeNodeListsInCoop: [],//存储与当前节点具有交换关系的节点列表
reverseLocalFileHashMap: {},//键名是 ipfscid 键值是localFileHashMap的键名
}; };
}, },
mounted: function () { mounted: function () {
@@ -400,6 +475,10 @@ export default {
errorEvent => { notify.error('本地网关通讯失败'); } errorEvent => { notify.error('本地网关通讯失败'); }
); );
this.intervalTask(); this.intervalTask();


this.workFileScrollBar = this.$refs.workfilescrollbar;
// this.workFileScrollBar && this.workFileScrollBar.addEventListener('scroll', this.workFilePartScrollListener);
}, },
destroyed: function () { destroyed: function () {
window.removeEventListener("scroll", this.onscroll); window.removeEventListener("scroll", this.onscroll);
@@ -425,6 +504,116 @@ export default {
} }
}, },
methods: { methods: {
// 工作文件区域滚动条监听 卷去的头部 scrollTop >= scrollHeight - clientHeight的时候 认为滑到了底部
workFilePartScrollListener() {
const tempBar = this.workFileScrollBar;
if(tempBar && tempBar.scrollTop >= tempBar.scrollHeight - tempBar.clientHeight) {
console.log('滑到了底部');
this.openCopage();
}
},
// 删除文件夹 递归删除文件夹下面的所有文件
deleteFolderClick(id) {
const { subFolderList, workFileList, subFolderMap, userId, localFileHashMap, reverseLocalFileHashMap } = this;
const deleteFolderName = subFolderMap[id].folderName;
const thisApp = this;
const totalDeleteFileLists = [];
this.$confirm(`确认删除文件夹“${deleteFolderName}”吗?`, "", {
confirmButtonText: "确定",
cancelButtonText: "取消",
showClose: false,
type: "warning",
}).then(async function () {
circulateDelete(id);
const totalNum = totalDeleteFileLists.length;
console.log('要删除的文件总数是', totalNum);
let isFileInWorking = totalDeleteFileLists.find(f => f.workStatus == 2 && f.modifyUserId !== userId);
if(isFileInWorking) {
// 提示 该文件夹下有他人正在工作中的文件 -> 删除失败
thisApp.$notify({
title: " ",
message: `“${deleteFolderName}”文件夹下存在“工作中”文件,删除失败。`,
type: "error",
offset: 100,
duration: 2500,
});
} else {
// 删除文件夹
let counter = 0;
totalDeleteFileLists.forEach(async delFile => {
delete localFileHashMap[reverseLocalFileHashMap[delFile.ipfsCid]];
const res = await services.deleteFile(delFile.id);
counter = res.Code == 0 ? counter+1 : counter;
if(counter == totalNum) {
thisApp.$notify({
title: " ",
message: `“${deleteFolderName}”文件夹已删除。`,
type: "success",
offset: 100,
duration: 2500,
});
}
thisApp.fetchFolderFiles();
})
}
})
function circulateDelete(deleteFolderId) {
const delFolderLists = subFolderList.filter(folder => folder.parentFolderPath == deleteFolderId);
if(delFolderLists.length == 0) {
//表明到了最底层的文件夹 删除deleteFolderId对应这个文件夹下面的所有文件
let delFileLists = workFileList.filter(file => file.relativePath == deleteFolderId);
// 删除与这个要删除文件夹同级的文件
const parentFolderPath = subFolderMap[deleteFolderId].parentFolderPath
if(parentFolderPath !== "") {
const tempLists = workFileList.filter(wf => wf.relativePath == parentFolderPath);
delFileLists.push(...tempLists);
}
totalDeleteFileLists.push(...delFileLists);
}
delFolderLists.forEach(df => {
circulateDelete(df.id);
})
}
},
// 当workLine组件获得节点的交换节点的时候 调用函数
finishGetExchangeNodes() {
this.isfinishGetExchangeNodes = true;
this.getExchangeNodes();
},
// 协作文件一开始显示的文件夹要显示具有节点交换关系的文件夹 但是这个时候listShareFrom[1]还没有塞入值
getExchangeNodes() {
const froms = this.currentNodeFolder.listsShareFrom[1];
const tempMap = froms.map(f => f.nodeId);
this.exchangeNodeListsInCoop = this.nodeFolders.filter(folder => tempMap.includes(folder.id));
},
// 对协作文件的relativePath处理 生成文件夹
dealWithCoopFiles(fileList) {
const folderList = [];
const folderMap = {};

fileList.forEach(file => {
const relativePath = file.relativePath;
if(relativePath) {
const paths = relativePath.split('/');
paths.forEach((folderName, idx) => {
const fullRelativePath = paths.slice(0, idx + 1).join('/');
if(folderMap[fullRelativePath]) return;
const folder = new VirtualFolder(fullRelativePath);
const parentRelativePath = folder.parentFolderPath;
folderList.push(folder);
folderMap[fullRelativePath] = folder;
if(folderMap[parentRelativePath]) {
folderMap[parentRelativePath].childCount++;
}
});
folderMap[relativePath].fileCount++;
}
});
this.coopSubFolderList = folderList;
},
// 接收到了一个文件的右键菜单点击事件 // 接收到了一个文件的右键菜单点击事件
oneFileRightBtnClick(id) { oneFileRightBtnClick(id) {
this.tempRightFileId = id; this.tempRightFileId = id;
@@ -433,16 +622,32 @@ export default {
// 文件展示过滤 // 文件展示过滤
filterFiles(fileList) { filterFiles(fileList) {
// 子文件会有这个属性,节点文件夹不会有 // 子文件会有这个属性,节点文件夹不会有
const { folderPath = '' } = this.currentFolder;
const { folderPath = '' } = this.currentFolder ;
return fileList.filter(file => { return fileList.filter(file => {
if(file.relativePath !== folderPath) return false; if(file.relativePath !== folderPath) return false;
return true; return true;
}); });
}, },
// 文件展示过滤
// 文件展示过滤
filterFolders(folderList) { filterFolders(folderList) {
// 子文件会有这个属性,节点文件夹不会有 // 子文件会有这个属性,节点文件夹不会有
const { folderPath = '' } = this.currentFolder;
const { folderPath = '' } = this.currentFolder;
return folderList.filter(folder => {
if(folder.parentFolderPath !== folderPath) return false;
return true;
});
},
// 协作文件下的文件展示过滤
filterFilesInCoop(fileList){
const { folderPath = '' } = this.currentFolderInCoop;
return fileList.filter(file=> {
if(file.relativePath !== folderPath) return false;
return true;
});
},
// 协作文件下的文件夹展示过滤
filterFoldersInCoop(folderList) {
const { folderPath = '' } = this.currentFolderInCoop;
return folderList.filter(folder => { return folderList.filter(folder => {
if(folder.parentFolderPath !== folderPath) return false; if(folder.parentFolderPath !== folderPath) return false;
return true; return true;
@@ -604,6 +809,7 @@ export default {
*/ */
previousFolder () { previousFolder () {
this.goFolder(this.nowFolderIndex - 1); this.goFolder(this.nowFolderIndex - 1);
this.isShowStartNodeFolders = true;
}, },
/** /**
* 查看下一个文件夹文件 * 查看下一个文件夹文件
@@ -629,15 +835,23 @@ export default {
this.clearCurrentFolderFiles(); this.clearCurrentFolderFiles();
} }
this.currentFolder = this.currentNodeFolder; this.currentFolder = this.currentNodeFolder;
this.currentFolderInCoop = this.currentNodeFolder;
this.breadcrumbFolderList = []; this.breadcrumbFolderList = [];
this.breadcrumbFolderListInCoop = [];
this.fetchFolderFiles(); this.fetchFolderFiles();
}, },
/** /**
* 进入子文件夹 * 进入子文件夹
*/ */
intoSubFolder(folder) {
this.currentFolder = folder;
this.breadcrumbFolderList.push(folder);
intoSubFolder(folder, flag) {
if(flag == 0) {
this.currentFolder = folder;
this.breadcrumbFolderList.push(folder);
} else if(flag == 1) {
this.currentFolderInCoop = folder;
this.breadcrumbFolderListInCoop.push(folder);
}

// this.clearCurrentFolderFiles(); // this.clearCurrentFolderFiles();
// this.fetchFolderFiles(); // this.fetchFolderFiles();
}, },
@@ -646,6 +860,7 @@ export default {
*/ */
nowFolderClick(nextFolderIndex) { nowFolderClick(nextFolderIndex) {
this.goFolder(nextFolderIndex); this.goFolder(nextFolderIndex);
this.isShowStartNodeFolders = true;//上面切换点击到另一个工作节点的时候 协作文件先显示总的节点入口
}, },


/* 文件夹及文件API */ /* 文件夹及文件API */
@@ -668,6 +883,7 @@ export default {
this.currentNodeFolder = folderList[0]; this.currentNodeFolder = folderList[0];
} }
this.currentFolder = this.currentNodeFolder; this.currentFolder = this.currentNodeFolder;
this.currentFolderInCoop = this.currentNodeFolder;
this.fetchFolderFiles(); this.fetchFolderFiles();
}, },
/** /**
@@ -695,6 +911,7 @@ export default {
// resolve dupilicate folders // resolve dupilicate folders
this.tempWorkSubFolderList = this.tempWorkSubFolderList.filter(tempFolder => !folderResInfo.folder.some(folder => folder.id === tempFolder.id)); this.tempWorkSubFolderList = this.tempWorkSubFolderList.filter(tempFolder => !folderResInfo.folder.some(folder => folder.id === tempFolder.id));
this.cooperationFileList = folderResInfo.coordinationFiles; this.cooperationFileList = folderResInfo.coordinationFiles;
this.dealWithCoopFiles(this.cooperationFileList);
this.resolveUploadFileList(this.cooperationFileList); this.resolveUploadFileList(this.cooperationFileList);
}, 1000), }, 1000),
/** /**
@@ -749,14 +966,28 @@ export default {
/** /**
* 面包屑导航点击 * 面包屑导航点击
*/ */
clickBreadcrumb(breadFolderIdx) {
const targetFolder = breadFolderIdx === -1
clickBreadcrumb(breadFolderIdx, flag) {
if(flag == 0) {
// 工作文件
const targetFolder = breadFolderIdx === -1
? this.currentNodeFolder ? this.currentNodeFolder
: this.breadcrumbFolderList[breadFolderIdx]; : this.breadcrumbFolderList[breadFolderIdx];
this.currentFolder = targetFolder;
this.fetchFolderFiles();
// 重置面包屑导航数组
this.breadcrumbFolderList = this.breadcrumbFolderList.slice(0, breadFolderIdx + 1);
this.currentFolder = targetFolder;
this.fetchFolderFiles();
// 重置面包屑导航数组
this.breadcrumbFolderList = this.breadcrumbFolderList.slice(0, breadFolderIdx + 1);
} else if(flag == 1) {
// 协作文件
const targetFolder = breadFolderIdx === -1
? this.currentNodeFolder
: this.breadcrumbFolderListInCoop[breadFolderIdx];
this.currentFolderInCoop = targetFolder;
this.isShowStartNodeFolders = breadFolderIdx === -1;
// this.fetchFolderFiles();
// 重置面包屑导航数组
this.breadcrumbFolderListInCoop = this.breadcrumbFolderListInCoop.slice(0, breadFolderIdx + 1);
}
}, },
/** /**
* 客户端选择文件列表并上传 * 客户端选择文件列表并上传
@@ -810,7 +1041,7 @@ export default {
* } * }
*/ */
async clientUpload(filePaths) { // uploadTask async clientUpload(filePaths) { // uploadTask
console.log('filePaths');
const tasksGroup = await Promise.all(filePaths.map(path => system.analyzeSystemPath(path))); const tasksGroup = await Promise.all(filePaths.map(path => system.analyzeSystemPath(path)));
const uploadTasks = flatten(tasksGroup); const uploadTasks = flatten(tasksGroup);
const { folderName, levelId, id: folderId } = this.currentNodeFolder; const { folderName, levelId, id: folderId } = this.currentNodeFolder;
@@ -1069,6 +1300,8 @@ export default {
this.isShowpageIcon = true; this.isShowpageIcon = true;
this.neibianju = "neibianju"; this.neibianju = "neibianju";
this.closepageH = ""; this.closepageH = "";
// this.workFileScrollBar ? this.workFileScrollBar.scrollTop = 0 : "";
}, },
/** /**
* 点击了复制文件副本的按钮 * 点击了复制文件副本的按钮
@@ -1140,6 +1373,16 @@ export default {
} }
}, },
watch: { watch: {
localFileHashMap(val) {
let temp = {};
for(let key in val) {
temp[val[key]] = key;
}
this.reverseLocalFileHashMap = temp;
},
nowFolderIndex() {
this.isfinishGetExchangeNodes && this.getExchangeNodes();
},
rightMenuvisible(value) { rightMenuvisible(value) {
if (value) { if (value) {
document.body.addEventListener("click", this.closeShowMenu); document.body.addEventListener("click", this.closeShowMenu);
@@ -1182,6 +1425,9 @@ export default {


</style> </style>
<style lang="scss" scoped> <style lang="scss" scoped>
.titleBox {
position: relative;
}
.app-header-style { .app-header-style {
background-color: #f0f0f0; background-color: #f0f0f0;
} }


Carregando…
Cancelar
Salvar