This repository has been archived on 2025-03-16. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
boilerplate/frontend/src/pages/Index.vue

34 lines
1.1 KiB
Vue
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<script setup lang="ts">
import { Button } from 'primevue';
import NavCard from '../components/cards/NavCard.vue';
import { ExportAllEntities, ImportAllEntities } from '../../bindings/app/internal/services/excelmodule';
import { useErrorStore } from '../stores/error.store';
const errorStore = useErrorStore()
const importFromExcel = async () => {
try {
await ImportAllEntities()
} catch(e) {
errorStore.summon((e as Error).message)
}
}
const exportFromExcel = async () => {
try {
await ExportAllEntities()
} catch(e) {
errorStore.summon((e as Error).message)
}
}
</script>
<template>
<div class="flex w-screen h-screen items-center gap-5 justify-center">
<NavCard :title="'Пользователь'" :to="'/user'" :content="'Не может пользоваться туалетной бумагой'" />
</div>
<footer class="fixed w-full bottom-10 flex items-center justify-center gap-2">
<Button severity="secondary" @click="importFromExcel">Импортировать данные</Button>
<Button severity="secondary" @click="exportFromExcel">Экспортировать данные</Button>
</footer>
</template>