commit
356fa00c5a
@ -1123,6 +1123,7 @@ export default {
|
|||||||
selectFileList: [], // 选中的文件
|
selectFileList: [], // 选中的文件
|
||||||
deleteLoading: false, // 删除loading
|
deleteLoading: false, // 删除loading
|
||||||
debounceSearch: null,// 搜索防抖
|
debounceSearch: null,// 搜索防抖
|
||||||
|
debounceGetFileList: null,// 获取文件列表防抖
|
||||||
searchDialogVisible: false
|
searchDialogVisible: false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -1204,19 +1205,22 @@ export default {
|
|||||||
this.debounceSearch = _.debounce((key, onLoad) => {
|
this.debounceSearch = _.debounce((key, onLoad) => {
|
||||||
this.searchFile(key, onLoad)
|
this.searchFile(key, onLoad)
|
||||||
}, 200)
|
}, 200)
|
||||||
|
this.debounceGetFileList = _.debounce((onLoad) => {
|
||||||
|
this.getFileList(onLoad)
|
||||||
|
}, 200)
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
$route(to) {
|
$route(to) {
|
||||||
if (to.query.tagId && this.queryCondition.tagId !== this.$route.query.tagId) {
|
if (to.query.tagId && this.queryCondition.tagId !== this.$route.query.tagId) {
|
||||||
this.queryCondition.tagId = this.$route.query.tagId
|
this.queryCondition.tagId = this.$route.query.tagId
|
||||||
this.pathList = [{ folder: "" }]
|
this.pathList = [{ folder: "" }]
|
||||||
this.getFileList()
|
this.getFileListEnter()
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
message(msg) {
|
message(msg) {
|
||||||
switch (msg.event) {
|
switch (msg.event) {
|
||||||
case 'msg/file/operation/fault':
|
case 'msg/file/operation/fault':
|
||||||
this.getFileList()
|
this.getFileListEnter()
|
||||||
break
|
break
|
||||||
case 'fileSuccess':
|
case 'fileSuccess':
|
||||||
this.setOnCreateFilename(msg.data)
|
this.setOnCreateFilename(msg.data)
|
||||||
@ -1317,7 +1321,7 @@ export default {
|
|||||||
|
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
if (!this.getFileListed) {
|
if (!this.getFileListed) {
|
||||||
this.getFileList()
|
this.getFileListEnter()
|
||||||
}
|
}
|
||||||
}, 50)
|
}, 50)
|
||||||
},
|
},
|
||||||
@ -1480,7 +1484,7 @@ export default {
|
|||||||
}
|
}
|
||||||
if ('deleteFile' === url) {
|
if ('deleteFile' === url) {
|
||||||
if (index > -1) {
|
if (index > -1) {
|
||||||
this.getFileList()
|
this.getFileListEnter()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if ('createFile' === url) {
|
if ('createFile' === url) {
|
||||||
@ -1498,18 +1502,18 @@ export default {
|
|||||||
let path = fileDoc.$set.path
|
let path = fileDoc.$set.path
|
||||||
path = path.replace(/\\/g, '/')
|
path = path.replace(/\\/g, '/')
|
||||||
if (this.path + '/' === path) {
|
if (this.path + '/' === path) {
|
||||||
this.getFileList()
|
this.getFileListEnter()
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (this.path + '/' === fileDoc.path) {
|
if (this.path + '/' === fileDoc.path) {
|
||||||
this.getFileList()
|
this.getFileListEnter()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
this.clearOnCreateFilename()
|
this.clearOnCreateFilename()
|
||||||
}
|
}
|
||||||
if (this.$route.path === '/trash' && msg.url === 'operationTips') {
|
if (this.$route.path === '/trash' && msg.url === 'operationTips') {
|
||||||
this.getFileList()
|
this.getFileListEnter()
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
// 延时清空onCreateFilename
|
// 延时清空onCreateFilename
|
||||||
@ -1554,7 +1558,7 @@ export default {
|
|||||||
if (this.$route.query.tagId) {
|
if (this.$route.query.tagId) {
|
||||||
this.queryCondition.tagId = this.$route.query.tagId
|
this.queryCondition.tagId = this.$route.query.tagId
|
||||||
}
|
}
|
||||||
this.getFileList()
|
this.getFileListEnter()
|
||||||
}
|
}
|
||||||
// 使列表可拖拽
|
// 使列表可拖拽
|
||||||
this.rowDrop()
|
this.rowDrop()
|
||||||
@ -2375,7 +2379,7 @@ export default {
|
|||||||
}
|
}
|
||||||
if (!unRefresh) {
|
if (!unRefresh) {
|
||||||
this.pagination.pageIndex = 1
|
this.pagination.pageIndex = 1
|
||||||
this.getFileList()
|
this.getFileListEnter()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -2510,7 +2514,7 @@ export default {
|
|||||||
type: 'success',
|
type: 'success',
|
||||||
duration: 1000,
|
duration: 1000,
|
||||||
})
|
})
|
||||||
this.getFileList()
|
this.getFileListEnter()
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.catch(() => {
|
.catch(() => {
|
||||||
@ -2768,6 +2772,9 @@ export default {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
getFileListEnter(onLoad) {
|
||||||
|
this.debounceGetFileList(onLoad)
|
||||||
|
},
|
||||||
searchFileEnter(key, onLoad) {
|
searchFileEnter(key, onLoad) {
|
||||||
this.debounceSearch(key, onLoad)
|
this.debounceSearch(key, onLoad)
|
||||||
},
|
},
|
||||||
@ -2905,8 +2912,7 @@ export default {
|
|||||||
this.searchFileName = ''
|
this.searchFileName = ''
|
||||||
this.getFileListed = true
|
this.getFileListed = true
|
||||||
this.beforeLoadData(onLoad)
|
this.beforeLoadData(onLoad)
|
||||||
api
|
api.fileList({
|
||||||
.fileList({
|
|
||||||
userId: this.$store.state.user.userId,
|
userId: this.$store.state.user.userId,
|
||||||
username: this.$store.state.user.name,
|
username: this.$store.state.user.name,
|
||||||
currentDirectory: this.getQueryPath(),
|
currentDirectory: this.getQueryPath(),
|
||||||
@ -2958,7 +2964,7 @@ export default {
|
|||||||
this.searchFile(this.searchFileName, true)
|
this.searchFile(this.searchFileName, true)
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
this.getFileList(true)
|
this.getFileListEnter(true)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -3015,7 +3021,7 @@ export default {
|
|||||||
if (this.listModeSearch) {
|
if (this.listModeSearch) {
|
||||||
this.searchFile(this.searchFileName)
|
this.searchFile(this.searchFileName)
|
||||||
} else {
|
} else {
|
||||||
this.getFileList()
|
this.getFileListEnter()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -3284,7 +3290,7 @@ export default {
|
|||||||
setOnCreateFilename(newFileName) {
|
setOnCreateFilename(newFileName) {
|
||||||
if (this.$route.query.folder) {
|
if (this.$route.query.folder) {
|
||||||
this.onCreateFilename = newFileName
|
this.onCreateFilename = newFileName
|
||||||
this.getFileList()
|
this.getFileListEnter()
|
||||||
this.clearOnCreateFilename()
|
this.clearOnCreateFilename()
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -3469,7 +3475,7 @@ export default {
|
|||||||
} else {
|
} else {
|
||||||
localStorage.setItem('showFolderSize', '1')
|
localStorage.setItem('showFolderSize', '1')
|
||||||
}
|
}
|
||||||
this.getFileList()
|
this.getFileListEnter()
|
||||||
break
|
break
|
||||||
case 'orderName':
|
case 'orderName':
|
||||||
this.sortChangeOfMenu('name', 2)
|
this.sortChangeOfMenu('name', 2)
|
||||||
@ -3481,7 +3487,7 @@ export default {
|
|||||||
this.sortChangeOfMenu('updateDate', 6)
|
this.sortChangeOfMenu('updateDate', 6)
|
||||||
break
|
break
|
||||||
case 'refresh':
|
case 'refresh':
|
||||||
this.getFileList()
|
this.getFileListEnter()
|
||||||
break
|
break
|
||||||
case 'createTextFile':
|
case 'createTextFile':
|
||||||
this.newCreateFileDialogTitle = '新建文本文件'
|
this.newCreateFileDialogTitle = '新建文本文件'
|
||||||
@ -3826,7 +3832,7 @@ export default {
|
|||||||
}
|
}
|
||||||
if (operating === 'move') {
|
if (operating === 'move') {
|
||||||
// 移除列表
|
// 移除列表
|
||||||
this.getFileList()
|
this.getFileListEnter()
|
||||||
}
|
}
|
||||||
setTimeout(function() {
|
setTimeout(function() {
|
||||||
copying.close()
|
copying.close()
|
||||||
@ -3925,7 +3931,7 @@ export default {
|
|||||||
this.tagDialogVisible = true
|
this.tagDialogVisible = true
|
||||||
},
|
},
|
||||||
allocateTagSuccess() {
|
allocateTagSuccess() {
|
||||||
this.getFileList()
|
this.getFileListEnter()
|
||||||
},
|
},
|
||||||
share(row) {
|
share(row) {
|
||||||
if (!row || !row.id) {
|
if (!row || !row.id) {
|
||||||
@ -4043,7 +4049,7 @@ export default {
|
|||||||
this.deleteConfirmVisible = false
|
this.deleteConfirmVisible = false
|
||||||
// 刷新列表
|
// 刷新列表
|
||||||
if (this.$route.query.folder) {
|
if (this.$route.query.folder) {
|
||||||
this.getFileList()
|
this.getFileListEnter()
|
||||||
}
|
}
|
||||||
}).catch(() => {
|
}).catch(() => {
|
||||||
this.deleteLoading = false
|
this.deleteLoading = false
|
||||||
@ -4187,7 +4193,7 @@ export default {
|
|||||||
decompressing.close()
|
decompressing.close()
|
||||||
that.openCompressionVisible = false
|
that.openCompressionVisible = false
|
||||||
if (file.id === destFileId) {
|
if (file.id === destFileId) {
|
||||||
that.getFileList()
|
that.getFileListEnter()
|
||||||
}
|
}
|
||||||
if (destFileId && file.id !== destFileId && !tempDir) {
|
if (destFileId && file.id !== destFileId && !tempDir) {
|
||||||
that.dialogMoveOrCopyVisible = false
|
that.dialogMoveOrCopyVisible = false
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user