<template>
  <view class="module-container">
    <FlowTable
      :id="projectId"
      :businessCode="projectData?.projectCode"
      :defCode="computedDefCode"
    />
  </view>
</template>

<script setup lang="ts">
import { computed } from 'vue';
import FlowTable from './FlowTable.vue';

const props = defineProps<{
  projectId: number;
  projectType: string;
  projectData: any;
}>();

const computedDefCode = computed(() => {
  const prefix = props.projectData?.projectStatus === '05' ? 'pre_' : '';
  let baseCode = 'sci_project_vertical';

  if (props.projectType === 'horizontal' || props.projectType === '20') {
    baseCode = 'sci_project_horizontal';
  } else if (props.projectType === 'spontaneity' || props.projectType === '30') {
    baseCode = 'sci_project_spontaneity';
  }

  return prefix + baseCode;
});
</script>

<style lang="scss" scoped>
.module-container {
  min-height: 400rpx;
  position: relative;
}
</style>
