index.vue 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  1. <template>
  2. <div style="overflow-y: auto">
  3. <a-layout>
  4. <Header @onChangeCurrent="onChangeCurrent" />
  5. <div style="width: 71%; margin-left: 10%">
  6. <QueryView style="margin-top: 10px" @handlerSearch="handlerSearch"></QueryView>
  7. <!-- 新建课程按钮 -->
  8. <a-button style="margin-top: 10px" type="primary" @click="handleNewCourse">
  9. <template #icon>
  10. <PlusOutlined />
  11. </template>
  12. 新建
  13. </a-button>
  14. <div style="height: 10px"></div>
  15. <ListView ref="listViewRef" style="margin-top: 10px" @handleEdit="handleEdit"></ListView>
  16. </div>
  17. </a-layout>
  18. <Footer />
  19. <DialogView ref="dialogViewRef" @handleAddItem="handleAddItem"></DialogView>
  20. </div>
  21. </template>
  22. <script setup>
  23. import { ref, onMounted } from 'vue'
  24. import { PlusOutlined } from '@ant-design/icons-vue'
  25. import tool from '@/utils/tool'
  26. import Header from '@/views/portal/components/Header.vue'
  27. import Footer from '@/views/portal/components/Footer.vue'
  28. import QueryView from './components/QueryView.vue'
  29. import ListView from './components/ListView.vue'
  30. import DialogView from './components/DialogView.vue'
  31. import { useRouter } from 'vue-router'
  32. const router = useRouter()
  33. //发布按钮状态
  34. const releaseVisible = ref(false)
  35. const loading = ref(false) // 列表loading
  36. const isState = ref(0) // 列表loading
  37. const listViewRef = ref(null)
  38. const dialogViewRef = ref(null)
  39. // 搜索值
  40. const searchValue = ref('')
  41. const open = ref(false)
  42. const handleNewCourse = () => {
  43. console.log('新建课程111')
  44. // 在这里添加新建课程的逻辑
  45. dialogViewRef.value.open()
  46. // router.push({
  47. // path: '/portal/courseAdd'
  48. // })
  49. }
  50. const handleAddItem = () => {
  51. console.log('新建课程111')
  52. // 在这里添加新建课程的逻辑
  53. listViewRef.value.getList()
  54. // router.push({
  55. // path: '/portal/courseAdd'
  56. // })
  57. }
  58. const handlerSearch = (data) => {
  59. console.log('新建课程')
  60. // 在这里添加新建课程的逻辑
  61. listViewRef.value.setList(data)
  62. }
  63. const handleEdit = (item) => {
  64. // router.push({
  65. // path: '/portal/courseAdd',
  66. // query: {
  67. // id: item.courseId
  68. // }
  69. // })
  70. dialogViewRef.value.edit(item)
  71. }
  72. const pagination = reactive({
  73. pageSize: 10,
  74. pageNum: 1,
  75. total: 0
  76. })
  77. const onChangeCurrent = (current) => {
  78. router.push({
  79. path: '/' + current
  80. })
  81. }
  82. const publishedData = ref()
  83. //发布确定
  84. // 上传资源模态框
  85. const uploadModalVisible = ref(false)
  86. onMounted(() => {
  87. // getListData()
  88. })
  89. </script>
  90. <style scoped>
  91. .desc p {
  92. margin-bottom: 1em;
  93. }
  94. </style>