Browse Source

顶部路径显示,可编辑文件筛选

liuQiang 2 years ago
parent
commit
5d5015f9d7
1 changed files with 21 additions and 9 deletions
  1. 21 9
      src/views/myfile/MyFile.vue

+ 21 - 9
src/views/myfile/MyFile.vue

@@ -115,8 +115,9 @@
                                 <img style="display:block;width: 16px;height: 16px;" :src="grayRight" alt="">
                             </div>
                             <!-- 面包屑 -->
-                            <div>
-                                <BreadMenu></BreadMenu>
+                            <div class="topPath">
+                                {{topPath}}
+                                <!-- <BreadMenu></BreadMenu> -->
                             </div>
                         </div>
                         <!-- 右侧 -->
@@ -627,6 +628,7 @@ export default {
         const fileCheckout = ref(false)//是否有勾选
         const haveCheck = ref(false)//是否有勾选
         const onlyView = ref(false) //预览
+        const topPath = ref()//顶部路径
         function getAllCollect() {
             collect.getCollect({}).then(res => {
                 const maxAge = res.rows.reduce((max, obj) => (obj.orderNum > max ? obj.orderNum : max), res.rows[0].orderNum)
@@ -648,6 +650,8 @@ export default {
                 impSpaceId.value = userMe[0].spaceId//固定
                 newSpaceId.value = userMe[0].spaceId//变化
                 newDirId.value = userMe[0].dirId//变化
+                topPath.value = userMe[0].dirPath
+                // console.log('topPath',topPath.value);
                 documents.getALLdocument({ parentId: userMe[0].dirId - 0, spaceId: userMe[0].spaceId }).then(res => {
                     fileMenu.value = res.data
                     folderList.value = res.data
@@ -1011,7 +1015,9 @@ export default {
             // 上一级dirId就是下一级的parentId
             // 判断是点击打开还是右键菜单打开
             row = row ? row : thisFolder.value
-            console.log('row', row);
+            // console.log('row', toRaw(row));
+            topPath.value = row.dirPath
+            // console.log('topPath',toRaw(topPath.value));
             newDirId.value = row.dirId
             newSpaceId.value = row.spaceId
             documents.getALLdocument({ parentId: row.dirId - 0, spaceId: row.spaceId - 0 }).then(res => {
@@ -1146,16 +1152,17 @@ export default {
 
         //对mouseCli数组进行筛选,实现菜单的区分显示
         const filterMouseCli = ()=>{
-            const array = ['.doc', '.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','.pdf']
+            const canPreviewArray = ['.doc', '.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', '.docm', '.docx', '.dot', '.dotm', '.dotx', '.txt', '.djvu', '.xps','csv', 'fods', 'ods', 'ots', 'xls', 'xlsm', 'xlsx', 'xlt', 'xltm', 'xltx','fodp', 'odp', 'otp']
             let arr = []
-            if (!(typeArr.includes(copyFileType.value) || array.includes(copyFileType.value)) ) {
+            if (!(typeArr.includes(copyFileType.value) || canPreviewArray.includes(copyFileType.value)) ) {
                 arr = mouseCli.value.filter(item => item.name !== "预览")
             } else {
                 arr = toRaw(mouseCli.value)
             }
-            if(!array.includes(copyFileType.value)){
+            if(!canEditArr.includes(copyFileType.value)){
                 arr = arr.filter(item => item.name !== "在线编辑" && item.name !== "协作" && item.name !== "历史版本")
             }
             if (!imgTypeArr.includes(copyFileType.value)) {
@@ -1330,7 +1337,8 @@ export default {
             folderCheckout,
             fileCheckout,
             haveCheck,
-            onlyView
+            onlyView,
+            topPath
         }
 
     },
@@ -1481,7 +1489,11 @@ p {
     display: flex;
     justify-content: space-between;
     align-items: center;
-    background-color: #D9E0F0;
+    background-color: #F6F7F9;
+    .topPath{
+        color: #6F85B5;
+        font-size: 12px;
+    }
 }
 
 :deep(.el-collapse-item__header) {