mirror of
https://github.com/VueFileManager/vuefilemanager.git
synced 2026-05-15 01:35:02 +00:00
bulk-operations v0.1 add selecting to FileItem List and Grid
This commit is contained in:
@@ -3,7 +3,10 @@
|
||||
namespace App\Console;
|
||||
|
||||
use App\Console\Commands\Deploy;
|
||||
//use App\Console\Commands\SetupDevelopmentEnvironment;
|
||||
// use App\Console\Commands\SetupDevelopmentEnvironment;
|
||||
use App\Console\Commands\SetupDevEnvironment;
|
||||
use App\Console\Commands\SetupProductionEnvironment;
|
||||
use App\Console\Commands\UpgradeApp;
|
||||
use App\Share;
|
||||
use Carbon\Carbon;
|
||||
use Illuminate\Console\Scheduling\Schedule;
|
||||
@@ -18,7 +21,7 @@ class Kernel extends ConsoleKernel
|
||||
*/
|
||||
protected $commands = [
|
||||
Deploy::class,
|
||||
//SetupDevelopmentEnvironment::class,
|
||||
// SetupDevelopmentEnvironment::class,
|
||||
];
|
||||
|
||||
/**
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
"/chunks/environment-setup.js": "/chunks/environment-setup.js?id=405847df44edd86e301a",
|
||||
"/chunks/files.js": "/chunks/files.js?id=e0e01c40a7c37f170270",
|
||||
"/chunks/files~chunks/settings-subscription~chunks/shared-files~chunks/shared-page~chunks/trash~chunks~3ea7670b.js": "/chunks/files~chunks/settings-subscription~chunks/shared-files~chunks/shared-page~chunks/trash~chunks~3ea7670b.js?id=6cafd70cb9e5ae25f02a",
|
||||
"/chunks/files~chunks/shared-files~chunks/shared-page~chunks/trash.js": "/chunks/files~chunks/shared-files~chunks/shared-page~chunks/trash.js?id=a02eca42d178d034c7fb",
|
||||
"/chunks/files~chunks/shared-files~chunks/shared-page~chunks/trash.js": "/chunks/files~chunks/shared-files~chunks/shared-page~chunks/trash.js?id=4663bca7e1ed60adb774",
|
||||
"/chunks/forgotten-password.js": "/chunks/forgotten-password.js?id=aba8c662fbc234892216",
|
||||
"/chunks/installation-disclaimer.js": "/chunks/installation-disclaimer.js?id=ecceaa6cdf5768826b36",
|
||||
"/chunks/invoices.js": "/chunks/invoices.js?id=248503ac5967fe8370f9",
|
||||
@@ -178,5 +178,6 @@
|
||||
"/chunks/app-others.e9a41033e7b11fab8d60.hot-update.js": "/chunks/app-others.e9a41033e7b11fab8d60.hot-update.js",
|
||||
"/chunks/files~chunks/shared-files~chunks/shared-page~chunks/trash.e9a41033e7b11fab8d60.hot-update.js": "/chunks/files~chunks/shared-files~chunks/shared-page~chunks/trash.e9a41033e7b11fab8d60.hot-update.js",
|
||||
"/js/main.8e5724e1bf2542aefedb.hot-update.js": "/js/main.8e5724e1bf2542aefedb.hot-update.js",
|
||||
"/chunks/files~chunks/shared-files~chunks/shared-page~chunks/trash.8e5724e1bf2542aefedb.hot-update.js": "/chunks/files~chunks/shared-files~chunks/shared-page~chunks/trash.8e5724e1bf2542aefedb.hot-update.js"
|
||||
"/chunks/files~chunks/shared-files~chunks/shared-page~chunks/trash.8e5724e1bf2542aefedb.hot-update.js": "/chunks/files~chunks/shared-files~chunks/shared-page~chunks/trash.8e5724e1bf2542aefedb.hot-update.js",
|
||||
"/chunks/files~chunks/shared-files~chunks/shared-page~chunks/trash.6e05a68f5ae202d91bc4.hot-update.js": "/chunks/files~chunks/shared-files~chunks/shared-page~chunks/trash.6e05a68f5ae202d91bc4.hot-update.js"
|
||||
}
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
@dragleave="dragLeave"
|
||||
@dragover.prevent="dragEnter"
|
||||
class="file-item"
|
||||
:class="{ 'is-clicked': isClicked, 'is-dragenter': area }"
|
||||
:class="{ 'is-clicked': this.isClicked, 'is-dragenter': area }"
|
||||
>
|
||||
<!--Thumbnail for item-->
|
||||
<div class="icon-item">
|
||||
@@ -93,8 +93,16 @@
|
||||
},
|
||||
computed: {
|
||||
...mapGetters([
|
||||
'FilePreviewType', 'sharedDetail'
|
||||
'FilePreviewType', 'sharedDetail' , 'fileInfoDetail'
|
||||
]),
|
||||
...mapGetters({allData: 'data'}),
|
||||
isClicked() {
|
||||
if(this.fileInfoDetail.some(element => element.unique_id == this.data.unique_id)){
|
||||
return true
|
||||
}else {
|
||||
return false
|
||||
}
|
||||
},
|
||||
isFolder() {
|
||||
return this.data.type === 'folder'
|
||||
},
|
||||
@@ -138,7 +146,6 @@
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
isClicked: false,
|
||||
area: false,
|
||||
itemName: undefined
|
||||
}
|
||||
@@ -160,10 +167,39 @@
|
||||
},
|
||||
clickedItem(e) {
|
||||
events.$emit('contextMenu:hide')
|
||||
events.$emit('fileItem:deselect')
|
||||
|
||||
// Set clicked item
|
||||
this.isClicked = true
|
||||
if(e.ctrlKey && !e.shiftKey) {
|
||||
if(this.fileInfoDetail.some(item => item.unique_id === this.data.unique_id)){
|
||||
this.$store.commit('REMOVE_ITEM_FILEINFO_DETAIL',this.data )
|
||||
}else {
|
||||
console.log(this.data.name)
|
||||
this.$store.commit('GET_FILEINFO_DETAIL', this.data)
|
||||
}
|
||||
}else if (e.shiftKey){
|
||||
let lastItem = this.allData.indexOf(this.fileInfoDetail[this.fileInfoDetail.length -1])
|
||||
let clickedItem = this.allData.indexOf(this.data)
|
||||
|
||||
if(!e.ctrlKey) {
|
||||
this.$store.commit('CLEAR_FILEINFO_DETAIL')
|
||||
}
|
||||
|
||||
if(lastItem < clickedItem) {
|
||||
for(let i=lastItem ; i<=clickedItem; i++ ) {
|
||||
this.$store.commit('GET_FILEINFO_DETAIL', this.allData[i])
|
||||
console.log(this.allData[i].name)
|
||||
}
|
||||
}else {
|
||||
for(let i=clickedItem ; i<=lastItem; i++ ) {
|
||||
this.$store.commit('GET_FILEINFO_DETAIL', this.allData[i])
|
||||
console.log(this.allData[i].name)
|
||||
}
|
||||
}
|
||||
this.fileInfoDetail.forEach(element => console.log(element.id ,element.name))
|
||||
}else {
|
||||
events.$emit('fileItem:deselect')
|
||||
this.$store.commit('CLEAR_FILEINFO_DETAIL')
|
||||
this.$store.commit('GET_FILEINFO_DETAIL', this.data)
|
||||
}
|
||||
|
||||
// Open in mobile version on first click
|
||||
if (this.$isMobile() && this.isFolder) {
|
||||
@@ -182,9 +218,6 @@
|
||||
}
|
||||
}
|
||||
|
||||
// Load file info detail
|
||||
this.$store.commit('GET_FILEINFO_DETAIL', this.data)
|
||||
|
||||
// Get target classname
|
||||
let itemClass = e.target.className
|
||||
|
||||
@@ -227,7 +260,7 @@
|
||||
|
||||
events.$on('fileItem:deselect', () => {
|
||||
// Deselect file
|
||||
this.isClicked = false
|
||||
this.$store.commit('CLEAR_FILEINFO_DETAIL')
|
||||
})
|
||||
|
||||
// Change item name
|
||||
|
||||
@@ -85,14 +85,12 @@ export default {
|
||||
computed: {
|
||||
...mapGetters(['FilePreviewType', 'fileInfoDetail' ]),
|
||||
...mapGetters({allData: 'data'}),
|
||||
isClicked() {
|
||||
// let clicked = false
|
||||
isClicked() {
|
||||
if(this.fileInfoDetail.some(element => element.unique_id == this.data.unique_id)){
|
||||
return true
|
||||
}else {
|
||||
return false
|
||||
}
|
||||
// return clicked
|
||||
}
|
||||
},
|
||||
isFolder() {
|
||||
return this.data.type === 'folder'
|
||||
@@ -140,7 +138,6 @@ export default {
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
// isClicked: false,
|
||||
area: false,
|
||||
itemName: undefined
|
||||
}
|
||||
@@ -192,7 +189,8 @@ export default {
|
||||
this.fileInfoDetail.forEach(element => console.log(element.id ,element.name))
|
||||
}else {
|
||||
events.$emit('fileItem:deselect')
|
||||
this.$store.commit('LOAD_FILEINFO_DETAIL', this.data )
|
||||
this.$store.commit('CLEAR_FILEINFO_DETAIL')
|
||||
this.$store.commit('GET_FILEINFO_DETAIL', this.data)
|
||||
}
|
||||
|
||||
// Open in mobile version on first click
|
||||
@@ -247,7 +245,6 @@ export default {
|
||||
|
||||
events.$on('fileItem:deselect', () => {
|
||||
// Deselect file
|
||||
// this.isClicked = false
|
||||
this.$store.commit('CLEAR_FILEINFO_DETAIL')
|
||||
})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user