fix: excel
This commit is contained in:
@@ -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>
|
||||||
@@ -135,9 +135,9 @@ const validate: Validate<Post> = (entity) => {
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<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>
|
||||||
|
|||||||
Reference in New Issue
Block a user