fix: excel
This commit is contained in:
@@ -1,7 +1,26 @@
|
||||
<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>
|
||||
@@ -9,7 +28,7 @@ import NavCard from '../components/cards/NavCard.vue';
|
||||
<NavCard :title="'Пользователь'" :to="'/user'" :content="'Может кидать зигу и не может пользоваться туалетной бумагой'" />
|
||||
</div>
|
||||
<footer class="fixed w-full bottom-10 flex items-center justify-center gap-2">
|
||||
<Button severity="secondary">Импортировать данные</Button>
|
||||
<Button severity="secondary">Экспортировать данные</Button>
|
||||
<Button severity="secondary" @click="importFromExcel">Импортировать данные</Button>
|
||||
<Button severity="secondary" @click="exportFromExcel">Экспортировать данные</Button>
|
||||
</footer>
|
||||
</template>
|
||||
@@ -135,9 +135,9 @@ const validate: Validate<Post> = (entity) => {
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<Table :scheme :service :get-defaults :load :items :validate>
|
||||
<Table :scheme :service :get-defaults :load :items :validate >
|
||||
<template #CommentsCreate="{ data }">
|
||||
<p>{{ data.Comments }}</p>
|
||||
<p>{{ data }}</p>
|
||||
</template>
|
||||
</Table>
|
||||
</template>
|
||||
|
||||
Reference in New Issue
Block a user