提交 2b786ee9 authored 作者: lhh's avatar lhh

增加数字教材

上级 037cf9f0
...@@ -238,3 +238,19 @@ export function setDownload(data: { course_id: string; information_id: string; c ...@@ -238,3 +238,19 @@ export function setDownload(data: { course_id: string; information_id: string; c
export function searchAssistant(params: { name: string; page?: string; 'per-page'?: string }) { export function searchAssistant(params: { name: string; page?: string; 'per-page'?: string }) {
return httpRequest.get('/api/resource/v1/course/course/search-teacher', { params }) return httpRequest.get('/api/resource/v1/course/course/search-teacher', { params })
} }
// 获取教师书籍列表
export function getBookList(data: { tel: string; name?: string; }) {
return httpRequest.post('/api/ebook/open/teacher/book/getList', data)
}
// 获取教师书籍详情
export function getBookDetail(data: { id: string; }) {
return httpRequest.post('/api/ebook/open/teacher/book/getInfoById', data)
}
// 获取教师书籍详情
export function getChapter(data: { book_id: string; }) {
return httpRequest.post('/api/ebook/open/teacher/chapter/getAllList', data)
}
...@@ -105,7 +105,8 @@ const imgUrl = (val: any) => { ...@@ -105,7 +105,8 @@ const imgUrl = (val: any) => {
:chapterID="''" :chapterID="''"
:course_id="'0'" :course_id="'0'"
:btnInfo="{ btn_name: '课程资料', resource_type: '4' }" :btnInfo="{ btn_name: '课程资料', resource_type: '4' }"
@create="handleAdd" /> @create="handleAdd"
/>
</div> </div>
</template> </template>
<style> <style>
......
<script setup lang="ts">
import AddTextbookListDialog from '../stepTwoComponents/AddTextbookListDialog.vue'
const emit = defineEmits<Emits>()
const dataList: any = ref([])
const isShowAddDialog = ref(false)
interface Emits {
(e: 'information', dataList: any): void
}
const props = defineProps({
data: {
type: Array,
required: true
},
id: {
type: String
}
})
watch(
() => props.data,
value => {
if (value?.length > 0) {
dataList.value = [...props.data]
} else {
dataList.value = []
}
},
{ immediate: true }
)
watch(
() => dataList.value,
value => {
if (value?.length > 0) {
emit('information', dataList.value)
}
}
)
const handleAddData = () => {
isShowAddDialog.value = true
}
const handleAdd = (val: any) => {
dataList.value = [val]
emit('information', dataList.value)
}
const listOptions = $computed(() => {
return {
columns: [
{ label: '数字教材名称', prop: 'name' },
{
label: '封面',
prop: 'img',
computed(row: any) {
return `<img src="${row.row.img}" style="height:100px;display:block">`
}
},
{ label: '作者', prop: 'authors' },
// { label: '发布者', prop: 'user.real_name' },
// { label: '版号', prop: 'name' },
{ label: '操作', slots: 'table-operate', align: 'center', width: 200, fixed: 'right' }
],
data: dataList.value.length > 0 ? dataList.value : []
}
})
const handleDel = (row: any) => {
const index = dataList.value.findIndex((item: any) => item.id === row.id)
dataList.value.splice(index, 1)
emit('information', dataList.value)
}
const handleView = function (row: any) {
window.open(`https://zijingebook.ezijing.com/student/book?book_id=${row.id}`)
}
</script>
<template>
<div>
<el-button type="primary" @click="handleAddData">添加数字教材</el-button>
<AppList v-bind="listOptions" ref="appList">
<template #table-operate="{ row }">
<el-button plain @click="handleView(row)">查阅</el-button>
<el-button type="primary" plain @click="handleDel(row)">删除</el-button>
</template>
</AppList>
<!-- 添加资源 -->
<AddTextbookListDialog
v-if="isShowAddDialog === true"
v-model:isShowAddDialog="isShowAddDialog"
@create="handleAdd"
/>
</div>
</template>
<style>
.node_type {
background: #bf9d6b;
border-radius: 20px;
line-height: 1;
font-size: 12px;
font-weight: 400;
color: #ffffff;
text-align: center;
padding: 4px 8px;
margin-right: 14px;
}
</style>
<script setup lang="ts">
import { getChapter, createCharacter } from '../../api'
import { Plus } from '@element-plus/icons-vue'
import { ElMessage } from 'element-plus'
const route = useRoute()
const emit = defineEmits<Emits>()
const props = defineProps({
isShowTextbookDialog: {
type: Boolean,
required: true
},
course_id: {
type: String,
required: true
},
chapterName: {
type: String,
required: true
},
chapterID: {
type: String,
required: true
}
})
interface Emits {
(e: 'update:isShowTextbookDialog', isShowVideoDialog: boolean): void
(e: 'create', val: any): void
}
// 取消
const handleCancel = () => {
emit('update:isShowTextbookDialog', false)
}
const chapterList = ref([])
onMounted(() => {
getChapter({ book_id: route.query?.bid as string }).then(res => {
chapterList.value = res.data.reduce((a: any, b: any) => {
b.index = '0'
if (b.children) {
b.children.map((m: any) => {
m.index = '1'
})
}
a.push(b)
return a
}, [])
console.log(chapterList.value, 'chapterList.value')
})
})
// emit('update:isShowTextbookDialog', false)
const handleView = function (id: any) {
window.open(`https://zijingebook.ezijing.com/student/book?book_id=${route.query.bid}&chapter_id=${id}`)
}
const handleGl = function (val: any) {
const params: any = {
name: val.name,
course_id: props.course_id,
resource_type: '13',
parent_id: props.chapterID,
resource_id: val.id
}
createCharacter(params).then(() => {
emit('update:isShowTextbookDialog', false)
emit('create', val)
ElMessage.success('添加成功')
})
}
</script>
<template>
<el-drawer :model-value="isShowTextbookDialog" draggable :before-close="handleCancel" size="60%" title="添加数字教材">
<el-tree :data="chapterList" node-key="id" :accordion="true" :expand-on-click-node="false" style="min-width: 100%">
<template #default="{ data }">
<span class="custom-tree-node">
<span class="node_title">{{ data.name }}</span>
<div>
<el-button class="btn_operate" v-if="data.index === '1'" @click="handleView(data.id)">查阅 </el-button>
<el-button class="btn_operate" v-if="data.index === '1'" @click="handleGl(data)">
<el-icon><Plus /></el-icon>
&nbsp; 关联
</el-button>
</div>
</span>
</template>
</el-tree>
</el-drawer>
</template>
<style lang="scss" scoped>
.custom-tree-node {
flex: 1;
display: flex;
align-items: center;
justify-content: space-between;
font-size: 14px;
padding-right: 8px;
}
.btn_operate {
background-color: rgba(248, 241, 229, 0.39);
font-weight: 400;
color: #b2833d;
border: none;
border-radius: 16px;
margin: 3px;
}
.card-list {
display: flex;
flex-direction: column;
}
.card-list-con {
background: #fafafa;
padding: 20px;
display: flex;
flex-wrap: wrap;
}
.video-head {
position: relative;
.video-head-icon {
position: absolute;
top: 0;
right: 0;
font-size: 30px;
color: #666;
cursor: pointer;
}
}
.video-tool-btn {
padding: 10px 0 30px 0;
}
.video-head-icon {
position: absolute;
top: 0;
right: 0;
font-size: 30px;
color: #666;
cursor: pointer;
}
</style>
<script setup lang="ts">
import { getBookList } from '../../api'
import { useUserStore } from '@/stores/user'
const appList = ref()
const userStore = useUserStore()
const userInfo: any = userStore.user
const emit = defineEmits<Emits>()
const props = defineProps({
isShowAddDialog: {
type: Boolean,
required: true
}
})
interface Emits {
(e: 'update:isShowAddDialog', isShowVideoDialog: boolean): void
(e: 'create', val: any): void
}
const listOptions = computed(() => {
return {
remote: {
httpRequest: getBookList,
params: { tel: userInfo.mobile, name: '' }
},
filters: [{ type: 'input', prop: 'name', placeholder: '书籍名称' }],
columns: [
// { type: 'selection' },
{ label: '数字教材名称', prop: 'name' },
{
label: '封面',
prop: 'img',
computed(row: any) {
return `<img src="${row.row.img}" style="height:100px;display:block">`
}
},
{ label: '作者', prop: 'authors' },
{ label: '发布者', prop: 'user.real_name' },
{ label: '审核状态', prop: 'audit_status', computed(row: any){
const j: any = {
'1': '待发布',
'2': '审核中',
'3': '审核未通过',
'4': '审核通过'
}
return j[row?.row?.audit_status]
} },
// { label: '版号', prop: 'name' },
{ label: '操作', slots: 'table-operate', align: 'center', width: 200, fixed: 'right' }
]
}
})
// 取消
const handleCancel = () => {
emit('update:isShowAddDialog', false)
}
const handleDetail = function (row: any) {
emit('update:isShowAddDialog', false)
emit('create', row)
}
const handleView = function (row: any) {
window.open(`https://zijingebook.ezijing.com/student/book?book_id=${row.id}`)
}
</script>
<template>
<el-drawer :model-value="isShowAddDialog" draggable :before-close="handleCancel" size="60%" title="添加数字教材">
<AppList v-bind="listOptions" ref="appList">
<!-- <el-button style="margin-bottom: 15px" type="primary" @click="addTextbook">添加</el-button> -->
<template #table-operate="{ row }">
<el-button plain @click="handleView(row)">查阅</el-button>
<el-button plain @click="handleDetail(row)">添加</el-button>
</template>
</AppList>
</el-drawer>
</template>
<style lang="scss" scoped>
.card-list {
display: flex;
flex-direction: column;
}
.card-list-con {
background: #fafafa;
padding: 20px;
display: flex;
flex-wrap: wrap;
}
.video-head {
position: relative;
.video-head-icon {
position: absolute;
top: 0;
right: 0;
font-size: 30px;
color: #666;
cursor: pointer;
}
}
.video-tool-btn {
padding: 10px 0 30px 0;
}
.video-head-icon {
position: absolute;
top: 0;
right: 0;
font-size: 30px;
color: #666;
cursor: pointer;
}
</style>
...@@ -75,7 +75,6 @@ const listOptions = computed(() => { ...@@ -75,7 +75,6 @@ const listOptions = computed(() => {
callback(data: any) { callback(data: any) {
data.list.forEach((item: any) => (item.check_status = false)) data.list.forEach((item: any) => (item.check_status = false))
tableData = data tableData = data
console.log(tableData.list, '123')
return { list: data.list, total: data.total } return { list: data.list, total: data.total }
}, },
params: { tab: tabValue, status: '1', authorized: '', name: '', course_id: props.course_id || '' } params: { tab: tabValue, status: '1', authorized: '', name: '', course_id: props.course_id || '' }
...@@ -211,11 +210,9 @@ const changeCard = () => { ...@@ -211,11 +210,9 @@ const changeCard = () => {
let checkBox = $ref([]) let checkBox = $ref([])
const select = function (row: any) { const select = function (row: any) {
checkBox = row checkBox = row
console.log(row)
} }
const addVideoList = function () { const addVideoList = function () {
console.log(checkBox, 'checkBox')
checkBox.forEach((item: any, index: number) => { checkBox.forEach((item: any, index: number) => {
addRequest(item, index, checkBox) addRequest(item, index, checkBox)
}) })
...@@ -228,7 +225,8 @@ const addVideoList = function () { ...@@ -228,7 +225,8 @@ const addVideoList = function () {
draggable draggable
:before-close="handleCancel" :before-close="handleCancel"
size="60%" size="60%"
:title="`添加${props.btnInfo.btn_name}`"> :title="`添加${props.btnInfo.btn_name}`"
>
<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>
...@@ -253,7 +251,8 @@ const addVideoList = function () { ...@@ -253,7 +251,8 @@ const addVideoList = function () {
display: block; display: block;
height: 83px; height: 83px;
background-size: cover; background-size: cover;
background-image: url(${row.cover});`"></div> background-image: url(${row.cover});`"
></div>
</div> </div>
</template> </template>
<template #filter-type="{ params }"> <template #filter-type="{ params }">
...@@ -264,7 +263,8 @@ const addVideoList = function () { ...@@ -264,7 +263,8 @@ const addVideoList = function () {
:props="defaultProps" :props="defaultProps"
v-model="params.classification" v-model="params.classification"
:data="selectTree" :data="selectTree"
:default-expanded-keys="selectTree.length ? [selectTree[0]?.id] : []" /> :default-expanded-keys="selectTree.length ? [selectTree[0]?.id] : []"
/>
</template> </template>
<template #body="{ data }" v-if="isCard"> <template #body="{ data }" v-if="isCard">
<div class="card-list" v-if="data.length"> <div class="card-list" v-if="data.length">
...@@ -279,7 +279,8 @@ const addVideoList = function () { ...@@ -279,7 +279,8 @@ const addVideoList = function () {
:tabIndex="tabValue" :tabIndex="tabValue"
:data="item" :data="item"
:path="path" :path="path"
@add="handleAdd"> @add="handleAdd"
>
<el-checkbox @change="checkboxSelect" v-model="item.check_status"></el-checkbox> <el-checkbox @change="checkboxSelect" v-model="item.check_status"></el-checkbox>
</CardListItem> </CardListItem>
</div> </div>
......
<script setup lang="ts"> <script setup lang="ts">
import { createCourse, getCourseDetails, updateCourse, getMajorList } from '../api' import { createCourse, getCourseDetails, updateCourse, getMajorList, getBookDetail } from '../api'
// setStatus // setStatus
import { useGetCategoryList } from '@/composables/useGetCategoryList' import { useGetCategoryList } from '@/composables/useGetCategoryList'
import { useMapStore } from '@/stores/map' import { useMapStore } from '@/stores/map'
...@@ -19,6 +19,9 @@ import AddLive from '../components/stepOneComponents/AddLive.vue' ...@@ -19,6 +19,9 @@ import AddLive from '../components/stepOneComponents/AddLive.vue'
import AddCourseData from '../components/stepOneComponents/AddCourseData.vue' import AddCourseData from '../components/stepOneComponents/AddCourseData.vue'
// 添加数字教材
import AddTextbook from '../components/stepOneComponents/AddTextbook.vue'
import { ElMessage } from 'element-plus' import { ElMessage } from 'element-plus'
import type { FormInstance, FormRules } from 'element-plus' import type { FormInstance, FormRules } from 'element-plus'
const store = useMapStore() const store = useMapStore()
...@@ -74,7 +77,8 @@ const form = reactive<Record<string, any>>({ ...@@ -74,7 +77,8 @@ const form = reactive<Record<string, any>>({
exam_id: '', exam_id: '',
live_id: '', live_id: '',
specialty_id: [], specialty_id: [],
information_id: '' information_id: '',
book_id: ''
}) })
// 表单验证 // 表单验证
...@@ -111,6 +115,7 @@ const changeExam = (data: any) => { ...@@ -111,6 +115,7 @@ const changeExam = (data: any) => {
// 考试数据回显 // 考试数据回显
const examList: any = ref([]) const examList: any = ref([])
const information: any = ref([]) const information: any = ref([])
const textbookInfo: any = ref([])
// 获取详情 // 获取详情
let loading = $ref<boolean>(false) let loading = $ref<boolean>(false)
...@@ -123,6 +128,15 @@ function fetchDetail() { ...@@ -123,6 +128,15 @@ function fetchDetail() {
form.exam_id = res.data.examinations.map((item: any) => item.id).toString() form.exam_id = res.data.examinations.map((item: any) => item.id).toString()
form.specialty_id = res.data.specialty.map((item: any) => item.id) form.specialty_id = res.data.specialty.map((item: any) => item.id)
form.teacher_id = res.data.teachers.map((item: any) => item.id) form.teacher_id = res.data.teachers.map((item: any) => item.id)
// textbookList.value = res.data.books?.book_id
if (res.data.books.length) {
getBookDetail({ id: res.data.books[0]?.book_id }).then(res => {
if (res.data) {
textbookInfo.value = [res.data]
}
})
// res.data.books[0]?.book_id
}
loading = false loading = false
}) })
} }
...@@ -165,7 +179,7 @@ function handleCreate() { ...@@ -165,7 +179,7 @@ function handleCreate() {
// 操作第二部 // 操作第二部
router.push({ router.push({
path: '/course/update-course/stepTwo', path: '/course/update-course/stepTwo',
query: { id: res.data.id, isEditCourse: '0' } query: { id: res.data.id, isEditCourse: '0', bid: form.book_id }
}) })
} }
}) })
...@@ -178,7 +192,7 @@ function handleUpdate() { ...@@ -178,7 +192,7 @@ function handleUpdate() {
// 操作第二部 // 操作第二部
router.push({ router.push({
path: '/course/update-course/stepTwo', path: '/course/update-course/stepTwo',
query: { id: res.data.id, isEditCourse: '1' } query: { id: res.data.id, isEditCourse: '1', bid: form.book_id }
}) })
} }
}) })
...@@ -196,6 +210,10 @@ getMajorList({ name: '', 'per-page': '100' }).then((res: any) => { ...@@ -196,6 +210,10 @@ getMajorList({ name: '', 'per-page': '100' }).then((res: any) => {
const handleInformation = (val: any) => { const handleInformation = (val: any) => {
form.information_id = val.map((item: any) => item.id).toString() form.information_id = val.map((item: any) => item.id).toString()
} }
const handleTextbook = (val: any) => {
form.book_id = val[0].id
}
</script> </script>
<template> <template>
...@@ -229,7 +247,8 @@ const handleInformation = (val: any) => { ...@@ -229,7 +247,8 @@ const handleInformation = (val: any) => {
:data="selectTree" :data="selectTree"
node-key="id" node-key="id"
:default-expanded-keys="selectTree.length ? [selectTree[0]?.id] : []" :default-expanded-keys="selectTree.length ? [selectTree[0]?.id] : []"
placeholder="请选择课程分类" /> placeholder="请选择课程分类"
/>
</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="3" /> <el-input v-model="form.credit" maxlength="3" />
...@@ -241,14 +260,16 @@ const handleInformation = (val: any) => { ...@@ -241,14 +260,16 @@ const handleInformation = (val: any) => {
style="width: 100%" style="width: 100%"
clearable clearable
multiple multiple
v-permission="'v1-course-search-specialty'"> v-permission="'v1-course-search-specialty'"
>
<!-- :remote-method="handleMajorList" --> <!-- :remote-method="handleMajorList" -->
<el-option <el-option
v-for="(item, index) in majorList" v-for="(item, index) in majorList"
:key="index" :key="index"
:label="item.name" :label="item.name"
:value="item.id"></el-option> :value="item.id"
></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-form> </el-form>
...@@ -259,7 +280,8 @@ const handleInformation = (val: any) => { ...@@ -259,7 +280,8 @@ const handleInformation = (val: any) => {
:model="form" :model="form"
:rules="rules" :rules="rules"
label-suffix=":" label-suffix=":"
style="width: 100%; margin-top: 30px"> style="width: 100%; margin-top: 30px"
>
<el-form-item label="课程助教" prop="teacher_id"> <el-form-item label="课程助教" prop="teacher_id">
<!-- 添加助教 --> <!-- 添加助教 -->
<AddAssistant v-model="form.teachers" style="width: 100%"></AddAssistant> <AddAssistant v-model="form.teachers" style="width: 100%"></AddAssistant>
...@@ -295,7 +317,19 @@ const handleInformation = (val: any) => { ...@@ -295,7 +317,19 @@ const handleInformation = (val: any) => {
:data="information" :data="information"
style="width: 100%" style="width: 100%"
:id="id" :id="id"
@information="handleInformation"></AddCourseData> @information="handleInformation"
></AddCourseData>
</el-form-item>
<!-- AddDigitalTextbook -->
<el-form-item label="数字教材" prop="information_id">
<!-- 添加数字教材 -->
<AddTextbook
v-model="form.book_id"
:data="textbookInfo"
style="width: 100%"
:id="id"
@information="handleTextbook"
></AddTextbook>
</el-form-item> </el-form-item>
</el-form> </el-form>
</div> </div>
......
...@@ -12,6 +12,8 @@ import AddVideoDialog from '../components/stepTwoComponents/AddVideoDialog.vue' ...@@ -12,6 +12,8 @@ import AddVideoDialog from '../components/stepTwoComponents/AddVideoDialog.vue'
import AddExamDialog from '../components/stepTwoComponents/AddExamDialog.vue' import AddExamDialog from '../components/stepTwoComponents/AddExamDialog.vue'
import VideoPlayDialog from '../components/stepTwoComponents/VideoPlayDialog.vue' import VideoPlayDialog from '../components/stepTwoComponents/VideoPlayDialog.vue'
import AddChapterDialog from '../components/stepTwoComponents/AddChapterDialog.vue' import AddChapterDialog from '../components/stepTwoComponents/AddChapterDialog.vue'
import AddTextbookDialog from '../components/stepTwoComponents/AddTextbookDialog.vue'
import OpenRules from '../components/stepTwoComponents/OpenRules.vue' import OpenRules from '../components/stepTwoComponents/OpenRules.vue'
const route = useRoute() const route = useRoute()
const router = useRouter() const router = useRouter()
...@@ -24,6 +26,7 @@ const isShowSectionDialog = ref(false) ...@@ -24,6 +26,7 @@ const isShowSectionDialog = ref(false)
// 修改资源名称弹窗 // 修改资源名称弹窗
const isEditResourcesNameDialog = ref(false) const isEditResourcesNameDialog = ref(false)
// 资源id // 资源id
const isShowTextbookDialog = ref(false)
const resourceId = ref('') const resourceId = ref('')
const isShowLiveDialog = ref(false) const isShowLiveDialog = ref(false)
const isShowAddDialog = ref(false) const isShowAddDialog = ref(false)
...@@ -67,6 +70,10 @@ const btnList = [ ...@@ -67,6 +70,10 @@ const btnList = [
{ {
btn_name: '直播', btn_name: '直播',
resource_type: '6' resource_type: '6'
},
{
btn_name: '关联数字教材',
resource_type: '13'
} }
] ]
const defaultProps = { const defaultProps = {
...@@ -143,7 +150,8 @@ const handleDel = (node: any) => { ...@@ -143,7 +150,8 @@ const handleDel = (node: any) => {
} }
// 添加 // 添加
const handleAddDialog = (node: any, item: any) => { const handleAddDialog = (node: any, item: any, data: any) => {
console.log(data, 'data', dataSource)
chapterID.value = node.key chapterID.value = node.key
chapterName.value = node.label chapterName.value = node.label
btnInfo.value = item btnInfo.value = item
...@@ -164,10 +172,14 @@ const handleAddDialog = (node: any, item: any) => { ...@@ -164,10 +172,14 @@ const handleAddDialog = (node: any, item: any) => {
} else if (item.resource_type === '3') { } else if (item.resource_type === '3') {
isShowExamDialog.value = true isShowExamDialog.value = true
paper_use_list.value = [2] paper_use_list.value = [2]
} else if (item.resource_type === '13') {
isShowTextbookDialog.value = true
} }
} }
//查阅 //查阅
const handleConsult = (node: any) => { const handleConsult = (node: any) => {
console.log(node, 'node')
// 视频 // 视频
if (node.data.resource_type === '2') { if (node.data.resource_type === '2') {
getVideoDetails({ id: node.data.resource_id }).then(res => { getVideoDetails({ id: node.data.resource_id }).then(res => {
...@@ -175,6 +187,11 @@ const handleConsult = (node: any) => { ...@@ -175,6 +187,11 @@ const handleConsult = (node: any) => {
isShowVideoPlayDialog.value = true isShowVideoPlayDialog.value = true
}) })
} }
if (node.data.resource_type === '13') {
window.open(
`https://zijingebook.ezijing.com/student/book?book_id=${route.query.bid}&chapter_id=${node.data.resource_id}`
)
}
} }
// 下载 // 下载
const handleDownload = (node: any) => { const handleDownload = (node: any) => {
...@@ -252,6 +269,9 @@ const imgUrl = (node: any) => { ...@@ -252,6 +269,9 @@ const imgUrl = (node: any) => {
} else if (node.data.resource_type === '9') { } else if (node.data.resource_type === '9') {
// 考试 // 考试
return '/center_resource/test_img.png' return '/center_resource/test_img.png'
} else if (node.data.resource_type === '13') {
// 考试
return '/center_resource/docx_img.png'
} }
} }
const nodeType = (node: any) => { const nodeType = (node: any) => {
...@@ -275,6 +295,8 @@ const nodeType = (node: any) => { ...@@ -275,6 +295,8 @@ const nodeType = (node: any) => {
} else if (node.data.resource_type === '11') { } else if (node.data.resource_type === '11') {
// 考试 // 考试
return '教案' return '教案'
} else if (node.data.resource_type === '13') {
return '数字教材'
} }
} }
const handleNodeExpand = (data: any) => { const handleNodeExpand = (data: any) => {
...@@ -355,7 +377,8 @@ const handleChangeStatus = (node: any, data: any) => { ...@@ -355,7 +377,8 @@ const handleChangeStatus = (node: any, data: any) => {
@node-drop="handleDrop" @node-drop="handleDrop"
style="min-width: 100%" style="min-width: 100%"
@node-expand="handleNodeExpand" @node-expand="handleNodeExpand"
@node-collapse="handleNodeCollapse"> @node-collapse="handleNodeCollapse"
>
<!-- --> <!-- -->
<template #default="{ node, data }"> <template #default="{ node, data }">
<span class="custom-tree-node"> <span class="custom-tree-node">
...@@ -365,9 +388,9 @@ const handleChangeStatus = (node: any, data: any) => { ...@@ -365,9 +388,9 @@ const handleChangeStatus = (node: any, data: any) => {
<span class="node_title">{{ node.label.length > 20 ? node.label.slice(0, 20) + '...' : node.label }}</span> <span class="node_title">{{ node.label.length > 20 ? node.label.slice(0, 20) + '...' : node.label }}</span>
<el-link <el-link
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') || node.data.resource_type === '13'"
@click="handleConsult(node)" @click="handleConsult(node)"
:disabled="node.data.resource.can_view !== true" :disabled="node.data.resource?.can_view !== true && node.data.resource_type !== '13'"
style="margin-left: 35px" style="margin-left: 35px"
>查阅</el-link >查阅</el-link
> >
...@@ -378,15 +401,17 @@ const handleChangeStatus = (node: any, data: any) => { ...@@ -378,15 +401,17 @@ const handleChangeStatus = (node: any, data: any) => {
node.data.resource_type !== '2' && node.data.resource_type !== '2' &&
node.data.resource_type !== '6' && node.data.resource_type !== '6' &&
node.data.resource_type !== '3' && node.data.resource_type !== '3' &&
node.data.resource_type !== '9' node.data.resource_type !== '9' &&
node.data.resource_type !== '13'
" "
@click="handleDownload(node)" @click="handleDownload(node)"
:disabled="node.data.resource.can_view !== true" :disabled="node.data.resource?.can_view !== true"
style="margin-left: 35px" style="margin-left: 35px"
>下载</el-link >下载</el-link
> >
<!-- data.depth !== '3' 资源--> <!-- data.depth !== '3' 资源-->
<el-link <el-link
v-if="node.data.resource_type !== '13'"
class="btn_edit" class="btn_edit"
@click="handleEdit(node, data.depth)" @click="handleEdit(node, data.depth)"
style="margin-left: 35px" style="margin-left: 35px"
...@@ -407,7 +432,8 @@ const handleChangeStatus = (node: any, data: any) => { ...@@ -407,7 +432,8 @@ const handleChangeStatus = (node: any, data: any) => {
class="btn_operate" class="btn_operate"
v-if="data.depth === '1' || data.depth === '2'" v-if="data.depth === '1' || data.depth === '2'"
@click="handleOpenRules(node, data)" @click="handleOpenRules(node, data)"
v-permission="'v1-course-set-chapter-rules'"> v-permission="'v1-course-set-chapter-rules'"
>
<el-icon><Plus /></el-icon> <el-icon><Plus /></el-icon>
&nbsp; 开放规则 &nbsp; 开放规则
</el-button> </el-button>
...@@ -420,7 +446,8 @@ const handleChangeStatus = (node: any, data: any) => { ...@@ -420,7 +446,8 @@ const handleChangeStatus = (node: any, data: any) => {
class="btn_operate" class="btn_operate"
v-for="(item, index) in btnList" v-for="(item, index) in btnList"
:key="index" :key="index"
@click="handleAddDialog(node, item)"> @click="handleAddDialog(node, item, data)"
>
<el-icon><Plus /></el-icon> <el-icon><Plus /></el-icon>
{{ item.btn_name }} {{ item.btn_name }}
</el-button> </el-button>
...@@ -431,8 +458,10 @@ const handleChangeStatus = (node: any, data: any) => { ...@@ -431,8 +458,10 @@ const handleChangeStatus = (node: any, data: any) => {
node.data.resource_type !== '2' && node.data.resource_type !== '2' &&
node.data.resource_type !== '6' && node.data.resource_type !== '6' &&
node.data.resource_type !== '3' && node.data.resource_type !== '3' &&
node.data.resource_type !== '9' node.data.resource_type !== '9' &&
"> node.data.resource_type !== '13'
"
>
<span class="btn_operate">学生下载控制:</span> <span class="btn_operate">学生下载控制:</span>
<el-switch <el-switch
class="btn_edit" class="btn_edit"
...@@ -449,7 +478,8 @@ const handleChangeStatus = (node: any, data: any) => { ...@@ -449,7 +478,8 @@ const handleChangeStatus = (node: any, data: any) => {
inactive-value="0" inactive-value="0"
inline-prompt inline-prompt
style="--el-switch-on-color: #aa1941" style="--el-switch-on-color: #aa1941"
@change="handleChangeStatus(node, data)"></el-switch> @change="handleChangeStatus(node, data)"
></el-switch>
</template> </template>
</span> </span>
</span> </span>
...@@ -471,7 +501,8 @@ const handleChangeStatus = (node: any, data: any) => { ...@@ -471,7 +501,8 @@ const handleChangeStatus = (node: any, data: any) => {
:chapterID="chapterID" :chapterID="chapterID"
:course_id="id" :course_id="id"
:sectionName="sectionName" :sectionName="sectionName"
:resourceId="resourceId" /> :resourceId="resourceId"
/>
<!-- 添加章 --> <!-- 添加章 -->
<AddChapterDialog <AddChapterDialog
v-if="isShowDialog === true" v-if="isShowDialog === true"
...@@ -480,7 +511,8 @@ const handleChangeStatus = (node: any, data: any) => { ...@@ -480,7 +511,8 @@ const handleChangeStatus = (node: any, data: any) => {
:course_id="id" :course_id="id"
:isEdit="isEdit" :isEdit="isEdit"
:chapterID="chapterID" :chapterID="chapterID"
:chapterName="chapterName" /> :chapterName="chapterName"
/>
<!-- 添加小节 --> <!-- 添加小节 -->
<AddSectionDialog <AddSectionDialog
v-if="isShowSectionDialog === true" v-if="isShowSectionDialog === true"
...@@ -490,7 +522,8 @@ const handleChangeStatus = (node: any, data: any) => { ...@@ -490,7 +522,8 @@ const handleChangeStatus = (node: any, data: any) => {
:chapterID="chapterID" :chapterID="chapterID"
:course_id="id" :course_id="id"
:isEdit="isEdit" :isEdit="isEdit"
:sectionName="sectionName" /> :sectionName="sectionName"
/>
<!-- 添加直播 --> <!-- 添加直播 -->
<AddLiveDialog <AddLiveDialog
v-if="isShowLiveDialog === true" v-if="isShowLiveDialog === true"
...@@ -499,7 +532,8 @@ const handleChangeStatus = (node: any, data: any) => { ...@@ -499,7 +532,8 @@ const handleChangeStatus = (node: any, data: any) => {
:chapterName="chapterName" :chapterName="chapterName"
:chapterID="chapterID" :chapterID="chapterID"
:course_id="id" :course_id="id"
:btnInfo="btnInfo" /> :btnInfo="btnInfo"
/>
<!-- 添加资源 --> <!-- 添加资源 -->
<AddVideoDialog <AddVideoDialog
v-if="isShowAddDialog === true" v-if="isShowAddDialog === true"
...@@ -508,7 +542,8 @@ const handleChangeStatus = (node: any, data: any) => { ...@@ -508,7 +542,8 @@ const handleChangeStatus = (node: any, data: any) => {
:chapterName="chapterName" :chapterName="chapterName"
:chapterID="chapterID" :chapterID="chapterID"
:course_id="id" :course_id="id"
:btnInfo="btnInfo" /> :btnInfo="btnInfo"
/>
<!-- 添加考试 --> <!-- 添加考试 -->
<AddExamDialog <AddExamDialog
...@@ -520,12 +555,14 @@ const handleChangeStatus = (node: any, data: any) => { ...@@ -520,12 +555,14 @@ const handleChangeStatus = (node: any, data: any) => {
:course_id="id" :course_id="id"
:btnInfo="btnInfo" :btnInfo="btnInfo"
:paper_use_list="paper_use_list" :paper_use_list="paper_use_list"
:isMultiple="false" /> :isMultiple="false"
/>
<!-- 视频查阅弹框 --> <!-- 视频查阅弹框 -->
<VideoPlayDialog <VideoPlayDialog
v-if="isShowVideoPlayDialog === true" v-if="isShowVideoPlayDialog === true"
v-model:isShowVideoPlayDialog="isShowVideoPlayDialog" v-model:isShowVideoPlayDialog="isShowVideoPlayDialog"
:videoOptions="videoUrl" /> :videoOptions="videoUrl"
/>
<OpenRules <OpenRules
v-model:isShowOpenRules="isShowOpenRules" v-model:isShowOpenRules="isShowOpenRules"
v-if="isShowOpenRules === true" v-if="isShowOpenRules === true"
...@@ -534,7 +571,16 @@ const handleChangeStatus = (node: any, data: any) => { ...@@ -534,7 +571,16 @@ const handleChangeStatus = (node: any, data: any) => {
:chapterID="chapterID" :chapterID="chapterID"
:course_id="id" :course_id="id"
:controlInfo="controlInfo" :controlInfo="controlInfo"
@create="handleFresh" /> @create="handleFresh"
/>
<AddTextbookDialog
v-if="isShowTextbookDialog === true"
v-model:isShowTextbookDialog="isShowTextbookDialog"
@create="handleFresh"
:chapterName="chapterName"
:chapterID="chapterID"
:course_id="id"
/>
</template> </template>
<style> <style>
......
...@@ -234,7 +234,8 @@ const handleDetail = (row: any) => { ...@@ -234,7 +234,8 @@ const handleDetail = (row: any) => {
inline-prompt inline-prompt
style="--el-switch-on-color: #aa1941" style="--el-switch-on-color: #aa1941"
@click="handleChangeStatus(row)" @click="handleChangeStatus(row)"
:disabled="!checkPermission('v1-course-set-course-information-can-download')"> :disabled="!checkPermission('v1-course-set-course-information-can-download')"
>
</el-switch> </el-switch>
</template> </template>
<template #table-operate="{ row }"> <template #table-operate="{ row }">
......
...@@ -33,7 +33,6 @@ export default defineConfig(({ mode }) => ({ ...@@ -33,7 +33,6 @@ export default defineConfig(({ mode }) => ({
changeOrigin: true, changeOrigin: true,
rewrite: path => path.replace(/^\/api\/qbs/, '') rewrite: path => path.replace(/^\/api\/qbs/, '')
}, },
'/api': 'https://resource-center.ezijing.com' '/api': 'https://resource-center.ezijing.com'
} }
}, },
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论