<script setup lang="ts">
import type { ReportModel }   from '@/model';
import { reportSchemeMethod } from '@/request/api/report.api';
import { useWatcher }         from 'alova/client';


const props = defineProps<{ report?: ReportModel }>();
const emits = defineEmits<{ loaded: [] }>();
const reportId = inject('report-id', toRef(() => props.report?.id));

const { data: scheme, loading: schemeLoading } = useWatcher(
  () => reportSchemeMethod(reportId.value!),
  [ reportId ],
  { initialData: {}, immediate: true },
).onComplete(() => { emits('loaded'); });
</script>
<template>
  <div class="widget-wrapper">{{ scheme }}</div>
</template>
<style scoped lang="scss">
</style>
