提交 75f84279 authored 作者: lihuihui's avatar lihuihui

更改文件目录

上级 bab50a3f
import { getCategoryList } from '@/api/base'
export function useCategory() {
let list = $ref([])
onMounted(() => {
getCategoryList({ type: 'tree' }).then((res: any) => {
list = res.data
console.log(list)
})
})
return { list }
}
\ No newline at end of file
<script setup lang="ts">
import TopInfo from '../components/view/TopInfo.vue'
import CenterInfo from '../components/view/CenterInfo.vue'
import BottomInfo from '../components/view/BottomInfo.vue'
import TopInfo from '../components/TopInfo.vue'
import CenterInfo from '../components/CenterInfo.vue'
import BottomInfo from '../components/BottomInfo.vue'
import { getCourseDetails } from '../api'
const router = useRouter()
......
import httpRequest from '@/utils/axios'
// 获取视频列表
export function getVideoList(params?: { type?: string; page?: number; page_size?: number }) {
return httpRequest.get('/api/psp/backend/video/index', { params })
// 获取教案列表
export function getLessonList(params?: {
tab: string
status?: string
authorized?: string
classification?: string
page?: number
['per-page']?: number
}) {
return httpRequest.get('/api/resource/v1/resource/lesson-plan/list', { params })
}
// 创建视频
export function createVideo(data: { course_name: string; cover_page: string; type: string; weight?: string }) {
return httpRequest.post('/api/psp/backend/video/create', data)
// 获取项目列表
export function getProjectList(params: { organization_id: string }) {
return httpRequest.get('/api/resource/v1/util/members', { params })
}
// 更新视频
export function updateVideo(data: { id: string; course_name: string; cover_page: string; type: string; weight?: string }) {
return httpRequest.post('/api/psp/backend/video/update', data)
// 获取分类列表
export function getCategoryList(params: { type: string; category_name?: string }) {
return httpRequest.get('/api/resource/v1/backend/category/list', { params })
}
// 获取视频详情
export function getVideo(params: { id: string }) {
return httpRequest.get('/api/psp/backend/video/view', { params })
// 创建教案
export function createLessonPlan(data: { name: string; source: string; classification: string; knowledge_points: string; url: string; type: string; size: string }) {
return httpRequest.post('/api/resource/v1/resource/lesson-plan/create', data)
}
......@@ -3,6 +3,7 @@
import { getCategoryList } from '@/api/base'
import type { FormInstance } from 'element-plus'
import { ElMessage } from 'element-plus'
import { createLessonPlan } from '../api'
// 路由
const router = useRouter()
......@@ -38,6 +39,12 @@
return
}
const id = router.currentRoute.value.query.id as string
const formFile = form.file[0]
form.url = formFile.url
form.type = formFile.type
form.size = formFile.size
const params = Object.assign({}, form)
delete params.file
if (id !== '' && id) {
// const params = Object.assign({ id: id }, form)
// updateVideo(params).then((res: any) => {
......@@ -51,16 +58,16 @@
// }
// })
} else {
// createVideo(form).then((res:any) => {
// if (res.code === 0) {
// ElMessage({ message: '创建成功', type: 'success' })
// setTimeout(() => {
// router.push({
// path: '/resource/video'
// })
// }, 1000)
// }
// })
createLessonPlan(params).then((res:any) => {
if (res.code === 0) {
ElMessage({ message: '创建成功', type: 'success' })
setTimeout(() => {
router.push({
path: '/resource/lessonplan'
})
}, 1000)
}
})
}
} else {
......
<script setup lang="ts">
import TopInfo from '../components/view/TopInfo.vue'
import CenterInfo from '../components/view/CenterInfo.vue'
import BottomInfo from '../components/view/BottomInfo.vue'
import TopInfo from '../components/TopInfo.vue'
import CenterInfo from '../components/CenterInfo.vue'
import BottomInfo from '../components/BottomInfo.vue'
const listOptions = {
columns: [
{ label: '课程图片', prop: 'img', align: 'center' },
......@@ -39,12 +39,7 @@ const listOptions = {
<template #table-operate="{ row }">
<el-space>
<router-link :to="`/video/update/${row.id}`">
<el-button
style="color: #399EE8;"
type="primary"
link
>查看</el-button
>
<el-button style="color: #399ee8" type="primary" link>查看</el-button>
</router-link>
</el-space>
</template>
......@@ -52,17 +47,17 @@ const listOptions = {
</AppCard>
</template>
<style lang="scss" scoped>
.btn-box{
.btn-box {
display: flex;
justify-content: right;
.btn-item{
.btn-item {
width: 127px;
line-height: 36px;
background: #AA1941;
background: #aa1941;
border-radius: 20px;
margin-right: 10px;
font-size: 14px;
color: #FFFFFF;
color: #ffffff;
text-align: center;
}
}
......
<script setup lang="ts">
import { getVideoList, getProjectList } from '../api'
import { getCategoryList } from '@/api/base'
// import { getCategoryList } from '@/api/base'
import CardListItem from '../components/CardListItem.vue'
import { Expand, Search } from '@element-plus/icons-vue'
import { useCategory } from '@/composables/useCategory'
// 筛选项目列表
let projectList: any = $ref([])
......@@ -17,7 +18,6 @@ const tabChange = () => {
appList.value.refetch()
}
// 列表切换
const isCard = ref(false)
......@@ -62,10 +62,11 @@ const listOptions = $computed(() => {
})
// 下拉选择tree 视频分类
let selectTree = $ref([])
getCategoryList({ type: 'tree' }).then((res: any) => {
selectTree = res.data
})
let { list: selectTree } = useCategory()
console.log(selectTree)
// getCategoryList({ type: 'tree' }).then((res: any) => {
// selectTree = res.data
// })
const defaultProps = {
children: 'children',
label: 'category_name',
......@@ -91,7 +92,7 @@ const defaultProps = {
<AppList v-bind="listOptions" ref="appList">
<template #header-aside></template>
<template #table-cover="{ row }">
<img :src="row.cover" style="width:150px;display: block;">
<img :src="row.cover" style="width: 150px; display: block" />
</template>
<template #filter-type="{ params }">
<el-tree-select :props="defaultProps" v-model="params.classification" :data="selectTree" />
......@@ -121,8 +122,8 @@ const defaultProps = {
</AppCard>
</template>
<style lang="scss">
.card-list{
background: #FAFAFA;
.card-list {
background: #fafafa;
padding: 20px;
display: flex;
}
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论