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