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

bug fixes

上级 9bec5a21
......@@ -3,7 +3,7 @@ import { getQuestionCategory } from '@/api/base'
export function useQuestionList() {
const list = ref([])
getQuestionCategory({ project_tag: 'resourse_ci' }).then((res: any) => {
list.value = res.data.filter((item: any) => {
list.value = res.data?.filter((item: any) => {
item.children = detailChild(item.children)
return item.children
})
......@@ -11,7 +11,7 @@ export function useQuestionList() {
const detailChild = (child: any) => {
if (!child) return []
return child.filter((item: any) => {
return child?.filter((item: any) => {
item.children = detailChild(item.children)
return item.children
})
......
......@@ -69,7 +69,7 @@ const listOptions = computed(() => {
httpRequest: getHttpRequest,
callback(data: any) {
tableData = data
tableData.list.forEach((item: any) => (item.check_status = false))
tableData.list.forEach((item: any) => (item.status = '1'))
return data
},
params: { tab: tabValue, status: '', authorized: '', name: '', course_id: props.course_id }
......
......@@ -24,7 +24,9 @@ const props: any = defineProps<{ data: object; tabIndex: string; path: string }>
<div class="card-item-bottom">
<div class="item-t">
<div class="text">{{ props.data.created_operator_name }}/{{ props.data.organ_id_name }}</div>
<div :class="props.data.status == 1 ? 'tag green' : 'tag'">{{ props.data.status_name }}</div>
<div :class="props.data.status == 1 ? 'tag green' : 'tag'">
{{ props.data.status_name }}
</div>
</div>
<div class="item-b">
<div class="time">{{ props.data.updated_time }}</div>
......
......@@ -23,6 +23,7 @@ const handleCancel = () => {
</script>
<template>
<el-dialog :model-value="isShowVideoPlayDialog" draggable :before-close="handleCancel" width="35%">
<AppVideoPlayer :options="{sources:[{src:props.videoOptions}]}"></AppVideoPlayer>
{{props.videoOptions}}
<AppVideoPlayer :options="{ sources: [{ src: props.videoOptions }] }"></AppVideoPlayer>
</el-dialog>
</template>
......@@ -51,7 +51,6 @@ const defaultProps = {
// form
let form = $ref<Record<string, any>>({
status: 1,
source: '2',
cover: 'https://webapp-pub.oss-cn-beijing.aliyuncs.com/center_resource/course-cover.png'
})
......@@ -65,8 +64,7 @@ const rules = {
credit: [{ required: true, message: '请输入学分' }],
lecturer_id: [{ required: true, message: '' }],
exam_id: [{ required: true, message: '' }],
live_id: [{ required: true, message: '' }],
status: [{ required: true, message: '' }]
live_id: [{ required: true, message: '' }]
}
// 课程封面dialog
......@@ -114,7 +112,6 @@ if (isUpdate) {
form.lecturer_id = setDefaultData(lecturerList.value)
form.exam_id = setDefaultData(examList.value)
form.live_id = setDefaultData(liveList.value)
switchFlag.value = !!parseInt(res.data.status)
})
}
const setDefaultData = (data: object[]) => {
......@@ -129,7 +126,6 @@ const setDefaultData = (data: object[]) => {
const stepOneId = ref()
// 新建课件
const createCourseForm = () => {
form.status = switchFlag.value ? '1' : '0'
if (isUpdate) {
updateCourse(form).then((res: any) => {
if (res.code === 0) {
......@@ -161,9 +157,6 @@ const createCourseForm = () => {
})
}
}
// 开关
const switchFlag = ref(true)
</script>
<template>
......@@ -200,9 +193,6 @@ const switchFlag = ref(true)
<el-form-item label="课程学分:" prop="credit">
<el-input v-model="form.credit" maxlength="40" />
</el-form-item>
<el-form-item label="是否可用:" prop="status">
<el-switch v-model="switchFlag" />
</el-form-item>
</el-form>
</div>
<el-form
......
......@@ -54,6 +54,8 @@ const btnList = [
resource_type: '6'
}
]
// const fileType = ['doc', 'docx', 'xls', 'xlsx', 'pdf', 'ppt', 'pptx', 'mp3', 'mp4', 'png', 'jpeg', 'jpg']
const defaultProps = {
children: 'children',
label: 'name'
......@@ -132,6 +134,7 @@ const handleConsult = (node: any) => {
if (node.data.resource_type === '2') {
getVideoDetails({ id: node.data.resource_id }).then(res => {
videoUrl.value = res.data.play_auth.play_info_list.filter((item: any) => item.Definition === 'SD')[0].PlayURL
console.log(videoUrl.value, 'videoUrl.value')
isShowVideoPlayDialog.value = true
})
}
......@@ -168,6 +171,49 @@ const handleDrop = (startNode: any, endNode: any, position: any, event: any) =>
handleChapterList()
})
}
const imgUrl = (node: any) => {
if (node.data.resource_type === '1') {
// 章节
return 'https://webapp-pub.oss-cn-beijing.aliyuncs.com/center_resource/chapter_img.png'
} else if (node.data.resource_type === '2') {
// 视频
console.log(node.data.resource, '000')
return 'https://webapp-pub.oss-cn-beijing.aliyuncs.com/center_resource/mp4_img.png'
} else if (node.data.resource_type === '3') {
// 作业
return 'https://webapp-pub.oss-cn-beijing.aliyuncs.com/center_resource/homework.png'
} else if (node.data.resource_type === '4') {
if (node.data.resource?.url.includes('pptx') || node.data.resource?.url.includes('ppt')) {
// 其他资源
return 'https://webapp-pub.oss-cn-beijing.aliyuncs.com/center_resource/pptx_img.png'
} else if (node.data.resource?.url.includes('rar')) {
// 其他资源
return 'https://webapp-pub.oss-cn-beijing.aliyuncs.com/center_resource/rar_img.png'
} else if (node.data.resource?.url.includes('mp3')) {
// 其他资源
return 'https://webapp-pub.oss-cn-beijing.aliyuncs.com/center_resource/mp3_img.png'
} else if (node.data.resource?.url.includes('mp4')) {
// 其他资源
return 'https://webapp-pub.oss-cn-beijing.aliyuncs.com/center_resource/mp4_img.png'
} else if (node.data.resource?.url.includes('docx') || node.data.resource?.url.includes('doc')) {
return 'https://webapp-pub.oss-cn-beijing.aliyuncs.com/center_resource/docx_img.png'
} else if (node.data.resource?.url.includes('xls') || node.data.resource?.url.includes('xlsx')) {
return ''
} else if (
node.data.resource?.url.includes('png') ||
node.data.resource?.url.includes('jpeg') ||
node.data.resource?.url.includes('jpg')
) {
return 'https://webapp-pub.oss-cn-beijing.aliyuncs.com/center_resource/jpg_img.png'
} else if (node.data.resource?.url.includes('pdf')) {
return 'https://webapp-pub.oss-cn-beijing.aliyuncs.com/center_resource/pdf_img.png'
}
} else if (node.data.resource_type === '9') {
// 考试
return 'https://webapp-pub.oss-cn-beijing.aliyuncs.com/center_resource/test_img.png'
}
}
</script>
<template>
<AppCard :title="isEditCourse === '1' ? '编辑课程' : '新建课程'">
......@@ -190,14 +236,14 @@ const handleDrop = (startNode: any, endNode: any, position: any, event: any) =>
>
<template #default="{ node, data }">
<span class="custom-tree-node">
<span>{{ node.label }}</span>
<span>
<el-link class="btn_edit" v-if="data.depth !== '3'" @click="handleEdit(node)">编辑</el-link>
<img :src="imgUrl(node)" alt="" style="margin-right: 9px; width: 13px; height: 100%" />{{ node.label }}
<el-link
class="btn_edit"
v-if="data.depth === '3' && node.data.resource_type === '2'"
@click="handleConsult(node)"
:disabled="node.data.resource.can_view !== true"
style="margin-left: 35px"
>查阅</el-link
>
<el-link
......@@ -205,10 +251,16 @@ const handleDrop = (startNode: any, endNode: any, position: any, event: any) =>
v-if="data.depth === '3' && node.data.resource_type !== '2' && node.data.resource_type !== '6'"
@click="handleDownload(node)"
:disabled="node.data.resource.can_view !== true"
style="margin-left: 35px"
>下载</el-link
>
<el-link class="btn_edit" v-if="data.depth !== '3'" @click="handleEdit(node)" style="margin-left: 35px"
>编辑</el-link
>
<el-link type="info" @click="handleDel(node)" style="margin-left: 25px">删除</el-link></span
>
<el-link type="info" @click="handleDel(node)">删除</el-link>
<span>
<el-button class="btn_operate" v-if="data.depth === '1'" @click="handleAddSection(node)">
<el-icon><Plus /></el-icon>
&nbsp; 添加小节
......
......@@ -20,8 +20,8 @@ const handleDepartment = () => {
`
${
parseInt(props.data.department_public) === 0
? `该操作将会使本课件资源在您所在的部门“${props.data.organ_id_name}”内部共享,管理者不变,其余人员只能共享使用该资源,确认部门共享吗?`
: `该操作将会取消本课件资源在您所在的部门“${props.data.organ_id_name}”内部共享,部门其余人员将不能再看到该共享资源,确认取消部门共享吗?`
? `该操作将会使本课程在您所在的部门“${props.data.organ_id_name}”内部共享,管理者不变,其余人员只能共享使用该课程,确认部门共享吗?`
: `该操作将会取消本课程在您所在的部门“${props.data.organ_id_name}”内部共享,部门其余人员将不能再看到该共享课程,确认取消部门共享吗?`
}
`,
'提示',
......@@ -48,8 +48,8 @@ const handlePlatform = () => {
`
${
parseInt(props.data.platform_public) === 0
? '该操作将会使本课件资源在e-SaaS平台中公开共享供所有老师使用,资源的管理者不变,其余人员只能共享使用该资源,确认公开该资源吗?'
: '该操作将会取消本课件资源在e-SaaS平台中公开共享,平台所有人员将不能再看到该共享资源,确认取消平台共享吗?'
? '该操作将会使本课程在e-SaaS平台中公开共享供所有老师使用,课程的管理者不变,其余人员只能共享使用该课程,确认公开该课程吗?'
: '该操作将会取消本课程在e-SaaS平台中公开共享,平台所有人员将不能再看到该共享课程,确认取消平台共享吗?'
}
`,
'提示',
......@@ -76,8 +76,8 @@ const handleStatus = () => {
`
${
parseInt(props.data.status) === 1
? '已下线的资源将不能被关联到课程使用,确认下线该资源吗?'
: '确认再次上线该资源吗?'
? '已下线的课程将不能被关联到课程使用,确认下线该课程吗?'
: '确认再次上线该课程吗?'
}
`,
'提示',
......@@ -169,7 +169,7 @@ const copyCourse = () => {
{{ props.data.platform_public == 0 ? '平台共享' : '取消平台共享' }}
</div>
<div v-if="props.data.auth_status" class="btn-item" @click="handleStatus">
{{ props.data.status == 0 ? '资源上线' : '资源下线' }}
{{ props.data.status == 0 ? '课程上线' : '课程下线' }}
</div>
<div v-if="props.data.auth_belong" class="btn-item" @click="handleMembers">更改负责人</div>
</div>
......
......@@ -2,7 +2,7 @@
defineProps<{ data: any[]; isBlack?: boolean }>()
const route = useRoute()
const id = route.query.id ? route.query.id : route.params.courseId as string
const id = route.query.id ? route.query.id : (route.params.courseId as string)
</script>
<template>
<div :class="isBlack ? 'chapter-box active-black' : 'chapter-box'">
......@@ -12,9 +12,9 @@ const id = route.query.id ? route.query.id : route.params.courseId as string
<div class="order">{{ index + 1 }}</div>
<div class="chapter-text">
<div class="chapter">{{ item.name }}</div>
<div class="sections" v-for="(child, childIndex) in item.children" :key="child.id">
<div class="sections" v-for="child in item.children" :key="child.id">
<router-link :to="`/course/my/view/${child.id}/${id}`">
{{ index + 1 }}.{{ childIndex + 1 }} {{ child.name }}
{{ child.name }}
</router-link>
</div>
</div>
......@@ -26,23 +26,24 @@ const id = route.query.id ? route.query.id : route.params.courseId as string
.chapter-box {
width: 300px;
background: #aa1941;
border-radius: 10px;
border-radius: 20px;
margin-left: 20px;
height: fit-content;
&.active-black {
background: #1f1e24;
border-radius: 0;
background: #aa1941;
border-radius: 20px;
.chapter-list {
.item {
border-bottom: 1px dotted #fff;
// border-bottom: 1px dotted #fff;
}
}
}
.title {
width: 271px;
margin: 0 auto;
border-bottom: 1px solid #fff;
font-size: 16px;
// border-bottom: 1px solid #fff;
font-size: 24px;
font-weight: 500;
line-height: 52px;
color: #ffffff;
......@@ -53,12 +54,12 @@ const id = route.query.id ? route.query.id : route.params.courseId as string
padding: 0 23px 70px;
.item {
display: flex;
border-bottom: 1px dotted #e06386;
// border-bottom: 1px dotted #e06386;
margin-top: 30px;
.order {
width: 26px;
height: 26px;
background: rgba(255, 255, 255, 1);
// width: 26px;
// height: 26px;
// background: rgba(255, 255, 255, 1);
border-radius: 50%;
font-size: 16px;
line-height: 26px;
......@@ -68,8 +69,7 @@ const id = route.query.id ? route.query.id : route.params.courseId as string
}
.chapter-text {
.chapter {
font-size: 16px;
font-weight: 500;
font-size: 20px;
line-height: 100%;
color: #ffffff;
margin-bottom: 20px;
......@@ -77,7 +77,7 @@ const id = route.query.id ? route.query.id : route.params.courseId as string
cursor: pointer;
}
.sections {
font-size: 14px;
font-size: 16px;
line-height: 100%;
color: #ffffff;
margin-bottom: 20px;
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论