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

updates

上级 f79361a3
...@@ -33,11 +33,10 @@ const listOptions = computed(() => { ...@@ -33,11 +33,10 @@ const listOptions = computed(() => {
prop: 'start_time', prop: 'start_time',
align: 'center', align: 'center',
computed({ row }: any) { computed({ row }: any) {
console.log(row.start_time, row.end_time, Date.parse(Date()), '000row.start_time') if (row.start_time === undefined) {
if (row.start_time === undefined || Date.parse(Date()) > row.start_time) {
return '-' return '-'
} else { } else {
return format(parseInt(row.start_time)) return format(parseInt(row.start_time) * 1000)
} }
} }
}, },
...@@ -46,10 +45,10 @@ const listOptions = computed(() => { ...@@ -46,10 +45,10 @@ const listOptions = computed(() => {
prop: 'end_time', prop: 'end_time',
align: 'center', align: 'center',
computed({ row }: any) { computed({ row }: any) {
if (row.end_time === undefined || Date.parse(Date()) > row.end_time) { if (row.end_time === undefined) {
return '-' return '-'
} else { } else {
return format(parseInt(row.end_time)) return format(parseInt(row.end_time) * 1000)
} }
} }
}, },
......
...@@ -69,7 +69,8 @@ const listOptions = computed(() => { ...@@ -69,7 +69,8 @@ const listOptions = computed(() => {
httpRequest: getHttpRequest, httpRequest: getHttpRequest,
callback(data: any) { callback(data: any) {
tableData = data tableData = data
tableData.list.forEach((item: any) => (item.status = '1')) tableData.list.forEach((item: any) => (item.check_status = false))?.filter((it: any) => it.status === '1')
console.log(tableData, '0000')
return data return data
}, },
params: { tab: tabValue, status: '', authorized: '', name: '', course_id: props.course_id } params: { tab: tabValue, status: '', authorized: '', name: '', course_id: props.course_id }
......
...@@ -12,6 +12,7 @@ import AddLecturer from '../components/stepOneComponents/AddLecturer.vue' ...@@ -12,6 +12,7 @@ import AddLecturer from '../components/stepOneComponents/AddLecturer.vue'
import AddExam from '../components/stepOneComponents/AddExam.vue' import AddExam from '../components/stepOneComponents/AddExam.vue'
// 添加直播 // 添加直播
import AddLive from '../components/stepOneComponents/AddLive.vue' import AddLive from '../components/stepOneComponents/AddLive.vue'
import { ElMessage } from 'element-plus'
const store = useMapStore() const store = useMapStore()
...@@ -127,6 +128,10 @@ const stepOneId = ref() ...@@ -127,6 +128,10 @@ const stepOneId = ref()
// 新建课件 // 新建课件
const createCourseForm = () => { const createCourseForm = () => {
if (isUpdate) { if (isUpdate) {
if (form.lecturer_id === '') {
ElMessage.warning('请添加讲师')
return
}
updateCourse(form).then((res: any) => { updateCourse(form).then((res: any) => {
if (res.code === 0) { if (res.code === 0) {
// 操作第二部 // 操作第二部
...@@ -141,7 +146,10 @@ const createCourseForm = () => { ...@@ -141,7 +146,10 @@ const createCourseForm = () => {
} }
}) })
} else { } else {
console.log(form, 'form') if (form.lecturer_id === '') {
ElMessage.warning('请添加讲师')
return
}
createCourse(form).then((res: any) => { createCourse(form).then((res: any) => {
if (res.code === 0) { if (res.code === 0) {
// 操作第二部 // 操作第二部
...@@ -191,7 +199,7 @@ const createCourseForm = () => { ...@@ -191,7 +199,7 @@ const createCourseForm = () => {
/> />
</el-form-item> </el-form-item>
<el-form-item label="课程学分:" prop="credit"> <el-form-item label="课程学分:" prop="credit">
<el-input v-model="form.credit" maxlength="40" /> <el-input v-model="form.credit" maxlength="2" />
</el-form-item> </el-form-item>
</el-form> </el-form>
</div> </div>
......
<script setup lang="ts"> <script setup lang="ts">
import { courseCopy } from '../api'
import { ElMessage } from 'element-plus'
const props: any = defineProps<{ data: object; tabIndex: string }>() const props: any = defineProps<{ data: object; tabIndex: string }>()
// 复制
const copyCourse = () => {
courseCopy({ id: props.data.id }).then((res: any) => {
if (res.code === 0) {
ElMessage({ message: '复制成功', type: 'success' })
}
})
}
</script> </script>
<template> <template>
<!-- <div>{{ props.data }}</div> --> <!-- <div>{{ props.data }}</div> -->
...@@ -18,6 +29,9 @@ const props: any = defineProps<{ data: object; tabIndex: string }>() ...@@ -18,6 +29,9 @@ const props: any = defineProps<{ data: object; tabIndex: string }>()
<router-link v-if="props.data.auth_view" :to="`/course/my/view?id=${props.data.id}`"> <router-link v-if="props.data.auth_view" :to="`/course/my/view?id=${props.data.id}`">
<div class="view-btn">查看</div> <div class="view-btn">查看</div>
</router-link> </router-link>
<div style="min-width: 100%" v-if="props.data.auth_copy">
<div class="copy-btn" plain @click="copyCourse">复制</div>
</div>
</div> </div>
</div> </div>
</div> </div>
...@@ -78,7 +92,7 @@ const props: any = defineProps<{ data: object; tabIndex: string }>() ...@@ -78,7 +92,7 @@ const props: any = defineProps<{ data: object; tabIndex: string }>()
height: 100%; height: 100%;
background: rgba(0, 0, 0, 0.6); background: rgba(0, 0, 0, 0.6);
opacity: 0; opacity: 0;
padding-top: 52px; padding-top: 22px;
box-sizing: border-box; box-sizing: border-box;
.edit-btn { .edit-btn {
width: 113px; width: 113px;
...@@ -88,7 +102,7 @@ const props: any = defineProps<{ data: object; tabIndex: string }>() ...@@ -88,7 +102,7 @@ const props: any = defineProps<{ data: object; tabIndex: string }>()
text-align: center; text-align: center;
font-size: 14px; font-size: 14px;
color: #ffffff; color: #ffffff;
margin: 0 auto 12px; margin: 0 auto 5px;
cursor: pointer; cursor: pointer;
} }
.view-btn { .view-btn {
...@@ -102,6 +116,17 @@ const props: any = defineProps<{ data: object; tabIndex: string }>() ...@@ -102,6 +116,17 @@ const props: any = defineProps<{ data: object; tabIndex: string }>()
margin: 0 auto; margin: 0 auto;
cursor: pointer; cursor: pointer;
} }
.copy-btn {
width: 113px;
line-height: 32px;
border-radius: 18px;
text-align: center;
font-size: 14px;
color: #ffffff;
margin: 5px auto;
cursor: pointer;
border: 1px solid #d3d3d3;
}
} }
} }
} }
......
...@@ -76,7 +76,7 @@ const handleStatus = () => { ...@@ -76,7 +76,7 @@ const handleStatus = () => {
` `
${ ${
parseInt(props.data.status) === 1 parseInt(props.data.status) === 1
? '已下线的课程将不能被关联到课程使用,确认下线该课程吗?' ? '已下线的课程将不能被共享和使用,确认下线该课程吗?'
: '确认再次上线该课程吗?' : '确认再次上线该课程吗?'
} }
`, `,
......
...@@ -62,7 +62,7 @@ const basicInfo = computed((): IBasicInfo[] => { ...@@ -62,7 +62,7 @@ const basicInfo = computed((): IBasicInfo[] => {
}, },
{ {
icon: 'https://webapp-pub.oss-cn-beijing.aliyuncs.com/center_resource/course-view-icon7.png', icon: 'https://webapp-pub.oss-cn-beijing.aliyuncs.com/center_resource/course-view-icon7.png',
label: '是否可用', label: '是否有效',
value: '', value: '',
key: 'status_name' key: 'status_name'
}, },
...@@ -122,7 +122,7 @@ const basicInfo = computed((): IBasicInfo[] => { ...@@ -122,7 +122,7 @@ const basicInfo = computed((): IBasicInfo[] => {
<div class="item"> <div class="item">
<img src="https://webapp-pub.oss-cn-beijing.aliyuncs.com/center_resource/course-view-icon12.png" /> <img src="https://webapp-pub.oss-cn-beijing.aliyuncs.com/center_resource/course-view-icon12.png" />
<div class="label">课程授权信息</div> <div class="label">课程授权信息</div>
<div class="value">Marrywood</div> <div class="value" v-for="(item, index) in props.data" :key="index">{{ item.department_name }}</div>
</div> </div>
</div> </div>
</div> </div>
......
...@@ -24,7 +24,9 @@ const videoOptions = computed(() => { ...@@ -24,7 +24,9 @@ const videoOptions = computed(() => {
return { return {
sources: [ sources: [
{ {
src: resourceData.play_auth?.play_info_list.find((item: any) => { return item.Definition === 'SD' }).PlayURL src: resourceData.play_auth?.play_info_list.find((item: any) => {
return item.Definition === 'SD'
}).PlayURL
} }
] ]
} }
...@@ -60,6 +62,7 @@ const changeVideo = (index: number) => { ...@@ -60,6 +62,7 @@ const changeVideo = (index: number) => {
@click="changeVideo(index)" @click="changeVideo(index)"
> >
<div :class="index === videoIndex ? 'border active' : 'border'"></div> <div :class="index === videoIndex ? 'border active' : 'border'"></div>
<div class="cover-name">{{ item.name }}</div>
</div> </div>
</div> </div>
</div> </div>
...@@ -67,7 +70,7 @@ const changeVideo = (index: number) => { ...@@ -67,7 +70,7 @@ const changeVideo = (index: number) => {
<style lang="scss" scoped> <style lang="scss" scoped>
.cover-box { .cover-box {
display: flex; display: flex;
margin-bottom: 20px; margin-bottom: 30px;
} }
.cover-img { .cover-img {
width: 200px; width: 200px;
...@@ -81,8 +84,17 @@ const changeVideo = (index: number) => { ...@@ -81,8 +84,17 @@ const changeVideo = (index: number) => {
height: 100%; height: 100%;
box-sizing: border-box; box-sizing: border-box;
&.active { &.active {
border: 10px solid #aa1941; border-top: 5px solid #aa1941;
border-left: 5px solid #aa1941;
border-right: 5px solid #aa1941;
} }
} }
} }
.cover-name {
width: 100%;
height: 30px;
background: #aa1941;
text-align: center;
line-height: 30px;
}
</style> </style>
...@@ -43,8 +43,8 @@ interface IResourceAll { ...@@ -43,8 +43,8 @@ interface IResourceAll {
videoData: { cover: string; id: string }[] videoData: { cover: string; id: string }[]
courseware: { id: string; url: string }[] courseware: { id: string; url: string }[]
lessonPlan: { id: string; url: string }[] lessonPlan: { id: string; url: string }[]
data: { id: string; url: string }[], data: { id: string; url: string }[]
exam: any[], exam: any[]
live: any[] live: any[]
} }
...@@ -184,23 +184,25 @@ watch( ...@@ -184,23 +184,25 @@ watch(
<div class="title">{{ chapterDetails?.name }}</div> <div class="title">{{ chapterDetails?.name }}</div>
<div class="chapter-content"> <div class="chapter-content">
<div class="content-left"> <div class="content-left">
{{ resourceData.videoData }}
<ViewDetailsVideo <ViewDetailsVideo
v-if="Object.keys(resourceData.videoData).length" v-if="Object.keys(resourceData.videoData).length"
:data="resourceData.videoData" :data="resourceData.videoData"
></ViewDetailsVideo> ></ViewDetailsVideo>
<el-empty description="暂无数据" v-else/> <el-empty description="暂无数据" v-else />
<el-tabs :lazy="true" v-model="activeName" class="demo-tabs"> <el-tabs :lazy="true" v-model="activeName" class="demo-tabs">
<el-tab-pane label="课件" name="1"> <el-tab-pane label="课件" name="1">
<PreviewFiles v-for="item in resourceData.courseware" :key="item.id" :url="item.url"></PreviewFiles> <PreviewFiles v-for="item in resourceData.courseware" :key="item.id" :url="item.url"></PreviewFiles>
<el-empty description="暂无数据" v-if="!resourceData.courseware.length"/> <el-empty description="暂无数据" v-if="!resourceData.courseware.length" />
</el-tab-pane> </el-tab-pane>
<el-tab-pane label="教案" name="2"> <el-tab-pane label="教案" name="2">
<PreviewFiles :url="item.url" v-for="item in resourceData.courseware" :key="item.id"></PreviewFiles> <PreviewFiles :url="item.url" v-for="item in resourceData.courseware" :key="item.id"></PreviewFiles>
<el-empty description="暂无数据" v-if="!resourceData.courseware.length"/> <el-empty description="暂无数据" v-if="!resourceData.courseware.length" />
</el-tab-pane> </el-tab-pane>
<el-tab-pane label="资料" name="3"> <el-tab-pane label="资料" name="3">
<PreviewFiles :url="item.url" v-for="item in resourceData.courseware" :key="item.id"></PreviewFiles> <PreviewFiles :url="item.url" v-for="item in resourceData.courseware" :key="item.id"></PreviewFiles>
<el-empty description="暂无数据" v-if="!resourceData.courseware.length"/> <el-empty description="暂无数据" v-if="!resourceData.courseware.length" />
</el-tab-pane> </el-tab-pane>
<el-tab-pane label="考试 / 测验" name="4"> <el-tab-pane label="考试 / 测验" name="4">
<AppList v-bind="listOptions"></AppList> <AppList v-bind="listOptions"></AppList>
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论