Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
C
center-resource
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
EzijingWeb
center-resource
Commits
c0bc635c
提交
c0bc635c
authored
11月 07, 2024
作者:
lhh
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
对接知识图谱的接口
上级
e5513e29
全部展开
隐藏空白字符变更
内嵌
并排
正在显示
8 个修改的文件
包含
274 行增加
和
10 行删除
+274
-10
api.ts
src/modules/course/create/api.ts
+11
-0
AddGraphbookDialog.vue
...reate/components/stepTwoComponents/AddGraphbookDialog.vue
+5
-7
StepTwo.vue
src/modules/course/create/views/StepTwo.vue
+2
-2
api.ts
src/modules/course/my/api.ts
+31
-0
Operation.vue
src/modules/course/my/components/Operation.vue
+1
-1
ViewGraphBook.vue
src/modules/course/my/components/ViewGraphBook.vue
+112
-0
ViewGraphCourse.vue
src/modules/course/my/components/ViewGraphCourse.vue
+112
-0
Graph.vue
src/modules/course/my/views/Graph.vue
+0
-0
没有找到文件。
src/modules/course/create/api.ts
浏览文件 @
c0bc635c
...
@@ -254,3 +254,14 @@ export function getBookDetail(data: { id: string; }) {
...
@@ -254,3 +254,14 @@ export function getBookDetail(data: { id: string; }) {
export
function
getChapter
(
data
:
{
book_id
:
string
;
})
{
export
function
getChapter
(
data
:
{
book_id
:
string
;
})
{
return
httpRequest
.
post
(
'/api/ebook/open/teacher/chapter/getAllList'
,
data
)
return
httpRequest
.
post
(
'/api/ebook/open/teacher/chapter/getAllList'
,
data
)
}
}
// 获取知识图谱
export
function
getTagList
(
params
:
{
type
:
string
;
parent_id
:
string
;
chapter_id
?:
string
})
{
return
httpRequest
.
get
(
'/api/resource/v1/course/course/tag-list'
,
{
params
})
}
// 关联知识图谱
export
function
addTagCourse
(
data
:
{
tag_id
:
string
;
course_id
:
string
;
chapter_id
:
string
;
})
{
return
httpRequest
.
post
(
'/api/resource/v1/course/course/tag-add-course'
,
data
)
}
// /v1/course/course/tag-add-course
src/modules/course/create/components/stepTwoComponents/Add
TextbookDialog2
.vue
→
src/modules/course/create/components/stepTwoComponents/Add
GraphbookDialog
.vue
浏览文件 @
c0bc635c
<
script
setup
lang=
"ts"
>
<
script
setup
lang=
"ts"
>
import
{
get
Chapter
,
createCharacter
}
from
'../../api'
import
{
get
TagList
,
addTagCourse
}
from
'../../api'
import
{
Plus
}
from
'@element-plus/icons-vue'
import
{
Plus
}
from
'@element-plus/icons-vue'
import
{
ElMessage
}
from
'element-plus'
import
{
ElMessage
}
from
'element-plus'
...
@@ -35,7 +35,7 @@ const handleCancel = () => {
...
@@ -35,7 +35,7 @@ const handleCancel = () => {
const
chapterList
=
ref
([])
const
chapterList
=
ref
([])
onMounted
(()
=>
{
onMounted
(()
=>
{
get
Chapter
({
book_id
:
route
.
query
?.
b
id
as
string
}).
then
(
res
=>
{
get
TagList
({
type
:
'1'
,
parent_id
:
route
.
query
.
id
as
string
}).
then
(
res
=>
{
chapterList
.
value
=
res
.
data
.
reduce
((
a
:
any
,
b
:
any
)
=>
{
chapterList
.
value
=
res
.
data
.
reduce
((
a
:
any
,
b
:
any
)
=>
{
b
.
index
=
'0'
b
.
index
=
'0'
if
(
b
.
children
)
{
if
(
b
.
children
)
{
...
@@ -57,13 +57,11 @@ const handleView = function (id: any) {
...
@@ -57,13 +57,11 @@ const handleView = function (id: any) {
const
handleGl
=
function
(
val
:
any
)
{
const
handleGl
=
function
(
val
:
any
)
{
const
params
:
any
=
{
const
params
:
any
=
{
name
:
val
.
name
,
tag_id
:
val
.
id
,
course_id
:
props
.
course_id
,
course_id
:
props
.
course_id
,
resource_type
:
'13'
,
chapter_id
:
props
.
chapterID
parent_id
:
props
.
chapterID
,
resource_id
:
val
.
id
}
}
createCharacter
(
params
).
then
(()
=>
{
addTagCourse
(
params
).
then
(()
=>
{
emit
(
'update:isShowTextbookDialog2'
,
false
)
emit
(
'update:isShowTextbookDialog2'
,
false
)
emit
(
'create'
,
val
)
emit
(
'create'
,
val
)
ElMessage
.
success
(
'添加成功'
)
ElMessage
.
success
(
'添加成功'
)
...
...
src/modules/course/create/views/StepTwo.vue
浏览文件 @
c0bc635c
...
@@ -13,7 +13,7 @@ import AddExamDialog from '../components/stepTwoComponents/AddExamDialog.vue'
...
@@ -13,7 +13,7 @@ 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
AddTextbookDialog
from
'../components/stepTwoComponents/AddTextbookDialog.vue'
import
Add
TextbookDialog2
from
'../components/stepTwoComponents/AddTextbookDialog2
.vue'
import
Add
GraphbookDialog
from
'../components/stepTwoComponents/AddGraphbookDialog
.vue'
import
OpenRules
from
'../components/stepTwoComponents/OpenRules.vue'
import
OpenRules
from
'../components/stepTwoComponents/OpenRules.vue'
const
route
=
useRoute
()
const
route
=
useRoute
()
...
@@ -600,7 +600,7 @@ const handleChangeStatus = (node: any, data: any) => {
...
@@ -600,7 +600,7 @@ const handleChangeStatus = (node: any, data: any) => {
:chapterID=
"chapterID"
:chapterID=
"chapterID"
:course_id=
"id"
:course_id=
"id"
/>
/>
<Add
TextbookDialog2
<Add
GraphbookDialog
v-if=
"isShowTextbookDialog2 === true"
v-if=
"isShowTextbookDialog2 === true"
v-model:isShowTextbookDialog2=
"isShowTextbookDialog2"
v-model:isShowTextbookDialog2=
"isShowTextbookDialog2"
@
create=
"handleFresh"
@
create=
"handleFresh"
...
...
src/modules/course/my/api.ts
浏览文件 @
c0bc635c
...
@@ -92,3 +92,34 @@ export function courseCopy(data: { id: string }) {
...
@@ -92,3 +92,34 @@ export function courseCopy(data: { id: string }) {
export
function
setDownload
(
data
:
{
course_id
:
string
;
information_id
:
string
;
can_download
:
string
})
{
export
function
setDownload
(
data
:
{
course_id
:
string
;
information_id
:
string
;
can_download
:
string
})
{
return
httpRequest
.
post
(
'/api/resource/v1/course/course/set-course-information-can-download '
,
data
)
return
httpRequest
.
post
(
'/api/resource/v1/course/course/set-course-information-can-download '
,
data
)
}
}
// 获取知识图谱
export
function
getTagList
(
params
:
{
type
:
string
;
parent_id
:
string
;
chapter_id
?:
string
})
{
return
httpRequest
.
get
(
'/api/resource/v1/course/course/tag-list'
,
{
params
})
}
// 新增知识图谱
export
function
addTag
(
data
:
{
name
:
string
;
course_id
:
string
;
status
:
string
;
parent_id
?:
string
})
{
return
httpRequest
.
post
(
'/api/resource/v1/course/course/tag-add'
,
data
)
}
// 更新知识图谱
export
function
updateTag
(
data
:
{
id
:
string
;
name
:
string
;
course_id
:
string
;
status
:
string
;
})
{
return
httpRequest
.
post
(
'/api/resource/v1/course/course/tag-update'
,
data
)
}
// 删除知识图谱
export
function
deleteTag
(
data
:
{
id
:
string
;
course_id
:
string
})
{
return
httpRequest
.
post
(
'/api/resource/v1/course/course/tag-delete'
,
data
)
}
// 查看关联的课程章节
export
function
viewTagCourse
(
params
:
{
tag_id
:
string
;
course_id
:
string
})
{
return
httpRequest
.
get
(
'/api/resource/v1/course/course/tag-course'
,
{
params
})
}
// 查看关联的书籍章节
export
function
viewTagBook
(
params
:
{
tag_id
:
string
;
course_id
:
string
})
{
return
httpRequest
.
get
(
'/api/resource/v1/course/course/tag-book'
,
{
params
})
}
src/modules/course/my/components/Operation.vue
浏览文件 @
c0bc635c
...
@@ -126,7 +126,7 @@ const handleMembers = () => {
...
@@ -126,7 +126,7 @@ const handleMembers = () => {
// 点击知识图谱
// 点击知识图谱
const
handleChart
=
()
=>
{
const
handleChart
=
()
=>
{
router
.
push
({
path
:
'/course/my/graph'
,
query
:
{
n
:
props
.
data
?.
name
,
bid
:
19
}
})
router
.
push
({
path
:
'/course/my/graph'
,
query
:
{
n
:
props
.
data
?.
name
,
bid
:
19
,
cid
:
route
.
query
.
id
}
})
}
}
// 更改负责人确定
// 更改负责人确定
...
...
src/modules/course/my/components/ViewGraphBook.vue
0 → 100644
浏览文件 @
c0bc635c
<
script
setup
lang=
"ts"
>
import
{
viewTagBook
}
from
'../api'
const
route
=
useRoute
()
const
emit
=
defineEmits
<
Emits
>
()
const
props
=
defineProps
({
isShowGraphBookDialog
:
{
type
:
Boolean
,
required
:
true
},
id
:
{
type
:
String
,
required
:
false
}
})
interface
Emits
{
(
e
:
'update:isShowGraphBookDialog'
,
isShowVideoDialog
:
boolean
):
void
(
e
:
'create'
,
val
:
any
):
void
}
// 取消
const
handleCancel
=
()
=>
{
emit
(
'update:isShowGraphBookDialog'
,
false
)
}
const
chapterList
=
ref
([])
onMounted
(()
=>
{
viewTagBook
({
tag_id
:
props
.
id
as
string
,
course_id
:
route
.
query
.
cid
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'
)
})
})
</
script
>
<
template
>
<el-drawer
:model-value=
"isShowGraphBookDialog"
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>
</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
>
src/modules/course/my/components/ViewGraphCourse.vue
0 → 100644
浏览文件 @
c0bc635c
<
script
setup
lang=
"ts"
>
import
{
viewTagCourse
}
from
'../api'
const
route
=
useRoute
()
const
emit
=
defineEmits
<
Emits
>
()
const
props
=
defineProps
({
isShowGraphCourseDialog
:
{
type
:
Boolean
,
required
:
true
},
id
:
{
type
:
String
,
required
:
false
}
})
interface
Emits
{
(
e
:
'update:isShowGraphCourseDialog'
,
isShowVideoDialog
:
boolean
):
void
(
e
:
'create'
,
val
:
any
):
void
}
// 取消
const
handleCancel
=
()
=>
{
emit
(
'update:isShowGraphCourseDialog'
,
false
)
}
const
chapterList
=
ref
([])
onMounted
(()
=>
{
viewTagCourse
({
tag_id
:
props
.
id
as
string
,
course_id
:
route
.
query
.
cid
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'
)
})
})
</
script
>
<
template
>
<el-drawer
:model-value=
"isShowGraphCourseDialog"
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>
</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
>
src/modules/course/my/views/Graph.vue
浏览文件 @
c0bc635c
差异被折叠。
点击展开。
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论