@@ -1 +0,0 @@ | |||
.el-image img[data-v-7d4c9674]{max-width:100%;max-height:100%}.readytodownload-icon[data-v-7c93ce78]{position:relative;top:40px;margin:0 auto}.progress-circle[data-v-7c93ce78],.readytodownload-icon[data-v-7c93ce78]{width:45px;height:45px;background-color:#fff;border-radius:50%}.progress-circle .bg-pic[data-v-7c93ce78],.progress-circle[data-v-7c93ce78],.readytodownload-icon img[data-v-7c93ce78]{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%)}.progress-circle svg[data-v-7c93ce78]{position:relative!important}.progress-circle svg .el-progress-circle__track[data-v-7c93ce78]{stroke:#fff!important}.el-message-box--center .el-message-box__status.el-icon-warning{position:absolute;left:0}.youbian,.yywenjiantitle_text1{position:relative;top:2px}.youbian{color:#a7a8b7}.app-header-style[data-v-7378dac4]{background-color:#f0f0f0}[data-v-7378dac4] .readytodownload-icon{position:relative;top:40px;margin:0 auto}[data-v-7378dac4] .progress-circle,[data-v-7378dac4] .readytodownload-icon{width:45px;height:45px;background-color:#fff;border-radius:50%}[data-v-7378dac4] .progress-circle,[data-v-7378dac4] .progress-circle .bg-pic,[data-v-7378dac4] .readytodownload-icon img{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%)}[data-v-7378dac4] .progress-circle svg{position:relative!important}[data-v-7378dac4] .progress-circle svg .el-progress-circle__track{stroke:#fff!important} |
@@ -1 +1 @@ | |||
.black[data-v-5c0de3b7]{color:#fff}.white[data-v-5c0de3b7]{background-color:#fcfcfc;box-shadow:0 1px 2px 0 rgba(0,0,0,.2)}.app-header[data-v-5c0de3b7]{position:fixed;top:0;width:100%;z-index:1;height:50px;line-height:50px}.app-header-content[data-v-5c0de3b7]{box-sizing:border-box;display:flex;justify-content:space-between;height:100%;width:100%;padding:0 64px;font-size:16px}.app-header-content-right>div[data-v-5c0de3b7],.app-header-content-right>span[data-v-5c0de3b7]{margin-left:24px}.app-header-center[data-v-5c0de3b7]{position:absolute;top:0;left:50%;transform:translateX(-50%);font-size:18px;height:50px;line-height:50px}.app-header-back-btn[data-v-5c0de3b7]{position:absolute;left:36px;top:0;bottom:0;margin:auto 0}.folder-children[data-v-d26cb448]{padding-left:30px}[data-v-0dd33bda] .el-checkbox:last-of-type{margin-right:30px} | |||
.black[data-v-5c0de3b7]{color:#fff}.white[data-v-5c0de3b7]{background-color:#fcfcfc;box-shadow:0 1px 2px 0 rgba(0,0,0,.2)}.app-header[data-v-5c0de3b7]{position:fixed;top:0;width:100%;z-index:1;height:50px;line-height:50px}.app-header-content[data-v-5c0de3b7]{box-sizing:border-box;display:flex;justify-content:space-between;height:100%;width:100%;padding:0 64px;font-size:16px}.app-header-content-right>div[data-v-5c0de3b7],.app-header-content-right>span[data-v-5c0de3b7]{margin-left:24px}.app-header-center[data-v-5c0de3b7]{position:absolute;top:0;left:50%;transform:translateX(-50%);font-size:18px;height:50px;line-height:50px}.app-header-back-btn[data-v-5c0de3b7]{position:absolute;left:36px;top:0;bottom:0;margin:auto 0}.folder-children[data-v-d26cb448]{padding-left:30px}[data-v-1b98e719] .el-checkbox:last-of-type{margin-right:30px}[v-cloak][data-v-39c0fb98]{display:none!important}.user_info_role .el-icon-close{display:block}[v-cloak]{display:none!important}.icon-icon_huishouzhan[data-v-0fa08bfb]{line-height:inherit} |
@@ -0,0 +1 @@ | |||
.black[data-v-5c0de3b7]{color:#fff}.white[data-v-5c0de3b7]{background-color:#fcfcfc;box-shadow:0 1px 2px 0 rgba(0,0,0,.2)}.app-header[data-v-5c0de3b7]{position:fixed;top:0;width:100%;z-index:1;height:50px;line-height:50px}.app-header-content[data-v-5c0de3b7]{box-sizing:border-box;display:flex;justify-content:space-between;height:100%;width:100%;padding:0 64px;font-size:16px}.app-header-content-right>div[data-v-5c0de3b7],.app-header-content-right>span[data-v-5c0de3b7]{margin-left:24px}.app-header-center[data-v-5c0de3b7]{position:absolute;top:0;left:50%;transform:translateX(-50%);font-size:18px;height:50px;line-height:50px}.app-header-back-btn[data-v-5c0de3b7]{position:absolute;left:36px;top:0;bottom:0;margin:auto 0}.lottie-svg[data-v-1f22bc7a]{display:inline-block}.lottie-svg[data-v-1f22bc7a] svg{position:static}.readytodownload-icon[data-v-1752a9c5]{position:relative;top:40px;margin:0 auto}.progress-circle[data-v-1752a9c5],.readytodownload-icon[data-v-1752a9c5]{width:45px;height:45px;background-color:#fff;border-radius:50%}.progress-circle .bg-pic[data-v-1752a9c5],.progress-circle[data-v-1752a9c5],.readytodownload-icon img[data-v-1752a9c5]{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%)}.progress-circle svg[data-v-1752a9c5]{position:relative!important}.progress-circle svg .el-progress-circle__track[data-v-1752a9c5]{stroke:#fff!important}.have-modified-icon[data-v-1752a9c5]{width:22px;height:22px;border-radius:50%;background-color:#fff}.modified-icon-parent[data-v-1752a9c5]{background-color:transparent!important}.el-message-box--center .el-message-box__status.el-icon-warning{position:absolute;left:0}.youbian,.yywenjiantitle_text1{position:relative;top:2px}.youbian{color:#a7a8b7}.app-header-style[data-v-5e88fb15]{background-color:#f0f0f0}.titlebar_head[data-v-5e88fb15]{flex-direction:column}.folder_breadcrumb[data-v-5e88fb15] .el-breadcrumb__item{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;font-size:18px}.folder_breadcrumb[data-v-5e88fb15] .el-breadcrumb__item .el-breadcrumb__separator{color:#a7a8b7}.folder_breadcrumb[data-v-5e88fb15] .el-breadcrumb__item:not(:last-child){cursor:pointer}[data-v-5e88fb15] .readytodownload-icon{position:relative;top:40px;margin:0 auto}[data-v-5e88fb15] .progress-circle,[data-v-5e88fb15] .readytodownload-icon{width:45px;height:45px;background-color:#fff;border-radius:50%}[data-v-5e88fb15] .progress-circle,[data-v-5e88fb15] .progress-circle .bg-pic,[data-v-5e88fb15] .readytodownload-icon img{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%)}[data-v-5e88fb15] .progress-circle svg{position:relative!important}[data-v-5e88fb15] .progress-circle svg .el-progress-circle__track{stroke:#fff!important} |
@@ -1 +0,0 @@ | |||
[v-cloak][data-v-39c0fb98]{display:none!important}.user_info_role .el-icon-close{display:block}[v-cloak]{display:none!important}.icon-icon_huishouzhan[data-v-0fa08bfb]{line-height:inherit} |
@@ -3,7 +3,7 @@ | |||
<svg version="1.1" id="图层_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" | |||
viewBox="0 0 1024 1024" style="enable-background:new 0 0 1024 1024;" xml:space="preserve"> | |||
<style type="text/css"> | |||
.st0{fill:#D6243A;} | |||
.st0{fill:#c9c9c9;} | |||
</style> | |||
<g id="图层_1_1_"> | |||
</g> | |||
@@ -10658,6 +10658,51 @@ | |||
"integrity": "sha512-i2sY04nal5jDcagM3FMfG++T69GEEM8CYuOfeOIvmXzOIcwE9a/CJPR0MFM97pYMj/u10lzz7/zd7+qwhrBTqQ==", | |||
"dev": true | |||
}, | |||
"lottie-vuejs": { | |||
"version": "0.4.0", | |||
"resolved": "https://registry.npm.taobao.org/lottie-vuejs/download/lottie-vuejs-0.4.0.tgz", | |||
"integrity": "sha1-mijCvQ3cQCpDVM6Dpgzxmo+2cq0=", | |||
"requires": { | |||
"axios": "^0.19.0", | |||
"lottie-web": "^5.1.9" | |||
}, | |||
"dependencies": { | |||
"axios": { | |||
"version": "0.19.2", | |||
"resolved": "https://registry.npm.taobao.org/axios/download/axios-0.19.2.tgz", | |||
"integrity": "sha1-PqNsXYgY0NX4qKl6bTa4bNwAyyc=", | |||
"requires": { | |||
"follow-redirects": "1.5.10" | |||
} | |||
}, | |||
"debug": { | |||
"version": "3.1.0", | |||
"resolved": "https://registry.npm.taobao.org/debug/download/debug-3.1.0.tgz?cache=0&sync_timestamp=1600502822029&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fdebug%2Fdownload%2Fdebug-3.1.0.tgz", | |||
"integrity": "sha1-W7WgZyYotkFJVmuhaBnmFRjGcmE=", | |||
"requires": { | |||
"ms": "2.0.0" | |||
} | |||
}, | |||
"follow-redirects": { | |||
"version": "1.5.10", | |||
"resolved": "https://registry.npm.taobao.org/follow-redirects/download/follow-redirects-1.5.10.tgz?cache=0&sync_timestamp=1597058055564&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Ffollow-redirects%2Fdownload%2Ffollow-redirects-1.5.10.tgz", | |||
"integrity": "sha1-e3qfmuov3/NnhqlP9kPtB/T/Xio=", | |||
"requires": { | |||
"debug": "=3.1.0" | |||
} | |||
}, | |||
"ms": { | |||
"version": "2.0.0", | |||
"resolved": "https://registry.npm.taobao.org/ms/download/ms-2.0.0.tgz", | |||
"integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=" | |||
} | |||
} | |||
}, | |||
"lottie-web": { | |||
"version": "5.7.4", | |||
"resolved": "https://registry.npm.taobao.org/lottie-web/download/lottie-web-5.7.4.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Flottie-web%2Fdownload%2Flottie-web-5.7.4.tgz", | |||
"integrity": "sha1-OyUhSOkEoKqYM4ef+2SSTIWgiIw=" | |||
}, | |||
"loud-rejection": { | |||
"version": "1.6.0", | |||
"resolved": "https://registry.npmjs.org/loud-rejection/-/loud-rejection-1.6.0.tgz", | |||
@@ -147,8 +147,8 @@ const system = { | |||
// 项目id | |||
ProjId: projectId, | |||
// ShowUrl: "string", | |||
// Status: 0, | |||
// Version: 0, | |||
Status: 2, | |||
Version: 1, | |||
// WorkStatus: 0 | |||
}; | |||
@@ -210,7 +210,7 @@ const system = { | |||
const res = await fetchApi('file/updateFile', copyFile); | |||
wrapErrorHint(res); | |||
if(res.Code === 0) { notify.success(`${archName} 更新成功`); } | |||
// if(res.Code === 0) { notify.success(`${archName} 更新成功`); } | |||
onSuccessHandler(copyFile); | |||
return; | |||
} catch(err) { | |||
@@ -970,6 +970,7 @@ export default { | |||
*/ | |||
setManagerUser: function (nowUser) { | |||
if (this.InitData.manageUser.length != 0) { | |||
console.log(this.InitData.manageUser[0]); | |||
this.InitData.manageUser[0].selected = false; | |||
this.listDept.forEach(dept => { | |||
dept.listUser.forEach(user => { | |||
@@ -1013,20 +1014,9 @@ export default { | |||
} | |||
} | |||
this.InitData = data; | |||
this.setFolderPerm(data); | |||
this.selectedUser = data.listUser; | |||
this.selectedManageUser = data.manageUser; | |||
if(data.manageUser.length > 0 ) { | |||
data.manageUser.forEach(manager => { | |||
if(!manager.folderPerm) { | |||
manager.folderPerm = 2; | |||
} | |||
}) | |||
let res = this.selectedUser.find(user => user.id === data.manageUser[0].id); | |||
if(!res) { | |||
this.selectedUser.push(data.manageUser[0]); | |||
} | |||
} | |||
this.setFolderPerm(data); | |||
this.isShowSecondPage = true; | |||
this.isShowStaffList = false; | |||
this.isShowFirstPage = false; | |||
@@ -1058,19 +1048,11 @@ export default { | |||
} | |||
} | |||
} | |||
// for(var m = 0; m < data.manageUser.length; m++) { | |||
// if ( | |||
// // this.listDept[j].listUser[k].userID == data.listUser[i].userID | |||
// this.listDept[j].listUser[k].id == data.manageUser[m].id | |||
// ) { | |||
// this.listDept[j].listUser[k].folderPerm = | |||
// data.manageUser[m].folderPerm; | |||
// this.listDept[j].listUser[k].selected = true; | |||
// } | |||
// } | |||
this.getIsCheckSecondLevel(j); | |||
} | |||
} | |||
this.getIsCheckAll(); | |||
}, | |||
/* | |||
@@ -1220,7 +1202,9 @@ export default { | |||
this.checkDeptUserName(e, user); | |||
this.InitData.manageUser =[]; | |||
this.isSlectPal = true; | |||
//debugger; | |||
} | |||
this.getIsCheckSecondLevel(topIndex); | |||
this.getIsCheckAll(); | |||
}, | |||
@@ -1236,6 +1220,7 @@ export default { | |||
checkCount--; | |||
} | |||
} | |||
if (checkCount == this.listDept[topIndex].listUser.length) { | |||
//三级级全勾选 | |||
this.listDept[topIndex].selected = true; | |||
@@ -1266,6 +1251,7 @@ export default { | |||
} else { | |||
this.ischeckAll = false; | |||
} | |||
}, | |||
/** | |||
* 移除选中人员 | |||
@@ -1493,7 +1479,16 @@ export default { | |||
this.currUser = this.listManagerUser[0] || {}; | |||
this.listManagerUser = this.listManagerUser.slice(1); | |||
} | |||
const folderList = mergeFolderList(folder, userHash); | |||
const folderList = mergeFolderList(folder, userHash); | |||
folderList.forEach(folder=>{ | |||
folder.listUser.forEach(item=>{ | |||
item.folderPerm=1; | |||
}) | |||
if(folder.manageUser.length>0){ | |||
folder.manageUser[0].folderPerm=2; | |||
folder.listUser.push(folder.manageUser[0]); | |||
} | |||
}) | |||
this.listNewFolder = folderList; | |||
console.log('得到的listNewFolder', this.listNewFolder); | |||
}, | |||
@@ -1681,7 +1676,7 @@ function mergeFolderList(plainFolderList, userHash) { | |||
const folder = firstCharToLowerCase(upperFolder); | |||
hash[folder.id] = folder; | |||
folder.listChildren = []; | |||
folder.listUser = folder.oldGeneralId.split(',').filter(a => a).map(id => { return {...userHash[id]}}); | |||
folder.listUser = folder.oldGeneralId.split(',').filter(a => a).map(id => ({...userHash[id]})); | |||
folder.manageUser = (folder.oldManager === '0' ? '' : folder.oldManager).split(',').filter(a => a).map(id => userHash[id]); | |||
const parentFolderId = folder.superId; | |||
// headList.push(folder); | |||
@@ -23,7 +23,7 @@ | |||
<div class="dragareaBox"> | |||
<div | |||
class="dragarea_top uploadBtn" | |||
@click="clientUpload" | |||
@click="clientUpload(), isShowNewFiledialog = false" | |||
> | |||
<img src="static\img\upload.png" alt class="uploadBtnImg" /> | |||
<span class="uploadText">点击上传本地文件</span> | |||
@@ -13,7 +13,7 @@ | |||
v-if="!oneOf(file.extension, imgExtensionList)" | |||
class="defultImage-mid" | |||
:class="`${file.extension}-mid ${ | |||
isClient && file.downloadStatus !== DownloadStatus.DOWNLOADED ? 'toumin' : '' | |||
isClient && ((isInWorkFolder && !localFileIsLatest) || (!isInWorkFolder && !fileInLocal)) ? 'toumin' : '' | |||
}`" | |||
@contextmenu.prevent.stop="rightShowMenu($event, file, 1)" | |||
/> | |||
@@ -22,7 +22,7 @@ | |||
v-else | |||
class="defultImage-mid img_bg-mid" | |||
:class=" | |||
isClient && file.downloadStatus !== DownloadStatus.DOWNLOADED ? 'toumin' : '' | |||
isClient && ((isInWorkFolder && !localFileIsLatest) || (!isInWorkFolder && !fileInLocal)) ? 'toumin' : '' | |||
" | |||
@contextmenu.prevent.stop="rightShowMenu($event, file, 1)" | |||
> | |||
@@ -34,106 +34,91 @@ | |||
<!-- 标签 --> | |||
<div | |||
class="eidtTip" | |||
v-if="isWorking && file.modifyUserId !== currentUserId" | |||
v-if="isInWorkFolder && isWorking && file.modifyUserId !== currentUserId" | |||
> | |||
工作中 | |||
</div> | |||
<div | |||
@contextmenu.prevent.stop=" | |||
rightShowMenu($event, file, 1) | |||
" | |||
class="downloadIcon" | |||
@click="clientDownLoad(file, 1)" | |||
v-if="isClient && file.downloadStatus === DownloadStatus.UNDOWNLOAD && file.workStatus !== FileWorkStatus.WORKING | |||
" | |||
> | |||
<div class="readytodownload-icon"><img src="/static/img/download.svg" alt class="imgjuzhong" /></div> | |||
</div> | |||
<!-- 如果不在工作中 且上一次的修改者不是自己说明文件已经被更新 本地需要下载 --> | |||
<div | |||
@contextmenu.prevent.stop=" | |||
rightShowMenu($event, file, 1) | |||
" | |||
class="downloadIcon" | |||
@click="clientDownLoad(file, 1)" | |||
v-if="isClient && file.workStatus !== FileWorkStatus.WORKING && file.modifyUserId !== currentUserId | |||
" | |||
> | |||
<div class="readytodownload-icon"><img src="/static/img/download.svg" alt class="imgjuzhong" /></div> | |||
</div> | |||
<div | |||
class="downloadIcon" | |||
v-if=" | |||
isClient && | |||
file.downloadStatus === DownloadStatus.DOWNLOADING | |||
" | |||
> | |||
<div class="progress-circle"> | |||
<img class="bg-pic" src="/static/img/download.svg" alt=""> | |||
<el-progress :width="45" :height="45" | |||
type="circle" :show-text="false" | |||
:percentage="file.loadProgress" :stroke-width="3" color="rgb(140, 0, 255)"> | |||
</el-progress> | |||
</div> | |||
</div> | |||
<div | |||
@contextmenu.prevent.stop="rightShowMenu($event, file, 1)" | |||
class="downloadIcon" | |||
v-if="isClient && file.downloadStatus === DownloadStatus.UPLOADING" | |||
> | |||
<div class="progress-circle"> | |||
<img class="bg-pic" src="/static/img/upload.png" alt="" :style="{ width: '24px' }" > | |||
<el-progress :width="45" :height="45" | |||
type="circle" :show-text="false" | |||
:percentage="file.loadProgress" :stroke-width="3" color="rgb(140, 0, 255)"> | |||
</el-progress> | |||
</div> | |||
<!-- <span class="spanjuzhong"> | |||
<i class="el-icon-loading largeicon"></i> | |||
<div class="minifont">上传中 {{file.loadProgress}}</div> | |||
</span> --> | |||
</div> | |||
<!-- 左上角图标 --> | |||
<template v-if="isClient && file.localIpfsCid"> | |||
<!-- 灰色感叹号 --> | |||
<template v-if="isClient"> | |||
<!-- 如果不在工作中 且上一次的修改者不是自己说明文件已经被更新 本地需要下载 --> | |||
<!-- 待下载 状态蒙板 --> | |||
<div | |||
class="yijianxietong modified-icon-parent" | |||
v-if="isWorking || (file.modifyUserId === userId && file.localIpfsCid !== file.ipfsCid)" | |||
@contextmenu.prevent.stop="rightShowMenu($event, file, 1)" | |||
class="downloadIcon" | |||
@click="clientDownLoad(file, 1)" | |||
v-if="((isInWorkFolder && !localFileIsLatest) || (!isInWorkFolder && !fileInLocal)) && !fileIsLoading" | |||
> | |||
<img src="/static/img/警示.svg" alt | |||
class="have-modified-icon" | |||
title="文件已经被修改 点击进行文件更新" | |||
@click="updateFileWorkStatus(file, 1, '文件已更新', 1)" | |||
/> | |||
<div class="readytodownload-icon"><img src="/static/img/download.svg" alt class="imgjuzhong" /></div> | |||
</div> | |||
<!-- 蓝色更新图标 协同文件列表中当本地文件和云端文件不同时 出现 --> | |||
<!-- 下载中 状态蒙板 --> | |||
<div | |||
v-if=" | |||
!isInWorkFolder && file.downloadStatus === DownloadStatus.DIFF | |||
" | |||
class="yijianxietong isonselect_update" | |||
class="downloadIcon" | |||
v-if="file.downloadStatus === DownloadStatus.DOWNLOADING" | |||
> | |||
<i | |||
class="icon font_family icon-icon_status_wenjianbiaojigengxin yijianIcon" | |||
title="当前文件不是最新的文件" | |||
@click="clientDownLoad(file, 1)" | |||
/> | |||
<div class="progress-circle"> | |||
<LottieSvg class="bg-pic" :width="40" :height="40" path="static/img/lottie.download.svg.json" /> | |||
<el-progress :width="45" :height="45" | |||
type="circle" :show-text="false" | |||
:percentage="file.loadProgress" :stroke-width="3" color="rgb(140, 0, 255)"> | |||
</el-progress> | |||
</div> | |||
</div> | |||
<!-- 绿色钩 --> | |||
<!-- 上传中 状态蒙板 todo: 调整样式--> | |||
<div | |||
v-if="isInWorkFolder && file.workStatus === FileWorkStatus.NOT_WORKING" | |||
class="yijianxietong isonselect" | |||
@contextmenu.prevent.stop="rightShowMenu($event, file, 1)" | |||
class="downloadIcon" | |||
v-if="file.downloadStatus === DownloadStatus.UPLOADING" | |||
> | |||
<i | |||
class="icon font_family icon-icon_status_wenjianbiaojiwancheng yijianIcon" | |||
title="已是最新版本" | |||
></i> | |||
<div class="progress-circle"> | |||
<img class="bg-pic" src="/static/img/upload.png" alt="" :style="{ width: '24px' }" > | |||
<el-progress :width="45" :height="45" | |||
type="circle" :show-text="false" | |||
:percentage="file.loadProgress" :stroke-width="3" color="rgb(140, 0, 255)"> | |||
</el-progress> | |||
</div> | |||
<!-- <span class="spanjuzhong"> | |||
<i class="el-icon-loading largeicon"></i> | |||
<div class="minifont">上传中 {{file.loadProgress}}</div> | |||
</span> --> | |||
</div> | |||
<!-- 左上角图标 --> | |||
<template v-if="fileInLocal && !fileIsLoading"> | |||
<!-- 灰色感叹号 --> | |||
<div | |||
class="yijianxietong modified-icon-parent" | |||
v-if="isInWorkFolder && file.modifyUserId === currentUserId && isWorking" | |||
> | |||
<img src="/static/img/警示.svg" alt | |||
class="have-modified-icon" | |||
title="文件已经被修改 点击进行文件更新" | |||
@click="updateFileWorkStatus(file, 1, '文件已更新', 1)" | |||
/> | |||
</div> | |||
<!-- 蓝色更新图标 协同文件列表中当本地文件和云端文件不同时 出现 --> | |||
<div | |||
v-if=" | |||
!isInWorkFolder && !localFileIsLatest | |||
" | |||
class="yijianxietong isonselect_update" | |||
> | |||
<i | |||
class="icon font_family icon-icon_status_wenjianbiaojigengxin yijianIcon" | |||
title="当前文件不是最新的文件" | |||
@click="clientDownLoad(file, 1)" | |||
/> | |||
</div> | |||
<!-- 绿色钩 --> | |||
<div | |||
v-if="isInWorkFolder && file.workStatus === FileWorkStatus.NOT_WORKING" | |||
class="yijianxietong isonselect" | |||
> | |||
<i | |||
class="icon font_family icon-icon_status_wenjianbiaojiwancheng yijianIcon" | |||
title="已是最新版本" | |||
></i> | |||
</div> | |||
</template> | |||
</template> | |||
<!-- 右上设置按钮 --> | |||
@@ -165,7 +150,7 @@ | |||
>{{ file.archName }}</strong> | |||
<span | |||
v-if="file.createUserId != currentUserId" | |||
v-if="isInWorkFolder && file.createUserId != currentUserId" | |||
class="yiyunwenjian_infodesc" | |||
>{{ file.createUserName }} 创建</span> | |||
@@ -178,6 +163,7 @@ | |||
版本 | |||
{{ file.version }} | |||
</span> | |||
<span v-if="!isInWorkFolder" class="yiyunwenjian_infodesc">{{file.nodeName}}</span> | |||
</div> | |||
</div> | |||
</el-tooltip> | |||
@@ -186,12 +172,16 @@ | |||
<script> | |||
import system from "@/services/system"; | |||
import LottieSvg from '@/components/lottieSvg'; | |||
import { FileWorkStatus, DownloadStatus } from '../helper'; | |||
const imgExtensionList = ["jpg", "png", "bmp", "gif", "jpeg"]; | |||
const oneOf = (target, list) => list.indexOf(target) !== -1 | |||
export default { | |||
components: { | |||
LottieSvg | |||
}, | |||
props: { | |||
file: { | |||
type: Object, | |||
@@ -228,8 +218,28 @@ export default { | |||
return file.folderId === currentFolder.id; | |||
}, | |||
isWorking() { | |||
console.log(this.file, this.file.archName); | |||
return this.file.workStatus === FileWorkStatus.WORKING; | |||
}, | |||
fileIsDifferent() { | |||
const { localIpfsCid, ipfsCid } = this.file; | |||
return localIpfsCid && localIpfsCid !== ipfsCid; | |||
}, | |||
localFileIsLatest() { | |||
const { localIpfsCid, ipfsCid } = this.file; | |||
return localIpfsCid && localIpfsCid === ipfsCid; | |||
}, | |||
fileIsLoading() { | |||
const file = this.file; | |||
return file.downloadStatus === DownloadStatus.UPLOADING || file.downloadStatus === DownloadStatus.DOWNLOADING; | |||
}, | |||
// 本地是否有文件 | |||
fileInLocal() { | |||
return !!this.file.localIpfsCid; | |||
}, | |||
// 其他人员正在修改 | |||
otherUserIsWorking() { | |||
const { modifyUserId, workStatus } = this.file; | |||
return workStatus === FileWorkStatus.WORKING && modifyUserId !== this.currentUserId; | |||
} | |||
}, | |||
methods: { | |||
@@ -52,8 +52,8 @@ export const FileStatus = { | |||
*/ | |||
export function injectionFileLocalStatus(fileList, localFileHash, fileLoadingHash, folderMap) { | |||
return fileList.map(file => { | |||
const { archName, extension, folderId } = file; | |||
const folderName = (folderMap[folderId] || {}).folderName; | |||
const { archName, extension, folderId, nodeName } = file; | |||
const folderName = nodeName || (folderMap[folderId] || {}).folderName; | |||
const fileKey = `${folderName}\\${archName}${extension ? `.${extension}`:''}`; | |||
// 注入loadProgress 和 loadStatus属性 | |||
@@ -63,12 +63,7 @@ export function injectionFileLocalStatus(fileList, localFileHash, fileLoadingHas | |||
file.localIpfsCid = localFileHash[fileKey]; | |||
if(file.localIpfsCid === file.ipfsCid) { | |||
file.downloadStatus = FileLoadStatus.DOWNLOADED; | |||
} else if(!fileLoadingHash[file.id]) { // 不存在加载进度时 | |||
if(!file.localIpfsCid) { | |||
file.downloadStatus = FileLoadStatus.UNDOWNLOAD; | |||
} else { | |||
file.downloadStatus = FileLoadStatus.DIFF; | |||
} | |||
delete fileLoadingHash[file.id]; | |||
} | |||
return file; | |||
}); |
@@ -24,22 +24,17 @@ export async function fetchFolderFileList(folderId, userId, commonFolderId) { | |||
wrapErrorHint(res); | |||
if (res.Code !== 0) return null; | |||
const data = res.Data || {}; | |||
const injectFileBasicValue = upperCaseFile => { | |||
const file = firstCharToLowerCase(upperCaseFile); | |||
file.downloadStatus = DownloadStatus.UNDOWNLOAD; | |||
return file; | |||
} | |||
const outputObj = { | |||
folder: (data.folder || []).map(firstCharToLowerCase), | |||
myFile: (data.myFile || []).map(f => { | |||
const obj = firstCharToLowerCase(f); | |||
obj.isShowFile = true; | |||
obj.downloadStatus = DownloadStatus.UNDOWNLOAD; | |||
return obj; | |||
}), | |||
workFile: (data.workFile || []).map(f => { | |||
const obj = firstCharToLowerCase(f); | |||
obj.isShowFile = true; | |||
obj.downloadStatus = DownloadStatus.UNDOWNLOAD; | |||
return obj; | |||
}), | |||
coordinationFiles: (data.coordinationFiles || []).map(firstCharToLowerCase), | |||
public: (data.public || []).map(firstCharToLowerCase), | |||
myFile: (data.myFile || []).map(injectFileBasicValue), | |||
workFile: (data.workFile || []).map(injectFileBasicValue), | |||
coordinationFiles: (data.coordinationFiles || []).map(injectFileBasicValue), | |||
// public: (data.public || []).map(firstCharToLowerCase), | |||
} | |||
return outputObj; | |||
} | |||
@@ -451,16 +451,20 @@ export default { | |||
this.workFileList = injectionFileLocalStatus(this.workFileList, fileStatusHash, stateMap, folderMap); | |||
this.cooperationFileList = injectionFileLocalStatus(this.cooperationFileList, fileStatusHash, stateMap, folderMap); | |||
}, | |||
updateFileLoadState(file, progress){ | |||
updateFileLoadState(file, progress, type){ | |||
const stateMap = this.fileLocalStateMap; | |||
const updateState = { | |||
loadProgress: progress, | |||
downloadStatus: DownloadStatus.DOWNLOADING, | |||
downloadStatus: type === 'download' ? DownloadStatus.DOWNLOADING : DownloadStatus.UPLOADING, | |||
}; | |||
stateMap[file.id] = updateState; | |||
this.fileLocalStateMap = { ...stateMap, [file.id]: updateState }; | |||
this.refreshFileStatus(); | |||
}, | |||
removeFileLoadingState(fileId) { | |||
delete this.fileLocalStateMap[fileId]; | |||
this.fileLocalStateMap = {...this.fileLocalStateMap}; | |||
this.refreshFileStatus(); | |||
}, | |||
/* 工作链API */ | |||
/** | |||
* 工作链页面点击 | |||
@@ -540,7 +544,7 @@ export default { | |||
const userId = this.userId; | |||
const projId = this.projectId; | |||
const workList = await services.fetchWorkFlow(projId, userId); | |||
const folderList = workList.filter(folder => folder.nodeId !== folder.templateId); | |||
const folderList = workList.filter(folder => folder.nodeId !== folder.templateId && folder.folderName !== '公共文件夹'); | |||
this.nodeFolders = folderList; | |||
this.folderMap = folderList.reduce((h, f) => (h[f.id] = f, h), {}); | |||
@@ -578,6 +582,7 @@ export default { | |||
this.fileLocalStateMap, | |||
this.folderMap, | |||
); | |||
this.resolveUploadFileList(this.workFileList); | |||
this.workSubFolderList = folderResInfo.folder; | |||
this.cooperationFileList = injectionFileLocalStatus( | |||
folderResInfo.coordinationFiles, | |||
@@ -585,6 +590,7 @@ export default { | |||
this.fileLocalStateMap, | |||
this.folderMap, | |||
); | |||
this.resolveUploadFileList(this.cooperationFileList); | |||
}, | |||
/** | |||
* 点击确定 保存文件夹组 | |||
@@ -644,22 +650,31 @@ export default { | |||
// 重置面包屑导航数组 | |||
this.breadcrumbFolderList = this.breadcrumbFolderList.slice(0, breadFolderIdx + 1); | |||
}, | |||
/** | |||
* 去掉上传队列中已经上传成功的文件 | |||
*/ | |||
resolveUploadFileList(fileList) { | |||
this.uploadFileList = this.uploadFileList.filter(uploadFile => { | |||
const targetFile = fileList.find(iFile => iFile.archName === uploadFile.archName && iFile.extension === uploadFile.extension); | |||
return !targetFile; | |||
}); | |||
}, | |||
/** | |||
* 客户端上传文件 | |||
*/ | |||
clientUpload() { | |||
if(!this.isClient) return; | |||
this.isShowNewFiledialog = false; | |||
const { folderName, levelId, id: folderId } = this.currentFolder; | |||
// console.log(folderName, levelId, folderId); | |||
system.uploadFile( | |||
this.projectId, this.projectName, folderId, folderName, levelId, this.workFileList, | |||
(file) => { // onSuccess | |||
const {ArchName, IpfsCid} = file; | |||
const {ArchName, IpfsCid, Extension} = file; | |||
// 注入到文件下载检测表中 | |||
const key = `${folderName}\\${ArchName}`; | |||
const key = `${folderName}\\${ArchName}${Extension ? `.${Extension}`: ''}`; | |||
this.fileDownloadStatusHash[key] = IpfsCid; | |||
this.refreshFileStatus(); | |||
this.fetchFolderFiles(); | |||
}, | |||
(progressData, uploadFile) => { // onLoading | |||
const { process, hash } = progressData; | |||
@@ -696,9 +711,10 @@ export default { | |||
clientDownLoad: function (file, type) { | |||
if(!this.isClient) return; | |||
console.log('下载的文件对象', file); | |||
const { ipfsCid, archName: fileName, extension, folderId } = file; | |||
const { ipfsCid, archName: fileName, extension, folderId, nodeName } = file; | |||
const folderMap = this.folderMap; | |||
const { folderName, levelId } = folderMap[folderId] || {}; | |||
// const { levelId } = folderMap[folderId] || {}; | |||
const nodeFolderName = nodeName || this.currentNodeFolder.folderName; | |||
const extensionedFileName = `${fileName}${extension ? `.${extension}`:''}`; | |||
const copyFile = { ...file }; | |||
const errorHandler = () => { | |||
@@ -707,19 +723,19 @@ export default { | |||
delete this.fileLocalStateMap[file.id]; | |||
this.refreshFileStatus(); | |||
} | |||
this.updateFileLoadState(file, 0); | |||
system.downloadFile(ipfsCid, sessionStorage.projName, extensionedFileName, folderName, (resMessage, socketIns) => { | |||
this.updateFileLoadState(file, 0, 'download'); | |||
system.downloadFile(ipfsCid, sessionStorage.projName, extensionedFileName, nodeFolderName, (resMessage, socketIns) => { | |||
console.log('receive download file message:', resMessage, socketIns); | |||
// {"size":"11","currentSize":"11","unit":"B","process":100,"hash":""} | |||
try { | |||
const { process } = JSON.parse(resMessage.data); | |||
this.updateFileLoadState(file, process); | |||
if(resMessage.data === '-1') { throw 'download failed'; } | |||
this.updateFileLoadState(file, process, 'download'); | |||
if(process !== 100) return; | |||
socketIns.close(); | |||
// file.downloadStatus = 2; | |||
// file.isDownload = true; | |||
// 注入到文件下载检测表中 | |||
const key = `${folderName}\\${extensionedFileName}`; | |||
const key = `${nodeFolderName}\\${extensionedFileName}`; | |||
this.fileDownloadStatusHash[key] = ipfsCid; | |||
this.refreshFileStatus(); | |||
notify.success(`文件:${fileName} 下载完成`); | |||
@@ -727,6 +743,8 @@ export default { | |||
} catch (e) { | |||
console.error('socket-download-file parse data have error:', e); | |||
errorHandler(); | |||
} finally { | |||
socketIns.close(); | |||
} | |||
}, errorHandler); | |||
}, | |||
@@ -767,7 +785,7 @@ export default { | |||
* 更新文件 | |||
*/ | |||
async updateFileWorkStatus(file, nextWorkStatus, message) { | |||
if(!this.isClient || nextWorkStatus === FileWorkStatus.WORKING && file.workStatus === FileWorkStatus.NOT_WORKING) { | |||
if(!this.isClient || (nextWorkStatus === FileWorkStatus.WORKING && file.workStatus === FileWorkStatus.NOT_WORKING)) { | |||
const resFlag = await services.changeFileWorkStatus(file.id, nextWorkStatus); | |||
if(resFlag.Code !== 0) return; | |||
notify.success(message); | |||
@@ -778,16 +796,11 @@ export default { | |||
// todo 获取文件最新的hash并更新文件 | |||
const { folderName, levelId, id: folderId } = this.currentNodeFolder; | |||
const { archName, extension, id: fileId } = file; | |||
const stateMap = this.fileLocalStateMap; | |||
const updateState = { | |||
loadProgress: 0, | |||
downloadStatus: DownloadStatus.UPLOADING, | |||
isDownload: true, | |||
}; | |||
stateMap[fileId] = updateState; | |||
this.refreshFileStatus(); | |||
this.updateFileLoadState(file, 0, 'upload'); | |||
// const fileList = this.currentPageType === 0 ? this.folderFileList.listMyFiles : this.folderFileList.listOtherFiles; | |||
const fileKey = `${folderName}\\${archName}${extension ? `.${extension}`:''}`; | |||
this.fileDownloadStatusHash[fileId] = `${file.localIpfsCid}--upload`; | |||
this.refreshFileStatus(); | |||
system.updateFile( | |||
file, this.localWorkspacePrefix, | |||
this.projectName, folderName, | |||
@@ -798,17 +811,11 @@ export default { | |||
const {IpfsCid} = fileNewState; | |||
// 注入到文件下载检测表中 | |||
this.fileDownloadStatusHash[fileKey] = IpfsCid; | |||
this.refreshFileStatus(); | |||
this.removeFileLoadingState(fileId); | |||
}, | |||
(progressData) => { | |||
const { process, hash } = progressData; | |||
const updateState = { | |||
loadProgress: process, | |||
downloadStatus: process === 100 ? DownloadStatus.DOWNLOADED : DownloadStatus.UPLOADING, | |||
isDownload: true, | |||
}; | |||
stateMap[fileId] = updateState; | |||
this.refreshFileStatus(); | |||
this.updateFileLoadState(file, process, 'upload'); | |||
}, | |||
); | |||
}, | |||
@@ -818,16 +825,18 @@ export default { | |||
fileClick: async function (file) { | |||
if(!this.isClient) return; | |||
if(!fileIsDownloaded(file)) return; | |||
const { archName, extension, id: fileId } = file; | |||
const { folderName } = this.currentFolder; | |||
const { archName, extension, id: fileId, nodeName } = file; | |||
const folderName = nodeName || this.currentFolder.folderName; | |||
const localWorkspacePrefix = this.localWorkspacePrefix; | |||
const filePath = `${localWorkspacePrefix}\\${folderName}\\${archName}${extension ? `.${extension}` : ''}`; | |||
if(file.workStatus === 2 && sessionStorage.userId !== file.modifyUserId) { | |||
const isCooperationFile = !!nodeName; | |||
if(!isCooperationFile && (file.workStatus === 2 && sessionStorage.userId !== file.modifyUserId)) { | |||
notify.warning('文件正在工作编辑中,请耐心等待'); | |||
return; | |||
} | |||
system.openFile(filePath); | |||
// 若文件在协作文件中,则不更改状态 | |||
if(isCooperationFile) { return; } | |||
// 将文件状态设置为编辑中 | |||
const flagRes = await services.changeFileWorkStatus(fileId, 2); | |||
if(flagRes.Code !== 0) return; | |||
@@ -31,8 +31,8 @@ module.exports = { | |||
devServer: { | |||
proxy: { | |||
'/api/pms': { | |||
// target: 'http://47.104.91.134:8089', | |||
target:'http://10.240.32.145:8089', | |||
target: 'http://47.104.91.134:8089', | |||
// target:'http://10.240.32.176:8089', | |||
changeOrigin: true, | |||
secure: false, | |||