Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
L
learn-online-pc
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
EzijingWeb
learn-online-pc
Commits
48f7ccfe
提交
48f7ccfe
authored
9月 25, 2025
作者:
王鹏飞
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
feat: 增加回复评论
上级
3f8ec5f1
隐藏空白字符变更
内嵌
并排
正在显示
5 个修改的文件
包含
94 行增加
和
23 行删除
+94
-23
api.js
src/modules/viewer/api.js
+8
-0
chapterWorkComment.vue
src/modules/viewer/components/work/chapterWorkComment.vue
+1
-1
chapterWorkCommentAndReply.vue
...les/viewer/components/work/chapterWorkCommentAndReply.vue
+72
-0
chapterWorkCommentItem.vue
...modules/viewer/components/work/chapterWorkCommentItem.vue
+9
-6
chapterWorkCommentToMe.vue
...modules/viewer/components/work/chapterWorkCommentToMe.vue
+4
-16
没有找到文件。
src/modules/viewer/api.js
浏览文件 @
48f7ccfe
...
@@ -196,6 +196,14 @@ export function addChapterHomeworkComment(data) {
...
@@ -196,6 +196,14 @@ export function addChapterHomeworkComment(data) {
export
function
getChapterHomeworkComment
(
params
)
{
export
function
getChapterHomeworkComment
(
params
)
{
return
httpRequest
.
get
(
'/api/lms/v2/education/homeworks/fmcomment'
,
params
)
return
httpRequest
.
get
(
'/api/lms/v2/education/homeworks/fmcomment'
,
params
)
}
}
/**
* 提交作业互评
*/
export
function
addChapterHomeworkCommentReply
(
data
)
{
return
httpRequest
.
post
(
'/api/lms/v2/education/add-comment'
,
data
)
}
/**
/**
* 获取营销数据
* 获取营销数据
* @param {string} semesterId 学期ID
* @param {string} semesterId 学期ID
...
...
src/modules/viewer/components/work/chapterWorkComment.vue
浏览文件 @
48f7ccfe
...
@@ -11,7 +11,7 @@
...
@@ -11,7 +11,7 @@
ref=
"form"
ref=
"form"
>
>
<el-form-item
prop=
"comment"
>
<el-form-item
prop=
"comment"
>
<chapter-work-comment-item
:data=
"item"
:index=
"index"
:disabled=
"disabled"
:key=
"item.id"
/>
</el-form-item
<chapter-work-comment-item
:data=
"item"
:index=
"index"
:disabled=
"disabled"
:key=
"item.id"
@
update=
"getList"
/>
</el-form-item
></el-form>
></el-form>
</
template
>
</
template
>
<div
class=
"button"
v-if=
"status !== 0"
>
<div
class=
"button"
v-if=
"status !== 0"
>
...
...
src/modules/viewer/components/work/chapterWorkCommentAndReply.vue
0 → 100644
浏览文件 @
48f7ccfe
<
template
>
<div>
<div
class=
"chapter-work-comment-and-reply"
v-if=
"showFirst"
>
<show-more>
<div
v-html=
"data.comment"
></div>
</show-more>
</div>
<div
class=
"chapter-work-comment-and-reply"
v-for=
"reply in data.details"
>
<show-more
:key=
"reply.id"
>
<div
v-html=
"reply.comment"
></div>
</show-more>
</div>
<div
class=
"chapter-work-comment-and-reply-tools"
>
<el-button
size=
"small"
@
click=
"showComment = !showComment"
>
评论
</el-button>
<template
v-if=
"showComment"
>
<div
style=
"flex:1;"
>
<v-editor
v-model=
"comment"
></v-editor>
</div>
<el-button
type=
"primary"
@
click=
"handleSubmit"
>
提交
</el-button>
</
template
>
</div>
</div>
</template>
<
script
>
import
showMore
from
'@/components/showMore'
import
VEditor
from
'@/components/tinymce'
import
*
as
api
from
'../../api'
export
default
{
name
:
'ChapterWorkCommentAndReply'
,
props
:
{
data
:
{
type
:
Object
,
default
:
()
=>
({})
},
showFirst
:
{
type
:
Boolean
,
default
:
true
}
},
emits
:
[
'update'
],
components
:
{
VEditor
,
showMore
},
data
()
{
return
{
showComment
:
false
,
comment
:
''
}
},
methods
:
{
handleSubmit
()
{
api
.
addChapterHomeworkCommentReply
({
comment_id
:
this
.
data
.
id
,
comment
:
this
.
comment
}).
then
((
response
)
=>
{
this
.
$message
({
type
:
'success'
,
message
:
'回复成功'
})
this
.
showComment
=
false
this
.
comment
=
''
this
.
$emit
(
'update'
)
})
}
}
}
</
script
>
<
style
lang=
"scss"
>
.chapter-work-comment-and-reply
{
margin-bottom
:
10px
;
padding
:
10px
;
border-radius
:
8px
;
background-color
:
#fff
;
font-size
:
12pt
;
line-height
:
initial
;
img
{
max-width
:
100%
;
}
}
.chapter-work-comment-and-reply-tools
{
display
:
flex
;
flex-direction
:
column
;
// align-items: flex-end;
gap
:
10px
;
}
</
style
>
src/modules/viewer/components/work/chapterWorkCommentItem.vue
浏览文件 @
48f7ccfe
<
template
>
<
template
>
<chapter-work-answer-item
:data=
"data"
:key=
"data.id"
v-bind=
"$attrs"
>
<div>
<h3
class=
"comment-title"
>
{{
$t
(
'viewerWork.commentMyTitle'
)
}}
</h3>
<chapter-work-answer-item
:data=
"data"
:key=
"data.id"
v-bind=
"$attrs"
>
<v-editor
v-model=
"data.comment"
:disabled=
"disabled"
></v-editor>
<h3
class=
"comment-title"
>
{{
$t
(
'viewerWork.commentMyTitle'
)
}}
</h3>
</chapter-work-answer-item>
<v-editor
v-model=
"data.comment"
:disabled=
"disabled"
></v-editor>
</chapter-work-answer-item>
<chapter-work-comment-and-reply
:data=
"data"
v-on=
"$listeners"
:show-first=
"false"
/>
</div>
</
template
>
</
template
>
<
script
>
<
script
>
// componets
// componets
import
ChapterWorkAnswerItem
from
'./chapterWorkAnswerItem.vue'
import
ChapterWorkAnswerItem
from
'./chapterWorkAnswerItem.vue'
import
VEditor
from
'@/components/tinymce'
import
VEditor
from
'@/components/tinymce'
import
chapterWorkCommentAndReply
from
'./chapterWorkCommentAndReply.vue'
export
default
{
export
default
{
props
:
{
data
:
{
type
:
Object
,
default
:
()
=>
({})
},
disabled
:
{
type
:
Boolean
}
},
props
:
{
data
:
{
type
:
Object
,
default
:
()
=>
({})
},
disabled
:
{
type
:
Boolean
}
},
components
:
{
ChapterWorkAnswerItem
,
VEditor
},
components
:
{
ChapterWorkAnswerItem
,
VEditor
,
chapterWorkCommentAndReply
},
data
()
{
data
()
{
return
{}
return
{}
}
}
...
@@ -24,6 +28,5 @@ export default {
...
@@ -24,6 +28,5 @@ export default {
margin
:
10px
0
;
margin
:
10px
0
;
font-size
:
14px
;
font-size
:
14px
;
font-weight
:
normal
;
font-weight
:
normal
;
// padding: 10px 0;
}
}
</
style
>
</
style
>
src/modules/viewer/components/work/chapterWorkCommentToMe.vue
浏览文件 @
48f7ccfe
...
@@ -4,9 +4,7 @@
...
@@ -4,9 +4,7 @@
<div
class=
"module-item"
:key=
"index"
>
<div
class=
"module-item"
:key=
"index"
>
<div
class=
"module-item-hd"
>
{{
$t
(
'viewerWork.comment'
)
}}{{
index
+
1
}}
:
</div>
<div
class=
"module-item-hd"
>
{{
$t
(
'viewerWork.comment'
)
}}{{
index
+
1
}}
:
</div>
<div
class=
"module-item-bd"
>
<div
class=
"module-item-bd"
>
<show-more>
<chapter-work-comment-and-reply
:data=
"item"
:key=
"item.id"
@
update=
"getList"
/>
<div
v-html=
"item.comment"
></div>
</show-more>
</div>
</div>
</div>
</div>
</
template
>
</
template
>
...
@@ -19,10 +17,10 @@ import * as api from '../../api'
...
@@ -19,10 +17,10 @@ import * as api from '../../api'
// componets
// componets
import
Container
from
'../common/container.vue'
import
Container
from
'../common/container.vue'
import
showMore
from
'@/components/showMore'
import
showMore
from
'@/components/showMore'
import
chapterWorkCommentAndReply
from
'./chapterWorkCommentAndReply.vue'
export
default
{
export
default
{
props
:
{
id
:
{
type
:
String
}
},
props
:
{
id
:
{
type
:
String
}
},
components
:
{
Container
,
showMore
},
components
:
{
Container
,
showMore
,
chapterWorkCommentAndReply
},
data
()
{
data
()
{
return
{
return
{
list
:
[]
list
:
[]
...
@@ -31,7 +29,7 @@ export default {
...
@@ -31,7 +29,7 @@ export default {
computed
:
{},
computed
:
{},
methods
:
{
methods
:
{
getList
()
{
getList
()
{
api
.
getChapterHomeworkComment
({
homework_id
:
this
.
id
}).
then
(
response
=>
{
api
.
getChapterHomeworkComment
({
homework_id
:
this
.
id
}).
then
(
(
response
)
=>
{
this
.
list
=
response
this
.
list
=
response
})
})
}
}
...
@@ -52,14 +50,4 @@ export default {
...
@@ -52,14 +50,4 @@ export default {
.module-item-hd
{
.module-item-hd
{
margin-bottom
:
10px
;
margin-bottom
:
10px
;
}
}
.module-item-bd
{
padding
:
10px
;
border-radius
:
8px
;
background-color
:
#fff
;
font-size
:
12pt
;
line-height
:
initial
;
img
{
max-width
:
100%
;
}
}
</
style
>
</
style
>
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论