|
|
@@ -24,7 +24,12 @@
|
|
|
<a-skeleton avatar :title="false" :loading="!!item.loading" active>
|
|
|
<div style="width: 100%">
|
|
|
<a-list-item-meta>
|
|
|
- <template #title>{{ item.courseName }}</template>
|
|
|
+ <template #title>
|
|
|
+ <div class="fcbc">
|
|
|
+ <div>{{ item.courseName }}</div>
|
|
|
+ <div @click="videoSpeed(item)" style="cursor: pointer">{{ item.videoStopTime }}</div>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
<template #avatar v-if="item.avatar">
|
|
|
<a-avatar :src="item.avatar" />
|
|
|
</template>
|
|
|
@@ -85,7 +90,7 @@
|
|
|
}
|
|
|
})
|
|
|
const count = 3
|
|
|
- const emit = defineEmits({ videoStopTime: null })
|
|
|
+ const emit = defineEmits({ videoStopTime: null, videoSpeed: null })
|
|
|
const initLoading = ref(true)
|
|
|
const loading = ref(false)
|
|
|
const data = ref([])
|
|
|
@@ -104,6 +109,15 @@
|
|
|
},
|
|
|
pageSize: 10
|
|
|
})
|
|
|
+ //毫秒转 00:00:00
|
|
|
+ const formatTime = (milliseconds) => {
|
|
|
+ let totalSeconds = Math.floor(milliseconds / 1000)
|
|
|
+ const hours = Math.floor(totalSeconds / 3600)
|
|
|
+ totalSeconds %= 3600
|
|
|
+ const minutes = Math.floor(totalSeconds / 60)
|
|
|
+ const seconds = totalSeconds % 60
|
|
|
+ return [hours, minutes, seconds].map((val) => val.toString().padStart(2, '0')).join(':')
|
|
|
+ }
|
|
|
const getList = () => {
|
|
|
delete props.idsObj.parent
|
|
|
classCentre
|
|
|
@@ -119,7 +133,9 @@
|
|
|
data.records = data.records.map((r) => {
|
|
|
return {
|
|
|
...r,
|
|
|
- loading: false
|
|
|
+ loading: false,
|
|
|
+ startTime: r.videoStopTime ?? 0,
|
|
|
+ videoStopTime: formatTime(r.videoStopTime ?? 0)
|
|
|
}
|
|
|
})
|
|
|
listData.value = data.records
|
|
|
@@ -174,23 +190,27 @@
|
|
|
.validate()
|
|
|
.then(() => {
|
|
|
submitLoading.value = true
|
|
|
- classCentre
|
|
|
- .notesSubmitForm({
|
|
|
- ...props.idsObj,
|
|
|
- ...formDataAdd.value
|
|
|
- })
|
|
|
- .then(() => {
|
|
|
- formRefAdd.value.resetFields()
|
|
|
- getList()
|
|
|
- emit('videoStopTime', (e) => {
|
|
|
- videoStopTime.value = e * 1000
|
|
|
+ emit('videoStopTime', (e) => {
|
|
|
+ videoStopTime.value = e * 1000
|
|
|
+ classCentre
|
|
|
+ .notesSubmitForm({
|
|
|
+ ...props.idsObj,
|
|
|
+ ...formDataAdd.value,
|
|
|
+ videoStopTime: videoStopTime.value
|
|
|
+ })
|
|
|
+ .then(() => {
|
|
|
+ formRefAdd.value.resetFields()
|
|
|
+ getList()
|
|
|
})
|
|
|
- })
|
|
|
+ })
|
|
|
})
|
|
|
.finally(() => {
|
|
|
submitLoading.value = false
|
|
|
})
|
|
|
}
|
|
|
+ const videoSpeed = (e) => {
|
|
|
+ emit('videoSpeed', e)
|
|
|
+ }
|
|
|
// 调用这个函数将子组件的一些数据和方法暴露出去
|
|
|
defineExpose({
|
|
|
getList
|