index.vue 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145
  1. <template>
  2. <div style="overflow-y: auto; height: 100vh;width: 100vw">
  3. <!-- <BreadCrumb /> -->
  4. <VideoDetails :isState="isState" ref="VideoDetailsRef" @onGetPageCommentNew="onGetPageCommentNew" />
  5. <TallList ref="tallList" v-show="!isState" />
  6. <div style="display: flex; justify-content: flex-end; margin-top: 10px" v-if="isAudit && isState">
  7. <a-button @click="handleAuditResult(3)" style="margin-right: 10px">不同意</a-button>
  8. <a-button type="primary" @click="handleAuditResult(2)">同意</a-button>
  9. </div>
  10. <!-- <ResourceDetails v-if="indexType == 'resourceDetails'" ref="ResourceDetailsRef" /> -->
  11. </div>
  12. </template>
  13. <script setup>
  14. import Header from '@/views/portal/components/Header.vue'
  15. import BreadCrumb from '@/views/portal/components/BreadCrumb.vue'
  16. import Footer from '@/views/portal/components/Footer.vue'
  17. import VideoDetails from './components/VideoDetails.vue'
  18. import { useRoute, useRouter } from 'vue-router'
  19. import TallList from './components/TallList.vue'
  20. import { addViewCount, detail, add, queryList ,isHaveAuth} from '@/api/portal'
  21. import resourceAuditApi from '@/api/resourceAudit.js'
  22. import EventBus from '@/utils/EventBus'
  23. const router = useRouter()
  24. const route = useRoute()
  25. const indexType = ref('resourceCenter')
  26. const itemData = ref({})
  27. const tallList = ref(null)
  28. const VideoDetailsRef = ref(null)
  29. const isState = ref(route.query.state || null)
  30. const isAudit = ref(route.query.audit || null)
  31. // {
  32. // "fileName": "Kettle文档",
  33. // "courseType": "0",
  34. // "courseTypeName": "必修",
  35. // "collegeAllId": "1938796923484962817,1938796975385280513,1938797957397676033",
  36. // "suffix": "doc",
  37. // "collegeTwoId": "1938796975385280513",
  38. // "verifyStatus": "2",
  39. // "collegeThreeIdName": "维修部",
  40. // "collegeThreeId": "1938797957397676033",
  41. // "collegeId": "1938796923484962817",
  42. // "resourceCreaterUserName": "超管",
  43. // "coverImage": "",
  44. // "coverImagePath": "",
  45. // "fileUrl": "upload/20250626/a37672e03659d06fa618842c9c443910.doc",
  46. // "courseIdName": "胸口碎大石2",
  47. // "id": "1938857816211292161",
  48. // "viewCount": 100,
  49. // "courseId": "1937326992873689091",
  50. // "collegeAllIdName": "汽车工程学院,汽车部门,维修部",
  51. // "FILESIZE": 1105920,
  52. // "majorId": "1",
  53. // "uploadTime": "2025-06-26 18:32:18",
  54. // "verifyStatusName": "已发布",
  55. // "resourceDesc": "大东北,是我的家乡,唢呐吹出了美美滴模样",
  56. // "collegeIdName": "汽车工程学院",
  57. // "majorIdName": "草台班子",
  58. // "collegeTwoIdName": "汽车部门",
  59. // "fileId": "1938183534250917888"
  60. // }
  61. const onGetPageCommentNew = (item) => {
  62. // emit('handlerItemSidebar', item)
  63. console.log('发消息去请求网卡罗2', item)
  64. tallList.value.onGetPageCommentNew(item)
  65. }
  66. const handleAuditResult = (val) => {
  67. const params = {
  68. ids: route.query.id,
  69. verifyStatus: val
  70. }
  71. resourceAuditApi
  72. .updateStatus(params)
  73. .then((res) => {
  74. if (res.code == 200) {
  75. // auditModalVisible.value = false
  76. router.go(-1)
  77. }
  78. // getListData()
  79. })
  80. .catch((err) => {
  81. console.error(err)
  82. })
  83. }
  84. // const onChangeCurrent = (current) => {
  85. // indexType.value = current
  86. //
  87. // router.push({
  88. // path: '/' + current
  89. // })
  90. // }
  91. const setData = (item) => {
  92. // emit('handlerItemSidebar', item)
  93. getData(item)
  94. }
  95. const getData = (item) => {
  96. detail({ id: item.id })
  97. .then((res) => {
  98. if (res.code == 200) {
  99. itemData.value = res.data
  100. VideoDetailsRef.value.setData(res.data)
  101. }
  102. })
  103. .catch((err) => {})
  104. }
  105. onMounted(() => {
  106. const id = route.query.id
  107. if (id != undefined && id != '') {
  108. isHaveAuth({ id: id }).then((res)=>{
  109. if(res.code == 200){
  110. if(res.data.isHaveAuth == 1){
  111. addViewCount({ id: id })
  112. getData({ id: id })
  113. }else{
  114. router.replace({
  115. path: '/notLook'
  116. })
  117. }
  118. }
  119. })
  120. }
  121. })
  122. defineExpose({
  123. setData
  124. })
  125. </script>
  126. <style scoped>
  127. .content {
  128. border: 1px solid #00000011; /* 灰色细边框 */
  129. }
  130. .scroll-container {
  131. height: 100vh;
  132. overflow-y: auto;
  133. }
  134. </style>