Optimize the list of file mounts used for queries on mobile
This commit is contained in:
parent
862cb2d0ba
commit
2a320c1f48
@ -428,7 +428,9 @@ export default {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
if (this.$route.query.folder && this.path) {
|
||||||
|
localStorage.setItem(this.path, this.$route.query.folder)
|
||||||
|
}
|
||||||
if (window.history && window.history.pushState) {
|
if (window.history && window.history.pushState) {
|
||||||
history.pushState(null, null, document.URL)
|
history.pushState(null, null, document.URL)
|
||||||
window.addEventListener('popstate', this.goBack, false)
|
window.addEventListener('popstate', this.goBack, false)
|
||||||
@ -809,7 +811,7 @@ export default {
|
|||||||
if (!this.path) {
|
if (!this.path) {
|
||||||
this.path = ''
|
this.path = ''
|
||||||
}
|
}
|
||||||
this.$router.push(`?vmode=${this.vmode}&path=${this.path}`)
|
this.$router.push(`?vmode=${this.vmode}&path=${this.path}${this.$route.query.folder ? '&folder='+this.$route.query.folder : ''}`)
|
||||||
},
|
},
|
||||||
showSortSheet() {
|
showSortSheet() {
|
||||||
this.actionSortSheetShow = true
|
this.actionSortSheetShow = true
|
||||||
@ -850,11 +852,12 @@ export default {
|
|||||||
this.path += '/' + this.pathList[number].folder
|
this.path += '/' + this.pathList[number].folder
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
let queryFolder = localStorage.getItem(this.path)
|
||||||
if (!unPushLink) {
|
if (!unPushLink) {
|
||||||
if (!this.$route.query.path) {
|
if (!this.$route.query.path) {
|
||||||
this.$router.push(`/_m?vmode=${this.vmode}&path=${encodeURI(this.path)}`)
|
this.$router.push(`/_m?vmode=${this.vmode}&path=${encodeURI(this.path)}${queryFolder ? '&folder='+queryFolder : ''}`)
|
||||||
} else {
|
} else {
|
||||||
this.$router.push(`/_m?vmode=${this.vmode}&path=${encodeURI(this.path)}`)
|
this.$router.push(`/_m?vmode=${this.vmode}&path=${encodeURI(this.path)}${queryFolder ? '&folder='+queryFolder : ''}`)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!unRefresh) {
|
if (!unRefresh) {
|
||||||
@ -881,12 +884,12 @@ export default {
|
|||||||
this.getFileList();
|
this.getFileList();
|
||||||
},
|
},
|
||||||
getFileList(onLoad) {
|
getFileList(onLoad) {
|
||||||
console.log("getFileList", onLoad)
|
|
||||||
this.beforeLoadData(onLoad)
|
this.beforeLoadData(onLoad)
|
||||||
api.fileList({
|
api.fileList({
|
||||||
username: this.$store.state.user.name,
|
username: this.$store.state.user.name,
|
||||||
userId: this.$store.state.user.userId,
|
userId: this.$store.state.user.userId,
|
||||||
currentDirectory: encodeURI(this.$route.query.path),
|
currentDirectory: encodeURI(this.$route.query.path),
|
||||||
|
folder: this.$route.query.folder,
|
||||||
queryFileType: this.queryFileType,
|
queryFileType: this.queryFileType,
|
||||||
sortableProp: this.sortableProp,
|
sortableProp: this.sortableProp,
|
||||||
order: this.order,
|
order: this.order,
|
||||||
@ -1069,7 +1072,14 @@ export default {
|
|||||||
item['folder'] = row.name
|
item['folder'] = row.name
|
||||||
item['index'] = this.pathList.length - 1
|
item['index'] = this.pathList.length - 1
|
||||||
this.pathList.push(item)
|
this.pathList.push(item)
|
||||||
this.$router.push(`/_m?vmode=${this.vmode}&path=${encodeURI(this.path)}`)
|
const path = encodeURI(this.path);
|
||||||
|
if (this.$store.getters.userId !== row.userId) {
|
||||||
|
row.mountFileId = row.id
|
||||||
|
}
|
||||||
|
if (row.mountFileId) {
|
||||||
|
localStorage.setItem(this.path, row.mountFileId)
|
||||||
|
}
|
||||||
|
this.$router.push(`/_m?vmode=${this.vmode}&path=${path}${row.mountFileId ? '&folder='+row.mountFileId : ''}`)
|
||||||
this.getFileList()
|
this.getFileList()
|
||||||
} else {
|
} else {
|
||||||
if (row.contentType.startsWith('image')) {
|
if (row.contentType.startsWith('image')) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user