suppression recusivite des checkbox

This commit is contained in:
Alexandre_BRAVO 2024-12-12 15:11:48 +01:00
parent eb571627dd
commit fcdb749f26
2 changed files with 2 additions and 41 deletions

View File

@ -443,30 +443,17 @@ export default {
this.isDroppable = true;
},
async moveListOfFiles(files) {
let listOfFolder = [];
for (const file of files.children) {
this.transferProgress += 100 / files.children.length;
if (file.isDirectory) {
//just create the folder
await this.createFolder(file, file.parentPath + '/');
let parentPath = file.parentPath;
if(parentPath === ''){
listOfFolder.push(file.name);
}
else{
listOfFolder.push(file.parentPath + '/' + file.name);
}
await this.moveFilesOfFolder(file, file.parentPath + '/');
} else {
if (file.content && typeof file.content.arrayBuffer === 'function') {
file.content = await file.content.arrayBuffer();
}
if (listOfFolder.includes(file.parentPath)) {
await this.moveFileToTarget(file, file.parentPath + '/', file.name);
} else {
await this.moveFileToTarget(file, '');
}
}
}
},
async moveFilesOfFolder(folder, parentPath) {
await this.createFolder(folder, parentPath + '/');

View File

@ -240,18 +240,8 @@ export default {
handleCheckboxChange(file, event) {
if (event.target.checked) {
this.cocheFile(file);
// Si c'est un dossier, cocher récursivement tous les fichiers enfants
if (file.isDirectory && file.children) {
this.cocheFilesRecursively(file.children);
}
} else {
this.decocheFile(file);
// Si c'est un dossier, décocher récursivement tous les fichiers enfants
if (file.isDirectory && file.children) {
this.decocheFilesRecursively(file.children);
}
}
},
getFullPath(file) {
@ -269,22 +259,6 @@ export default {
decocheFile(file) {
this.cochedFiles = this.cochedFiles.filter(f => this.getFullPath(f) !== this.getFullPath(file));
},
cocheFilesRecursively(files) {
files.forEach(file => {
this.cocheFile(file);
if (file.isDirectory && file.children) {
this.cocheFilesRecursively(file.children);
}
});
},
decocheFilesRecursively(files) {
files.forEach(file => {
this.decocheFile(file);
if (file.isDirectory && file.children) {
this.decocheFilesRecursively(file.children);
}
});
},
isChecked(file) {
return this.cochedFiles.some(f => this.getFullPath(f) === this.getFullPath(file));
},