index.vue 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. <template>
  2. <div style="overflow-y: auto">
  3. <!-- <img :src="images" style="width: 100%; height: 100%" /> -->
  4. <div>
  5. <a-tabs v-model:activeKey="activeKey" type="card">
  6. <a-tab-pane key="1" tab="教室信息">
  7. <courseInfo :courseInfoId="courseInfoId" @nextStep="nextStep" />
  8. </a-tab-pane>
  9. <a-tab-pane key="2" tab="课程制作" :disabled="courseInfoId == null">
  10. <courseProduction :courseInfoId="courseInfoId" />
  11. </a-tab-pane>
  12. <a-tab-pane key="3" tab="学员管理" :disabled="courseInfoId == null">
  13. <StudentDetails :courseInfoId="courseInfoId"></StudentDetails>
  14. </a-tab-pane>
  15. <!-- <a-tab-pane key="4" tab="作业布置" :disabled="courseInfoId==null">-->
  16. <!-- <div>这里是作业布置的内容</div>-->
  17. <!-- </a-tab-pane>-->
  18. <!-- <a-tab-pane key="5" tab="测试布置" :disabled="courseInfoId==null">-->
  19. <!-- <div>这里是测试布置的内容</div>-->
  20. <!-- </a-tab-pane>-->
  21. </a-tabs>
  22. </div>
  23. </div>
  24. </template>
  25. <script setup>
  26. import { ref, onMounted } from 'vue'
  27. import Header from '@/views/portal/components/Header.vue'
  28. import Footer from '@/views/portal/components/Footer.vue'
  29. import courseInfo from './components/courseInfo.vue'
  30. import courseProduction from './components/courseProduction/index.vue'
  31. import StudentDetails from './components/StudentDetails.vue'
  32. import { useRoute, useRouter } from 'vue-router'
  33. const router = useRouter()
  34. const route = useRoute()
  35. const activeKey = ref('1') // 默认选中的标签页
  36. // const courseInfoId = ref(route.query.id || null) // 编辑课程信息id
  37. const props = defineProps({
  38. courseInfoId: {
  39. type: String,
  40. default: null
  41. }
  42. })
  43. const courseInfoId = ref(props.courseInfoId)
  44. console.log('courseInfoId', courseInfoId.value)
  45. const nextStep = (id) => {
  46. courseInfoId.value = id
  47. activeKey.value = '2'
  48. }
  49. const onChangeCurrent = (current) => {
  50. router.push({
  51. path: '/' + current
  52. })
  53. }
  54. // onMounted(() => {
  55. // })
  56. </script>
  57. <style scoped>
  58. /* 自定义样式 */
  59. </style>