|
|
@@ -5,6 +5,7 @@ import { message } from 'ant-design-vue'
|
|
|
import { fileImgMap, unknownImg, fileSuffixCodeModeMap, markdownFileType } from '@/libs/map.js'
|
|
|
import { officeFileType } from '@/libs/map.js'
|
|
|
import fileOperationPlugins from '@/libs/fileOperationPlugins.js'
|
|
|
+import { useMyResourceStore } from '@/store/myResource'
|
|
|
|
|
|
// 全局函数 - 文件相关
|
|
|
const fileFunction = {
|
|
|
@@ -304,6 +305,7 @@ const fileFunction = {
|
|
|
* @param {array} fileList 文件列表
|
|
|
*/
|
|
|
handleFileNameClick(row, currentIndex, fileList = []) {
|
|
|
+ const myResourceStore = useMyResourceStore()
|
|
|
console.log('查看')
|
|
|
// 如果当前文件在回收站中,则不允许预览
|
|
|
if (row.deleteFlag !== undefined && row.deleteFlag !== 0) {
|
|
|
@@ -313,29 +315,42 @@ const fileFunction = {
|
|
|
if (row.isDir) {
|
|
|
if (router.currentRoute.value.name === 'Share') {
|
|
|
// 当前是查看他人分享列表的页面
|
|
|
- router.push({
|
|
|
- query: {
|
|
|
- filePath: `${row.shareFilePath === '/' ? '' : row.shareFilePath}/${row.fileName}`
|
|
|
- }
|
|
|
+ myResourceStore.changeQuery({
|
|
|
+ filePath: `${row.shareFilePath === '/' ? '' : row.shareFilePath}/${row.fileName}`
|
|
|
})
|
|
|
+ // router.push({
|
|
|
+ // query: {
|
|
|
+ // filePath: `${row.shareFilePath === '/' ? '' : row.shareFilePath}/${row.fileName}`
|
|
|
+ // }
|
|
|
+ // })
|
|
|
} else if (Number(router.currentRoute.value.query.fileType) === 8) {
|
|
|
// 当前是我的已分享列表页面
|
|
|
- router.push({
|
|
|
- query: {
|
|
|
- fileType: 8,
|
|
|
- filePath: `${row.shareFilePath === '/' ? '' : row.shareFilePath}/${row.fileName}`,
|
|
|
- shareBatchNum: row.shareBatchNum
|
|
|
- }
|
|
|
+ myResourceStore.changeQuery({
|
|
|
+ fileType: 8,
|
|
|
+ filePath: `${row.shareFilePath === '/' ? '' : row.shareFilePath}/${row.fileName}`,
|
|
|
+ shareBatchNum: row.shareBatchNum
|
|
|
})
|
|
|
+ // router.push({
|
|
|
+ // query: {
|
|
|
+ // fileType: 8,
|
|
|
+ // filePath: `${row.shareFilePath === '/' ? '' : row.shareFilePath}/${row.fileName}`,
|
|
|
+ // shareBatchNum: row.shareBatchNum
|
|
|
+ // }
|
|
|
+ // })
|
|
|
} else if (Number(router.currentRoute.value.query.fileType) !== 6) {
|
|
|
+ console.log('打开网盘文件夹', row)
|
|
|
// 回收站页面不允许打开文件夹
|
|
|
// 网盘页面
|
|
|
- router.push({
|
|
|
- query: {
|
|
|
- filePath: `${row.filePath === '/' ? '' : row.filePath}/${row.fileName}`,
|
|
|
- fileType: 0
|
|
|
- }
|
|
|
+ myResourceStore.changeQuery({
|
|
|
+ filePath: `${row.filePath === '/' ? '' : row.filePath}/${row.fileName}`,
|
|
|
+ fileType: 0
|
|
|
})
|
|
|
+ // router.push({
|
|
|
+ // query: {
|
|
|
+ // filePath: `${row.filePath === '/' ? '' : row.filePath}/${row.fileName}`,
|
|
|
+ // fileType: 0
|
|
|
+ // }
|
|
|
+ // })
|
|
|
}
|
|
|
}
|
|
|
// 若是文件,则进行相应的预览
|