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

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

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