|
|
@@ -56,7 +56,7 @@
|
|
|
</div>
|
|
|
<div style="display: flex; flex-direction: column; padding: 5px 10px">
|
|
|
<span style="font-size: 16px; font-weight: bold">{{ item.courseName || '-' }}</span>
|
|
|
- <div><a-progress :percent="progressVal" /></div>
|
|
|
+ <div><a-progress :percent="item.progressVal" /></div>
|
|
|
<span style="font-size: 12px">{{ item.majorIdName || '-' }}</span>
|
|
|
<span style="font-size: 12px">{{ item.teacherIdName || '-' }}</span>
|
|
|
</div>
|
|
|
@@ -80,7 +80,7 @@
|
|
|
<script setup>
|
|
|
import { ref, onMounted } from 'vue'
|
|
|
import TabSwitcher from './TabSwitcher.vue'
|
|
|
- import { list } from '@/api/studentCourseCenter'
|
|
|
+ import { list, getFinishRate } from '@/api/studentCourseCenter'
|
|
|
import tool from '@/utils/tool'
|
|
|
import EventBus from '@/utils/EventBus'
|
|
|
import sysConfig from '@/config/index'
|
|
|
@@ -98,7 +98,6 @@
|
|
|
})
|
|
|
const searchKeyword = ref('')
|
|
|
const resources = ref([])
|
|
|
- const progressVal = computed(()=>30)
|
|
|
const selectTab = (key) => {
|
|
|
if (key == 'latest') {
|
|
|
tabKey.value = 0
|
|
|
@@ -132,8 +131,17 @@
|
|
|
|
|
|
const getList = () => {
|
|
|
list({ ...currentPage, ...queryData.value })
|
|
|
- .then((res) => {
|
|
|
+ .then(async (res) => {
|
|
|
if (res.code == 200) {
|
|
|
+ for (let index = 0; index < res.data.records.length; index++) {
|
|
|
+ let progressRes = 0
|
|
|
+ try {
|
|
|
+ progressRes = await getFinishRate({ courseId: res.data.records[index].courseId })
|
|
|
+ } catch (error) {
|
|
|
+ progressRes = 0
|
|
|
+ }
|
|
|
+ res.data.records[index].progressVal = progressRes?.data.finishRate * 100 ?? 0
|
|
|
+ }
|
|
|
resources.value = res.data.records
|
|
|
total.value = res.data.total
|
|
|
currentPage.current = res.data.current
|
|
|
@@ -148,17 +156,7 @@
|
|
|
currentPage.current = 1
|
|
|
currentPage.size = 12
|
|
|
queryData.value = data
|
|
|
- list({ ...currentPage, ...queryData.value })
|
|
|
- .then((res) => {
|
|
|
- if (res.code == 200) {
|
|
|
- resources.value = res.data.records
|
|
|
- total.value = res.data.total
|
|
|
- currentPage.current = res.data.current
|
|
|
- }
|
|
|
- })
|
|
|
- .catch((err) => {
|
|
|
- console.log(err)
|
|
|
- })
|
|
|
+ getList()
|
|
|
}
|
|
|
|
|
|
onMounted(() => {
|