<script setup lang="ts">
import {
  salaryInfo,
} from '#/api/biz/salary';
import { computed, h, onMounted, ref } from "vue";
import { useRoute } from "vue-router";
// import { useTitle } from '/@/hooks/web/useTitle';

import { Description, useDescription } from '#/components/description';

import { descSchema } from './data';

// const title = useTitle('工资明细');
const route = useRoute();
// 获取路由参数
const id = route.params.id;

const pageData = ref<any>({
});
const getData = async () => {
  pageData.value = await salaryInfo(id as string | number);
  // route.meta.title = `工资明细 - `+pageData.value.salaryYearMonth;
  setDescProps({ data: pageData.value }, true);
};

const [registerDescription, { setDescProps }] = useDescription({
  column: 1,
  schema: descSchema,
});

onMounted(() => {
  getData();
});
</script>

<template>
  <Page>
    <Card class="w-full">
      <template #title>
        <span>基础信息</span>
      </template>
      <Description @register="registerDescription" />
    </Card>
    
  </Page>
</template>
