antares/src/renderer/components/WorkspaceQueryTableContext.vue

72 lines
1.8 KiB
Vue
Raw Normal View History

<template>
<BaseContextMenu
:context-event="contextEvent"
2020-08-12 18:11:48 +02:00
@close-context="closeContext"
>
<div class="context-element" @click="showConfirmModal">
<i class="mdi mdi-18px mdi-delete text-light pr-1" /> {{ $tc('message.deleteRows', selectedRows.length) }}
</div>
<ConfirmModal
v-if="isConfirmModal"
@confirm="deleteRows"
@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>
</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
},
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();
}
}
};
</script>