index.vue 2.8 KB

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