<template>
  <div style="padding:10px;">
    <a-tabs v-model:activeKey="activeKey" @change="handleChange">
      <a-tab-pane key="1" tab="我的作业">
        <YyzyList ref="yyzyListPage" @yinyong="handleYinyong"></YyzyList>
      </a-tab-pane>
      <a-tab-pane key="2" tab="他人分享">
        <YyzyOtherList ref="yyzyOtherListPage" @yinyong="handleYinyong"></YyzyOtherList>
      </a-tab-pane>
    </a-tabs>
  </div>
</template>

<script lang="ts" name="kcTeachingUnitContentOne-kcTeachingUnitContentOne" setup>
import { ref, reactive } from 'vue';
import YyzyList from '/@/views/zy/zyInfo/YyzyList.vue';
import YyzyOtherList from '/@/views/zy/zyInfo/YyzyOtherList.vue';


const queryParam = ref<any>({});
const toggleSearchStatus = ref<boolean>(false);
const yyzyListPage = ref();
const yyzyOtherListPage = ref();
const activeKey= ref('1');

const emit = defineEmits(['register', 'ok', 'yinyong']);

//引用
function handleYinyong(record) {
  emit('yinyong', record);
}
//切换标签
function handleChange(record){
console.log("🚀 ~ handleChange ~ record:", record)
  if(record == '2'){
    yyzyOtherListPage.value.init(queryParam.value);
  }
}

//初始化
function init(record) {
  queryParam.value = record;
  activeKey.value = "1";
  yyzyListPage.value.init(record);
}

/**
 * 提交数据
 */
async function submitForm() {
}
defineExpose({
  init,
  submitForm,
});
</script>

<style lang="less" scoped>
.jeecg-basic-table-form-container {
  .table-page-search-submitButtons {
    display: block;
    margin-bottom: 24px;
    white-space: nowrap;
  }
  .query-group-cust {
    width: calc(50% - 15px);
    min-width: 100px !important;
  }
  .query-group-split-cust {
    width: 30px;
    display: inline-block;
    text-align: center;
  }
}
</style>
