index.vue 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  1. <template>
  2. <a-card>
  3. <div style="width: 100%">
  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. </div>
  11. <forumBtn :forumData="forumData"></forumBtn>
  12. </a-card>
  13. </template>
  14. <script setup>
  15. import Header from '@/views/portal/components/Header.vue'
  16. import BreadCrumb from '@/views/portal/components/BreadCrumb.vue'
  17. import Footer from '@/views/portal/components/Footer.vue'
  18. import VideoDetails from './components/VideoDetails.vue'
  19. import { useRoute, useRouter } from 'vue-router'
  20. import TallList from './components/TallList.vue'
  21. import { addViewCount, detail, add, queryList } from '@/api/portal'
  22. import resourceAuditApi from '@/api/resourceAudit.js'
  23. import EventBus from '@/utils/EventBus'
  24. import classCentre from '@/api/student/classCentre'
  25. const router = useRouter()
  26. const indexType = ref('resourceCenter')
  27. const itemData = ref({})
  28. const tallList = ref(null)
  29. const VideoDetailsRef = ref(null)
  30. const route = useRoute()
  31. const isState = ref(route.query.state || null)
  32. const isAudit = ref(route.query.audit || null)
  33. const onGetPageCommentNew = (item) => {
  34. tallList.value.onGetPageCommentNew(item)
  35. }
  36. const handleAuditResult = (val) => {
  37. const params = {
  38. ids: route.query.id,
  39. verifyStatus: val
  40. }
  41. resourceAuditApi
  42. .updateStatus(params)
  43. .then((res) => {
  44. if (res.code == 200) {
  45. // auditModalVisible.value = false
  46. router.go(-1)
  47. }
  48. // getListData()
  49. })
  50. .catch((err) => {
  51. console.error(err)
  52. })
  53. }
  54. const onChangeCurrent = (current) => {
  55. indexType.value = current
  56. router.push({
  57. path: '/' + current
  58. })
  59. }
  60. const setData = (item) => {
  61. getData(item)
  62. }
  63. const getData = (item) => {
  64. detail({ id: item.id })
  65. .then((res) => {
  66. if (res.code == 200) {
  67. itemData.value = res.data
  68. addFootprint()
  69. }
  70. })
  71. .catch((err) => {})
  72. }
  73. onMounted(() => {
  74. const id = route.query.id
  75. if (id != undefined && id != '') {
  76. addViewCount({ id: id })
  77. getData({ id: id })
  78. }
  79. })
  80. const addFootprint = () => {
  81. classCentre.footprintAdd({
  82. userFileId: route.query.id, //userfile文件id
  83. extendName: itemData.value.suffix, //扩展名
  84. fileId: itemData.value.fileId, //文件id
  85. fileName: itemData.value.fileName, //文件名称
  86. filePath: itemData.value.fileUrl, //文件路劲
  87. resourceRecordId: itemData.value.id //文件记录id
  88. })
  89. }
  90. const forumData = computed(() => {
  91. return {
  92. postType: 2,
  93. id: route.query.id,
  94. title: itemData.value.fileName ,
  95. }
  96. })
  97. defineExpose({
  98. setData
  99. })
  100. </script>
  101. <style scoped>
  102. .content {
  103. border: 1px solid #00000011; /* 灰色细边框 */
  104. }
  105. .scroll-container {
  106. height: 100vh;
  107. overflow-y: auto;
  108. }
  109. </style>