提交 468e4f08 authored 作者: 王鹏飞's avatar 王鹏飞

chore: update

上级 d669985a
...@@ -5,7 +5,7 @@ const emit = defineEmits<{ ...@@ -5,7 +5,7 @@ const emit = defineEmits<{
(e: 'resize'): void (e: 'resize'): void
}>() }>()
defineProps<{ isLeftShow?: number }>() defineProps<{ isLeftShow?: boolean }>()
const leftPanelVisible = $ref<boolean>(true) const leftPanelVisible = $ref<boolean>(true)
const leftPanelWidth = useStorage('leftPanelWidth', 400) const leftPanelWidth = useStorage('leftPanelWidth', 400)
...@@ -42,7 +42,7 @@ onMounted(() => { ...@@ -42,7 +42,7 @@ onMounted(() => {
<template> <template>
<section class="drag-panel"> <section class="drag-panel">
<div v-show="isLeftShow !== 1" class="drag-panel-left" :class="{ 'is-hidden': !leftPanelVisible }"> <div v-show="!isLeftShow" class="drag-panel-left" :class="{ 'is-hidden': !leftPanelVisible }">
<div class="drag-cover" v-if="dragFlag"></div> <div class="drag-cover" v-if="dragFlag"></div>
<slot name="left"></slot> <slot name="left"></slot>
<div class="panel-resize" id="panel-resize"></div> <div class="panel-resize" id="panel-resize"></div>
...@@ -73,6 +73,7 @@ onMounted(() => { ...@@ -73,6 +73,7 @@ onMounted(() => {
.drag-panel { .drag-panel {
display: flex; display: flex;
height: calc(100vh - 110px); height: calc(100vh - 110px);
gap: 20px;
} }
.drag-panel-left { .drag-panel-left {
position: relative; position: relative;
...@@ -123,7 +124,6 @@ onMounted(() => { ...@@ -123,7 +124,6 @@ onMounted(() => {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
height: 100%; height: 100%;
margin-left: 20px;
} }
.drag-cover { .drag-cover {
width: 100%; width: 100%;
......
...@@ -35,7 +35,7 @@ const title = computed(() => { ...@@ -35,7 +35,7 @@ const title = computed(() => {
// 列表配置 // 列表配置
const listOptions = computed(() => { const listOptions = computed(() => {
let columns = [] let columns: any = []
switch (props.row.type) { switch (props.row.type) {
case 6: case 6:
// 用户标签 // 用户标签
......
...@@ -30,7 +30,12 @@ export function getExperimentVideoPlayInfo(params: { source_id: string }) { ...@@ -30,7 +30,12 @@ export function getExperimentVideoPlayInfo(params: { source_id: string }) {
} }
// 获取实验讨论交流 // 获取实验讨论交流
export function getExperimentDiscussList(params: { experiment_id: string; tag: number; page?: number; 'per-page'?: number }) { export function getExperimentDiscussList(params: {
experiment_id: string
tag: number
page?: number
'per-page'?: number
}) {
return httpRequest.get('/api/lab/v1/student/experiment-topic/list', { params }) return httpRequest.get('/api/lab/v1/student/experiment-topic/list', { params })
} }
// 发表新话题 // 发表新话题
...@@ -85,11 +90,21 @@ export function getExperimentReportTemplate(params: { experiment_id: string }) { ...@@ -85,11 +90,21 @@ export function getExperimentReportTemplate(params: { experiment_id: string }) {
return httpRequest.get('/api/lab/v1/student/experiment/report-template', { params }) return httpRequest.get('/api/lab/v1/student/experiment/report-template', { params })
} }
// 更新实验在线报告 // 更新实验在线报告
export function updateExperimentReport(data: { experiment_id: string; experiment_address: string; experiment_date: string; detail: string }) { export function updateExperimentReport(data: {
experiment_id: string
experiment_address: string
experiment_date: string
detail: string
}) {
return httpRequest.post('/api/lab/v1/student/experiment/upload-online-report', data) return httpRequest.post('/api/lab/v1/student/experiment/upload-online-report', data)
} }
// 缓存实验在线报告 // 缓存实验在线报告
export function cacheExperimentReport(data: { experiment_id: string; experiment_address: string; experiment_date: string; detail: string }) { export function cacheExperimentReport(data: {
experiment_id: string
experiment_address: string
experiment_date: string
detail: string
}) {
return httpRequest.post('/api/lab/v1/student/experiment/cache-online-report', data) return httpRequest.post('/api/lab/v1/student/experiment/cache-online-report', data)
} }
// 获取实验在线报告缓存 // 获取实验在线报告缓存
...@@ -120,3 +135,8 @@ export function getExperimentQuestion(params: { experiment_id: string; id: strin ...@@ -120,3 +135,8 @@ export function getExperimentQuestion(params: { experiment_id: string; id: strin
export function getExperimentExamList(params: { experiment_id: string }) { export function getExperimentExamList(params: { experiment_id: string }) {
return httpRequest.get('/api/lab/v1/student/experiment-exam/exams', { params }) return httpRequest.get('/api/lab/v1/student/experiment-exam/exams', { params })
} }
// 学生查看分数详情页面
export function getExperimentScoreDetail(params: { experiment_id: string; type: string }) {
return httpRequest.get('/api/lab/v1/student/experiment-question/score-detail', { params })
}
...@@ -12,12 +12,16 @@ interface Props { ...@@ -12,12 +12,16 @@ interface Props {
course_id?: string course_id?: string
} }
const props = defineProps<Props>() const props = defineProps<Props>()
const emits = defineEmits(['empty'])
let list = $ref<ExperimentBookType[]>([]) let list = $ref<ExperimentBookType[]>([])
function fetchInfo() { function fetchInfo() {
if (!props.experiment_id) return if (!props.experiment_id) return
getExperimentBookList({ experiment_id: props.experiment_id }).then(res => { getExperimentBookList({ experiment_id: props.experiment_id }).then((res) => {
list = res.data.items list = res.data.items
if (list.length === 0) {
emits('empty')
}
}) })
} }
watchEffect(() => { watchEffect(() => {
...@@ -34,7 +38,7 @@ function handleView(row: ExperimentBookType) { ...@@ -34,7 +38,7 @@ function handleView(row: ExperimentBookType) {
log.upload({ log.upload({
event: 'file_event', event: 'file_event',
action: 'experiment_book_stu_watch_action', action: 'experiment_book_stu_watch_action',
data: { experiment_id: props.experiment_id, course_id: props.course_id, book_id: row.id } data: { experiment_id: props.experiment_id, course_id: props.course_id, book_id: row.id },
}) })
} }
// 关闭 // 关闭
......
...@@ -8,12 +8,16 @@ interface Props { ...@@ -8,12 +8,16 @@ interface Props {
course_id?: string course_id?: string
} }
const props = defineProps<Props>() const props = defineProps<Props>()
const emits = defineEmits(['empty'])
let detail = $ref<ExperimentBookType>() let detail = $ref<ExperimentBookType>()
function fetchInfo() { function fetchInfo() {
if (!props.experiment_id) return if (!props.experiment_id) return
getExperimentCase({ experiment_id: props.experiment_id }).then(res => { getExperimentCase({ experiment_id: props.experiment_id }).then((res) => {
detail = res.data.detail detail = res.data.detail || {}
if (detail && Object.keys(detail).length === 0) {
emits('empty')
}
}) })
} }
watchEffect(() => { watchEffect(() => {
......
...@@ -10,6 +10,7 @@ interface Props { ...@@ -10,6 +10,7 @@ interface Props {
} }
const props = defineProps<Props>() const props = defineProps<Props>()
const model = defineModel() const model = defineModel()
const emits = defineEmits(['empty'])
const cookies = useCookies() const cookies = useCookies()
...@@ -22,22 +23,27 @@ const currentExam = computed(() => { ...@@ -22,22 +23,27 @@ const currentExam = computed(() => {
// 考试平台 URL // 考试平台 URL
const examURL = computed(() => { const examURL = computed(() => {
if (!currentExam.value) return '' if (!currentExam.value) return ''
return appConfig.system !== 'x' || props.examStatus !== 0 return appConfig.system === 'x' && props.examStatus === 0
? `${import.meta.env.VITE_EXAM_SHOW_URL}/exam/${currentExam.value?.exam_id}` ? `${import.meta.env.VITE_EXAM_SHOW_URL}/exam/${
: `${import.meta.env.VITE_EXAM_SHOW_URL}/exam/${
currentExam.value?.exam_id currentExam.value?.exam_id
}?has_time=0&has_submit=0&has_save=1&show_answer=1` }?has_time=0&has_submit=0&has_save=1&show_answer=1`
: `${import.meta.env.VITE_EXAM_SHOW_URL}/exam/${currentExam.value?.exam_id}`
// return `https://dev.ezijing.com:5173/exam/7003551966412406784?has_time=0&has_submit=0&has_save=1&show_answer=1` // return `https://dev.ezijing.com:5173/exam/7003551966412406784?has_time=0&has_submit=0&has_save=1&show_answer=1`
}) })
async function fetchInfo() { async function fetchInfo() {
if (!props.experiment_id) return
const res = await getExperimentExamList({ experiment_id: props.experiment_id }) const res = await getExperimentExamList({ experiment_id: props.experiment_id })
const resCookies = res.data.cookies const resCookies = res.data.cookies
cookies.set(resCookies.key, resCookies.auth_key, { domain: '.ezijing.com', path: '/' }) cookies.set(resCookies.key, resCookies.auth_key, { domain: '.ezijing.com', path: '/' })
list.value = res.data.items || [] list.value = res.data.items || []
model.value = examURL.value model.value = examURL.value
if (list.value.length === 0) {
emits('empty')
}
} }
onMounted(() => { watchEffect(() => {
fetchInfo() fetchInfo()
}) })
</script> </script>
...@@ -50,11 +56,9 @@ onMounted(() => { ...@@ -50,11 +56,9 @@ onMounted(() => {
>{{ currentExam.exam_info.start_time }}{{ currentExam.exam_info.end_time }}</el-form-item >{{ currentExam.exam_info.start_time }}{{ currentExam.exam_info.end_time }}</el-form-item
> >
</el-form> </el-form>
<div style="width: 100%; height: 100%" v-if="props.examStatus === 0"> <div style="width: 100%; height: 100%">
<iframe style="width: 100%; height: 100%" allowfullscreen class="iframe" :src="examURL" frameborder="0"></iframe> <iframe style="width: 100%; height: 100%" allowfullscreen class="iframe" :src="examURL" frameborder="0"></iframe>
</div> </div>
<!-- <teleport to=".lab-box"> -->
<!-- </teleport> -->
</template> </template>
<el-empty description="暂无数据" v-else /> <el-empty description="暂无数据" v-else />
</template> </template>
...@@ -4,7 +4,7 @@ import { Document } from '@element-plus/icons-vue' ...@@ -4,7 +4,7 @@ import { Document } from '@element-plus/icons-vue'
import { filesize } from 'filesize' import { filesize } from 'filesize'
interface Props { interface Props {
experiment_id: string, experiment_id: string
exam_status?: number exam_status?: number
} }
interface QuestionListItem { interface QuestionListItem {
...@@ -20,6 +20,7 @@ interface QuestionGroupList { ...@@ -20,6 +20,7 @@ interface QuestionGroupList {
} }
const props = defineProps<Props>() const props = defineProps<Props>()
const emits = defineEmits(['empty'])
const questionIndex = ref<number>(1) const questionIndex = ref<number>(1)
const questionId = computed(() => { const questionId = computed(() => {
...@@ -45,6 +46,9 @@ async function fetchList() { ...@@ -45,6 +46,9 @@ async function fetchList() {
if (!props.experiment_id) return if (!props.experiment_id) return
const res = await getExperimentQuestionList({ experiment_id: props.experiment_id }) const res = await getExperimentQuestionList({ experiment_id: props.experiment_id })
questionList.value = res.data.items questionList.value = res.data.items
if (questionList.value.length === 0) {
emits('empty')
}
} }
watchEffect(() => { watchEffect(() => {
if (props.experiment_id) fetchList() if (props.experiment_id) fetchList()
...@@ -52,19 +56,21 @@ watchEffect(() => { ...@@ -52,19 +56,21 @@ watchEffect(() => {
// 试题详情 // 试题详情
const questionDetail = ref() const questionDetail = ref()
const file = ref()
async function fetchDetail() { async function fetchDetail() {
if (!questionId.value) return if (!questionId.value) return
const res = await getExperimentQuestion({ experiment_id: props.experiment_id, id: questionId.value }) const res = await getExperimentQuestion({ experiment_id: props.experiment_id, id: questionId.value })
const detail = res.data.detail const detail = res.data.detail || {}
let files = [] let answer: any = {}
try { try {
files = JSON.parse(detail.files) answer = JSON.parse(detail.answer)
file.value = answer.data?.file || {}
} catch (error) { } catch (error) {
console.log(error) console.log(error)
} }
questionDetail.value = { ...detail, files, score: parseFloat(detail.score) } questionDetail.value = { ...detail, answer, score: parseFloat(detail.score) }
} }
watch(questionId, id => { watch(questionId, (id) => {
if (id) fetchDetail() if (id) fetchDetail()
}) })
...@@ -79,7 +85,9 @@ function handleNext() { ...@@ -79,7 +85,9 @@ function handleNext() {
} }
function getQuestionTypeName(type: string) { function getQuestionTypeName(type: string) {
if (['101', '102'].includes(type)) return '用户/事件管理' if (['101'].includes(type)) return '用户管理'
if (['102'].includes(type)) return '事件管理'
// if (['101', '102'].includes(type)) return '用户/事件管理'
if (['201', '202'].includes(type)) return '标签管理' if (['201', '202'].includes(type)) return '标签管理'
if (['301', '302'].includes(type)) return '群组管理' if (['301', '302'].includes(type)) return '群组管理'
if (['401', '402', '403', '404', '405', '406', '407'].includes(type)) return '营销资料管理' if (['401', '402', '403', '404', '405', '406', '407'].includes(type)) return '营销资料管理'
...@@ -111,17 +119,18 @@ function customFloor(num: number) { ...@@ -111,17 +119,18 @@ function customFloor(num: number) {
<el-card shadow="never" class="question-item" v-if="questionDetail"> <el-card shadow="never" class="question-item" v-if="questionDetail">
<h3 class="question-item__title">{{ getQuestionTypeName(questionDetail.type) }}</h3> <h3 class="question-item__title">{{ getQuestionTypeName(questionDetail.type) }}</h3>
<p class="question-item__stem"> <p class="question-item__stem">
{{ questionIndex }}{{ questionDetail.title }} <span v-if="props?.exam_status !== 1">{{ questionDetail.score }}分)</span> {{ questionIndex }}{{ questionDetail.title }}
<span>{{ questionDetail.score }}分)</span>
</p> </p>
<p class="question-item__content">{{ questionDetail.content }}</p> <p class="question-item__content">{{ questionDetail.content }}</p>
<ul class="question-item__files"> <ul class="question-item__files" v-if="!!Object.keys(file).length">
<li class="question-item__files-item" v-for="(file, index) in questionDetail.files" :key="index"> <li class="question-item__files-item">
<el-icon><Document /></el-icon> <el-icon><Document /></el-icon>
<div class="question-item__files-item__title"> <div class="question-item__files-item__title">
<p>{{ file.name }}</p> <p>{{ file.name }}</p>
<p>{{ filesize(file.size) }}</p> <p>{{ filesize(file.size) }}</p>
</div> </div>
<a :href="file.url" target="_blank" download v-if="file.is_download">下载</a> <a :href="file.url" target="_blank" download>下载</a>
<a :href="file.url" target="_blank">查看</a> <a :href="file.url" target="_blank">查看</a>
</li> </li>
</ul> </ul>
......
<script setup lang="ts"> <script setup lang="ts">
import { getExperimentScore } from '../api' import { getExperimentScore } from '../api'
import { useAppConfig } from '@/composables/useAppConfig'
const appConfig = useAppConfig()
const ResultScoreViewAutoDialog = defineAsyncComponent(() => import('./ResultScoreViewAutoDialog.vue'))
interface Props { interface Props {
experiment_id: string experiment_id: string
} }
import { useAppConfig } from '@/composables/useAppConfig'
const appConfig = useAppConfig()
const props = defineProps<Props>() const props = defineProps<Props>()
let experiment = $ref<any>() let experiment = $ref<any>()
...@@ -16,7 +19,7 @@ const classText = $computed(() => { ...@@ -16,7 +19,7 @@ const classText = $computed(() => {
}) })
function fetchInfo() { function fetchInfo() {
getExperimentScore({ experiment_id: props.experiment_id }).then(res => { getExperimentScore({ experiment_id: props.experiment_id }).then((res) => {
experiment = res.data.experiment experiment = res.data.experiment
let scoreDetails = [] let scoreDetails = []
try { try {
...@@ -28,7 +31,7 @@ function fetchInfo() { ...@@ -28,7 +31,7 @@ function fetchInfo() {
} }
detail = Object.assign(res.data.achievement, { detail = Object.assign(res.data.achievement, {
score: parseFloat(res.data.achievement.score), score: parseFloat(res.data.achievement.score),
score_details: scoreDetails score_details: scoreDetails,
}) })
}) })
} }
...@@ -42,13 +45,22 @@ function getOperationUrl(type: number) { ...@@ -42,13 +45,22 @@ function getOperationUrl(type: number) {
return `/student/lab/report/view/${experiment.id}` return `/student/lab/report/view/${experiment.id}`
} else if (type === 8) { } else if (type === 8) {
// 用户旅程 // 用户旅程
return `${appConfig.dmlURL || import.meta.env.VITE_DML_URL}/trip/my/score?experiment_id=${experiment.id}&student_id=${experiment.student.id}` return `${appConfig.dmlURL || import.meta.env.VITE_DML_URL}/trip/my/score?experiment_id=${
experiment.id
}&student_id=${experiment.student.id}`
} }
} }
const autoVisible = ref(false)
const currentRow = ref(null)
function handleViewAuto(row: any) {
autoVisible.value = true
currentRow.value = row
}
</script> </script>
<template> <template>
<el-dialog title="实验成绩详情" width="600px"> <el-dialog title="实验成绩详情" width="800px">
<el-form label-width="120px" label-suffix=":" v-if="detail"> <el-form label-width="120px" label-suffix=":" v-if="detail">
<el-form-item label="实验名称">{{ experiment.name }}</el-form-item> <el-form-item label="实验名称">{{ experiment.name }}</el-form-item>
<el-form-item label="实验课程名称">{{ experiment.course.name }}</el-form-item> <el-form-item label="实验课程名称">{{ experiment.course.name }}</el-form-item>
...@@ -71,7 +83,9 @@ function getOperationUrl(type: number) { ...@@ -71,7 +83,9 @@ function getOperationUrl(type: number) {
<el-row> <el-row>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="评分教师"> <el-form-item label="评分教师">
{{ detail.checker_sso_user.real_name || detail.checker_sso_user.nickname || detail.checker_sso_user.username }} {{
detail.checker_sso_user.real_name || detail.checker_sso_user.nickname || detail.checker_sso_user.username
}}
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
...@@ -83,7 +97,11 @@ function getOperationUrl(type: number) { ...@@ -83,7 +97,11 @@ function getOperationUrl(type: number) {
<p>实验得分</p> <p>实验得分</p>
<p class="t1">{{ detail.score }}</p> <p class="t1">{{ detail.score }}</p>
</div> </div>
<el-table :data="detail.score_details" stripe :header-cell-style="{ background: '#ededed' }" v-if="detail.is_show === '1'"> <el-table
:data="detail.score_details"
stripe
:header-cell-style="{ background: '#ededed' }"
v-if="detail.is_show === '1'">
<el-table-column label="实验成绩组成项" prop="name" align="center"></el-table-column> <el-table-column label="实验成绩组成项" prop="name" align="center"></el-table-column>
<el-table-column label="权重" prop="percent" align="center"> <el-table-column label="权重" prop="percent" align="center">
<template #default="{ row }">{{ row.percent }}%</template> <template #default="{ row }">{{ row.percent }}%</template>
...@@ -99,6 +117,23 @@ function getOperationUrl(type: number) { ...@@ -99,6 +117,23 @@ function getOperationUrl(type: number) {
</template> </template>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="标准答案" align="center" width="80">
<template #default="{ row }">
<el-button type="primary" link @click="handleViewAuto(row)" v-if="[6, 7, 9, 11, 12].includes(row.type)"
>查看</el-button
>
</template>
</el-table-column>
<el-table-column label="我的答案" align="center" width="80">
<template #default="{ row }">
<el-button type="primary" @click="handleViewAuto(row)" link>查看</el-button>
</template>
</el-table-column>
<el-table-column label="评语" align="center" width="80" v-if="false">
<template #default="{ row }">
<el-button type="primary" link v-if="row.type === 9">查看</el-button>
</template>
</el-table-column>
</el-table> </el-table>
</div> </div>
</el-form> </el-form>
...@@ -107,6 +142,12 @@ function getOperationUrl(type: number) { ...@@ -107,6 +142,12 @@ function getOperationUrl(type: number) {
<el-button round auto-insert-space @click="$emit('update:modelValue', false)">关闭</el-button> <el-button round auto-insert-space @click="$emit('update:modelValue', false)">关闭</el-button>
</el-row> </el-row>
</template> </template>
<ResultScoreViewAutoDialog
v-model="autoVisible"
:data="experiment"
:row="currentRow"
v-if="currentRow"></ResultScoreViewAutoDialog>
</el-dialog> </el-dialog>
</template> </template>
......
<script setup>
import AppList from '@/components/base/AppList.vue'
import { getExperimentScoreDetail } from '../api'
import { gradeRule } from '@/utils/dictionary'
import Preview from '@/components/Preview.vue'
import { useAppConfig } from '@/composables/useAppConfig'
const appConfig = useAppConfig()
const props = defineProps({
data: {
type: Object,
default: () => ({}),
},
row: {
type: Object,
default: () => ({}),
},
})
let datalist = $ref([])
function fetchInfo() {
getExperimentScoreDetail({
experiment_id: props.data.id,
type: props.row.type,
}).then((res) => {
datalist = res.data
})
}
watchEffect(() => {
fetchInfo()
})
const title = computed(() => {
return '查看' + gradeRule[props.row.type]
})
// 列表配置
const listOptions = computed(() => {
let columns = []
switch (props.row.type) {
case 6:
// 用户标签
columns = [
{ label: '序号', type: 'index', width: 60 },
{ label: '标签名称', prop: 'tag_name' },
{ label: '操作', prop: 'status', slots: 'table-x' },
]
break
case 7:
// 用户群组
columns = [
{ label: '序号', type: 'index', width: 60 },
{ label: '群组名称', prop: 'group_name' },
{ label: '操作', prop: 'status', slots: 'table-x' },
]
break
case 9:
// 营销资料
columns = [
{ label: '序号', type: 'index', width: 60 },
{ label: '资料名称', prop: 'material_name' },
{
label: '资料类型',
prop: 'type_name',
computed() {
return '文本'
},
},
{ label: '评语', prop: 'comment' },
{ label: '操作', prop: 'status', slots: 'table-x' },
]
break
case 12:
// 事件数据
columns = [
{ label: '序号', type: 'index', width: 60 },
{ label: '事件名称', prop: 'event_name' },
{ label: '操作', prop: 'status', slots: 'table-x' },
]
break
default:
break
}
return {
columns,
data: datalist,
}
})
function getOperationUrl(row) {
const type = props.row.type
const dmlURL = appConfig.dmlURL || import.meta.env.VITE_DML_URL
if (type === 6) {
// 用户标签
return `${dmlURL}/label?experiment_id=${props.data.id}&student_id=${props.data.student.id}&id=${row.tag_id}&name=${row.tag_name}`
} else if (type === 7) {
// 用户群组
return `${dmlURL}/group?experiment_id=${props.data.id}&student_id=${props.data.student.id}&id=${row.group_id}&name=${row.group_name}`
} else if (type === 9) {
// 营销资料
return `${dmlURL}/material?experiment_id=${props.data.id}&student_id=${props.data.student.id}&id=${row.material_id}&name=${row.material_name}`
} else if (type === 12) {
const url = row.file.url
// 事件数据
return ['pptx', 'doc', 'docx', 'xls', 'xlsx'].includes(url)
? `https://view.officeapps.live.com/op/view.aspx?src=${url}`
: url
}
}
</script>
<template>
<el-dialog :title="title" width="800px">
<template v-if="row.type === 11">
<Preview v-for="(item, index) in datalist" :key="index" :url="item.file.url"></Preview>
</template>
<AppList v-bind="listOptions" ref="appList" v-else>
<template #table-x="{ row }">
<el-button type="primary" link>
<a :href="getOperationUrl(row)" target="_blank">查看</a>
</el-button>
</template>
</AppList>
<template #footer>
<el-row justify="center">
<el-button round auto-insert-space @click="$emit('update:modelValue', false)">关闭</el-button>
</el-row>
</template>
</el-dialog>
</template>
...@@ -8,12 +8,16 @@ interface Props { ...@@ -8,12 +8,16 @@ interface Props {
course_id?: string course_id?: string
} }
const props = defineProps<Props>() const props = defineProps<Props>()
const emits = defineEmits(['empty'])
let list = $ref<ExperimentVideoType[]>([]) let list = $ref<ExperimentVideoType[]>([])
function fetchInfo() { function fetchInfo() {
if (!props.experiment_id) return if (!props.experiment_id) return
getExperimentVideoList({ experiment_id: props.experiment_id }).then(res => { getExperimentVideoList({ experiment_id: props.experiment_id }).then((res) => {
list = res.data.list list = res.data.list
if (list.length === 0) {
emits('empty')
}
}) })
} }
watchEffect(() => { watchEffect(() => {
...@@ -33,8 +37,7 @@ const isEmpty = $computed(() => { ...@@ -33,8 +37,7 @@ const isEmpty = $computed(() => {
:key="item.id" :key="item.id"
:data="item" :data="item"
:course_id="course_id" :course_id="course_id"
:experiment_id="experiment_id" :experiment_id="experiment_id"></VideoItem>
></VideoItem>
</template> </template>
</template> </template>
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论