zhengzhou hace 4 años
padre
commit
046436f6e5
Se han modificado 3 ficheros con 46 adiciones y 23 borrados
  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 Ver fichero

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

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


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

<style lang="scss">


+ 15
- 10
src/views/main_web/workspace/index.vue Ver fichero

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


+ 10
- 1
src/views/main_web/workspace/service.js Ver fichero

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


Cargando…
Cancelar
Guardar