This commit is contained in:
2021-06-30 22:30:46 +00:00
parent bca6dbce38
commit 7e3a964c05
4 changed files with 38 additions and 9 deletions

View File

@@ -29,6 +29,14 @@
</v-list-item-icon>
<v-list-item-title>{{ $ay.t("SoftDelete") }}</v-list-item-title>
</v-list-item>
<v-list-item v-if="canDelete && !isDeleted" @click="deleteAllItem">
<v-list-item-icon>
<v-icon>$ayiTrashAlt</v-icon>
</v-list-item-icon>
<v-list-item-title>{{
$ay.t("SoftDeleteAll")
}}</v-list-item-title>
</v-list-item>
<v-list-item v-if="canDelete && isDeleted" @click="unDeleteItem">
<v-list-item-icon>
<v-icon>$ayiTrashRestoreAlt</v-icon>
@@ -898,6 +906,16 @@ export default {
this.setDefaultView();
this.$emit("change");
},
deleteAllItem() {
this.value.items.forEach(z => (z.deleted = true));
// //CHILDREN
// this.value.items[this.activeItemIndex].scheduledUsers.forEach(
// z => (z.deleted = true)
// );
//todo: other grandchildren
this.setDefaultView();
this.$emit("change");
},
setDefaultView: function() {
//if only one record left then display it otherwise just let the datatable show what the user can click on
if (this.value && this.value.items && this.value.items.length == 1) {