mirror of
https://github.com/Fabio286/antares.git
synced 2025-06-05 21:59:22 +02:00
refactor: ts and composition api on missing components
This commit is contained in:
@ -4,7 +4,7 @@
|
||||
@close-context="closeContext"
|
||||
>
|
||||
<div v-if="selectedRows.length === 1" class="context-element">
|
||||
<span class="d-flex"><i class="mdi mdi-18px mdi-content-copy text-light pr-1" /> {{ $t('word.copy') }}</span>
|
||||
<span class="d-flex"><i class="mdi mdi-18px mdi-content-copy text-light pr-1" /> {{ t('word.copy') }}</span>
|
||||
<i class="mdi mdi-18px mdi-chevron-right text-light pl-1" />
|
||||
<div class="context-submenu">
|
||||
<div
|
||||
@ -13,7 +13,7 @@
|
||||
@click="copyCell"
|
||||
>
|
||||
<span class="d-flex">
|
||||
<i class="mdi mdi-18px mdi-numeric-0 mdi-rotate-90 text-light pr-1" /> {{ $tc('word.cell', 1) }}
|
||||
<i class="mdi mdi-18px mdi-numeric-0 mdi-rotate-90 text-light pr-1" /> {{ t('word.cell', 1) }}
|
||||
</span>
|
||||
</div>
|
||||
<div
|
||||
@ -22,7 +22,7 @@
|
||||
@click="copyRow"
|
||||
>
|
||||
<span class="d-flex">
|
||||
<i class="mdi mdi-18px mdi-table-row text-light pr-1" /> {{ $tc('word.row', 1) }}
|
||||
<i class="mdi mdi-18px mdi-table-row text-light pr-1" /> {{ t('word.row', 1) }}
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
@ -33,7 +33,7 @@
|
||||
@click="setNull"
|
||||
>
|
||||
<span class="d-flex">
|
||||
<i class="mdi mdi-18px mdi-null text-light pr-1" /> {{ $t('message.setNull') }}
|
||||
<i class="mdi mdi-18px mdi-null text-light pr-1" /> {{ t('message.setNull') }}
|
||||
</span>
|
||||
</div>
|
||||
<div
|
||||
@ -42,45 +42,46 @@
|
||||
@click="showConfirmModal"
|
||||
>
|
||||
<span class="d-flex">
|
||||
<i class="mdi mdi-18px mdi-delete text-light pr-1" /> {{ $tc('message.deleteRows', selectedRows.length) }}
|
||||
<i class="mdi mdi-18px mdi-delete text-light pr-1" /> {{ t('message.deleteRows', selectedRows.length) }}
|
||||
</span>
|
||||
</div>
|
||||
</BaseContextMenu>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import BaseContextMenu from '@/components/BaseContextMenu';
|
||||
<script setup lang="ts">
|
||||
import BaseContextMenu from '@/components/BaseContextMenu.vue';
|
||||
import { useI18n } from 'vue-i18n';
|
||||
|
||||
export default {
|
||||
name: 'WorkspaceTabQueryTableContext',
|
||||
components: {
|
||||
BaseContextMenu
|
||||
},
|
||||
props: {
|
||||
contextEvent: MouseEvent,
|
||||
selectedRows: Array,
|
||||
selectedCell: Object
|
||||
},
|
||||
emits: ['show-delete-modal', 'close-context', 'set-null', 'copy-cell', 'copy-row'],
|
||||
methods: {
|
||||
showConfirmModal () {
|
||||
this.$emit('show-delete-modal');
|
||||
},
|
||||
closeContext () {
|
||||
this.$emit('close-context');
|
||||
},
|
||||
setNull () {
|
||||
this.$emit('set-null');
|
||||
this.closeContext();
|
||||
},
|
||||
copyCell () {
|
||||
this.$emit('copy-cell');
|
||||
this.closeContext();
|
||||
},
|
||||
copyRow () {
|
||||
this.$emit('copy-row');
|
||||
this.closeContext();
|
||||
}
|
||||
}
|
||||
const { t } = useI18n();
|
||||
|
||||
defineProps({
|
||||
contextEvent: MouseEvent,
|
||||
selectedRows: Array,
|
||||
selectedCell: Object
|
||||
});
|
||||
|
||||
const emit = defineEmits(['show-delete-modal', 'close-context', 'set-null', 'copy-cell', 'copy-row']);
|
||||
|
||||
const showConfirmModal = () => {
|
||||
emit('show-delete-modal');
|
||||
};
|
||||
|
||||
const closeContext = () => {
|
||||
emit('close-context');
|
||||
};
|
||||
|
||||
const setNull = () => {
|
||||
emit('set-null');
|
||||
closeContext();
|
||||
};
|
||||
|
||||
const copyCell = () => {
|
||||
emit('copy-cell');
|
||||
closeContext();
|
||||
};
|
||||
|
||||
const copyRow = () => {
|
||||
emit('copy-row');
|
||||
closeContext();
|
||||
};
|
||||
</script>
|
||||
|
Reference in New Issue
Block a user