Browse Source

workspace update

master
unknown 4 years ago
parent
commit
d913d88966
3 changed files with 52 additions and 28 deletions
  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 View File

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

<!-- 图片文件图标 --> <!-- 图片文件图标 -->
<div <div
v-if="isImageFile"
v-else
class="defultImage-mid img_bg-mid" class="defultImage-mid img_bg-mid"
:class=" :class="
isClient && !file.isDownload && file.status == 2 ? 'toumin' : '' isClient && !file.isDownload && file.status == 2 ? 'toumin' : ''
@@ -109,7 +108,26 @@
@click="setFileStatus(file, 1, '更新为工作中', 1)" @click="setFileStatus(file, 1, '更新为工作中', 1)"
></i> ></i>
</div> </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>
</div> </div>
</el-tooltip> </el-tooltip>
@@ -121,6 +139,7 @@ import system from "@/services/system";
import { FileWorkStatus, DownloadStatus } from '../helper'; import { FileWorkStatus, DownloadStatus } from '../helper';


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


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

+ 11
- 0
src/views/main_web/workspace/helper.js View File

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

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

+ 16
- 18
src/views/main_web/workspace/workspace.vue View File

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


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


Loading…
Cancel
Save