|
|
@@ -15,14 +15,14 @@ |
|
|
|
:class="`${file.extension}-mid ${ |
|
|
|
fileIsLoading || (isInWorkFolder && otherUserIsWorking) || showDownloadMask ? 'toumin' : '' |
|
|
|
}`" |
|
|
|
@contextmenu.prevent.stop="rightShowMenu($event, file, 1)" |
|
|
|
@contextmenu.prevent.stop="fileRightBtnClick" |
|
|
|
/> |
|
|
|
<!-- 图片文件图标 --> |
|
|
|
<div |
|
|
|
v-else |
|
|
|
class="defultImage-mid img_bg-mid" |
|
|
|
:class=" fileIsLoading || (isInWorkFolder && otherUserIsWorking) || showDownloadMask ? 'toumin' : ''" |
|
|
|
@contextmenu.prevent.stop="rightShowMenu($event, file, 1)" |
|
|
|
@contextmenu.prevent.stop="fileRightBtnClick" |
|
|
|
> |
|
|
|
<div class="file_Im gbox-mid"> |
|
|
|
<img v-lazy="file.alias" alt class="file_Img" /> |
|
|
@@ -41,7 +41,7 @@ |
|
|
|
<!-- 如果不在工作中 且上一次的修改者不是自己说明文件已经被更新 本地需要下载 --> |
|
|
|
<!-- 待下载 状态蒙板 --> |
|
|
|
<div |
|
|
|
@contextmenu.prevent.stop="rightShowMenu($event, file, 1)" |
|
|
|
@contextmenu.prevent.stop="fileRightBtnClick($event), rightShowMenu($event, file, 1)" |
|
|
|
class="downloadIcon" |
|
|
|
@click="clientDownLoad(file, 1)" |
|
|
|
v-if="showDownloadMask" |
|
|
@@ -63,7 +63,7 @@ |
|
|
|
</div> |
|
|
|
<!-- 上传中 状态蒙板 todo: 调整样式--> |
|
|
|
<div |
|
|
|
@contextmenu.prevent.stop="rightShowMenu($event, file, 1)" |
|
|
|
@contextmenu.prevent.stop="fileRightBtnClick($event), rightShowMenu($event, file, 1)" |
|
|
|
class="downloadIcon" |
|
|
|
v-if="loadingState.type === UPLOADING" |
|
|
|
> |
|
|
@@ -129,6 +129,17 @@ |
|
|
|
</template> |
|
|
|
</template> |
|
|
|
|
|
|
|
<!-- 右键菜单 --> |
|
|
|
<div class="contextmenu" v-show="isFileRightMenuVisible" |
|
|
|
:style="{ top: fileRightMenuTop + 'px', left: fileRightMenuLeft + 'px'}" |
|
|
|
> |
|
|
|
<ul class="rightMenu fileRightMenu"> |
|
|
|
<li v-if="fileInLocal" @click.stop="openfileBtnClick">打开</li> |
|
|
|
<li v-else class="function-disabled" title="请先下载文件再打开">打开</li> |
|
|
|
<li @click.stop="copyFileBtnClick">创建文件副本</li> |
|
|
|
</ul> |
|
|
|
</div> |
|
|
|
|
|
|
|
<!-- 右上设置按钮 --> |
|
|
|
<!-- 下拉列表 --> |
|
|
|
<div class="top_optionBar" v-show="false"> |
|
|
@@ -229,7 +240,10 @@ export default { |
|
|
|
WORKING, NOT_WORKING, |
|
|
|
DOWNLOADING, |
|
|
|
UPLOADING, |
|
|
|
imgExtensionList |
|
|
|
imgExtensionList, |
|
|
|
isFileRightMenuVisible: false,//控制文件右键菜单显示与隐藏 |
|
|
|
fileRightMenuLeft: 0,//文件右键菜单位置 |
|
|
|
fileRightMenuTop: 0, |
|
|
|
}; |
|
|
|
}, |
|
|
|
computed: { |
|
|
@@ -283,7 +297,32 @@ export default { |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
oneOf, |
|
|
|
fileRightBtnClick(e) { |
|
|
|
this.isFileRightMenuVisible = true; |
|
|
|
this.fileRightMenuLeft = e.offsetX; |
|
|
|
this.fileRightMenuTop = e.offsetY; |
|
|
|
}, |
|
|
|
closeFileRightMenu() { |
|
|
|
this.isFileRightMenuVisible = false; |
|
|
|
}, |
|
|
|
openfileBtnClick() { |
|
|
|
this.isFileRightMenuVisible = false; |
|
|
|
this.$emit('openfileBtnClick', this.file); |
|
|
|
}, |
|
|
|
copyFileBtnClick() { |
|
|
|
this.isFileRightMenuVisible = false; |
|
|
|
this.$emit('copyFileBtnClick', this.file); |
|
|
|
} |
|
|
|
}, |
|
|
|
watch: { |
|
|
|
isFileRightMenuVisible(value) { |
|
|
|
if (value) { |
|
|
|
document.body.addEventListener("click", this.closeFileRightMenu); |
|
|
|
} else { |
|
|
|
document.body.removeEventListener("click", this.closeFileRightMenu); |
|
|
|
} |
|
|
|
}, |
|
|
|
} |
|
|
|
}; |
|
|
|
</script> |
|
|
|
|
|
|
@@ -318,4 +357,16 @@ export default { |
|
|
|
.have-modified-icon { |
|
|
|
background-color: #cccdd7; |
|
|
|
} |
|
|
|
.fileRightMenu li { |
|
|
|
white-space: nowrap; |
|
|
|
} |
|
|
|
.function-disabled { |
|
|
|
color: rgb(216,216,216); |
|
|
|
} |
|
|
|
.function-disabled:hover { |
|
|
|
cursor: not-allowed; |
|
|
|
background-color: #ecf5ff; |
|
|
|
color:rgb(167,168,183); |
|
|
|
} |
|
|
|
|
|
|
|
</style> |