ProjectDocs.vue 968 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. <template>
  2. <view class="module-container">
  3. <CommonSection title="项目文档" isFirst>
  4. <CommonFileList :files="fileList" />
  5. </CommonSection>
  6. </view>
  7. </template>
  8. <script setup lang="ts">
  9. import { computed } from 'vue';
  10. import type { ProjectFile } from '@/types/project';
  11. import CommonFileList from '@/components/ui/CommonFileList.vue';
  12. import CommonSection from '@/components/ui/CommonSection.vue';
  13. /**
  14. * 接收父组件传递的属性
  15. */
  16. const props = defineProps<{
  17. projectId: number;
  18. projectType: string;
  19. projectData: any;
  20. }>();
  21. /**
  22. * 计算属性:获取最终渲染的文件列表
  23. * 针对不同项目类型(纵向/横向/自发类)提取对应的文件列表字段
  24. */
  25. const fileList = computed<ProjectFile[]>(() => {
  26. return props.projectData?.fileList ||
  27. props.projectData?.files ||
  28. [];
  29. });
  30. </script>
  31. <style lang="scss" scoped>
  32. .module-container {
  33. min-height: 400rpx;
  34. position: relative;
  35. }
  36. </style>