perf: 可搜索挂载文件夹内的文件
This commit is contained in:
parent
f6aadecca2
commit
9fc67f6eb0
@ -2222,7 +2222,7 @@ export default {
|
|||||||
event: 'openUploader',
|
event: 'openUploader',
|
||||||
data: {
|
data: {
|
||||||
// 传入的参数
|
// 传入的参数
|
||||||
folder: this.$route.query.folder,
|
folder: this.$route.query.searchOpenFolder || this.$route.query.folder,
|
||||||
currentDirectory: this.getQueryPath(),
|
currentDirectory: this.getQueryPath(),
|
||||||
username: this.$store.state.user.name,
|
username: this.$store.state.user.name,
|
||||||
userId: this.$store.state.user.userId,
|
userId: this.$store.state.user.userId,
|
||||||
@ -2235,7 +2235,7 @@ export default {
|
|||||||
event: 'uploadFolder',
|
event: 'uploadFolder',
|
||||||
data: {
|
data: {
|
||||||
// 传入的参数
|
// 传入的参数
|
||||||
folder: this.$route.query.folder,
|
folder: this.$route.query.searchOpenFolder || this.$route.query.folder,
|
||||||
currentDirectory: this.getQueryPath(),
|
currentDirectory: this.getQueryPath(),
|
||||||
username: this.$store.state.user.name,
|
username: this.$store.state.user.name,
|
||||||
userId: this.$store.state.user.userId,
|
userId: this.$store.state.user.userId,
|
||||||
@ -2437,7 +2437,7 @@ export default {
|
|||||||
isFolder: true,
|
isFolder: true,
|
||||||
filename: encodeURI(this.newFolderName),
|
filename: encodeURI(this.newFolderName),
|
||||||
currentDirectory: this.getQueryPath(),
|
currentDirectory: this.getQueryPath(),
|
||||||
folder: this.$route.query.folder,
|
folder: this.$route.query.searchOpenFolder || this.$route.query.folder,
|
||||||
username: this.$store.state.user.name,
|
username: this.$store.state.user.name,
|
||||||
userId: this.$store.state.user.userId,
|
userId: this.$store.state.user.userId,
|
||||||
})
|
})
|
||||||
@ -2459,11 +2459,7 @@ export default {
|
|||||||
type: 'success',
|
type: 'success',
|
||||||
duration: 1000,
|
duration: 1000,
|
||||||
})
|
})
|
||||||
if (this.listModeSearch) {
|
this.getFileList()
|
||||||
this.getFileListBySearchMode()
|
|
||||||
} else {
|
|
||||||
this.getFileList()
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.catch(() => {
|
.catch(() => {
|
||||||
@ -2505,7 +2501,7 @@ export default {
|
|||||||
.addFile({
|
.addFile({
|
||||||
fileName: encodeURI(newFileName),
|
fileName: encodeURI(newFileName),
|
||||||
isFolder: false,
|
isFolder: false,
|
||||||
folder: this.$route.query.folder,
|
folder: this.$route.query.searchOpenFolder || this.$route.query.folder,
|
||||||
username: this.$store.state.user.name,
|
username: this.$store.state.user.name,
|
||||||
parentPath: encodeURI(parentPath),
|
parentPath: encodeURI(parentPath),
|
||||||
})
|
})
|
||||||
@ -2735,7 +2731,6 @@ export default {
|
|||||||
let searchOpenFolder = this.$route.query.searchOpenFolder ? `&searchOpenFolder=${this.$route.query.searchOpenFolder}` : ''
|
let searchOpenFolder = this.$route.query.searchOpenFolder ? `&searchOpenFolder=${this.$route.query.searchOpenFolder}` : ''
|
||||||
|
|
||||||
const searchPathIndex = this.pathList.findIndex(item => item.search)
|
const searchPathIndex = this.pathList.findIndex(item => item.search)
|
||||||
console.log('searchPathIndex', searchPathIndex)
|
|
||||||
if (searchPathIndex < 0) {
|
if (searchPathIndex < 0) {
|
||||||
this.pathList.push(item)
|
this.pathList.push(item)
|
||||||
} else {
|
} else {
|
||||||
@ -2876,22 +2871,6 @@ export default {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
getFileListBySearchMode(onLoad) {
|
|
||||||
this.beforeLoadData(onLoad)
|
|
||||||
api
|
|
||||||
.fileList({
|
|
||||||
userId: this.$store.state.user.userId,
|
|
||||||
username: this.$store.state.user.name,
|
|
||||||
currentDirectory: this.getQueryPath(),
|
|
||||||
folder: this.$route.query.folder,
|
|
||||||
pageIndex: this.pagination.pageIndex,
|
|
||||||
pageSize: this.pagination.pageSize,
|
|
||||||
showFolderSize: localStorage.getItem('showFolderSize'),
|
|
||||||
})
|
|
||||||
.then(res => {
|
|
||||||
this.loadData(res, onLoad)
|
|
||||||
})
|
|
||||||
},
|
|
||||||
getQueryPath() {
|
getQueryPath() {
|
||||||
// 去掉this.$route.query.basePath最后的/
|
// 去掉this.$route.query.basePath最后的/
|
||||||
let basePath = this.$route.query.basePath
|
let basePath = this.$route.query.basePath
|
||||||
@ -3290,7 +3269,7 @@ export default {
|
|||||||
.rename({
|
.rename({
|
||||||
newFileName: encodeURI(newFileName),
|
newFileName: encodeURI(newFileName),
|
||||||
username: this.$store.state.user.name,
|
username: this.$store.state.user.name,
|
||||||
folder: this.$route.query.folder,
|
folder: this.$route.query.searchOpenFolder || this.$route.query.folder,
|
||||||
id: row.id,
|
id: row.id,
|
||||||
})
|
})
|
||||||
.then(res => {
|
.then(res => {
|
||||||
@ -3338,7 +3317,6 @@ export default {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
if (row.isFolder && row.mountFileId) {
|
if (row.isFolder && row.mountFileId) {
|
||||||
console.log('this.menus', this.menus)
|
|
||||||
const indicesToDelete = [7, 6, 5, 4, 1]
|
const indicesToDelete = [7, 6, 5, 4, 1]
|
||||||
for (let i of indicesToDelete) {
|
for (let i of indicesToDelete) {
|
||||||
this.menus.splice(i, 1)
|
this.menus.splice(i, 1)
|
||||||
@ -3868,7 +3846,7 @@ export default {
|
|||||||
isFolder: true,
|
isFolder: true,
|
||||||
filename: encodeURI(newFolderName),
|
filename: encodeURI(newFolderName),
|
||||||
currentDirectory: this.getQueryPath(),
|
currentDirectory: this.getQueryPath(),
|
||||||
folder: this.$route.query.folder,
|
folder: this.$route.query.searchOpenFolder || this.$route.query.folder,
|
||||||
username: this.$store.state.user.name,
|
username: this.$store.state.user.name,
|
||||||
userId: this.$store.state.user.userId,
|
userId: this.$store.state.user.userId,
|
||||||
})
|
})
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user