<%_
const { formFieldLines, detailShowInOneRelationships: showInOneRelationships } = (bcEntityData || { formFieldLines: [] });
_%>
<template>
  <PageWrapper v-bind="pageProps">
    <template #default>
      <<%= entityClass %>Descriptions ref="<%= entityInstance %>DescriptionsRef" v-bind="descriptionProps">
      </<%= entityClass %>Descriptions>
    </template>
    <template #rightFooter>
      <a-space>
        <a-button v-for="operation in operations"
          :type="operation.type"
          @click="operation.click"
        >
          <Icon :icon="operation.icon" v-if="operation.icon"/>{{ operation.title }}</a-button>
      </a-space>
    </template>
  </PageWrapper>
</template>
<script lang="ts" setup>
import { useRoute, useRouter } from 'vue-router';
import { PageWrapper } from '@/components/Page';
import { useMultipleTabStore } from '@/store/modules/multipleTab';
import <%= entityClass %>Descriptions from './components/detail-component.vue';
<%_ if (addCustomMethod.indexOf('updateTemplate') !== -1) { _%>
<%- include(`../common/entity-custom/${entityClass}.updateTemplate.ejs`, {position: 'import'}); -%>
<%_ } _%>

  // begcode-please-regenerate-this-file 如果您不希望重新生成代码时被覆盖，将please修改为don't ！！！

  defineOptions({
    name: '<%= this._.upperFirst((moduleName || clientRootFolder) ? (moduleName || clientRootFolder) + entityAngularName : entityInstance) %>Detail',
    inheritAttrs: false,
  });

  const props = defineProps({
    entityId: {
      type: [String, Number] as PropType<string | number>,
      default: 0,
    },
  });

  const route = useRoute();
  const router = useRouter();
  const tabStore = useMultipleTabStore();

  const <%= entityInstance %>DescriptionsRef = ref(null);
  const descriptionProps = reactive({
    entityId: (route.params?.entityId || props.entityId || '') as string,
  });

  const pageProps = reactive({
    title: '详情',
  });

  const operations = ref<any>([
    {
      title: '关闭',
      name: 'close',
      type: 'default',
      icon: '',
      click: async () => {
        const { fullPath } = route;
        await tabStore.closeTabByKey(fullPath, router);
      },
    },
  ]);
  <%_ if (addCustomMethod.indexOf('detailTemplate') !== -1) { _%>
  <%- include(`../common/entity-custom/${entityClass}.updateTemplate.ejs`, {position: 'pageMethod'}); -%>
  <%_ } _%>
</script>
