<template>
  <div class="st_coolection_cont">
    <div class="st_coolection">
    <a-form>
     {{ complianeInfoRecord.projectName+'项目' }}
      <a-button type="link" @click="returnUpper">上一级</a-button>
    </a-form>
    <StProjectExecOneList v-show="onlyFlay==1" :complianeInfoRecord="complianeInfoRecord" ref="punishref1" @success="doUpdateCount"/>
    <StProjectExecTwoList v-show="onlyFlay==2" :complianeInfoRecord="complianeInfoRecord" ref="punishref2" @success="doUpdateCount"/>
    <StProjectExecThreeList v-show="onlyFlay==3" :complianeInfoRecord="complianeInfoRecord" ref="punishref3" @success="doUpdateCount"/>
    <StProjectExecFourList v-show="onlyFlay==4" :complianeInfoRecord="complianeInfoRecord" ref="punishref4" @success="doUpdateCount"/>
    <StProjectExecFiveList v-show="onlyFlay==5" :complianeInfoRecord="complianeInfoRecord" ref="punishref5" @success="doUpdateCount"/>
    <StProjectExecSixList v-show="onlyFlay==6" :complianeInfoRecord="complianeInfoRecord" ref="punishref6" @success="doUpdateCount"/>

   </div>
  </div> 
</template>
<script lang="ts" setup>
  import { ref } from 'vue';
import StProjectExecOneList from './StProjectExecOneList.vue';
import StProjectExecTwoList from './StProjectExecTwoList.vue';
import StProjectExecThreeList from './StProjectExecThreeList.vue';
import StProjectExecFourList from './StProjectExecFourList.vue';
import StProjectExecFiveList from './StProjectExecFiveList.vue';
import StProjectExecSixList from './StProjectExecSixList.vue';


  const onlyFlay = ref(1)
  const punishref1 = ref(null)
  const punishref2 = ref(null)
  const punishref3 = ref(null)
  const punishref4 = ref(null)
  const punishref5 = ref(null)
  const punishref6 = ref(null)
  const props = defineProps({
    complianeInfoRecord: {}
  });
  const emit = defineEmits(['callBack']);
  function returnJh() {
    emit('callBack',props.complianeInfoRecord)
   }
   function returnUpper() {
    emit('callBack')
   }
   function doUpdateCount(){
   }
   function initActiveKey(projectCreId,execLevelCode) {
      // 初始化数据
      if(execLevelCode == '0001'){
        onlyFlay.value = 2
      }else if(execLevelCode == '0002') {
        onlyFlay.value = 3
      }else if(execLevelCode  == '0003'){
        onlyFlay.value = 4
      }else if(execLevelCode  == '0004'){
        onlyFlay.value = 5
      }else if(execLevelCode == '0000'){
        onlyFlay.value = 1

      }else if(execLevelCode == '0005'){
        onlyFlay.value = 6

      }
      initItemList(projectCreId)
   }
   function initItemList(projectCreId){
    console.log(projectCreId)
    console.log(onlyFlay)
    if(onlyFlay.value==1){
      punishref1.value?.setProps({searchInfo:{projectCreId:projectCreId,projectName:props.complianeInfoRecord.projectName}});
      punishref1.value?.reload()
    }else if(onlyFlay.value==2) {
      punishref2.value?.setProps({searchInfo:{projectCreId:projectCreId,projectName:props.complianeInfoRecord.projectName}});
      punishref2.value?.reload()
    }else if(onlyFlay.value==3) {
      punishref3.value?.setProps({searchInfo:{projectCreId:projectCreId,projectName:props.complianeInfoRecord.projectName}});
      punishref3.value?.reload()
    }else if(onlyFlay.value==4) {
      punishref4.value?.setProps({searchInfo:{projectCreId:projectCreId,projectName:props.complianeInfoRecord.projectName}});
      punishref4.value?.reload()
    }else if(onlyFlay.value==5) {
      punishref5.value?.setProps({searchInfo:{projectCreId:projectCreId,projectName:props.complianeInfoRecord.projectName}});
      punishref5.value?.reload()
   }else if(onlyFlay.value==6) {
      punishref6.value?.setProps({searchInfo:{projectCreId:projectCreId,projectName:props.complianeInfoRecord.projectName}});
      punishref6.value?.reload()
    }
   }
  defineExpose({initActiveKey})
</script>
<style scoped>
.st_coolection_cont {
  padding: 10px;
}
.st_coolection {
  padding: 12px 10px 6px 10px;
  margin-bottom: 8px;
  background-color: #fff;
  border-radius: 2px;
}
</style>