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

课程资料以及考试优化

上级 bab33b35
...@@ -22,6 +22,7 @@ export function searchExam(params: { ...@@ -22,6 +22,7 @@ export function searchExam(params: {
paper_categories?: string paper_categories?: string
page?: number page?: number
limit?: number limit?: number
paper_use_list?:any
}) { }) {
return httpRequest.get(`/api/qbs/admin/v2/question-papers/resourse_ci`, { params }) return httpRequest.get(`/api/qbs/admin/v2/question-papers/resourse_ci`, { params })
} }
......
...@@ -67,7 +67,9 @@ const handlePrimary = () => { ...@@ -67,7 +67,9 @@ const handlePrimary = () => {
<template> <template>
<div> <div>
<el-button type="primary" @click="dialogVisible = true" v-permission="'v1-course-search-teacher'">添加助教</el-button> <el-button type="primary" @click="dialogVisible = true" v-permission="'v1-course-search-teacher'"
>添加助教</el-button
>
<AppList v-bind="listOptions" ref="appList"> <AppList v-bind="listOptions" ref="appList">
<template #table-avatar="{ row }"> <template #table-avatar="{ row }">
<img <img
...@@ -79,7 +81,7 @@ const handlePrimary = () => { ...@@ -79,7 +81,7 @@ const handlePrimary = () => {
<div v-html="row.summarize"></div> <div v-html="row.summarize"></div>
</template> </template>
<template #table-operate="{ row }"> <template #table-operate="{ row }">
<el-button plain @click="handelRemove(row.id)">删除</el-button> <el-button type="primary" plain @click="handelRemove(row.id)">删除</el-button>
</template> </template>
</AppList> </AppList>
<el-dialog v-model="dialogVisible" width="400px" title="添加助教" append-to-body> <el-dialog v-model="dialogVisible" width="400px" title="添加助教" append-to-body>
......
<script setup lang="ts"> <script setup lang="ts">
import { checkPermission } from '@/utils/permission'
import { ElMessage } from 'element-plus'
import { setDownload } from '../../api'
import AddVideoDialog from '../stepTwoComponents/AddVideoDialog.vue' import AddVideoDialog from '../stepTwoComponents/AddVideoDialog.vue'
const emit = defineEmits<Emits>() const emit = defineEmits<Emits>()
...@@ -51,7 +47,6 @@ const listOptions = $computed(() => { ...@@ -51,7 +47,6 @@ const listOptions = $computed(() => {
return { return {
columns: [ columns: [
{ label: '资料名称', prop: 'name', slots: 'table-name' }, { label: '资料名称', prop: 'name', slots: 'table-name' },
{ label: '能否下载', prop: 'can_download', slots: 'table-status' },
{ label: '操作', slots: 'table-operate', align: 'center', width: 200, fixed: 'right' } { label: '操作', slots: 'table-operate', align: 'center', width: 200, fixed: 'right' }
], ],
data: dataList.value.length > 0 ? dataList.value : [] data: dataList.value.length > 0 ? dataList.value : []
...@@ -85,19 +80,6 @@ const imgUrl = (val: any) => { ...@@ -85,19 +80,6 @@ const imgUrl = (val: any) => {
return 'https://webapp-pub.ezijing.com/center_resource/pptx_img.png' return 'https://webapp-pub.ezijing.com/center_resource/pptx_img.png'
} }
} }
const handleChangeStatus = (row: any) => {
if (row.id !== undefined) {
const params: any = {
course_id: props.id,
information_id: row.id,
can_download: row.can_download
}
setDownload(params).then(() => {
ElMessage.success('设置课程资料能否下载成功')
})
}
}
</script> </script>
<template> <template>
...@@ -109,20 +91,8 @@ const handleChangeStatus = (row: any) => { ...@@ -109,20 +91,8 @@ const handleChangeStatus = (row: any) => {
<span class="node_type">资料</span> <span class="node_type">资料</span>
<span class="node_title">{{ row.name }}</span> <span class="node_title">{{ row.name }}</span>
</template> </template>
<template #table-status="{ row }">
<el-switch
size="large"
v-model="row.can_download"
active-value="1"
inactive-value="0"
inline-prompt
style="--el-switch-on-color: #aa1941"
@change="handleChangeStatus(row)"
:disabled="!checkPermission('v1-course-set-course-information-can-download')"
></el-switch>
</template>
<template #table-operate="{ row }"> <template #table-operate="{ row }">
<el-button plain @click="handleDetail(row)" :disabled="row.can_download === '0'">查阅</el-button> <el-button plain @click="handleDetail(row)">查阅</el-button>
<el-button type="primary" plain @click="handleDel(row)">删除</el-button> <el-button type="primary" plain @click="handleDel(row)">删除</el-button>
</template> </template>
</AppList> </AppList>
......
...@@ -59,7 +59,7 @@ const listOptions = computed(() => { ...@@ -59,7 +59,7 @@ const listOptions = computed(() => {
}, },
{ label: '总分', prop: 'paper_total_score', align: 'center' }, { label: '总分', prop: 'paper_total_score', align: 'center' },
{ label: '及格分数', prop: 'pass_score', align: 'center' }, { label: '及格分数', prop: 'pass_score', align: 'center' },
{ label: '操作', slots: 'table-operate', align: 'center' , fixed: 'right'} { label: '操作', slots: 'table-operate', align: 'center', fixed: 'right' }
] ]
} }
}) })
...@@ -98,7 +98,7 @@ const handleAddExam = (val: any) => { ...@@ -98,7 +98,7 @@ const handleAddExam = (val: any) => {
<div v-html="row.summarize"></div> <div v-html="row.summarize"></div>
</template> </template>
<template #table-operate="{ row }"> <template #table-operate="{ row }">
<el-button plain @click="removeLectuter(row.id)">删除</el-button> <el-button type="primary" plain @click="removeLectuter(row.id)">删除</el-button>
</template> </template>
</AppList> </AppList>
<AddExamDialog <AddExamDialog
......
...@@ -34,7 +34,8 @@ const listOptions = { ...@@ -34,7 +34,8 @@ const listOptions = {
}, },
params: { params: {
project_tag: 'resourse_ci', project_tag: 'resourse_ci',
permission: tabValue permission: tabValue,
paper_use_list: [1, 3]
} }
}, },
filters: [ filters: [
...@@ -100,6 +101,11 @@ const handleSelectionChange = (val: any) => { ...@@ -100,6 +101,11 @@ const handleSelectionChange = (val: any) => {
<template> <template>
<el-drawer :model-value="isShowExamDialog" :before-close="handleCancel" size="60%" title="添加考试"> <el-drawer :model-value="isShowExamDialog" :before-close="handleCancel" size="60%" title="添加考试">
<el-row>
<el-col :span="2" :offset="22">
<el-button type="primary" @click="handleSave">保存</el-button>
</el-col>
</el-row>
<div class="video-head"> <div class="video-head">
<el-tabs @tab-change="tabChange" v-model="tabValue"> <el-tabs @tab-change="tabChange" v-model="tabValue">
<el-tab-pane label="我的资源" name="1"></el-tab-pane> <el-tab-pane label="我的资源" name="1"></el-tab-pane>
...@@ -118,9 +124,6 @@ const handleSelectionChange = (val: any) => { ...@@ -118,9 +124,6 @@ const handleSelectionChange = (val: any) => {
/> />
</template> </template>
</AppList> </AppList>
<div class="btn-box" style="display: flex; justify-content: center">
<el-button type="primary" @click="handleSave">保存</el-button>
</div>
</el-drawer> </el-drawer>
</template> </template>
<style lang="scss"></style> <style lang="scss"></style>
...@@ -79,7 +79,7 @@ const handlePrimary = () => { ...@@ -79,7 +79,7 @@ const handlePrimary = () => {
<div v-html="row.summarize"></div> <div v-html="row.summarize"></div>
</template> </template>
<template #table-operate="{ row }"> <template #table-operate="{ row }">
<el-button plain @click="handelRemove(row.id)">删除</el-button> <el-button type="primary" plain @click="handelRemove(row.id)">删除</el-button>
</template> </template>
</AppList> </AppList>
<el-dialog v-model="dialogVisible" width="400px" title="添加讲师" append-to-body> <el-dialog v-model="dialogVisible" width="400px" title="添加讲师" append-to-body>
......
...@@ -95,7 +95,7 @@ const handlePrimary = () => { ...@@ -95,7 +95,7 @@ const handlePrimary = () => {
<div v-html="row.summarize"></div> <div v-html="row.summarize"></div>
</template> </template>
<template #table-operate="{ row }"> <template #table-operate="{ row }">
<el-button plain @click="handleRemove(row.id)">删除</el-button> <el-button type="primary" plain @click="handleRemove(row.id)">删除</el-button>
</template> </template>
</AppList> </AppList>
<el-dialog v-model="dialogVisible" width="400px" title="添加直播" append-to-body> <el-dialog v-model="dialogVisible" width="400px" title="添加直播" append-to-body>
......
...@@ -32,6 +32,10 @@ const props = defineProps({ ...@@ -32,6 +32,10 @@ const props = defineProps({
btnInfo: { btnInfo: {
type: Object, type: Object,
required: true required: true
},
paper_use_list: {
type: Array,
required: true
} }
}) })
interface Emits { interface Emits {
...@@ -40,7 +44,6 @@ interface Emits { ...@@ -40,7 +44,6 @@ interface Emits {
} }
const listOptions = { const listOptions = {
isLimit: true, isLimit: true,
remote: { remote: {
httpRequest: searchExam, httpRequest: searchExam,
beforeRequest(params: any) { beforeRequest(params: any) {
...@@ -53,7 +56,8 @@ const listOptions = { ...@@ -53,7 +56,8 @@ const listOptions = {
}, },
params: { params: {
project_tag: 'resourse_ci', project_tag: 'resourse_ci',
permission: tabValue permission: tabValue,
paper_use_list: props.paper_use_list
} }
}, },
filters: [ filters: [
...@@ -146,9 +150,11 @@ const typeFilter = () => { ...@@ -146,9 +150,11 @@ const typeFilter = () => {
size="70%" size="70%"
:title="`添加${props.btnInfo.btn_name}`" :title="`添加${props.btnInfo.btn_name}`"
> >
<div class="btn-box"> <el-row>
<el-button type="primary" @click="handleSave">保存</el-button> <el-col :span="2" :offset="22">
</div> <el-button type="primary" @click="handleSave">保存</el-button>
</el-col>
</el-row>
<div class="video-head"> <div class="video-head">
<el-tabs @tab-change="tabChange" v-model="tabValue"> <el-tabs @tab-change="tabChange" v-model="tabValue">
<el-tab-pane label="我的资源" name="1"></el-tab-pane> <el-tab-pane label="我的资源" name="1"></el-tab-pane>
...@@ -177,10 +183,4 @@ const typeFilter = () => { ...@@ -177,10 +183,4 @@ const typeFilter = () => {
:deep(.el-table__header-wrapper .el-checkbox) { :deep(.el-table__header-wrapper .el-checkbox) {
display: none; display: none;
} }
.btn-box {
display: flex;
justify-content: flex-end;
margin-bottom: -20px;
cursor: pointer;
}
</style> </style>
...@@ -30,6 +30,7 @@ const isEdit = ref(false) ...@@ -30,6 +30,7 @@ const isEdit = ref(false)
const videoUrl = ref('') const videoUrl = ref('')
const sectionName = ref('') const sectionName = ref('')
const controlInfo = ref({}) const controlInfo = ref({})
const paper_use_list: any = ref([])
const defaultExpandedKeys: any = ref([]) const defaultExpandedKeys: any = ref([])
const flag = ref(false) const flag = ref(false)
const btnList = [ const btnList = [
...@@ -146,8 +147,12 @@ const handleAddDialog = (node: any, item: any) => { ...@@ -146,8 +147,12 @@ const handleAddDialog = (node: any, item: any) => {
(item.resource_type === '4' && checkPermission('v1-course-search-other-information')) (item.resource_type === '4' && checkPermission('v1-course-search-other-information'))
) { ) {
isShowAddDialog.value = true isShowAddDialog.value = true
} else if (item.resource_type === '3' || item.resource_type === '9') { } else if (item.resource_type === '9') {
isShowExamDialog.value = true isShowExamDialog.value = true
paper_use_list.value = [1, 3]
} else if (item.resource_type === '3') {
isShowExamDialog.value = true
paper_use_list.value = [2]
} }
} }
//查阅 //查阅
...@@ -503,6 +508,7 @@ const handleChangeStatus = (node: any, data: any) => { ...@@ -503,6 +508,7 @@ const handleChangeStatus = (node: any, data: any) => {
:chapterID="chapterID" :chapterID="chapterID"
:course_id="id" :course_id="id"
:btnInfo="btnInfo" :btnInfo="btnInfo"
:paper_use_list="paper_use_list"
:isMultiple="false" :isMultiple="false"
/> />
<!-- 视频查阅弹框 --> <!-- 视频查阅弹框 -->
......
...@@ -18,7 +18,6 @@ export function getVideoDetails(params: { id: string }) { ...@@ -18,7 +18,6 @@ export function getVideoDetails(params: { id: string }) {
return httpRequest.get('/api/resource/v1/resource/video/view', { params }) return httpRequest.get('/api/resource/v1/resource/video/view', { params })
} }
// 获取课程列表 // 获取课程列表
export function getCourseList(params: { export function getCourseList(params: {
tab: string tab: string
...@@ -86,6 +85,10 @@ export function courseAuthorization(data: { id: string; organ_ids: string }) { ...@@ -86,6 +85,10 @@ export function courseAuthorization(data: { id: string; organ_ids: string }) {
} }
// 复制课程 // 复制课程
export function courseCopy(data: { id: string; }) { export function courseCopy(data: { id: string }) {
return httpRequest.post('/api/resource/v1/course/course/copy', data) return httpRequest.post('/api/resource/v1/course/course/copy', data)
} }
// 控制资料能否下载
export function setDownload(data: { course_id: string; information_id: string; can_download: string }) {
return httpRequest.post('/api/resource/v1/course/course/set-course-information-can-download ', data)
}
<script setup lang="ts"> <script setup lang="ts">
// import VEditor from '@/components/tinymce/Index.vue' import { checkPermission } from '@/utils/permission'
import { ElMessage } from 'element-plus'
import { setDownload } from '../api'
const props: any = defineProps({ const props: any = defineProps({
data: { data: {
type: Object type: Object
},
id: {
type: String
} }
}) })
const form: any = ref({}) const form: any = ref({})
...@@ -96,6 +101,52 @@ const liveOptions = computed(() => { ...@@ -96,6 +101,52 @@ const liveOptions = computed(() => {
] ]
} }
}) })
const courseDataOptions = computed(() => {
return {
data: props.data.information,
columns: [
{ label: '资料名称', prop: 'name', slots: 'table-name' },
{ label: '能否下载', prop: 'can_download', slots: 'table-status' },
{ label: '操作', slots: 'table-operate', align: 'center', width: 200, fixed: 'right' }
]
}
})
const imgUrl = (val: any) => {
if (val.type === 'zip') {
return 'https://webapp-pub.ezijing.com/center_resource/zip_img.png'
} else if (val.type === 'pdf') {
return 'https://webapp-pub.ezijing.com/center_resource/pdf_img.png'
} else if (val.type === 'png' || val.type === 'jpeg' || val.type === 'jpg') {
return 'https://webapp-pub.ezijing.com/center_resource/jpg_img.png'
} else if (val.type === 'xls' || val.type === 'xlsx') {
return 'https://webapp-pub.ezijing.com/center_resource/xls_img.png'
} else if (val.type === 'docx' || val.type === 'doc') {
return 'https://webapp-pub.ezijing.com/center_resource/docx_img.png'
} else if (val.type === 'mp4') {
return 'https://webapp-pub.ezijing.com/center_resource/mp4_img.png'
} else if (val.type === 'mp3') {
return 'https://webapp-pub.ezijing.com/center_resource/mp3_img.png'
} else if (val.type === 'rar') {
return 'https://webapp-pub.ezijing.com/center_resource/rar_img.png'
} else if (val.type === 'pptx' || val.type === 'ppt') {
return 'https://webapp-pub.ezijing.com/center_resource/pptx_img.png'
}
}
const handleChangeStatus = (row: any) => {
if (row.id !== undefined) {
const params: any = {
course_id: props.id,
information_id: row.id,
can_download: row.can_download
}
setDownload(params).then(() => {
ElMessage.success('设置课程资料能否下载成功')
})
}
}
const handleDetail = (row: any) => {
window.open(row.url)
}
</script> </script>
<template> <template>
<div class="info-box"> <div class="info-box">
...@@ -151,6 +202,31 @@ const liveOptions = computed(() => { ...@@ -151,6 +202,31 @@ const liveOptions = computed(() => {
<el-form-item label="周期性直播:"> <el-form-item label="周期性直播:">
<AppList v-bind="liveOptions" style="width: 100%"> </AppList> <AppList v-bind="liveOptions" style="width: 100%"> </AppList>
</el-form-item> </el-form-item>
<el-form-item label="课程资料:">
<AppList v-bind="courseDataOptions" style="width: 100%">
<template #table-name="{ row }">
<img :src="imgUrl(row)" alt="" style="width: 13px; height: 100%; margin-right: 13px" />
<span class="node_type">资料</span>
<span class="node_title">{{ row.name }}</span>
</template>
<template #table-status="{ row }">
<el-switch
size="large"
v-model="row.can_download"
active-value="1"
inactive-value="0"
inline-prompt
style="--el-switch-on-color: #aa1941"
@click="handleChangeStatus(row)"
:disabled="!checkPermission('v1-course-set-course-information-can-download')"
>
</el-switch>
</template>
<template #table-operate="{ row }">
<el-button plain @click="handleDetail(row)">查阅</el-button>
</template>
</AppList>
</el-form-item>
</el-form> </el-form>
</div> </div>
</template> </template>
......
...@@ -33,7 +33,7 @@ const handleFresh = () => { ...@@ -33,7 +33,7 @@ const handleFresh = () => {
<ViewCourseInfoTop :data="courseDetails"></ViewCourseInfoTop> <ViewCourseInfoTop :data="courseDetails"></ViewCourseInfoTop>
<div class="course-left_info"> <div class="course-left_info">
<ViewCourseInfo :data="courseDetails" class="info_bottom"></ViewCourseInfo> <ViewCourseInfo :data="courseDetails" class="info_bottom" :id="id"></ViewCourseInfo>
<ViewCourseChapter <ViewCourseChapter
v-if="Object.keys(courseDetails).length" v-if="Object.keys(courseDetails).length"
:data="courseDetails.chapters[0]?.children || []" :data="courseDetails.chapters[0]?.children || []"
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论