优化知识图谱

develoop
JayChou 3 weeks ago
parent a4d6da5205
commit 2c6924f501
  1. 4
      .env.development
  2. 5
      src/Layout/tabbar/index.vue
  3. 16
      src/api/course.ts
  4. 20
      src/router/module/constRouter/index.ts
  5. 59
      src/views/course/index.vue
  6. 2
      src/views/home/components/Graph.vue
  7. 10
      src/views/home/components/Graph1.vue
  8. 18
      src/views/home/index.vue
  9. 4
      src/views/knowledge/index.vue
  10. 7
      vite.config.ts

@ -1,5 +1,5 @@
# 变量必须以 VITE_ 为前缀才能暴露给外部读取
NODE_ENV = 'development'
VITE_APP_TITLE = '教学一体化平台'
VITE_APP_BASE_API = 'http://39.106.16.162:8080'
# VITE_APP_BASE_API = 'http://127.0.0.1:8080'
VITE_APP_BASE_API = 'http://127.0.0.1:8080'
# VITE_APP_BASE_API = 'http://10.100.200.177:8080'

@ -28,7 +28,7 @@
</template>
</el-dropdown>
</div>
<li v-else @click="skip('http://localhost:5173/#/login?redirect=/configurationPage')">登录注册</li>
<li v-else @click="skip('http://localhost:8888/')">登录注册</li>
<!-- <li v-if="$route.path != '/home'" @click="$router.push('/')">回到首页</li> -->
</ul>
<div class="entry">
@ -82,7 +82,8 @@ userGetInfoService(userStore.token).then(res => {
}
})
function skip(url: string) {
location.assign(url)
// location.replace(url)
window.open(url)
}

@ -4,7 +4,7 @@ import { GetCourseObjectivesList} from './types/courseType'
export const getCourseList = (params: object) => {
return request({
url: '/api/coursesteacher/page',
url: '/api/coursesteacher/index',
params,
})
}
@ -16,14 +16,14 @@ export const getCourseAtlas = (params: object) => {
})
}
// 获取课程简介
// export const getCourseDescription = (params:any) => {
// return request({
// url:''
// })
// }
export const getCourseDescription = (params:any) => {
return request({
url:'/api/coursesteacher/' + params.id,
})
}
export const getCourseChapter = (params: any) => {
return request({
url: '/api/chapter2/chapter',
url: '/api/chapter/chapter2',
params,
})
}
@ -31,7 +31,7 @@ export const getCourseChapter = (params: any) => {
// 获取所有课程资源
export const getCourseFiles = (params: any) => {
return request({
url: '/api/resource/graph/queryByCourseId',
url: '/api/resource/queryByCourseId',
params,
})
}

@ -42,16 +42,16 @@ export const constRouter: any = [
// hidden: false,
// },
// },
{
path: '/professionalListProfile', // 课程
component: () => import('@/views/professionalListProfile/index.vue'),
name: 'professionalListProfile',
meta: {
icon: '',
title: '课程',
hidden: false,
},
},
// {
// path: '/professionalListProfile', // 课程
// component: () => import('@/views/professionalListProfile/index.vue'),
// name: 'professionalListProfile',
// meta: {
// icon: '',
// title: '课程',
// hidden: false,
// },
// },
{
path: '/roadbedRecommendation',
component: () => import('@/views/roadbedRecommendation/index.vue'),

@ -20,7 +20,6 @@
</video>
</div>
<div class="pdf" v-if="flag === 3">
<!-- <vuePdf /> -->
<VuePdf
v-for="page in numOfPages"
:key="page"
@ -126,54 +125,40 @@
<div class="right">
<div class="course-info">
<div class="image">
<img src="../../assets/images/kcfm.jpg" alt="" />
<img :src="cuorseInfo.img" alt="" />
</div>
<div class="description">
<div class="description-box">
Vues 设计与实现这本书的简介 Vues 设计与实现是一本深入剖析
Vues 框架核心原理的权威著作
本书首先会为读者搭建起一个坚实的知识基础详细介绍 Vues
的发展历程和其在前端开发领域的重要地位接着深入探讨 Vues
的设计理念让读者理解其背后的创新思维和解决问题的独特视角
在实现方面书中通过大量的代码示例和详细的解释逐步拆解 Vues
的内部机制包括数据响应式系统虚拟 DOM
算法组件化架构等核心模块读者能够清晰地了解到 Vues
是如何高效地处理数据更新渲染页面以及优化性能的
不仅如此本书还会探讨 Vues
与其他前端技术的集成和协作帮助读者在实际项目中更好地运用 Vues
来构建复杂而强大的应用程序同时书中也提供了丰富的实战案例和最佳实践让读者能够将所学知识迅速应用到实际开发中
无论是前端开发的新手还是经验丰富的开发者都能从Vues
设计与实现中获得宝贵的知识和技能从而提升自己的开发水平打造出更加出色的前端应用它不仅是一本技术指南更是一本启发思考引领创新的宝典为读者打开了深入理解和掌握
Vues 框架的大门
{{ cuorseInfo.description }}
</div>
</div>
<div class="hours">
<div class="item">
<div style="display: flex">
<div class="label">学时</div>
<div class="content">9H</div>
<div class="content">{{cuorseInfo.classhours}}H</div>
</div>
<div style="display: flex; margin-left: 20px">
<div class="label">学分</div>
<div class="content">9</div>
<div class="content">{{ cuorseInfo.credit }}</div>
</div>
</div>
<div class="item">
<div class="label">先修</div>
<div class="content">Vue.js程序设计与实现</div>
<div class="label">课程名称</div>
<div class="content">{{ cuorseInfo.name }}</div>
</div>
<div class="item">
<div class="label">后继</div>
<div class="content">前端工程化模块化</div>
<div class="label">老师</div>
<div class="content">{{ cuorseInfo.teacher}}</div>
</div>
<div class="item">
<div class="label">知识点</div>
<div class="content">webpackvite</div>
<div class="label">类型</div>
<div class="content">{{ cuorseInfo.nature}}</div>
</div>
</div>
</div>
<div class="chapter">
<courseTree :chapterList="chapterList" />
<courseTree v-if="loading" :chapterList="chapterList" />
</div>
<div class="student-list">
<stu-list></stu-list>
@ -192,6 +177,7 @@ import {
getCourseChapter,
getCourseFiles,
getCourseObjectivesList,
getCourseDescription
} from '@/api/course'
import { ElLoading } from 'element-plus'
import { filterFilesType } from '@/utils/filters'
@ -213,7 +199,7 @@ const getCourseChapterEvent = async () => {
})
const res = await getCourseChapter({
// courseId: Route.query.id,
courseId: '2cd6b5b62c344fd0becff6010cba566e',
courseId: Route.query.id,
})
chapterList.value = res.data
console.log(res)
@ -233,14 +219,23 @@ const courseFilesList = ref<any>({})
const getCourseFilesEvent = async () => {
isTabsLoading.value = true
const res: any = await getCourseFiles({
courseId: '2cd6b5b62c344fd0becff6010cba566e',
courseId: courseId,
})
// console.log(filterFilesType(res));
courseFilesList.value = filterFilesType(res.data)
isTabsLoading.value = false
}
getCourseFilesEvent()
//
const cuorseInfo = ref({})
const getCourseDescriptionEvent = async () => {
const res = await getCourseDescription({
id:courseId,
})
cuorseInfo.value = res.data
console.log(res,'getCourseDescriptionEvent')
}
getCourseDescriptionEvent()
//
const flag = ref<number>(1)
const videoUrl = ref<string>('')
@ -262,7 +257,7 @@ const clickFile = async (file: any, index: number) => {
flag.value = index
tabLoading.value = false
} else if (index === 3) {
pdfUrl.value = `http://39.106.16.162:8080/api/resource/read?filename=${file.name}`
pdfUrl.value = file.url
const loadingTask = createLoadingTask(pdfUrl.value)
loadingTask.promise.then((pdf: any) => {
numOfPages.value = pdf.numPages
@ -275,7 +270,7 @@ const clickFile = async (file: any, index: number) => {
// console.log(resoinse.blob())
// })
} else if (index === 4) {
docx.value = `http://39.106.16.162:8080/api/resource/read?filename=${file.name}`
docx.value = file.url
flag.value = index
tabLoading.value = false
}
@ -371,7 +366,7 @@ const getCourseObjectivesListEvent = async () => {
courseObjectivesTrees.value = res.data[0].courseObjectivesTrees
console.log(courseObjectivesTrees.value, '111212')
}
getCourseObjectivesListEvent()
// getCourseObjectivesListEvent()
</script>
<style lang="scss" scoped>

@ -45,7 +45,7 @@ const emits = defineEmits(['clickGraph'])
const dom = ref(null)
onMounted(async () => {
const res: any = await getCourseAtlas({ id: '719f91586a64413898253c5b7d046fd8' })
const res: any = await getCourseAtlas({ id:props.id})
// console.log(res,'res')
const gData:any = {
nodes: [...res.data.knowList],

@ -60,7 +60,7 @@ const emits = defineEmits(['clickGraph'])
const data = ref({})
const dom = ref(null)
const getCourseDepthEvent = async(depth:any) => {
const res = await getCourseDepth({courseId:'719f91586a64413898253c5b7d046fd8',depth})
const res = await getCourseDepth({courseId:props.id,depth})
data.value = res.data
const gData:any = {
nodes: [... data.value.knowList],
@ -212,17 +212,17 @@ const getCourseDepthEvent = async(depth:any) => {
}
const getCourseTypeEvent = async(type:any) => {
const res = await getCourseType({courseId:'719f91586a64413898253c5b7d046fd8',type})
const res = await getCourseType({courseId:props.id,type})
console.log(res);
}
onMounted(async () => {
const res: any = await getCourseAtlas({ id: '719f91586a64413898253c5b7d046fd8' })
const res: any = await getCourseAtlas({ id: props.id })
data.value = res.data
// console.log(res,'res')
const gData:any = {
nodes: [... data.value.knowList],
links: [... data.value.linksList],
nodes: [... res.data.knowList],
links: [... res.data.linksList],
}
gData.links.forEach((link:any) => {
const a = gData.nodes.find((item:any) => item.id === link.source)

@ -74,10 +74,9 @@ import { getCourseList } from '@/api/course'
import { reactive, ref } from 'vue'
import {useRouter} from 'vue-router'
interface Page {
pageNo: number
page: number
pageSize: number
username:string
userId: string | number
}
interface item {
@ -96,10 +95,9 @@ interface CouresData {
}
const Router = useRouter()
const currentPage: Page = reactive({
pageNo: 1,
page: 1,
pageSize: 5,
username:'xiao1111',
userId:3
})
const couresData: CouresData = reactive({
content: [],
@ -113,16 +111,16 @@ const getCourseListEvent = async () => {
}
btnTexst.value = '正在加载'
const res: any = await getCourseList(currentPage)
couresData.content = [... couresData.content,...res.data.list]
couresData.totalcount = res.data.total
couresData.content = [... couresData.content,...res.data.content]
couresData.totalcount = res.data.totalcount
btnTexst.value = '加载更多'
console.log( couresData)
console.log( couresData,'couresData')
}
getCourseListEvent()
const getMore = () => {
if(btnTexst.value === '正在加载' || btnTexst.value === '没有更多了') return
currentPage.pageNo += 1
currentPage.page += 1
getCourseListEvent()
}
//

@ -127,7 +127,7 @@ const Route = useRoute()
const router = useRouter()
// const courseId: string = Route.query.id as string
console.log(Route.query.id)
const loading = ref(false)
const loading = ref(true)
const activeName = ref<string>('1')
const handleClick = (e: any) => {
@ -184,7 +184,7 @@ const getCourseFilesEvent = async () => {
console.log(courseFilesList.value[key])
loadingInstance.close()
}
getCourseFilesEvent()
// getCourseFilesEvent()
//
const flag = ref<number>(1)

@ -34,6 +34,13 @@ export default defineConfig({
server:{
host: '0.0.0.0',
port: 8866,
// proxy: {
// '/youhang': {
// target: 'http://10.100.200.177:8080',
// changeOrigin: true,
// rewrite: (path) => path.replace(/^\/youhang/, ''),
// },
// }
},
resolve: {
alias: {

Loading…
Cancel
Save