mirror of
https://github.com/VueFileManager/vuefilemanager.git
synced 2026-04-19 08:32:14 +00:00
vuex refactoring
This commit is contained in:
@@ -160,7 +160,7 @@
|
||||
},
|
||||
ItemDetail() {
|
||||
// Dispatch load file info detail
|
||||
this.$store.dispatch('loadFileInfoDetail', this.item)
|
||||
this.$store.commit('GET_FILEINFO_DETAIL', this.item)
|
||||
|
||||
// Show panel if is not open
|
||||
this.$store.dispatch('fileInfoToggle', true)
|
||||
|
||||
@@ -84,7 +84,7 @@
|
||||
'currentFolder',
|
||||
'browseHistory',
|
||||
'homeDirectory',
|
||||
'preview_type',
|
||||
'FilePreviewType',
|
||||
]),
|
||||
directoryName() {
|
||||
return this.currentFolder ? this.currentFolder.name : this.homeDirectory.name
|
||||
@@ -95,7 +95,7 @@
|
||||
return this.browseHistory[length] ? this.browseHistory[length] : this.homeDirectory
|
||||
},
|
||||
preview() {
|
||||
return this.preview_type === 'list' ? 'th' : 'th-list'
|
||||
return this.FilePreviewType === 'list' ? 'th' : 'th-list'
|
||||
},
|
||||
isTrash() {
|
||||
return this.currentFolder.location === 'trash' || this.currentFolder.location === 'trash-root'
|
||||
@@ -122,7 +122,7 @@
|
||||
if ( this.$isThisLocation('public') ) {
|
||||
this.$store.dispatch('browseShared', [this.previousFolder, true])
|
||||
} else {
|
||||
this.$store.dispatch('goToFolder', [this.previousFolder, true])
|
||||
this.$store.dispatch('getFolder', [this.previousFolder, true])
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
name="file"
|
||||
tag="section"
|
||||
class="file-list"
|
||||
:class="preview_type"
|
||||
:class="FilePreviewType"
|
||||
>
|
||||
<FileItemList
|
||||
@dragstart="dragStart(item)"
|
||||
@@ -46,7 +46,7 @@
|
||||
name="file"
|
||||
tag="section"
|
||||
class="file-list"
|
||||
:class="preview_type"
|
||||
:class="FilePreviewType"
|
||||
>
|
||||
<FileItemGrid
|
||||
@dragstart="dragStart(item)"
|
||||
@@ -112,16 +112,16 @@
|
||||
'fileInfoVisible',
|
||||
'fileInfoDetail',
|
||||
'currentFolder',
|
||||
'preview_type',
|
||||
'FilePreviewType',
|
||||
'isSearching',
|
||||
'isLoading',
|
||||
'data'
|
||||
]),
|
||||
isGrid() {
|
||||
return this.preview_type === 'grid'
|
||||
return this.FilePreviewType === 'grid'
|
||||
},
|
||||
isList() {
|
||||
return this.preview_type === 'list'
|
||||
return this.FilePreviewType === 'list'
|
||||
},
|
||||
isEmpty() {
|
||||
return this.data.length == 0
|
||||
|
||||
@@ -80,7 +80,7 @@
|
||||
name: 'FileItem',
|
||||
props: ['data'],
|
||||
computed: {
|
||||
...mapGetters(['preview_type']),
|
||||
...mapGetters(['FilePreviewType']),
|
||||
isFolder() {
|
||||
return this.data.type === 'folder'
|
||||
},
|
||||
@@ -113,7 +113,7 @@
|
||||
methods: {
|
||||
showItemActions() {
|
||||
// Load file info detail
|
||||
this.$store.dispatch('loadFileInfoDetail', this.data)
|
||||
this.$store.commit('GET_FILEINFO_DETAIL', this.data)
|
||||
|
||||
events.$emit('mobileMenu:show')
|
||||
},
|
||||
@@ -139,12 +139,12 @@
|
||||
if ( this.$isThisLocation('public') ) {
|
||||
this.$store.dispatch('browseShared', [this.data, false])
|
||||
} else {
|
||||
this.$store.dispatch('goToFolder', [this.data, false])
|
||||
this.$store.dispatch('getFolder', [this.data, false])
|
||||
}
|
||||
}
|
||||
|
||||
// Load file info detail
|
||||
this.$store.dispatch('loadFileInfoDetail', this.data)
|
||||
this.$store.commit('GET_FILEINFO_DETAIL', this.data)
|
||||
|
||||
// Get target classname
|
||||
let itemClass = e.target.className
|
||||
@@ -173,7 +173,7 @@
|
||||
if ( this.$isThisLocation('public') ) {
|
||||
this.$store.dispatch('browseShared', [this.data, false])
|
||||
} else {
|
||||
this.$store.dispatch('goToFolder', [this.data, false])
|
||||
this.$store.dispatch('getFolder', [this.data, false])
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
@@ -82,7 +82,7 @@
|
||||
name: 'FileItem',
|
||||
props: ['data'],
|
||||
computed: {
|
||||
...mapGetters(['preview_type']),
|
||||
...mapGetters(['FilePreviewType']),
|
||||
isFolder() {
|
||||
return this.data.type === 'folder'
|
||||
},
|
||||
@@ -126,7 +126,7 @@
|
||||
methods: {
|
||||
showItemActions() {
|
||||
// Load file info detail
|
||||
this.$store.dispatch('loadFileInfoDetail', this.data)
|
||||
this.$store.commit('GET_FILEINFO_DETAIL', this.data)
|
||||
|
||||
//this.isClicked = true
|
||||
|
||||
@@ -154,12 +154,12 @@
|
||||
if ( this.$isThisLocation('public') ) {
|
||||
this.$store.dispatch('browseShared', [this.data, false])
|
||||
} else {
|
||||
this.$store.dispatch('goToFolder', [this.data, false])
|
||||
this.$store.dispatch('getFolder', [this.data, false])
|
||||
}
|
||||
}
|
||||
|
||||
// Load file info detail
|
||||
this.$store.dispatch('loadFileInfoDetail', this.data)
|
||||
this.$store.commit('GET_FILEINFO_DETAIL', this.data)
|
||||
|
||||
// Get target classname
|
||||
let itemClass = e.target.className
|
||||
@@ -188,7 +188,7 @@
|
||||
if ( this.$isThisLocation('public') ) {
|
||||
this.$store.dispatch('browseShared', [this.data, false])
|
||||
} else {
|
||||
this.$store.dispatch('goToFolder', [this.data, false])
|
||||
this.$store.dispatch('getFolder', [this.data, false])
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
@@ -52,12 +52,12 @@
|
||||
UploadProgress,
|
||||
},
|
||||
computed: {
|
||||
...mapGetters(['preview_type']),
|
||||
...mapGetters(['FilePreviewType']),
|
||||
previewIcon() {
|
||||
return this.preview_type === 'list' ? 'th' : 'th-list'
|
||||
return this.FilePreviewType === 'list' ? 'th' : 'th-list'
|
||||
},
|
||||
previewText() {
|
||||
return this.preview_type === 'list' ? this.$t('preview_type.grid') : this.$t('preview_type.list')
|
||||
return this.FilePreviewType === 'list' ? this.$t('preview_type.grid') : this.$t('preview_type.list')
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
|
||||
@@ -39,11 +39,11 @@
|
||||
computed: {
|
||||
...mapGetters([
|
||||
'fileInfoVisible',
|
||||
'FilePreviewType',
|
||||
'fileInfoDetail',
|
||||
'currentFolder',
|
||||
'browseHistory',
|
||||
'homeDirectory',
|
||||
'preview_type',
|
||||
'appSize',
|
||||
]),
|
||||
directoryName() {
|
||||
@@ -78,7 +78,7 @@
|
||||
if ( this.$isThisLocation('public') ) {
|
||||
this.$store.dispatch('browseShared', [this.previousFolder, false])
|
||||
} else {
|
||||
this.$store.dispatch('goToFolder', [this.previousFolder, false])
|
||||
this.$store.dispatch('getFolder', [this.previousFolder, false])
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
@@ -54,7 +54,7 @@
|
||||
if ( this.$isThisLocation('public') ) {
|
||||
this.$store.dispatch('browseShared', [this.currentFolder, true])
|
||||
} else {
|
||||
this.$store.dispatch('goToFolder', [this.currentFolder, true])
|
||||
this.$store.dispatch('getFolder', [this.currentFolder, true])
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -121,12 +121,12 @@
|
||||
},
|
||||
goHome() {
|
||||
this.$store.commit('FLUSH_BROWSER_HISTORY')
|
||||
this.$store.dispatch('goToFolder', [this.homeDirectory, true])
|
||||
this.$store.dispatch('getFolder', [this.homeDirectory, true])
|
||||
},
|
||||
openFolder(folder) {
|
||||
|
||||
// Go to folder
|
||||
this.$store.dispatch('goToFolder', [folder, false])
|
||||
this.$store.dispatch('getFolder', [folder, false])
|
||||
},
|
||||
downloadFile(file) {
|
||||
|
||||
@@ -134,7 +134,7 @@
|
||||
},
|
||||
showFileDetail(file) {
|
||||
// Dispatch load file info detail
|
||||
this.$store.dispatch('getLatestUploadDetail', file)
|
||||
this.$store.dispatch('getFileDetail', file)
|
||||
|
||||
// Show panel if is not open
|
||||
this.$store.dispatch('fileInfoToggle', true)
|
||||
|
||||
Reference in New Issue
Block a user