<template>
  <div style="background: #fff;  margin: 10px 0;padding:10px;">
    <div style="text-align: right;width:100%;"><a-button type="primary" @click="handleback">返回</a-button></div>
    <a-tabs v-model:activeKey="activeKey" @change="handleChange">
      <a-tab-pane key="1" tab="待互评">
        <ZyInfoStudentHpList ref="dhpPage"/>
      </a-tab-pane>
      <a-tab-pane key="2" tab="已互评" force-render>
        <ZyInfoStudentHpYpyList ref="yhpPage" />
      </a-tab-pane>
      <a-tab-pane key="3" tab="我的作业互评结果" v-if="zyInfo.xssfck=='1'">
        <ZyInfoStudentHpMyhpfsList ref="wdhpPage" />
      </a-tab-pane>
    </a-tabs>
  </div>
</template>

<script lang="ts" name="zyInfo-zyInfo" setup>
import { ref, reactive, onMounted, unref } from 'vue';
import ZyInfoStudentHpList from '/@/views/zy/zyInfoStudentHp/ZyInfoStudentHpList.vue'
import ZyInfoStudentHpYpyList from '/@/views/zy/zyInfoStudentHp/ZyInfoStudentHpYpyList.vue'
import ZyInfoStudentHpMyhpfsList from '/@/views/zy/zyInfoStudentHp/ZyInfoStudentHpMyhpfsList.vue'

import { useRouter } from 'vue-router';
import { defHttp } from '/@/utils/http/axios';
var activeKey = ref('1');
const dhpPage = ref();
const yhpPage = ref();
const wdhpPage = ref();
const { currentRoute } = useRouter();
const { query } = unref(currentRoute);
const { rwbh, xqxn, type, teano ,mainId,zyStuId} = query; //获取传递参数
let router = useRouter();
const zyInfo = ref<any>({});
function handleChange(record) {
  console.log('👩‍🚒', record);
  if(record == '1'){
    dhpPage.value.reload();
  }else if(record == '2'){
    yhpPage.value.reload();
  }else if(record == '3'){
    wdhpPage.value.reload();
  }
}
function handleback(){
  var href = "/stuzy/studentDqzy";
  router.push({path:href,query: {rwbh,xqxn,type,teano}});
}

onMounted(() => {
  defHttp.get({ url: '/zyInfo/zyInfo/queryById', params: { id: mainId } }).then((res) => {
    console.log('😒', res);
    zyInfo.value = res;
  });
});
</script>

<style lang="less" scoped>
</style>
