index.vue 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. <template>
  2. <div style="overflow-y: auto">
  3. <a-layout>
  4. <Header @onChangeCurrent="onChangeCurrent" />
  5. <div style="width: 71%; margin-left: 10%">
  6. <myResources pageType="economize" />
  7. <!-- <ResourceDetails v-if="indexType == 'resourceDetails'" ref="ResourceDetailsRef" /> -->
  8. </div>
  9. </a-layout>
  10. <Footer />
  11. </div>
  12. </template>
  13. <script setup>
  14. import Header from '@/views/portal/components/Header.vue'
  15. import Footer from '@/views/portal/components/Footer.vue'
  16. import myResources from '../myResources.vue'
  17. import { useRoute, useRouter } from 'vue-router'
  18. import { addViewCount, detail, add, queryList } from '@/api/portal'
  19. const router = useRouter()
  20. const indexType = ref('resourceCenter')
  21. const itemData = ref({})
  22. const VideoDetailsRef = ref(null)
  23. const route = useRoute()
  24. // {
  25. // "fileName": "Kettle文档",
  26. // "courseType": "0",
  27. // "courseTypeName": "必修",
  28. // "collegeAllId": "1938796923484962817,1938796975385280513,1938797957397676033",
  29. // "suffix": "doc",
  30. // "collegeTwoId": "1938796975385280513",
  31. // "verifyStatus": "2",
  32. // "collegeThreeIdName": "维修部",
  33. // "collegeThreeId": "1938797957397676033",
  34. // "collegeId": "1938796923484962817",
  35. // "resourceCreaterUserName": "超管",
  36. // "coverImage": "",
  37. // "coverImagePath": "",
  38. // "fileUrl": "upload/20250626/a37672e03659d06fa618842c9c443910.doc",
  39. // "courseIdName": "胸口碎大石2",
  40. // "id": "1938857816211292161",
  41. // "viewCount": 100,
  42. // "courseId": "1937326992873689091",
  43. // "collegeAllIdName": "汽车工程学院,汽车部门,维修部",
  44. // "FILESIZE": 1105920,
  45. // "majorId": "1",
  46. // "uploadTime": "2025-06-26 18:32:18",
  47. // "verifyStatusName": "已发布",
  48. // "resourceDesc": "大东北,是我的家乡,唢呐吹出了美美滴模样",
  49. // "collegeIdName": "汽车工程学院",
  50. // "majorIdName": "草台班子",
  51. // "collegeTwoIdName": "汽车部门",
  52. // "fileId": "1938183534250917888"
  53. // }
  54. const handlerItemSidebar = (item) => {
  55. // emit('handlerItemSidebar', item)
  56. }
  57. const onChangeCurrent = (current) => {
  58. indexType.value = current
  59. router.push({
  60. path: '/' + current
  61. })
  62. }
  63. const setData = (item) => {
  64. // emit('handlerItemSidebar', item)
  65. getData(item)
  66. }
  67. const getData = (item) => {
  68. detail({ id: item.id })
  69. .then((res) => {
  70. if (res.code == 200) {
  71. itemData.value = res.data
  72. // VideoDetailsRef.value.setData(res.data)
  73. }
  74. })
  75. .catch((err) => {})
  76. }
  77. onMounted(() => {
  78. const id = route.query.id
  79. if (id != undefined && id != '') {
  80. addViewCount({ id: id })
  81. getData({ id: id })
  82. }
  83. })
  84. defineExpose({
  85. setData
  86. })
  87. </script>
  88. <style scoped>
  89. .content {
  90. border: 1px solid #00000011; /* 灰色细边框 */
  91. }
  92. .scroll-container {
  93. height: 100vh;
  94. overflow-y: auto;
  95. }
  96. </style>