<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';
  } else if (props.projectType === 'safety' || props.projectType === '70') {
    baseCode = 'sci_project_safety';
  }

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

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