feat: sample data

This commit is contained in:
2025-03-08 20:06:06 +07:00
parent b4ea46140d
commit 9ea91f3b40
13 changed files with 396 additions and 73 deletions

View File

@@ -1,40 +1,57 @@
<script setup lang="ts">
import Table from '../table/Table.vue'
import { onMounted, reactive } from 'vue'
import { getDefaultValues } from '../utils/structs/defaults.util.ts'
import S from './author.service.ts'
import type { Scheme } from '../types/scheme.type'
import { Author } from '../../bindings/app/internal/services/models.ts'
import {onMounted, reactive} from 'vue'
import {getDefaultValues} from '../utils/structs/defaults.util'
import Service from './author.service.ts'
import type {Scheme} from '../types/scheme.type'
import {Author} from '../../bindings/app/internal/services'
const service = new S
import PostService from '../post/post.service.ts'
const postService = new PostService
const service = new Service
onMounted(async () => {
(scheme as any).Posts.type!.nested!.values = await postService.readAll()
console.log(scheme)
})
const scheme: Scheme<Author> = reactive({
Id:{
hidden: true,
type: {
primitive: "number",
Id: {
hidden: true,
type: {
primitive: "number",
},
},
},
Name:{
russian: "Имя",
type: {
primitive: "string",
Name: {
russian: "Имя",
type: {
primitive: "string",
},
},
Posts: {
russian: "Посты",
many: true,
type: {
nested: {
values: [],
field: ['Text']
},
},
},
},
})
const getDefaults = () => getDefaultValues(scheme)
const getDefaults = () => getDefaultValues(scheme)
</script>
<template>
<main class="w-screen h-screen">
<Table :scheme :service :getDefaults></Table>
</main>
</template>
<main class="w-screen h-screen">
<Table :scheme :service :getDefaults></Table>
</main>
</template>