|
|
|
@ -706,6 +706,8 @@ export class AllFileComponent {
|
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
isTrueDelete:any = ['基础知识','装备','技战术','消防设施','资料库']; //匹配内置一级目录 是否被选择删除
|
|
|
|
|
// 删除文件
|
|
|
|
|
deleteFiles(){ |
|
|
|
@ -713,17 +715,15 @@ export class AllFileComponent {
|
|
|
|
|
let isDelete = confirm('您确定要删除选中文件吗') |
|
|
|
|
let arr = [] |
|
|
|
|
if (isDelete) { |
|
|
|
|
let notDelete = [] //所有要删除文件 的 一级目录
|
|
|
|
|
let arrList = [] //匹配到 禁止删除的 目录
|
|
|
|
|
this.selection.selected.forEach((element)=>{ |
|
|
|
|
let data = element.key.split("/"); |
|
|
|
|
notDelete.push(data[2]) |
|
|
|
|
this.isTrueDelete.forEach(elements => { |
|
|
|
|
if (elements==data[data.length-2] && data.length-2==2) { |
|
|
|
|
arrList.push('true') |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
}) |
|
|
|
|
this.isTrueDelete.forEach(element => { |
|
|
|
|
notDelete.forEach(elements=>{ |
|
|
|
|
if (element==elements) { arrList.push('true') } |
|
|
|
|
}) |
|
|
|
|
}); |
|
|
|
|
if (arrList.length) { |
|
|
|
|
const config = new MatSnackBarConfig(); |
|
|
|
|
config.verticalPosition = 'top'; |
|
|
|
@ -774,9 +774,8 @@ export class AllFileComponent {
|
|
|
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
} // if arrList
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|