|
|
@@ -349,7 +349,7 @@
|
|
|
</div>
|
|
|
<div :class="{'setCli':!noMenuItem}" v-if="cliCC" :style="{ left: xz + 'px', top: yz -100 + 'px' }">
|
|
|
<template v-for="(item, index) in filterMouseCli()" :key="index">
|
|
|
- <p @click="chooseSet(item, index, 1)" v-if="!noMenuItem" class="chooseSet" style="cursor: pointer;">
|
|
|
+ <p @click="chooseSet(item, index, 1)" :class="{'hasLine':item.name == '删除'||item.name == '重命名' ||item.name == '文字识别','btmLine':item.name == '收藏'}" v-if="!noMenuItem" class="chooseSet" style="cursor: pointer;">
|
|
|
<img :src="item.img" alt="">
|
|
|
{{ item.name }}
|
|
|
<span v-if="item.name == '协作' ? true : false"
|
|
|
@@ -495,7 +495,7 @@ import SpaceBig from './modalComponebts/SpaceBig.vue'
|
|
|
// import PalaceGridFile from './components/PalaceGridFile.vue'
|
|
|
import PlaceGridFolder from '@/views/myfile/components/PlaceGridFolder.vue'
|
|
|
import PalaceGridFile from '@/views/myfile/components/PalaceGridFile.vue'
|
|
|
-import ImgFile from "./jsComponents/ImgFile"
|
|
|
+import ImgFile from "@/views/myfile/jsComponents/ImgFile"
|
|
|
import LeftList from "@/components/LeftList/LeftList.vue"
|
|
|
import ListShow from "@/components/ListShow/ListShow.vue"
|
|
|
import { Search } from '@element-plus/icons-vue'
|
|
|
@@ -652,7 +652,7 @@ export default {
|
|
|
let mouseCli = ref([
|
|
|
{
|
|
|
img: ImgFile.previewIcon,
|
|
|
- name: "预览"
|
|
|
+ name: "打开"
|
|
|
},
|
|
|
{
|
|
|
img: ImgFile.addolder,
|
|
|
@@ -662,14 +662,6 @@ export default {
|
|
|
img: ImgFile.copy,
|
|
|
name: "复制到...",
|
|
|
},
|
|
|
- // {
|
|
|
- // img: ImgFile.clipboard,
|
|
|
- // name: "粘贴"
|
|
|
- // },
|
|
|
- {
|
|
|
- img: ImgFile.collect,
|
|
|
- name: "收藏"
|
|
|
- },
|
|
|
{
|
|
|
img: ImgFile.downLoad,
|
|
|
name: "下载"
|
|
|
@@ -678,17 +670,13 @@ export default {
|
|
|
img: ImgFile.textbox,
|
|
|
name: "重命名"
|
|
|
},
|
|
|
- // {
|
|
|
- // img: ImgFile.goon,
|
|
|
- // name: "发送"
|
|
|
- // },
|
|
|
{
|
|
|
img: ImgFile.share,
|
|
|
name: "分享"
|
|
|
},
|
|
|
{
|
|
|
- img: ImgFile.notePencil,
|
|
|
- name: "在线编辑"
|
|
|
+ img: ImgFile.collect,
|
|
|
+ name: "收藏"
|
|
|
},
|
|
|
{
|
|
|
img: ImgFile.icc,
|
|
|
@@ -1026,6 +1014,14 @@ export default {
|
|
|
e.stopPropagation();
|
|
|
xz.value = e.pageX
|
|
|
yz.value = e.pageY
|
|
|
+ if ((window.innerHeight - e.clientY)<300) {
|
|
|
+ yz.value = e.pageY - 100
|
|
|
+ }
|
|
|
+ //如果带有(重命名)-前缀 只允许进行重命名操作
|
|
|
+ const regExp = /^\(重命名\)-/
|
|
|
+ if(regExp.test(clickRow.value.fileName)){
|
|
|
+ yz.value = e.pageY + 100
|
|
|
+ }
|
|
|
copyRow.value = row
|
|
|
clickRowId.value = row.docId
|
|
|
copyDirId.value = row.dirId
|
|
|
@@ -1185,17 +1181,38 @@ export default {
|
|
|
}
|
|
|
})
|
|
|
}
|
|
|
- if (row.name === '预览') {
|
|
|
+ if (row.name === '打开') {
|
|
|
loadingPreview.value = true
|
|
|
const filePreview = canPreviewFile(copyFileType.value)
|
|
|
+ const canEditArr = ['.doc', '.docm', '.docx', '.dot', '.dotm', '.dotx', '.txt', '.djvu', '.xps', '.csv', '.fods', '.ods', '.ots', '.xls', '.xlsm', '.xlsx', '.xlt', '.xltm', '.xltx', '.fodp', '.odp', '.otp', '.doc', '.docm', '.docx', '.dot', '.dotm', '.dotx', '.epub', '.fodt', '.htm', '.html', '.mht', '.odt', '.ott', '.rtf', '.txt', '.djvu', '.xps', '.wps','.dps','.et', '.pptx','.pdf','.PDF']
|
|
|
if (filePreview) {
|
|
|
- loadingPreview.value = false
|
|
|
- if(thisFolderRole.value &&thisFolderRole.value.roles&& thisFolderRole.value.roles.l0800){
|
|
|
- addFileTab(clickRow.value, 0,1);
|
|
|
- }else{
|
|
|
- addFileTab(clickRow.value, 0,0);
|
|
|
+ // 文件
|
|
|
+ getInfo(clickRow.value.docId).then((res)=>{
|
|
|
+ // console.log('res',res);
|
|
|
+ clickRow.value = res.data
|
|
|
+ if(clickRow.value.isFiled === "Y" || !canEditArr.includes(copyFileType.value) ){
|
|
|
+ //归档了或者不允许编辑的格式 就是预览
|
|
|
+ if(thisFolderRole.value &&thisFolderRole.value.roles&& thisFolderRole.value.roles.l0800){
|
|
|
+ addFileTab(clickRow.value, 0,1);
|
|
|
+ }else{
|
|
|
+ addFileTab(clickRow.value, 0,0);
|
|
|
+ }
|
|
|
+ }else{ // 编辑
|
|
|
+ //--------------------------
|
|
|
+ loadingPreview.value = false
|
|
|
+ if(thisFolderRole.value &&thisFolderRole.value.roles&& thisFolderRole.value.roles.l0800){
|
|
|
+ addFileTab(clickRow.value, 1,1);
|
|
|
+ }else{
|
|
|
+ addFileTab(clickRow.value, 1,0);
|
|
|
+ }
|
|
|
+ cliCC.value = false
|
|
|
+ loadingPreview.value = false
|
|
|
+ //---------------------------
|
|
|
}
|
|
|
+ })
|
|
|
+
|
|
|
onlyView.value = true
|
|
|
+ // editOnline.value = false
|
|
|
cliCC.value = false
|
|
|
} else {
|
|
|
const res = await preview(copyRow.value.docId)
|
|
|
@@ -1203,7 +1220,7 @@ export default {
|
|
|
previewData.value = URL.createObjectURL(res)
|
|
|
}
|
|
|
loadingPreview.value = false
|
|
|
- console.log('filePreview', filePreview);
|
|
|
+ // console.log('filePreview', filePreview);
|
|
|
|
|
|
// // console.log('res',res);
|
|
|
// const res = await preview(copyFileId.value)
|
|
|
@@ -1679,12 +1696,17 @@ export default {
|
|
|
//对mouseCli数组进行筛选,实现菜单的区分显示
|
|
|
const filterMouseCli = () => {
|
|
|
const canPreviewArray = ['.doc','.dps','.et','.wps', '.docm', '.docx', '.dot', '.dotm', '.dotx', '.epub', '.fodt', '.htm', '.html', '.mht', '.odt', '.ott', '.pdf', '.rtf', '.txt', '.djvu', '.xps', '.csv', '.fods', '.ods', '.ots', '.xls', '.xlsm', '.xlsx', '.xlt', '.xltm', '.xltx', '.fodp', '.odp', '.otp', '.pot', '.potm', '.potx', '.pps', '.ppsm', '.ppsx', '.ppt', '.pptm', '.pptx']
|
|
|
- const typeArr = ['.png', '.jpg', '.jpeg', '.JPG', '.mp3', '.mp4']
|
|
|
- const imgTypeArr = ['.png', '.jpg', '.jpeg', '.JPG']
|
|
|
- const canEditArr = ['.doc', '.dps','.et','.docm', '.docx', '.dot', '.dotm', '.dotx', '.txt', '.djvu', '.xps', '.csv', '.fods', '.ods', '.ots', '.xls', '.xlsm', '.xlsx', '.xlt', '.xltm', '.xltx', '.fodp', '.odp', '.otp','.doc', '.docm', '.docx', '.dot', '.dotm', '.dotx', '.epub', '.fodt', '.htm', '.html', '.mht', '.odt', '.ott', '.rtf', '.txt', '.djvu', '.xps', '.wps','.pptx']
|
|
|
+ const typeArr = ['.png', '.jpg', '.jpeg', '.JPG','.PNG', '.mp3', '.mp4']
|
|
|
+ const imgTypeArr = ['.png', '.jpg', '.jpeg', '.JPG','.PNG','.webg']
|
|
|
+ const canEditArr = ['.doc', '.dps','.et','.docm', '.docx', '.dot', '.dotm', '.dotx', '.txt', '.djvu', '.xps', '.csv', '.fods', '.ods', '.ots', '.xls', '.xlsm', '.xlsx', '.xlt', '.xltm', '.xltx', '.fodp', '.odp', '.otp','.doc', '.docm', '.docx', '.dot', '.dotm', '.dotx', '.epub', '.fodt', '.htm', '.html', '.mht', '.odt', '.ott', '.rtf', '.txt', '.djvu', '.xps', '.wps','.pptx','.pdf','.PDF']
|
|
|
let arr = []
|
|
|
+ //如果带有(重命名)-前缀 只允许进行重命名操作
|
|
|
+ const regExp = /^\(重命名\)-/
|
|
|
+ if(regExp.test(clickRow.value.fileName)){
|
|
|
+ return arr = mouseCli.value.filter(item => item.name === "重命名")
|
|
|
+ }
|
|
|
if (!(typeArr.includes(copyFileType.value) || canPreviewArray.includes(copyFileType.value))) {
|
|
|
- arr = mouseCli.value.filter(item => item.name !== "预览")
|
|
|
+ arr = mouseCli.value.filter(item => item.name !== "打开")
|
|
|
} else {
|
|
|
arr = toRaw(mouseCli.value)
|
|
|
}
|
|
|
@@ -2892,6 +2914,12 @@ p {
|
|
|
vertical-align: middle;
|
|
|
}
|
|
|
}
|
|
|
+.hasLine{
|
|
|
+ border-top: 1px solid #C1CCE3;
|
|
|
+}
|
|
|
+.btmLine{
|
|
|
+ border-bottom: 1px solid #C1CCE3;
|
|
|
+}
|
|
|
|
|
|
.chooseSet:hover {
|
|
|
width: 140px;
|