2020-07-10 19:51:36 +02:00
|
|
|
<template>
|
|
|
|
<BaseContextMenu
|
|
|
|
:context-event="contextEvent"
|
2020-08-12 18:11:48 +02:00
|
|
|
@close-context="closeContext"
|
2020-07-10 19:51:36 +02:00
|
|
|
>
|
|
|
|
<div class="context-element" @click="showConfirmModal">
|
2020-08-12 10:48:18 +02:00
|
|
|
<i class="mdi mdi-18px mdi-delete text-light pr-1" /> {{ $tc('message.deleteRows', selectedRows.length) }}
|
2020-07-10 19:51:36 +02:00
|
|
|
</div>
|
|
|
|
|
|
|
|
<ConfirmModal
|
|
|
|
v-if="isConfirmModal"
|
2020-07-30 19:12:29 +02:00
|
|
|
@confirm="deleteRows"
|
2020-07-10 19:51:36 +02:00
|
|
|
@hide="hideConfirmModal"
|
|
|
|
>
|
2020-07-23 19:10:14 +02:00
|
|
|
<template :slot="'header'">
|
2020-08-12 18:11:48 +02:00
|
|
|
<div class="d-flex">
|
|
|
|
<i class="mdi mdi-24px mdi-delete mr-1" /> {{ $tc('message.deleteRows', selectedRows.length) }}
|
|
|
|
</div>
|
2020-07-23 19:10:14 +02:00
|
|
|
</template>
|
|
|
|
<div :slot="'body'">
|
|
|
|
<div class="mb-2">
|
|
|
|
{{ $tc('message.confirmToDeleteRows', selectedRows.length) }}
|
|
|
|
</div>
|
|
|
|
</div>
|
2020-07-10 19:51:36 +02:00
|
|
|
</ConfirmModal>
|
|
|
|
</BaseContextMenu>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
|
|
|
import { mapActions } from 'vuex';
|
|
|
|
import BaseContextMenu from '@/components/BaseContextMenu';
|
|
|
|
import ConfirmModal from '@/components/BaseConfirmModal';
|
|
|
|
|
|
|
|
export default {
|
|
|
|
name: 'WorkspaceQueryTableContext',
|
|
|
|
components: {
|
|
|
|
BaseContextMenu,
|
|
|
|
ConfirmModal
|
|
|
|
},
|
|
|
|
props: {
|
2020-07-22 18:30:52 +02:00
|
|
|
contextEvent: MouseEvent,
|
|
|
|
selectedRows: Array
|
2020-07-10 19:51:36 +02:00
|
|
|
},
|
|
|
|
data () {
|
|
|
|
return {
|
|
|
|
isConfirmModal: false
|
|
|
|
};
|
|
|
|
},
|
|
|
|
computed: {
|
|
|
|
},
|
|
|
|
methods: {
|
|
|
|
...mapActions({
|
|
|
|
deleteConnection: 'connections/deleteConnection',
|
|
|
|
showEditModal: 'application/showEditConnModal'
|
|
|
|
}),
|
|
|
|
showConfirmModal () {
|
|
|
|
this.isConfirmModal = true;
|
|
|
|
},
|
|
|
|
hideConfirmModal () {
|
|
|
|
this.isConfirmModal = false;
|
2020-07-23 19:10:14 +02:00
|
|
|
},
|
|
|
|
closeContext () {
|
2020-08-12 18:11:48 +02:00
|
|
|
this.$emit('close-context');
|
2020-07-23 19:10:14 +02:00
|
|
|
},
|
|
|
|
deleteRows () {
|
|
|
|
this.$emit('deleteSelected');
|
|
|
|
this.closeContext();
|
2020-07-10 19:51:36 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
|
|
|
</script>
|