提交 144a3b74 authored 作者: matian's avatar matian

updates:章节内容下载按钮状态判断

上级 8f51e42e
......@@ -9,16 +9,16 @@ const props: any = defineProps<{ data: object; tabIndex: string }>()
<!-- <img :src="props.data.cover" /> -->
<div class="cover-img" :style="`background-image:url(${props.data.cover})`"></div>
<div class="tool-pop-btn">
<!-- <div style="min-width: 100%">
<router-link v-if="props.data.auth_edit" :to="`/resource/video/update?id=${props.data.id}`">
<div style="min-width: 100%">
<!-- <router-link v-if="props.data.auth_edit" :to="`/resource/video/update?id=${props.data.id}`">
<div class="edit-btn">编辑</div>
</router-link>
</router-link> -->
</div>
<div style="min-width: 100%">
<router-link v-if="props.data.auth_view" :to="`/resource/video/view?id=${props.data.id}`">
<div class="view-btn">查看</div>
</router-link>
</div> -->
</div>
</div>
</div>
<div class="card-item-bottom">
......
<script lang="ts" setup>
import { Plus } from '@element-plus/icons-vue'
import { ElMessage, ElMessageBox } from 'element-plus'
import {
getCharacter,
delCharacter,
getVideoDetails,
getCourseWareDetails,
getLessonDetails,
dragChapterList,
getOtherDetails
} from '../api'
import { getCharacter, delCharacter, getVideoDetails, dragChapterList } from '../api'
import AddSectionDialog from '../components/stepTwoComponents/AddSectionDialog.vue'
import AddLiveDialog from '../components/stepTwoComponents/AddLiveDialog.vue'
import AddVideoDialog from '../components/stepTwoComponents/AddVideoDialog.vue'
......@@ -32,7 +24,6 @@ const chapterID = ref('')
const btnInfo = ref({}) // 按钮信息
const isEdit = ref(false)
const videoUrl = ref('')
const otherUrl = ref('')
const btnList = [
{
btn_name: '视频',
......@@ -146,24 +137,8 @@ const handleConsult = (node: any) => {
}
// 下载
const handleDownload = (node: any) => {
if (node.data.resource_type === '10') {
// 课件
getCourseWareDetails({ id: node.data.resource_id }).then((res: any) => {
otherUrl.value = res.data.url
window.open(otherUrl.value)
})
} else if (node.data.resource_type === '11') {
//教案
getLessonDetails({ id: node.data.resource_id }).then(res => {
otherUrl.value = res.data.url
window.open(otherUrl.value)
})
} else if (node.data.resource_type === '4') {
getOtherDetails({ id: node.data.resource_id }).then(res => {
otherUrl.value = res.data.url
window.open(otherUrl.value)
})
}
console.log(node.data.resource.can_view)
window.open(node.data.resource.url)
}
//拖拽
const allowDrop = (draggingNode: any, dropNode: any, type: any) => {
......@@ -220,12 +195,14 @@ const handleDrop = (startNode: any, endNode: any, position: any, event: any) =>
class="btn_edit"
v-if="data.depth === '3' && node.data.resource_type === '2'"
@click="handleConsult(node)"
:disabled="node.data.resource.can_view !== true"
>查阅</el-link
>
<el-link
class="btn_edit"
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"
>下载</el-link
>
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论