<template>
  <div id="siteMain" style="min-height: calc(100vh - 160px);">
            <a-row>
              <a-col :span="24">
                <a-menu
                  v-model:selectedKeys="selectedKeys"
                  style="width: 98%;min-height: calc(100vh - 142px);margin: 10px 0;"
                  mode="inline"
                >
                  <a-sub-menu key="sub1">
                    <template #title>教学内容</template>
                    <a-menu-item key="1" @click="getGzt('kcjs')">课程介绍</a-menu-item>
                    <a-menu-item key="2" @click="getGzt('gonggao')">通知公告</a-menu-item>
                    <a-menu-item key="3" @click="gotoPageByName('jiaoXueDanYuanNeiRong')">教学单元内容</a-menu-item>
                  </a-sub-menu>
                  <a-sub-menu key="sub2">
                    <template #title>作业/测验</template>
                    <a-menu-item key="4" @click="getGzt('dqzy')">课程作业</a-menu-item>
                    <a-menu-item key="5" @click="getGzt('kcjc')">课程测验</a-menu-item>
                  </a-sub-menu>
                  <a-sub-menu key="sub3">
                    <template #title>教学工具</template>
                    <a-menu-item key="6" @click="getGzt('dcwj')">问卷调查</a-menu-item>
                    <a-menu-item key="7" @click="getGzt('gongju')">到课率识别</a-menu-item>
                  </a-sub-menu>
                  <a-menu-item key="sub4">
                    <span>教学资源库</span>
                  </a-menu-item>
                  <a-menu-item key="sub5">
                    <span @click="getGzt('tlq')">讨论区</span>
                  </a-menu-item>
                  <!-- <a-menu-item key="sub3">
                    <span  @click="getGzt('dqwj')">问卷调查</span>
                  </a-menu-item> -->
                  <!-- <a-sub-menu key="sub3">
                    <template #title>问卷管理</template>
                    <a-menu-item key="6" @click="getGzt('dqwj')">当前问卷</a-menu-item>
                    <a-menu-item key="7">历史问卷</a-menu-item>
                  </a-sub-menu> -->
                  <!-- <a-menu-item key="sub5">
                    <span @click="getGzt('gongju')">教学工具</span>
                  </a-menu-item> -->
                </a-menu>
              </a-col>
            </a-row>
  </div>
</template>

<script lang="ts" setup>
  import { ref, onMounted, unref  } from 'vue';

  import { getUserSf,getSysConfig } from '/@/views/site/utils/index';
  import { defHttp } from '/@/utils/http/axios';
  import { useRouter } from 'vue-router';


  import headerPage from '/@/views/site/common/header.vue';
  import footerPage from '/@/views/site/common/footer.vue';
  import dqxqkc from '/@/views/site/renKeJiaoCheng/checkKecheng/dqxqkc.vue';

  const maxClassName = ref<any>({});
  const selectedKeys = ref<string[]>([]);
  //当前路由信息
  const { currentRoute } = useRouter();
  const { query } = unref(currentRoute);
  const { rwbh,xqxn,type } = query;//获取传递参数
  let router = useRouter();


  function getGzt(zytype){
    var param = {rwbh,xqxn,type};
    // console.log(`🚀 ~ getGzt ~ type:`, zytype)
    var href = "/zy/dqkcDqzy";
    if(zytype=='dqzy'){
      href = "/zy/dqkcDqzy";
    }else if(zytype=='dcwj'){
      href = "/zy/dcwjWenjuan";
    }else if(zytype=='lszy'){
      href = "/zy/dqkcLszy";
    }else if(zytype=='gonggao'){
      href = "/zy/tuGonggao";
    }else if(zytype=='kcjs'){
      href = "/zy/dqkcDetail";
    }else if(zytype=='kcjc'){
      href = "/zy/ceshiWenjuan";
    }else if(zytype=='gongju'){
      href = "/zy/dqkcGongju";
    }else if(zytype=='tlq'){
      href = "/zy/dqkcTlq";
    }

    router.push({path:href,query: {rwbh,xqxn,type}});
  }

  function gotoPageByName(name) {
    router.push({ name, query: { rwbh, xqxn, type } });
  }

  //进入就加载
  onMounted(() => {
    console.log('rwbh:',rwbh);
  });

</script>
<style lang="less" scoped>
#siteMain {
  // font-size: ;
  // height: 100%;
  background: #f3f3f4;
  #maxSite {
    //最大宽度
    max-width: 1070px;
    min-height: 730px;
    //居中
    margin: 0 auto;
    .rowGutter{
      margin-top: 1rem;
      margin-bottom: 1rem;
    }

    .ant-layout-header {
      color: #fff;
      background: #1ab394;
    }
    .ant-layout-footer {
      line-height: 1.5;
      background: #FFF;
    }
    .ant-layout-sider {
      color: #fff;
      line-height: 120px;
      background: #3ba0e9;
    }
    .ant-layout-content {
      min-height: 120px;
      color: #000;
      line-height: 120px;
      background: #f3f3f4;
    }
  }
}
</style>
