This commit is contained in:
2021-04-07 15:01:51 +00:00
parent 7d922ff0a1
commit e412d32e90

View File

@@ -22,6 +22,12 @@
</v-list-item-icon>
<v-list-item-title>{{ $ay.t("New") }}</v-list-item-title>
</v-list-item>
<v-list-item v-if="canDelete" @click="deleteItem">
<v-list-item-icon>
<v-icon>$ayiTrashAlt</v-icon>
</v-list-item-icon>
<v-list-item-title>{{ $ay.t("Delete") }}</v-list-item-title>
</v-list-item>
</v-list>
</v-menu>
</v-col>
@@ -35,6 +41,7 @@
<v-data-table
:headers="headerList"
:items="itemList"
v-model="selectedRow"
class="elevation-1"
disable-pagination
disable-filtering
@@ -43,6 +50,7 @@
data-cy="scheduledUsersTable"
dense
:item-class="itemRowClasses"
item-key="id"
@click:row="selectItem"
>
<!-- <template v-slot:[`item.actions`]="{ item }">
@@ -53,10 +61,10 @@
</v-btn>
</template> -->
</v-data-table>
{{ selectedRow }}
</v-col>
</template>
<template v-if="pvm.hasSelectedScheduledUserItem">
[DELETE BUTTON HERE]
<v-col cols="12" sm="6" lg="4" xl="3">
<gz-decimal
v-model="
@@ -107,7 +115,7 @@
export default {
data() {
return {};
return { selectedRow: [] };
},
props: {
@@ -125,7 +133,12 @@ export default {
newItem() {
console.log("STUB: NEW ITEM");
},
selectItem: function(item) {
deleteItem() {
console.log("STUB: DELETE ITEM");
},
selectItem: function(item, row) {
this.selectedRow = [item];
// row.select(true);
this.pvm.selectedScheduledUserItemIndex = item.index;
},
form() {
@@ -256,6 +269,14 @@ IN ORDER: start, stop, quantity, user, rate
this.pvm.rights.change &&
this.pvm.subRights.scheduledUsers.create
);
},
canDelete: function() {
return (
this.pvm.hasSelectedScheduledUserItem &&
!this.value.isLockedAtServer &&
this.pvm.rights.change &&
this.pvm.subRights.scheduledUsers.delete
);
}
}
};