提交 a3c488f0 authored 作者: matian's avatar matian

bug fixes

上级 5ec334f0
......@@ -81,7 +81,7 @@ const swiperItemHandle = (url: string) => {
src="https://webapp-pub.oss-cn-beijing.aliyuncs.com/center_resource/upload-video-icon.png"
class="icon"
/>
<div class="text">该图片作为课程的封面图,用于视频封面显示</div>
<div class="text">该图片作为课程的封面图,用于课程封面显示</div>
</div>
<div class="item">
<img
......
......@@ -65,6 +65,7 @@ const listOptions = computed(() => {
const removeLectuter = (id: string) => {
const index = examList.value.findIndex((ids: string) => ids === id)
examList.value.splice(index, 1)
emit('change', examList.value)
}
const handleAddExam = (val: any) => {
console.log(props.data, 'pppp')
......
......@@ -42,7 +42,7 @@ const listOptions = {
return params
},
callback(data: any) {
return { list: data.data }
return { list: data.data, total: data.total }
},
params: {
project_tag: 'resourse_ci',
......@@ -124,7 +124,7 @@ const handleSelectionChange = (val: any) => {
:model-value="isShowExamDialog"
draggable
:before-close="handleCancel"
size="60%"
size="70%"
:title="`添加${props.btnInfo.btn_name}`"
>
<div class="video-head">
......@@ -141,6 +141,9 @@ const handleSelectionChange = (val: any) => {
:props="defaultProps"
v-model="params.paper_categories"
:data="selectTree"
check-strictly
:render-after-expand="false"
multiple
/>
</template>
</AppList>
......
......@@ -68,10 +68,10 @@ const listOptions = computed(() => {
remote: {
httpRequest: getHttpRequest,
callback(data: any) {
data.list.forEach((item: any) => (item.check_status = false))
data.list.filter((item: any) => item.status_name === '失效')
tableData = data
tableData.list.forEach((item: any) => (item.check_status = false))?.filter((it: any) => it.status === '1')
console.log(tableData, '0000')
return data
return { list: data.list.filter((item: any) => item.status_name === '有效'), total: data.total }
},
params: { tab: tabValue, status: '', authorized: '', name: '', course_id: props.course_id }
},
......@@ -80,7 +80,7 @@ const listOptions = computed(() => {
{ type: 'input', prop: 'name', label: '标题:' }
],
columns: [],
data: tableData
data: tableData.list
}
})
// tab切换
......
......@@ -127,11 +127,11 @@ const setDefaultData = (data: object[]) => {
const stepOneId = ref()
// 新建课件
const createCourseForm = () => {
if (isUpdate) {
if (form.lecturer_id === '') {
ElMessage.warning('请添加讲师')
return
}
if (isUpdate) {
updateCourse(form).then((res: any) => {
if (res.code === 0) {
// 操作第二部
......@@ -146,10 +146,6 @@ const createCourseForm = () => {
}
})
} else {
if (form.lecturer_id === '') {
ElMessage.warning('请添加讲师')
return
}
createCourse(form).then((res: any) => {
if (res.code === 0) {
// 操作第二部
......
......@@ -88,6 +88,7 @@ const handleAddSection = (node: any) => {
}
//编辑章节
const handleEdit = (node: any) => {
console.log(node, '0000node')
chapterID.value = node.key
isEdit.value = true
chapterName.value = node.label
......@@ -100,6 +101,8 @@ const handleEdit = (node: any) => {
}
// 删除章节
const handleDel = (node: any) => {
console.log(node, 'node1222')
ElMessageBox.confirm('确定要删除吗?', '提示').then(() => {
const params = { id: node.key, course_id: id }
delCharacter(params).then(() => {
......@@ -213,6 +216,29 @@ const imgUrl = (node: any) => {
return 'https://webapp-pub.oss-cn-beijing.aliyuncs.com/center_resource/test_img.png'
}
}
const nodeType = (node: any) => {
if (node.data.resource_type === '2') {
// 视频
return '视频'
} else if (node.data.resource_type === '3') {
// 作业
return '作业'
} else if (node.data.resource_type === '4') {
return '其他资源'
} else if (node.data.resource_type === '6') {
// 直播
return '直播'
} else if (node.data.resource_type === '9') {
// 考试
return '考试'
} else if (node.data.resource_type === '10') {
// 考试
return '课件'
} else if (node.data.resource_type === '11') {
// 考试
return '教案'
}
}
</script>
<template>
<AppCard :title="isEditCourse === '1' ? '编辑课程' : '新建课程'">
......@@ -236,7 +262,9 @@ const imgUrl = (node: any) => {
<template #default="{ node, data }">
<span class="custom-tree-node">
<span>
<img :src="imgUrl(node)" alt="" style="margin-right: 9px; width: 13px; height: 100%" />{{ node.label }}
<img :src="imgUrl(node)" alt="" style="width: 13px; height: 100%; margin-right: 13px" />
<span class="node_type" v-if="node.data.resource_type !== '1'">{{ nodeType(node) }}</span>
<span class="node_title">{{ node.label.length > 20 ? node.label.slice(0, 20) + '...' : node.label }}</span>
<el-link
class="btn_edit"
v-if="data.depth === '3' && node.data.resource_type === '2'"
......@@ -258,7 +286,6 @@ const imgUrl = (node: any) => {
>
<el-link type="info" @click="handleDel(node)" style="margin-left: 25px">删除</el-link></span
>
<span>
<el-button class="btn_operate" v-if="data.depth === '1'" @click="handleAddSection(node)">
<el-icon><Plus /></el-icon>
......@@ -379,4 +406,22 @@ const imgUrl = (node: any) => {
color: #b2833d;
margin-right: 10px;
}
.node_type {
background: #bf9d6b;
border-radius: 20px;
line-height: 1;
font-size: 12px;
font-weight: 400;
color: #ffffff;
text-align: center;
padding: 4px 8px;
margin-right: 14px;
}
.node_title {
font-size: 14px;
font-weight: 400;
color: #666666;
line-height: 1;
text-align: center;
}
</style>
......@@ -61,6 +61,10 @@ const copyCourse = () => {
&:hover {
.tool-pop-btn {
opacity: 1;
display: flex;
justify-content: center;
align-items: center;
flex-direction: column;
}
}
.cover-img {
......
......@@ -53,6 +53,8 @@ const changeVideo = (index: number) => {
<AppVideoPlayer :options="videoOptions"></AppVideoPlayer>
</div>
</div>
<div style="margin-top: 10px">本小节视频资源:</div>
<div class="cover-box">
<div
class="cover-img"
......@@ -96,5 +98,8 @@ const changeVideo = (index: number) => {
background: #aa1941;
text-align: center;
line-height: 30px;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
</style>
......@@ -37,7 +37,6 @@ const listOptions = computed(() => {
}
},
{ label: '课程分类', prop: 'classification_name', align: 'center' },
{ label: '知识点', prop: 'knowledge_points', align: 'center' },
{ label: '封面', slots: 'table-cover', width: 150, align: 'center' },
{ label: '资源状态', prop: 'status_name', align: 'center' },
{ label: '审核状态', prop: 'audit_status_name', align: 'center' },
......
......@@ -46,6 +46,7 @@ interface IResourceAll {
data: { id: string; url: string }[]
exam: any[]
live: any[]
homework: any[]
}
// 所有要渲染的资源
......@@ -55,7 +56,8 @@ const resourceData = reactive<IResourceAll>({
lessonPlan: [],
data: [],
exam: [],
live: []
live: [],
homework: []
})
// 分配资源
......@@ -88,6 +90,9 @@ const getChapterResource = () => {
case '6':
resourceData.live.push(item.resource)
break
case '3':
resourceData.homework.push(item.resource)
break
}
})
}
......@@ -124,6 +129,35 @@ const listOptions = computed(() => {
data: resourceData.exam
}
})
// 作业参数
const homeworkOptions = computed(() => {
return {
columns: [
{ type: 'index', label: '序号', fixed: 'left' },
{
label: '组卷模式',
prop: 'paper_type',
computed: (row: any) => {
return row.row.paper_type === 1 ? '选题组卷' : '自动组卷'
}
},
{
label: '试卷用途',
prop: 'paper_uses',
computed: (row: any) => {
const map = { 1: '考试', 2: '课后作业', 3: '课程测试' }
return map[row.row.paper_uses] || row.row.paper_uses
}
},
{ label: '试卷分类', prop: 'paper_category.name' },
{ label: '试卷名称', prop: 'paper_title' },
{ label: '总分', prop: 'paper_total_score' },
{ label: '及格分数', prop: 'pass_score' },
{ label: '更新时间', prop: 'updated_at' }
],
data: resourceData.homework
}
})
// 直播
const add0 = (m: number) => {
......@@ -180,6 +214,7 @@ watch(
</script>
<template>
<AppCard title="查阅课程">
{{ resourceData }}
<div class="chapter-box">
<div class="title">{{ chapterDetails?.name }}</div>
<div class="chapter-content">
......@@ -202,10 +237,13 @@ watch(
<PreviewFiles :url="item.url" v-for="item in resourceData.data" :key="item.id"></PreviewFiles>
<el-empty description="暂无数据" v-if="!resourceData.data.length" />
</el-tab-pane>
<el-tab-pane label="考试 / 测验" name="4">
<el-tab-pane label="作业" name="4">
<AppList v-bind="homeworkOptions"></AppList>
</el-tab-pane>
<el-tab-pane label="考试 / 测验" name="5">
<AppList v-bind="listOptions"></AppList>
</el-tab-pane>
<el-tab-pane label="直播" name="5">
<el-tab-pane label="直播" name="6">
<AppList v-bind="liveOptions">
<template #table-operate="{ row }">
<el-button plain @click="goLive(row.join_url)">查看</el-button>
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论