Browse Source

update

dev
zhengzhou 4 years ago
parent
commit
046436f6e5
3 changed files with 46 additions and 23 deletions
  1. +21
    -12
      src/views/main_web/workspace/components/file-item.vue
  2. +15
    -10
      src/views/main_web/workspace/index.vue
  3. +10
    -1
      src/views/main_web/workspace/service.js

+ 21
- 12
src/views/main_web/workspace/components/file-item.vue View File

@@ -1,6 +1,5 @@
<template> <template>
<div @dblclick="dblclickFile"> <div @dblclick="dblclickFile">

<div class="yiyun_wenjian_list loding-mask-parent" ref="file" <div class="yiyun_wenjian_list loding-mask-parent" ref="file"
:class="{'yiyun_wenjian_list_add': !isLocalIpfsCidValidate && isClient}" :class="{'yiyun_wenjian_list_add': !isLocalIpfsCidValidate && isClient}"
@contextmenu.prevent.stop="fileRightBtnClick"> @contextmenu.prevent.stop="fileRightBtnClick">
@@ -15,14 +14,14 @@
v-if="!oneOf(file.extension, imgExtensionList) && !oneOf(file.extension, VideoExtensionList)" v-if="!oneOf(file.extension, imgExtensionList) && !oneOf(file.extension, VideoExtensionList)"
class="defultImage-mid" class="defultImage-mid"
:class="`${file.extension}-mid ${ :class="`${file.extension}-mid ${
fileIsLoading || (isInWorkFolder && otherUserIsWorking) ? 'toumin' : ''
(fileIsLoading || (isInWorkFolder && otherUserIsWorking) && !enableSelect) ? 'toumin' : ''
} ${!oneOf(file.extension,filePreviewList) ? '':''} ` " } ${!oneOf(file.extension,filePreviewList) ? '':''} ` "
/> />
<!-- 图片文件图标 --> <!-- 图片文件图标 -->
<div ref="file-img" <div ref="file-img"
v-else-if="oneOf(file.extension, imgExtensionList)" v-else-if="oneOf(file.extension, imgExtensionList)"
class="defultImage-mid img_bg-mid" class="defultImage-mid img_bg-mid"
:class=" fileIsLoading ||(isInWorkFolder && otherUserIsWorking) || showDownloadMask ? 'toumin' : ''"
:class=" (fileIsLoading ||(isInWorkFolder && otherUserIsWorking) || showDownloadMask) && !enableSelect ? 'toumin' : ''"
> >
<div class="file_Im gbox-mid"> <div class="file_Im gbox-mid">
<img v-lazy="file.alias" alt class="file_Img" /> <img v-lazy="file.alias" alt class="file_Img" />
@@ -32,7 +31,7 @@
<div ref="file-img" <div ref="file-img"
v-else v-else
class="defultImage-mid video-mid" class="defultImage-mid video-mid"
:class="fileIsLoading || showDownloadMask ? 'toumin' : ''"
:class="(fileIsLoading || showDownloadMask) && !enableSelect ? 'toumin' : ''"
> >
</div> </div>
</div> </div>
@@ -49,14 +48,14 @@
<div <div
class="downloadIcon" class="downloadIcon"
@click="clientDownLoad(file, 1)" @click="clientDownLoad(file, 1)"
v-if="showDownloadMask"
v-if="showDownloadMask && !enableSelect"
> >
<div class="readytodownload-icon"><img src="/static/img/download.svg" alt class="imgjuzhong" /></div> <div class="readytodownload-icon"><img src="/static/img/download.svg" alt class="imgjuzhong" /></div>
</div> </div>
<!-- 下载中 状态蒙板 --> <!-- 下载中 状态蒙板 -->
<div <div
class="downloadIcon" class="downloadIcon"
v-if="loadingState.type === DOWNLOADING"
v-if="loadingState.type === DOWNLOADING && !enableSelect"
> >
<div class="progress-circle"> <div class="progress-circle">
<LottieSvg class="bg-pic" :width="40" :height="40" path="static/img/lottie.download.svg.json" /> <LottieSvg class="bg-pic" :width="40" :height="40" path="static/img/lottie.download.svg.json" />
@@ -69,7 +68,7 @@
<!-- 上传中 状态蒙板 todo: 调整样式--> <!-- 上传中 状态蒙板 todo: 调整样式-->
<div <div
class="downloadIcon" class="downloadIcon"
v-if="loadingState.type === UPLOADING"
v-if="loadingState.type === UPLOADING && !enableSelect"
> >
<div class="progress-circle"> <div class="progress-circle">
<img class="bg-pic" src="/static/img/upload.png" alt="" :style="{ width: '24px' }" > <img class="bg-pic" src="/static/img/upload.png" alt="" :style="{ width: '24px' }" >
@@ -117,13 +116,14 @@
>同步</div> >同步</div>
<!-- 绿色钩 协作文件无绿色钩--> <!-- 绿色钩 协作文件无绿色钩-->
<div <div
v-if="fileEnableShare"
v-else-if="fileEnableShare && !enableSelect"
class="yijianxietong isonselect" class="yijianxietong isonselect"
title="文件已协同" title="文件已协同"
> >
<i class="icon font_family icon-icon_status_wenjianbiaojiwancheng yijianIcon" /> <i class="icon font_family icon-icon_status_wenjianbiaojiwancheng yijianIcon" />
</div> </div>
</template> </template>
<div v-if="!isFileModified && enableSelect" class="yijianIcon select-icon" :class="{ selected: false }" />
</template> </template>




@@ -240,6 +240,10 @@ export default {
type: Object, type: Object,
default: () => ({}), default: () => ({}),
}, },
enableSelect: {
type: Boolean,
default: false,
},
// rightShowMenu: { // rightShowMenu: {
// type: Function, // type: Function,
// default: () => () => {} // default: () => () => {}
@@ -293,13 +297,13 @@ export default {
fileItemEl: null, fileItemEl: null,
workspaceEl: null,//工作文件区域 workspaceEl: null,//工作文件区域
fileImgEl: null, fileImgEl: null,
fileImgClass: ""
fileImgClass: "",
}; };
}, },
computed: { computed: {
fileStoreKey() { fileStoreKey() {
const { nodeName, extension, archName, relativePath } = this.file;
const folderName = nodeName ? `${nodeName}\\协作文件` : this.nodeFolder.folderName;
// const { nodeName, extension, archName, relativePath } = this.file;
// const folderName = nodeName ? `${nodeName}\\协作文件` : this.nodeFolder.folderName;
return getFileStoreKey(this.file, this.nodeFolder); return getFileStoreKey(this.file, this.nodeFolder);
}, },
isInWorkFolder() { isInWorkFolder() {
@@ -358,7 +362,7 @@ export default {
isFileModified() { isFileModified() {
const { ipfsCid } = this.file; const { ipfsCid } = this.file;
const localIpfsCid = this.localIpfsCid; const localIpfsCid = this.localIpfsCid;
const [myLocalIpfsCid, status] = localIpfsCid.split(";");
const [myLocalIpfsCid, status] = (localIpfsCid || '').split(";");
//本地修改 即hash最后一位是 1 //本地修改 即hash最后一位是 1
return localIpfsCid && status == "1"; return localIpfsCid && status == "1";
}, },
@@ -624,6 +628,11 @@ export default {
box-shadow: 0 1px 2px rgb(#666, 0.2); box-shadow: 0 1px 2px rgb(#666, 0.2);
} }
} }
.select-icon {
width: 24px;
height: 24px;
border-radius: 50%;
}
</style> </style>


<style lang="scss"> <style lang="scss">


+ 15
- 10
src/views/main_web/workspace/index.vue View File

@@ -49,6 +49,8 @@
:currentNodeFolder="currentNodeFolder" :currentNodeFolder="currentNodeFolder"
:searchContent="searchKeywords" :searchContent="searchKeywords"
:nodeFolders="nodeFolders" :nodeFolders="nodeFolders"
:publicFolder="publicFolder"
@showAchieveView="viewType = 'archive-view'"
/> />
<archive-view <archive-view
v-show="!workFlowVisible" v-show="!workFlowVisible"
@@ -81,20 +83,21 @@ export default {
projectName: sessionStorage.projName, // 当前项目名称 projectName: sessionStorage.projName, // 当前项目名称
nodeFolders: [], // 节点文件夹 nodeFolders: [], // 节点文件夹
currentNodeFolder: null, // 当前节点文件夹 currentNodeFolder: null, // 当前节点文件夹
publicFolder: null,
// currentFolder: {}, // 当前文件夹,可以是节点文件夹,可以是子文件夹 // currentFolder: {}, // 当前文件夹,可以是节点文件夹,可以是子文件夹
workFlowVisible: false, // 工作链页面显示开关 workFlowVisible: false, // 工作链页面显示开关
// viewType: undefined, // computed: file-explorer || archive-view
viewType: 'file-explorer', // computed: file-explorer || archive-view
// 搜索关键字 // 搜索关键字
searchKeywords: "", searchKeywords: "",
}; };
}, },
computed: {
viewType() {
const folder = this.currentNodeFolder;
if(!folder) return '';
return folder.folderType === 'archive' ? 'archive-view' : 'file-explorer';
}
},
// computed: {
// viewType() {
// const folder = this.currentNodeFolder;
// if(!folder) return '';
// return folder.folderType === 'archive' ? 'archive-view' : 'file-explorer';
// }
// },
mounted() { mounted() {
// 获取含有节点人员分配信息的节点列表 listNewFolder // 获取含有节点人员分配信息的节点列表 listNewFolder
this.getAllNodePeopleInfo(); this.getAllNodePeopleInfo();
@@ -116,9 +119,10 @@ export default {
); );
const folderList = workList.filter( const folderList = workList.filter(
(folder) => (folder) =>
folder.nodeId !== folder.templateId &&
folder.folderName !== "公共文件夹"
folder.nodeId !== folder.templateId
// && folder.folderName !== "公共文件夹"
); );
this.publicFolder = folderList.find(folder => folder.isPublic);
this.nodeFolders = folderList; this.nodeFolders = folderList;
this.folderMap = folderList.reduce((h, f) => ((h[f.id] = f), h), {}); this.folderMap = folderList.reduce((h, f) => ((h[f.id] = f), h), {});
if (!folderList.length) return; if (!folderList.length) return;
@@ -203,6 +207,7 @@ export default {
const nextFolderIndex = this.nodeFolders.indexOf(nextFolder); const nextFolderIndex = this.nodeFolders.indexOf(nextFolder);
sessionStorage.nowFolderIndex = nextFolderIndex; // 用于刷新页面时使用 sessionStorage.nowFolderIndex = nextFolderIndex; // 用于刷新页面时使用
this.currentNodeFolder = nextFolder; this.currentNodeFolder = nextFolder;
this.viewType = 'file-explorer';
}, },
}, },
}; };


+ 10
- 1
src/views/main_web/workspace/service.js View File

@@ -11,6 +11,9 @@ export async function fetchWorkFlow(projectId, userId) {
lower.nodeId = lower.id; lower.nodeId = lower.id;
lower.folderType = 'archive'; lower.folderType = 'archive';
} }
if(lower.folderName === '公共文件夹') {
lower.isPublic = true;
}
// 工作链中的上下游 // 工作链中的上下游
lower.listsShareFrom = [[], []]; lower.listsShareFrom = [[], []];
return lower; return lower;
@@ -78,7 +81,13 @@ export async function fetchFolderFileList(folderId, userId, commonFolderId) {
deliverables: (data.deliverables || []).map(firstCharToLowerCase), deliverables: (data.deliverables || []).map(firstCharToLowerCase),
// myFile: (data.myFile || []).map(injectFileBasicValue), // myFile: (data.myFile || []).map(injectFileBasicValue),
// workFile: (data.workFile || []).map(injectFileBasicValue), // workFile: (data.workFile || []).map(injectFileBasicValue),
coordinationFiles: (data.coordinationFiles || []).map(firstCharToLowerCase),
coordinationFiles: (data.public || [])
.map(d => {
const item = firstCharToLowerCase(d);
item.nodeName="公共文件夹";
return item;
})
.concat((data.coordinationFiles || []).map(firstCharToLowerCase)),
nestCoordinationFiles: (data.nestCoordinationFiles || []).map(firstCharToLowerCase), nestCoordinationFiles: (data.nestCoordinationFiles || []).map(firstCharToLowerCase),
// public: (data.public || []).map(firstCharToLowerCase), // public: (data.public || []).map(firstCharToLowerCase),
} }


Loading…
Cancel
Save