소스 검색

workspace update

master
unknown 4 년 전
부모
커밋
d913d88966
3개의 변경된 파일52개의 추가작업 그리고 28개의 파일을 삭제
  1. +25
    -10
      src/views/main_web/workspace/components/file-item.vue
  2. +11
    -0
      src/views/main_web/workspace/helper.js
  3. +16
    -18
      src/views/main_web/workspace/workspace.vue

+ 25
- 10
src/views/main_web/workspace/components/file-item.vue 파일 보기

@@ -10,17 +10,16 @@
<div>
<!-- 非图片文件图标 -->
<div
v-if="!isImageFile"
v-if="!oneOf(file.extension, imgExtensionList)"
class="defultImage-mid"
:class="`${file.extension}-mid ${
isClient && !file.isDownload && file.status === 2 ? 'toumin' : ''
}`"
@contextmenu.prevent.stop="rightShowMenu($event, file, 1)"
/>

<!-- 图片文件图标 -->
<div
v-if="isImageFile"
v-else
class="defultImage-mid img_bg-mid"
:class="
isClient && !file.isDownload && file.status == 2 ? 'toumin' : ''
@@ -109,7 +108,26 @@
@click="setFileStatus(file, 1, '更新为工作中', 1)"
></i>
</div>
<!-- 文件名 -->
<strong
class="yiyunwenjian_name"
:title="file.archName + '.' + file.extension"
>{{ file.archName }}</strong>

<span
v-if="file.createUserId != currentUserId"
class="yiyunwenjian_infodesc"
>{{ file.createUserName }} 创建</span>
<!-- 文件状态显示 -->
<span
v-if="file.version != 1"
class="visontext"
@click="showFileMilestone(file)"
>
版本
{{ file.version }}
</span>
</div>
</div>
</el-tooltip>
@@ -121,6 +139,7 @@ import system from "@/services/system";
import { FileWorkStatus, DownloadStatus } from '../helper';

const imgExtensionList = ["jpg", "png", "bmp", "gif", "jpeg"];
const oneOf = (target, list) => list.indexOf(target) !== -1

export default {
props: {
@@ -137,18 +156,14 @@ export default {
isClient: system.isClient,
currentUserId: sessionStorage.userId,
FileWorkStatus,
DownloadStatus
DownloadStatus,
imgExtensionList
};
},
computed: {
isImageFile: () => {
return this.oneOf(this.file.extension, imgExtensionList);
},
},
methods: {
oneOf(target, list) {
return list.indexOf(target) !== -1;
},
oneOf,
},
};
</script>

+ 11
- 0
src/views/main_web/workspace/helper.js 파일 보기

@@ -24,4 +24,15 @@ export const FileWorkStatus = {
NOT_WORKING: 1,
// 工作中
WORKING: 2,
}

export const FileStatus = {
/**
* 未协同: 1, 0也是未协同
*/
NOT_SHARE: 1,
/**
* 协同中: 2
*/
SHARING: 2,
}

+ 16
- 18
src/views/main_web/workspace/workspace.vue 파일 보기

@@ -451,16 +451,16 @@
</div>
<div
class="list-group"
v-show="false"
>
<FileItem
class="lisy-group-item"
v-for="file in uploadFileList"
:key="file.id"
:key="file.id || file.ArchName"
:file="file"
:rightShowMenu="rightShowMenu"
:clientDownLoad="clientDownLoad"
:setFileStatus="setFileStatus"
:showFileMilestone="showFileMilestone"
/>
</div>
<!-- zxm修改托拽 start -->
@@ -497,12 +497,7 @@
:class="
file.extension +
'-mid' +
(file.extension != 'map' &&
file.extension != 'svfzip' &&
file.extension != 'supermap' &&
isClient &&
!file.isDownload &&
(file.status == 0 || file.status == 2)
(isClient && file.downloadStatus !== 2
? ' toumin'
: '')
"
@@ -514,12 +509,9 @@
<div
:class="
'defultImage-mid img_bg-mid' +
(file.extension != 'map' &&
file.extension != 'svfzip' &&
file.extension != 'supermap' &&
isClient &&
!file.isDownload
? 'toumin'
(isClient &&
!file.isDownload && file.downloadStatus !== 2
? ' toumin'
: '')
"
v-if="oneOf(file.extension, ['jpg','png','bmp','gif','jpeg'])"
@@ -2970,6 +2962,12 @@ export default {
},
methods: {
fileIsDownloaded,
resolveUploadFileList(fileList) {
this.uploadFileList = this.uploadFileList.filter(uploadFile => {
const targetFile = fileList.find(iFile => iFile.archName === uploadFile.archName && iFile.extension === uploadFile.extension);
return !targetFile;
});
},
updateFileLoadState(file, progress){
const stateMap = this.fileLocalStateMap;
const updateState = {
@@ -3909,6 +3907,7 @@ export default {
if (this.currentPageType == 0) {
// 加载我的文件
this.myFilesList = this.folderFileList.listMyFiles;
this.resolveUploadFileList(this.myFilesList);
// 加载我的文件夹 zxm+
this.myListFolderGroups = this.folderFileList.listFolderGroups;
} else {
@@ -3918,10 +3917,7 @@ export default {
this.myListFolderGroups = this.folderFileList.listOtherFolderGroups;
}

if(isCommonFolder) {
this.loadCommitedComFiles();
}
else {
if(!isCommonFolder) {
if (this.curactive == 0) {
// this.listCollaborationFiles();
this.fileindex = 0;
@@ -4708,6 +4704,7 @@ export default {
const key = `${folderName}\\${extensionedFileName}`;
this.fileDownloadStatusHash[key] = ipfsCid;
this.refreshFileStatus();
notify.success(`文件:${fileName} 下载完成`);
// this.$forceUpdate();
} catch (e) {
console.error('socket-download-file parse data have error:', e);
@@ -4831,6 +4828,7 @@ export default {
return;
}
this.uploadFileList.push(firstCharToLowerCase({ ...uploadFile, ...updateState }));
// console.log(this.uploadFileList);
},
);
},


불러오는 중...
취소
저장