|
|
@@ -21,11 +21,19 @@
|
|
|
<EasyProcess ref="processRef" :data="course?.courseDataStream" :edit="false" />
|
|
|
</div>
|
|
|
<div class="flex flex-col gap-4">
|
|
|
- <div class="h-[180px] w-[320px] border p-4">
|
|
|
+ <div v-if="!runStatus || runStatus?.runCourseID === Number(courseId)" class="h-[180px] w-[320px] border p-4">
|
|
|
<el-button v-if="!isRunning" type="primary" @click="courseStart">开始课程</el-button>
|
|
|
<el-button v-else type="primary" @click="coursePause">暂停课程</el-button>
|
|
|
<el-button type="primary" @click="courseReset">结束课程</el-button>
|
|
|
</div>
|
|
|
+ <div v-else class="h-[180px] w-[320px] border p-4">
|
|
|
+ <div class="text-lg font-medium">正在运行的课程ID:{{ runStatus.runCourseID }} </div>
|
|
|
+ <div class="text-lg font-medium">正在运行的课程名称:{{ runStatus.runCourseName }} </div>
|
|
|
+ <div class="flex items-center gap-2 text-lg font-medium">
|
|
|
+ <i class="iconfont-sys"></i>
|
|
|
+ <span>{{ runStatus.runDateTime }} </span>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
<div class="flex-1 border p-4">
|
|
|
<div v-if="processData" class="mb-4 text-lg font-medium">
|
|
|
<div>节点名称:{{ processData?.nodeName }}</div>
|
|
|
@@ -46,7 +54,7 @@
|
|
|
import cover2 from '@imgs/cover/img2.webp'
|
|
|
import cover3 from '@imgs/cover/img3.webp'
|
|
|
import { Picture as IconPicture } from '@element-plus/icons-vue'
|
|
|
- import { Course, CourseServer, CourseRunServer } from '@/api/course.api'
|
|
|
+ import { Course, CourseServer, CourseRunServer, CourseRunStatus } from '@/api/course.api'
|
|
|
import courseDetail from './course-detail.vue'
|
|
|
import { useTimer } from '@/composables/useTimer'
|
|
|
|
|
|
@@ -85,7 +93,17 @@
|
|
|
}
|
|
|
})
|
|
|
|
|
|
+ const runStatus = ref<CourseRunStatus>()
|
|
|
+ const getRunStatus = () => {
|
|
|
+ CourseRunServer.status().then((res) => {
|
|
|
+ if (res.data && res.data.runCourseID) {
|
|
|
+ runStatus.value = res.data
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+
|
|
|
onMounted(async () => {
|
|
|
+ getRunStatus()
|
|
|
const { data } = await CourseServer.detail(courseId.value)
|
|
|
course.value = data
|
|
|
})
|