<template>
    <div class="main_container">
      <component :is="curentComponent"></component>
  </div>
</template>


<script setup lang="ts">
import { useRoute,useRouter } from 'vue-router';
import { computed, onMounted } from 'vue';
import { useStore } from 'vuex'

const store = useStore()


import EvaluationDataComponent from './stepComponent/evaluationDataComponent/EvaluationDataComponent.vue';
import TeachingRelationshipComponent from './stepComponent/teachingRelationshipComponent/TeachingRelationshipComponent.vue';
import QuestionnaireTemplateComponent from './stepComponent/questionnaireTemplateComponent/QuestionnaireTemplateComponent.vue';
import ReviewAccountComponent from './stepComponent/reviewAccountComponent/ReviewAccountComponent.vue';
import GenerateReviewCode from './stepComponent/reviewAccountComponent/GenerateReviewCode.vue';
import ParameterSettingComponent from './stepComponent/parameterSettingComponent/ParameterSettingComponent.vue';
import EvaluationProgressComponent from './stepComponent/evaluationProgressComponent/EvaluationProgressComponent.vue';
import GenerateAnalysisComponent from './stepComponent/generateAnalysisComponent/GenerateAnalysisComponent.vue';
import NumberMappingComponent from './stepComponent/numberMappingComponent/NumberMappingComponent.vue';


const route = useRoute()
const router = useRouter()

const curentComponent = computed(()=>{
  switch(route.params.stepRoute){
    case 'evaluationData':  //评价数据
      return EvaluationDataComponent
    case 'teachingRelationship':   //授课关系
      return TeachingRelationshipComponent
    case 'questionnaireTemplate':    //问卷模板
      return QuestionnaireTemplateComponent
    case 'reviewAccount':   //评价账号
      return ReviewAccountComponent
    case 'generateReviewCode':  // 评价账号生成
      return GenerateReviewCode
    case 'parameterSetting':    //参数设置
      return ParameterSettingComponent
    case 'evaluationProgress':   //评价进度
      return EvaluationProgressComponent
    case 'generateAnalysis':  //生成分析
      return GenerateAnalysisComponent
    case 'numberMapping':  //编号对应
      return NumberMappingComponent
    case 'templateSetting':   //模板设置
      break
    case 'scoreSetting':    // 分数设置
      break
    case 'scanQuestionnaire':   // 扫描问卷
      break
    default:
      router.replace('/login')
      break
  }
})

onMounted( async ()=>{
  await store.dispatch('updateEvaluationManageStepData',route.query.id)
})
</script>



<style lang="scss" scoped>
.main_container {
  height: 100vh !important;
}

</style>