Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
C
center-resource
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
EzijingWeb
center-resource
Commits
c2b5eab4
提交
c2b5eab4
authored
11月 11, 2024
作者:
lhh
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
update
上级
c0bc635c
隐藏空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
33 行增加
和
4 行删除
+33
-4
api.ts
src/modules/course/my/api.ts
+8
-0
Graph.vue
src/modules/course/my/views/Graph.vue
+25
-4
没有找到文件。
src/modules/course/my/api.ts
浏览文件 @
c2b5eab4
...
...
@@ -123,3 +123,10 @@ export function viewTagCourse(params: { tag_id: string; course_id: string }) {
export
function
viewTagBook
(
params
:
{
tag_id
:
string
;
course_id
:
string
})
{
return
httpRequest
.
get
(
'/api/resource/v1/course/course/tag-book'
,
{
params
})
}
// 导入
export
function
importTag
(
data
:
{
course_id
:
string
;
file
:
any
})
{
return
httpRequest
.
post
(
'/api/resource/v1/course/course/tag-import'
,
data
,
{
headers
:
{
'Content-Type'
:
'multipart/form-data'
}
})
}
\ No newline at end of file
src/modules/course/my/views/Graph.vue
浏览文件 @
c2b5eab4
<
script
setup
lang=
"ts"
>
import
{
getTagList
,
addTag
,
updateTag
,
deleteTag
}
from
'../api'
import
{
getTagList
,
addTag
,
updateTag
,
deleteTag
,
importTag
}
from
'../api'
import
ViewGraphCourse
from
'../components/ViewGraphCourse.vue'
import
ViewGraphBook
from
'../components/ViewGraphBook.vue'
import
{
ElMessage
}
from
'element-plus'
...
...
@@ -120,6 +120,21 @@ const handleBookView = function (scope: any) {
const
formInline
=
reactive
({
user
:
''
})
// 导出
const
handleTagDownload
=
()
=>
{
// tagDownload({ course_id: route.query.cid as string }).then()
window
.
open
(
`/api/resource/v1/course/course/tag-download?course_id=
${
route
.
query
.
cid
}
`
)
}
const
fetchFileUpload
=
(
option
:
any
)
=>
{
return
new
Promise
(()
=>
{
importTag
({
course_id
:
route
.
query
.
cid
as
string
,
file
:
option
.
file
}).
then
(()
=>
{
updateTagList
()
ElMessage
.
success
(
'导入数据成功'
)
})
})
}
</
script
>
<
template
>
<AppCard
title=
"知识图库"
>
...
...
@@ -135,9 +150,15 @@ const formInline = reactive({
</el-form-item>
</el-form>
</div>
-->
<el-button
type=
"primary"
@
click=
"handleAddTagSame"
>
添加知识点
</el-button>
<el-button
type=
"primary"
>
批量导入
</el-button>
<el-button
type=
"primary"
>
导出
</el-button>
<div
style=
"display: flex"
>
<el-button
type=
"primary"
@
click=
"handleAddTagSame"
>
添加知识点
</el-button>
<el-upload
:show-file-list=
"false"
ref=
"upload"
action=
"#"
:limit=
"1"
:http-request=
"fetchFileUpload"
>
<el-button
type=
"primary"
style=
"margin: 0 15px"
>
批量导入
</el-button>
<!--
<el-icon
class=
"el-icon--upload"
><upload-filled
/></el-icon>
<div
class=
"el-upload__text"
>
将文件拖至此处,点击上传
</div>
-->
</el-upload>
<el-button
type=
"primary"
@
click=
"handleTagDownload"
>
导出
</el-button>
</div>
<el-table
:data=
"tableData"
style=
"width: 100%; margin: 20px 0"
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论