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

updates

上级 31edd649
import httpRequest from '@/utils/axios'
// 讲师搜索
export function searchLecturer(params: { name: string; 'per-page'?: string; }) {
export function searchLecturer(params: { name: string; 'per-page'?: string }) {
return httpRequest.get('/api/resource/v1/course/course/search-lecturer', { params })
}
// 直播搜索
export function searchLive(params: { name: string; 'per-page'?: string; }) {
export function searchLive(params: { name: string; 'per-page'?: string }) {
return httpRequest.get('/api/resource/v1/course/course/search-live', { params })
}
// 试卷搜索
export function searchExam(data: { nonce: string; timestamp: string; signature: string, paper_title: string; limit: string; is_all: number; project_prefix: string; }) {
export function searchExam(data: {
nonce: string
timestamp: string
signature: string
paper_title: string
limit: string
is_all: number
project_prefix: string
}) {
return httpRequest.post('/api/qbs/api/v1/question-papers/search', data)
}
......@@ -41,7 +49,13 @@ export function setStatus(data: { id: string }) {
}
// 更新视频
export function updateVideo(data: { id: string; name: string; classification: string; knowledge_points?: string; cover?: string }) {
export function updateVideo(data: {
id: string
name: string
classification: string
knowledge_points?: string
cover?: string
}) {
return httpRequest.post('/api/resource/v1/resource/video/update', data)
}
......@@ -71,7 +85,7 @@ export function createPpt(data: { id: string; ppts: string }) {
}
// 编辑课件
export function updatePpt(data: { id: string; ppt_id: string, name: string, point: string, url: string }) {
export function updatePpt(data: { id: string; ppt_id: string; name: string; point: string; url: string }) {
return httpRequest.post('/api/resource/v1/resource/video/update-ppt', data)
}
......@@ -79,3 +93,123 @@ export function updatePpt(data: { id: string; ppt_id: string, name: string, poin
export function deletePpt(data: { id: string; ppt_id: string }) {
return httpRequest.post('/api/resource/v1/resource/video/delete-ppt', data)
}
// 获取视频列表
export function getVideoList(params: {
course_id: string
tab: string
status?: string
authorized?: string
classification?: string
page?: number
page_size?: number
}) {
return httpRequest.get('/api/resource/v1/course/course/search-video', { params })
}
// 获取视频列表
export function getCourseList(params: {
tab: string
name?: string
authorized?: string
page?: number
page_size?: number
}) {
return httpRequest.get('/api/resource/v1/course/course/list', { params })
}
// 获取课件列表
export function getCourseListSearch(params: {
tab: string
name?: string
authorized?: string
page?: number
page_size?: number
}) {
return httpRequest.get('/api/resource/v1/course/course/search-courseware', { params })
}
// 获取课程统计
export function getCourseStatistics() {
return httpRequest.get('/api/resource/v1/course/course/statistics')
}
// 获取教案列表
export function getLessonList(params?: {
tab: string
status?: string
authorized?: string
classification?: string
page?: number
['per-page']?: number
}) {
return httpRequest.get('/api/resource/v1/course/course/search-lesson-plan', { params })
}
// 获取其他资料列表
export function getOtherList(params?: {
tab: string
status?: string
authorized?: string
classification?: string
page?: number
['per-page']?: number
}) {
return httpRequest.get('/api/resource/v1/course/course/search-other-information', { params })
}
// 试卷搜索
export function gatExamList(data: {
nonce: string
timestamp: string
signature: string
paper_title: string
limit: string
is_all: number
project_prefix: string
}) {
return httpRequest.post('/api/qbs/api/v1/question-papers/search', data)
}
// 获取视频详情
export function getVideoDetails(params: { id: string }) {
return httpRequest.get('/api/resource/v1/resource/video/view', { params })
}
// 获取课件详情
export function getCourseWareDetails(params: { id: string }) {
return httpRequest.get('/api/resource/v1/resource/courseware/view', { params })
}
// 获取教案详情
export function getLessonDetails(params: { id: string }) {
return httpRequest.get('/api/resource/v1/resource/lesson-plan/view', { params })
}
// 获取其他资料详情
export function getOtherDetails(params: { id: string }) {
return httpRequest.get('/api/resource/v1/resource/other-information/view', { params })
}
// 章节结构调整
export function dragChapterList(data: { course_id: string; id: string; brother_id: string; type: string }) {
return httpRequest.post('/api/resource/v1/course/course/drag', data)
}
// 获取章节
export function getCharacter(params: { course_id: string; type: string }) {
return httpRequest.get('/api/resource/v1/course/course/chapters', { params })
}
// 新建章节
export function createCharacter(data: {
course_id: string
resource_type: string
name: string
parent_id?: string
resource_id?: string
}) {
return httpRequest.post('/api/resource/v1/course/course/create-chapter', data)
}
// 章节修改
export function editCharacter(data: { id: string; course_id: string; name: string; resource_id: string }) {
return httpRequest.post('/api/resource/v1/course/course/update-chapter', data)
}
// 章节删除
export function delCharacter(data: { id: string; course_id: string }) {
return httpRequest.post('/api/resource/v1/course/course/delete-chapter', data)
}
// 直播列表
export function getLiveList(params: { name: string; page?: number; ['page_size']?: number }) {
return httpRequest.get('/api/resource/v1/course/course/search-live', { params })
}
<script lang="ts" setup>
import { createCharacter, editCharacter } from '../api'
import { createCharacter, editCharacter } from '../../api'
import type { FormInstance, FormRules } from 'element-plus'
import { useMapStore } from '@/stores/map'
const store = useMapStore()
......
<script setup lang="ts">
import { gatExamList, createCharacter } from '../api'
import { useMapStore } from '@/stores/map'
import { gatExamList, createCharacter } from '../../api'
import { useGetCategoryList } from '@/composables/useGetCategoryList'
const store = useMapStore()
const appList = ref()
let { list: selectTree } = useGetCategoryList()
const tabValue = ref('1')
......@@ -26,6 +24,10 @@ const props = defineProps({
chapterID: {
type: String,
required: true
},
btnInfo: {
type: Object,
required: true
}
})
interface Emits {
......@@ -88,16 +90,12 @@ const handleCancel = () => {
}
// 保存
const handleSave = () => {
const type = store.mapList
.filter(item => item.key === 'system_chapter_resource_type')[0]
?.values.filter(it => it.label === '视频')[0]?.value
console.log(multipleSelection)
const name = multipleSelection.value.map((item: any) => item.paper_category.name)[0]
const resource_id = multipleSelection.value.map((item: any) => item.id)[0]
const params: any = {
name: name,
course_id: props.course_id,
resource_type: type,
resource_type: props.btnInfo.resource_type,
parent_id: props.chapterID,
resource_id: resource_id
}
......@@ -120,10 +118,13 @@ const typeFilter = () => {
const handleSelectionChange = (val: any) => {
multipleSelection.value = val
}
const title = computed(() => {
return `添加${props.btnInfo.btn_name}`
})
</script>
<template>
<el-drawer :model-value="isShowExamDialog" draggable :before-close="handleCancel" size="60%" title="添加考试/作业">
<el-drawer :model-value="isShowExamDialog" draggable :before-close="handleCancel" size="60%" :title="title">
<div class="video-head">
<el-tabs @tab-change="tabChange" v-model="tabValue">
<el-tab-pane label="我的资源" name="1"></el-tab-pane>
......
<script lang="ts" setup>
import { createCharacter, getLiveList } from '../api'
import { createCharacter, getLiveList } from '../../api'
import type { FormInstance, FormRules } from 'element-plus'
import { useMapStore } from '@/stores/map'
const store = useMapStore()
const emit = defineEmits<Emits>()
const ruleFormRef = ref<FormInstance>()
......@@ -41,6 +39,10 @@ const props = defineProps({
chapterID: {
type: String,
required: true
},
btnInfo: {
type: Object,
required: true
}
})
interface Emits {
......@@ -54,13 +56,10 @@ const handleCancel = () => {
}
// 确定
const handleConfirm = () => {
const type = store.mapList
.filter(item => item.key === 'system_chapter_resource_type')[0]
?.values.filter(it => it.label === '腾讯会议')[0]?.value
const params: any = Object.assign(
{
course_id: props.course_id,
resource_type: type,
resource_type: props.btnInfo.resource_type,
parent_id: props.chapterID,
resource_id: lecturerValue.value[0]
},
......
<script lang="ts" setup>
import { createCharacter, editCharacter } from '../api'
import { createCharacter, editCharacter } from '../../api'
import type { FormInstance, FormRules } from 'element-plus'
import { useMapStore } from '@/stores/map'
const store = useMapStore()
......
<script setup lang="ts">
import { getVideoList, createCharacter } from '../api'
import { getVideoList, createCharacter, getCourseListSearch, getLessonList, getOtherList } from '../../api'
import CardListItem from './CardListItem.vue'
import { useMapStore } from '@/stores/map'
import { useGetCategoryList } from '@/composables/useGetCategoryList'
const store = useMapStore()
const appList = ref()
// const page = reactive({ total: 0, size: 10, currentPage: 1 })
// 资源出处 tab触发
const tabValue = ref('1')
let tableData: any = reactive({
list: [],
title: '',
total: ''
})
const emit = defineEmits<Emits>()
const props = defineProps({
isShowVideoDialog: {
isShowAddDialog: {
type: Boolean,
required: true
},
......@@ -26,78 +29,88 @@ const props = defineProps({
chapterID: {
type: String,
required: true
},
btnInfo: {
type: Object,
required: true
}
})
interface Emits {
(e: 'update:isShowVideoDialog', isShowVideoDialog: boolean): void
(e: 'update:isShowAddDialog', isShowVideoDialog: boolean): void
(e: 'create'): void
}
// 筛选下拉选择tree 视频分类
let { list: selectTree } = useGetCategoryList()
const defaultProps = {
children: 'children',
label: 'category_name',
value: 'id'
}
const typeFilter = () => {
appList.value.refetch()
}
const title = computed(() => {
return `添加${props.btnInfo.btn_name}`
})
// 资源出处 tab触发
const tabValue = ref('1')
const listOptions = computed(() => {
console.log(props.btnInfo.resource_type)
let getHttpRequest = null
if (props.btnInfo.resource_type === '2') {
getHttpRequest = getVideoList
} else if (props.btnInfo.resource_type === '10') {
getHttpRequest = getCourseListSearch
} else if (props.btnInfo.resource_type === '11') {
getHttpRequest = getLessonList
} else if (props.btnInfo.resource_type === '4') {
getHttpRequest = getOtherList
}
return {
remote: {
httpRequest: getHttpRequest,
callback(data: any) {
tableData = data
return data
},
params: { tab: tabValue, status: '', authorized: '', name: '', course_id: props.course_id }
},
filters: [
{ prop: 'classification', label: '类别:', slots: 'filter-type' },
{ type: 'input', prop: 'name', label: '标题:' }
],
columns: [],
data: tableData
}
})
// tab切换
const tabChange = () => {
appList.value?.refetch()
}
// 取消
const handleCancel = () => {
emit('update:isShowVideoDialog', false)
emit('update:isShowAddDialog', false)
}
// 保存 添加
const handleSave = () => {
const type = store.mapList
.filter(item => item.key === 'system_chapter_resource_type')[0]
?.values.filter(it => it.label === '视频')[0]?.value
console.log(tableData.list)
const name = tableData.list.filter((item: any) => item.auth_department === true)[0].name
const resource_id = tableData.list.filter((item: any) => item.auth_department === true)[0].id
// console.log(resource_id, '1111', name)
const name = tableData.list.filter((item: any) => item.check_status === true)[0].name
const resource_id = tableData.list.filter((item: any) => item.check_status === true)[0].id
const params: any = {
name: name,
course_id: props.course_id,
resource_type: type,
resource_type: props.btnInfo.resource_type,
parent_id: props.chapterID,
resource_id: resource_id
}
createCharacter(params).then(() => {
emit('update:isShowVideoDialog', false)
emit('update:isShowAddDialog', false)
emit('create')
})
}
let tableData: any = reactive({
list: [],
title: '',
total: ''
})
const listOptions = {
remote: {
httpRequest: getVideoList,
callback(data: any) {
tableData = data
return data
},
params: { tab: tabValue, status: '', authorized: '', name: '' }
},
filters: [
{ prop: 'classification', label: '类别:', slots: 'filter-type' },
{ type: 'input', prop: 'name', label: '标题:' }
],
columns: [],
data: tableData
}
// 筛选下拉选择tree 视频分类
let { list: selectTree } = useGetCategoryList()
const defaultProps = {
children: 'children',
label: 'category_name',
value: 'id'
}
const typeFilter = () => {
appList.value.refetch()
}
</script>
<template>
<el-drawer :model-value="isShowVideoDialog" draggable :before-close="handleCancel" size="60%" title="添加视频">
<el-drawer :model-value="isShowAddDialog" draggable :before-close="handleCancel" size="60%" :title="title">
<div class="video-head">
<el-tabs @tab-change="tabChange" v-model="tabValue">
<el-tab-pane label="我的资源" name="1"></el-tab-pane>
......@@ -120,7 +133,7 @@ const typeFilter = () => {
<div class="card-list-con">
<div style="position: relative" v-for="(item, index) in data" :key="index">
<el-checkbox
v-model="item.auth_department"
v-model="item.check_status"
style="position: absolute; right: 40px; bottom: 22px"
></el-checkbox>
<CardListItem :tabIndex="tabValue" :data="item"> </CardListItem>
......
<script setup lang="ts">
const props: any = defineProps<{ data: object; tabIndex: string }>()
</script>
<template>
<!-- <div>{{ props.data }}</div> -->
<div class="card-item">
<div class="card-item-top">
<div class="title">{{ props.data.name }}</div>
<!-- <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 class="edit-btn">编辑</div>
</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 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>
<div class="item-b">
<div class="time">{{ props.data.updated_time }}</div>
<div class="tag" v-if="tabIndex === '2'">{{ props.data.department_public === '0' ? '未共享' : '已共享' }}</div>
<div class="tag" v-if="tabIndex === '3'">{{ props.data.platform_public === '0' ? '未共享' : '已共享' }}</div>
</div>
</div>
</div>
</template>
<style lang="scss" scoped>
.card-item {
width: 265px;
border-radius: 6px;
overflow: hidden;
margin-right: 20px;
margin-bottom: 20px;
.card-item-top {
height: 170px;
position: relative;
&:hover {
.tool-pop-btn {
opacity: 1;
}
}
.cover-img {
width: 100%;
height: 100%;
background-size: cover;
}
.title {
position: absolute;
bottom: 0;
left: 0;
width: 100%;
line-height: 37px;
background: rgba(0, 0, 0, 0.4);
font-size: 18px;
color: #ffffff;
padding-left: 16px;
box-sizing: border-box;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
.tool-pop-btn {
transition: all 0.5s;
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
background: rgba(0, 0, 0, 0.6);
opacity: 0;
padding-top: 52px;
box-sizing: border-box;
.edit-btn {
width: 113px;
line-height: 32px;
border: 1px solid #d3d3d3;
border-radius: 18px;
text-align: center;
font-size: 14px;
color: #ffffff;
margin: 0 auto 12px;
cursor: pointer;
}
.view-btn {
width: 113px;
line-height: 32px;
background: #aa1941;
border-radius: 18px;
text-align: center;
font-size: 14px;
color: #ffffff;
margin: 0 auto;
cursor: pointer;
}
}
}
}
.card-item-bottom {
background: #fff;
padding: 20px 16px 30px;
.item-t {
display: flex;
align-items: center;
justify-content: space-between;
.text {
width: 150px;
font-size: 16px;
line-height: 100%;
color: #666666;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
.tag {
width: 48px;
line-height: 22px;
background: #aa1941;
border-radius: 11px;
font-size: 14px;
color: #fff;
text-align: center;
&.green {
background: #1ab226;
}
}
}
.item-b {
margin-top: 18px;
display: flex;
align-items: center;
justify-content: space-between;
.time {
font-size: 14px;
line-height: 100%;
color: #999999;
}
.tag {
font-size: 16px;
line-height: 100%;
color: #999999;
}
}
}
</style>
......@@ -6,7 +6,8 @@ export const routes: Array<RouteRecordRaw> = [
path: '/course/update-course',
component: AppLayout,
children: [
{ path: '', component: () => import('./views/StepOne.vue') }
{ path: '', component: () => import('./views/StepOne.vue') },
{ path: '/course/update-course/stepTwo', component: () => import('./views/StepTwo.vue') }
]
}
]
......@@ -16,6 +16,7 @@ import AddLive from '../components/stepOneComponents/AddLive.vue'
const store = useMapStore()
const route = useRoute()
const router = useRouter()
// const router = useRouter()
......@@ -127,6 +128,13 @@ const createCourseForm = () => {
if (res.code === 0) {
// 操作第二部
stepOneId.value = res.data.id
router.push({
path: '/course/update-course/stepTwo',
query: {
id: stepOneId.value,
isEditCourse: '1'
}
})
}
})
} else {
......@@ -134,6 +142,13 @@ const createCourseForm = () => {
if (res.code === 0) {
// 操作第二部
stepOneId.value = res.data.id
router.push({
path: '/course/update-course/stepTwo',
query: {
id: stepOneId.value,
isEditCourse: '0'
}
})
}
})
}
......
......@@ -2,6 +2,7 @@ import httpRequest from '@/utils/axios'
// 获取视频列表
export function getVideoList(params: {
course_id: string
tab: string
status?: string
authorized?: string
......@@ -9,7 +10,7 @@ export function getVideoList(params: {
page?: number
page_size?: number
}) {
return httpRequest.get('/api/resource/v1/resource/video/list', { params })
return httpRequest.get('/api/resource/v1/course/course/search-video', { params })
}
// 获取视频列表
export function getCourseList(params: {
......@@ -21,6 +22,16 @@ export function getCourseList(params: {
}) {
return httpRequest.get('/api/resource/v1/course/course/list', { params })
}
// 获取课件列表
export function getCourseListSearch(params: {
tab: string
name?: string
authorized?: string
page?: number
page_size?: number
}) {
return httpRequest.get('/api/resource/v1/course/course/search-courseware', { params })
}
// 获取课程统计
export function getCourseStatistics() {
......@@ -36,7 +47,7 @@ export function getLessonList(params?: {
page?: number
['per-page']?: number
}) {
return httpRequest.get('/api/resource/v1/resource/lesson-plan/list', { params })
return httpRequest.get('/api/resource/v1/course/course/search-lesson-plan', { params })
}
// 获取其他资料列表
export function getOtherList(params?: {
......@@ -47,7 +58,7 @@ export function getOtherList(params?: {
page?: number
['per-page']?: number
}) {
return httpRequest.get('/api/resource/v1/resource/other-information/list', { params })
return httpRequest.get('/api/resource/v1/course/course/search-other-information', { params })
}
// 试卷搜索
export function gatExamList(data: {
......@@ -74,6 +85,10 @@ export function getCourseDetails(params: { id: string }) {
export function getLessonDetails(params: { id: string }) {
return httpRequest.get('/api/resource/v1/resource/lesson-plan/view', { params })
}
// 获取其他资料详情
export function getOtherDetails(params: { id: string }) {
return httpRequest.get('/api/resource/v1/resource/other-information/view', { params })
}
// 章节结构调整
export function dragChapterList(data: { course_id: string; id: string; brother_id: string; type: string }) {
return httpRequest.post('/api/resource/v1/course/course/drag', data)
......
<script setup lang="ts">
import { getCourseList, createCharacter } from '../api'
import CardListItem from './CardListItem.vue'
import { useMapStore } from '@/stores/map'
import { useGetCategoryList } from '@/composables/useGetCategoryList'
const store = useMapStore()
const appList = ref()
// const page = reactive({ total: 0, size: 10, currentPage: 1 })
const emit = defineEmits<Emits>()
const props = defineProps({
isShowCourseDialog: {
type: Boolean,
required: true
},
course_id: {
type: String,
required: true
},
chapterName: {
type: String,
required: true
},
chapterID: {
type: String,
required: true
}
})
interface Emits {
(e: 'update:isShowCourseDialog', isShowCourseDialog: boolean): void
(e: 'create'): void
}
// 资源出处 tab触发
const tabValue = ref('1')
const tabChange = () => {
appList.value?.refetch()
}
const handleCancel = () => {
emit('update:isShowCourseDialog', false)
}
const handleSave = () => {
const type = store.mapList
.filter(item => item.key === 'system_chapter_resource_type')[0]
?.values.filter(it => it.label === '课件')[0]?.value
console.log(tableData.list)
const name = tableData.list.filter((item: any) => item.auth_department === true)[0].name
const resource_id = tableData.list.filter((item: any) => item.auth_department === true)[0].id
// console.log(resource_id, '1111', name)
const params: any = {
name: name,
course_id: props.course_id,
resource_type: type,
parent_id: props.chapterID,
resource_id: resource_id
}
createCharacter(params).then(() => {
emit('update:isShowCourseDialog', false)
emit('create')
})
}
let tableData: any = reactive({
list: [],
title: '',
total: ''
})
const listOptions = {
remote: {
httpRequest: getCourseList,
callback(data: any) {
tableData = data
return data
},
params: { tab: tabValue, status: '', authorized: '', name: '' }
},
filters: [
{ prop: 'classification', label: '类别:', slots: 'filter-type' },
{ type: 'input', prop: 'name', label: '标题:' }
],
columns: [],
data: tableData
}
// 筛选下拉选择tree 视频分类
let { list: selectTree } = useGetCategoryList()
const defaultProps = {
children: 'children',
label: 'category_name',
value: 'id'
}
const typeFilter = () => {
appList.value.refetch()
}
</script>
<template>
<el-drawer :model-value="isShowCourseDialog" draggable :before-close="handleCancel" size="60%" title="添加课件">
<div class="video-head">
<el-tabs @tab-change="tabChange" v-model="tabValue">
<el-tab-pane label="我的资源" name="1"></el-tab-pane>
<el-tab-pane label="部门资源" name="2"></el-tab-pane>
<el-tab-pane label="公开资源" name="3"></el-tab-pane>
</el-tabs>
</div>
<AppList v-bind="listOptions" ref="appList">
<template #filter-type="{ params }">
<el-tree-select
@change="typeFilter"
clearable
:props="defaultProps"
v-model="params.classification"
:data="selectTree"
/>
</template>
<template #body="{ data }">
<div class="card-list" v-if="data.length">
<div class="card-list-con">
<div style="position: relative" v-for="(item, index) in data" :key="index">
<el-checkbox
v-model="item.auth_department"
style="position: absolute; right: 40px; bottom: 22px"
></el-checkbox>
<CardListItem :tabIndex="tabValue" :data="item"> </CardListItem>
</div>
</div>
</div>
<el-empty v-else description="暂无数据" />
</template>
</AppList>
<el-button type="primary" @click="handleSave">保存</el-button>
</el-drawer>
</template>
<style lang="scss">
.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;
}
</style>
<script setup lang="ts">
import { getLessonList, createCharacter } from '../api'
import CardListItem from './CardListItem.vue'
import { useMapStore } from '@/stores/map'
import { useGetCategoryList } from '@/composables/useGetCategoryList'
const store = useMapStore()
const appList = ref()
// const page = reactive({ total: 0, size: 10, currentPage: 1 })
const emit = defineEmits<Emits>()
const props = defineProps({
isShowLessonDialog: {
type: Boolean,
required: true
},
course_id: {
type: String,
required: true
},
chapterName: {
type: String,
required: true
},
chapterID: {
type: String,
required: true
}
})
interface Emits {
(e: 'update:isShowLessonDialog', isShowLessonDialog: boolean): void
(e: 'create'): void
}
// 资源出处 tab触发
const tabValue = ref('1')
const tabChange = () => {
appList.value?.refetch()
}
const handleCancel = () => {
emit('update:isShowLessonDialog', false)
}
const handleSave = () => {
const type = store.mapList
.filter(item => item.key === 'system_chapter_resource_type')[0]
?.values.filter(it => it.label === '视频')[0]?.value
console.log(tableData.list)
const name = tableData.list.filter((item: any) => item.auth_department === true)[0].name
const resource_id = tableData.list.filter((item: any) => item.auth_department === true)[0].id
// console.log(resource_id, '1111', name)
const params: any = {
name: name,
course_id: props.course_id,
resource_type: type,
parent_id: props.chapterID,
resource_id: resource_id
}
createCharacter(params).then(() => {
emit('update:isShowLessonDialog', false)
emit('create')
})
}
let tableData: any = reactive({
list: [],
title: '',
total: ''
})
const listOptions = {
remote: {
httpRequest: getLessonList,
callback(data: any) {
tableData = data
return data
},
params: { tab: tabValue, status: '', authorized: '', name: '' }
},
filters: [
{ prop: 'classification', label: '类别:', slots: 'filter-type' },
{ type: 'input', prop: 'name', label: '标题:' }
],
columns: [],
data: tableData
}
// 筛选下拉选择tree 视频分类
let { list: selectTree } = useGetCategoryList()
const defaultProps = {
children: 'children',
label: 'category_name',
value: 'id'
}
const typeFilter = () => {
appList.value.refetch()
}
</script>
<template>
<el-drawer :model-value="isShowLessonDialog" draggable :before-close="handleCancel" size="60%" title="添加教案">
<div class="video-head">
<el-tabs @tab-change="tabChange" v-model="tabValue">
<el-tab-pane label="我的资源" name="1"></el-tab-pane>
<el-tab-pane label="部门资源" name="2"></el-tab-pane>
<el-tab-pane label="公开资源" name="3"></el-tab-pane>
</el-tabs>
</div>
<AppList v-bind="listOptions" ref="appList">
<template #filter-type="{ params }">
<el-tree-select
@change="typeFilter"
clearable
:props="defaultProps"
v-model="params.classification"
:data="selectTree"
/>
</template>
<template #body="{ data }">
<div class="card-list" v-if="data.length">
<div class="card-list-con">
<div style="position: relative" v-for="(item, index) in data" :key="index">
<el-checkbox
v-model="item.auth_department"
style="position: absolute; right: 40px; bottom: 22px"
></el-checkbox>
<CardListItem :tabIndex="tabValue" :data="item"> </CardListItem>
</div>
</div>
</div>
<el-empty v-else description="暂无数据" />
</template>
</AppList>
<el-button type="primary" @click="handleSave">保存</el-button>
</el-drawer>
</template>
<style lang="scss">
.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;
}
</style>
<script setup lang="ts">
import { getOtherList, createCharacter } from '../api'
import CardListItem from './CardListItem.vue'
import { useMapStore } from '@/stores/map'
import { useGetCategoryList } from '@/composables/useGetCategoryList'
const store = useMapStore()
const appList = ref()
// const page = reactive({ total: 0, size: 10, currentPage: 1 })
const emit = defineEmits<Emits>()
const props = defineProps({
isShowOtherDialog: {
type: Boolean,
required: true
},
course_id: {
type: String,
required: true
},
chapterName: {
type: String,
required: true
},
chapterID: {
type: String,
required: true
}
})
interface Emits {
(e: 'update:isShowOtherDialog', isShowOtherDialog: boolean): void
(e: 'create'): void
}
// 资源出处 tab触发
const tabValue = ref('1')
const tabChange = () => {
appList.value?.refetch()
}
const handleCancel = () => {
emit('update:isShowOtherDialog', false)
}
const handleSave = () => {
const type = store.mapList
.filter(item => item.key === 'system_chapter_resource_type')[0]
?.values.filter(it => it.label === '视频')[0]?.value
console.log(tableData.list)
const name = tableData.list.filter((item: any) => item.auth_department === true)[0].name
const resource_id = tableData.list.filter((item: any) => item.auth_department === true)[0].id
// console.log(resource_id, '1111', name)
const params: any = {
name: name,
course_id: props.course_id,
resource_type: type,
parent_id: props.chapterID,
resource_id: resource_id
}
createCharacter(params).then(() => {
emit('update:isShowOtherDialog', false)
emit('create')
})
}
let tableData: any = reactive({
list: [],
title: '',
total: ''
})
const listOptions = {
remote: {
httpRequest: getOtherList,
callback(data: any) {
tableData = data
return data
},
params: { tab: tabValue, status: '', authorized: '', name: '' }
},
filters: [
{ prop: 'classification', label: '类别:', slots: 'filter-type' },
{ type: 'input', prop: 'name', label: '标题:' }
],
columns: [],
data: tableData
}
// 筛选下拉选择tree 视频分类
let { list: selectTree } = useGetCategoryList()
const defaultProps = {
children: 'children',
label: 'category_name',
value: 'id'
}
const typeFilter = () => {
appList.value.refetch()
}
</script>
<template>
<el-drawer :model-value="isShowOtherDialog" draggable :before-close="handleCancel" size="60%" title="添加其他资料">
<div class="video-head">
<el-tabs @tab-change="tabChange" v-model="tabValue">
<el-tab-pane label="我的资源" name="1"></el-tab-pane>
<el-tab-pane label="部门资源" name="2"></el-tab-pane>
<el-tab-pane label="公开资源" name="3"></el-tab-pane>
</el-tabs>
</div>
<AppList v-bind="listOptions" ref="appList">
<template #filter-type="{ params }">
<el-tree-select
@change="typeFilter"
clearable
:props="defaultProps"
v-model="params.classification"
:data="selectTree"
/>
</template>
<template #body="{ data }">
<div class="card-list" v-if="data.length">
<div class="card-list-con">
<div style="position: relative" v-for="(item, index) in data" :key="index">
<el-checkbox
v-model="item.auth_department"
style="position: absolute; right: 40px; bottom: 22px"
></el-checkbox>
<CardListItem :tabIndex="tabValue" :data="item"> </CardListItem>
</div>
</div>
</div>
<el-empty v-else description="暂无数据" />
</template>
</AppList>
<el-button type="primary" @click="handleSave">保存</el-button>
</el-drawer>
</template>
<style lang="scss">
.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;
}
</style>
......@@ -7,7 +7,6 @@ export const routes: Array<RouteRecordRaw> = [
component: AppLayout,
children: [
{ path: '', component: () => import('./views/List.vue') },
{ path: '/course/my/StepTwo', component: () => import('./views/StepTwo.vue') },
{ path: '/course/my/view', component: () => import('./views/View.vue') }
]
}
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论