This commit is contained in:
@@ -29,7 +29,7 @@
|
||||
</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 v-if="canDeleteAll" @click="deleteAllItem">
|
||||
<v-list-item-icon>
|
||||
<v-icon>$ayiTrashAlt</v-icon>
|
||||
</v-list-item-icon>
|
||||
@@ -889,30 +889,17 @@ export default {
|
||||
},
|
||||
unDeleteItem() {
|
||||
this.value.items[this.activeItemIndex].deleted = false;
|
||||
//CHILDREN
|
||||
this.value.items[this.activeItemIndex].scheduledUsers.forEach(
|
||||
z => (z.deleted = false)
|
||||
);
|
||||
//todo: other grandchildren
|
||||
|
||||
this.setDefaultView();
|
||||
},
|
||||
deleteItem() {
|
||||
this.value.items[this.activeItemIndex].deleted = true;
|
||||
//CHILDREN
|
||||
this.value.items[this.activeItemIndex].scheduledUsers.forEach(
|
||||
z => (z.deleted = true)
|
||||
);
|
||||
//todo: other grandchildren
|
||||
|
||||
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");
|
||||
},
|
||||
@@ -1122,11 +1109,14 @@ and it's probably not a big list to fill anyway
|
||||
);
|
||||
},
|
||||
canDelete: function() {
|
||||
return this.activeItemIndex != null && this.canDeleteAll;
|
||||
},
|
||||
canDeleteAll: function() {
|
||||
return (
|
||||
this.activeItemIndex != null &&
|
||||
!this.pvm.formState.readOnly &&
|
||||
this.pvm.rights.change &&
|
||||
this.pvm.subRights.items.delete
|
||||
this.pvm.subRights.items.delete &&
|
||||
this.hasData
|
||||
);
|
||||
},
|
||||
canAddUnit: function() {
|
||||
|
||||
Reference in New Issue
Block a user