fix: excel

This commit is contained in:
opbnq-q
2025-03-13 17:28:37 +07:00
parent 490b02e007
commit 031e22a4a3
2 changed files with 23 additions and 4 deletions

View File

@@ -1,7 +1,26 @@
<script setup lang="ts"> <script setup lang="ts">
import { Button } from 'primevue'; import { Button } from 'primevue';
import NavCard from '../components/cards/NavCard.vue'; 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> </script>
<template> <template>
@@ -9,7 +28,7 @@ import NavCard from '../components/cards/NavCard.vue';
<NavCard :title="'Пользователь'" :to="'/user'" :content="'Может кидать зигу и не может пользоваться туалетной бумагой'" /> <NavCard :title="'Пользователь'" :to="'/user'" :content="'Может кидать зигу и не может пользоваться туалетной бумагой'" />
</div> </div>
<footer class="fixed w-full bottom-10 flex items-center justify-center gap-2"> <footer class="fixed w-full bottom-10 flex items-center justify-center gap-2">
<Button severity="secondary">Импортировать данные</Button> <Button severity="secondary" @click="importFromExcel">Импортировать данные</Button>
<Button severity="secondary">Экспортировать данные</Button> <Button severity="secondary" @click="exportFromExcel">Экспортировать данные</Button>
</footer> </footer>
</template> </template>

View File

@@ -137,7 +137,7 @@ const validate: Validate<Post> = (entity) => {
<template> <template>
<Table :scheme :service :get-defaults :load :items :validate > <Table :scheme :service :get-defaults :load :items :validate >
<template #CommentsCreate="{ data }"> <template #CommentsCreate="{ data }">
<p>{{ data.Comments }}</p> <p>{{ data }}</p>
</template> </template>
</Table> </Table>
</template> </template>