Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
L
learn-online-pc
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
EzijingWeb
learn-online-pc
Commits
31decb36
提交
31decb36
authored
4月 22, 2021
作者:
王鹏飞
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
优化作业驳回
上级
064d8228
显示空白字符变更
内嵌
并排
正在显示
4 个修改的文件
包含
137 行增加
和
16 行删除
+137
-16
showMore.vue
src/components/showMore.vue
+75
-0
chapterWork.vue
src/modules/viewer/components/work/chapterWork.vue
+57
-15
chapterWorkAnswerItem.vue
src/modules/viewer/components/work/chapterWorkAnswerItem.vue
+4
-1
chapterWorkComment.vue
src/modules/viewer/components/work/chapterWorkComment.vue
+1
-0
没有找到文件。
src/components/showMore.vue
0 → 100644
浏览文件 @
31decb36
<
template
>
<div>
<div
ref=
"box"
:class=
"classes"
>
<slot></slot>
</div>
<div
class=
"block-control"
@
click=
"toggle"
v-if=
"hasMore"
>
<template
v-if=
"isOpen"
>
<i
class=
"el-icon-caret-top"
></i><span>
收起
</span>
</
template
>
<
template
v-else
>
<i
class=
"el-icon-caret-bottom"
></i><span>
展开
</span>
</
template
>
</div>
</div>
</template>
<
script
>
export
default
{
data
()
{
return
{
max
:
300
,
hasMore
:
false
,
isOpen
:
false
}
},
computed
:
{
classes
()
{
return
{
'has-more'
:
this
.
hasMore
&&
!
this
.
isOpen
}
}
},
methods
:
{
init
()
{
const
height
=
this
.
$refs
.
box
.
offsetHeight
this
.
hasMore
=
height
>
this
.
max
},
toggle
()
{
this
.
isOpen
=
!
this
.
isOpen
}
},
mounted
()
{
this
.
init
()
}
}
</
script
>
<
style
lang=
"scss"
>
.block-control
{
height
:
20px
;
display
:
flex
;
align-items
:
center
;
justify-content
:
center
;
margin-top
:
10px
;
padding-top
:
5px
;
color
:
#d3dce6
;
cursor
:
pointer
;
border-top
:
1px
solid
#eaeefb
;
i
{
font-size
:
16px
;
}
span
{
display
:
none
;
padding-left
:
5px
;
font-size
:
12px
;
}
&
:hover
{
color
:
#1f2f3d
;
span
{
display
:
block
;
}
}
}
.has-more
{
max-height
:
300px
;
overflow
:
hidden
;
}
</
style
>
src/modules/viewer/components/work/chapterWork.vue
浏览文件 @
31decb36
<
template
>
<
template
>
<div>
<div>
<container
:title=
"chapter.name"
v-loading=
"loading"
>
<container
:title=
"chapter.name"
v-loading=
"loading"
id=
"work"
>
<template
v-slot:header-aside
v-if=
"isRevised"
>
<template
v-slot:header-aside
v-if=
"isRevised"
>
{{
$t
(
'viewerWork.score'
)
}}
:
{{
detail
.
score
}}{{
$t
(
'viewerWork.fractionUnit'
)
}}
<p
v-if=
"hasScore"
>
{{
$t
(
'viewerWork.score'
)
}}
:
{{
detail
.
score
}}{{
$t
(
'viewerWork.fractionUnit'
)
}}
</p>
</
template
>
</
template
>
<div
class=
"exam-form"
>
<div
class=
"exam-form"
>
<
template
v-for=
"(item, index) in questions"
>
<
template
v-for=
"(item, index) in questions"
>
...
@@ -22,7 +22,7 @@
...
@@ -22,7 +22,7 @@
</div>
</div>
<p
style=
"color: red"
v-if=
"deadline"
>
{{ $t('viewerWork.deadline', { date: deadline }) }}
</p>
<p
style=
"color: red"
v-if=
"deadline"
>
{{ $t('viewerWork.deadline', { date: deadline }) }}
</p>
<!-- 驳回状态 -->
<!-- 驳回状态 -->
<
template
v-if=
"detail.status ===
1
"
>
<
template
v-if=
"detail.status ===
8
"
>
<div
class=
"work-bottom"
>
<div
class=
"work-bottom"
>
<div
class=
"info"
>
<div
class=
"info"
>
<div
class=
"paper-check"
>
<div
class=
"paper-check"
>
...
@@ -44,7 +44,7 @@
...
@@ -44,7 +44,7 @@
</
template
>
</
template
>
<!-- 正常状态 -->
<!-- 正常状态 -->
<
template
v-else
>
<
template
v-else
>
<div
class=
"work-bottom"
v-if=
"detail"
>
<div
class=
"work-bottom"
>
<div
class=
"info"
>
<div
class=
"info"
>
<template
v-if=
"isRevised"
>
<template
v-if=
"isRevised"
>
<div
class=
"paper-check"
>
<div
class=
"paper-check"
>
...
@@ -77,7 +77,34 @@
...
@@ -77,7 +77,34 @@
<
/div
>
<
/div
>
<
/template
>
<
/template
>
<
/container
>
<
/container
>
<
chapter
-
work
-
comment
:
endDate
=
"commentEndDate"
:
status
=
"detail.status2"
v
-
if
=
"showComment"
/>
<
chapter
-
work
-
comment
:
endDate
=
"commentEndDate"
:
status
=
"detail.status2"
@
update
=
"getDetail"
v
-
if
=
"showComment"
id
=
"comment"
/>
<
el
-
dialog
:
title
=
"dialogTitle"
:
visible
.
sync
=
"dialogVisible"
width
=
"400px"
>
<
div
class
=
"paper-check-item"
>
<
p
>
您本次的作业被老师驳回,请您重新编辑作业提交!
<
/p
>
<
/div
>
<
div
class
=
"paper-check-item"
>
<
span
>
{{
$t
(
'viewerWork.rejectTime'
)
}}
:
<
/span
>
{{
detail
.
checker_time
}}
<
/div
>
<
div
class
=
"paper-check-item"
>
<
span
>
{{
$t
(
'viewerWork.rejectContent'
)
}}
:
<
/span
>
<
div
class
=
"edit_html"
v
-
html
=
"detail.check_comments"
><
/div
>
<
/div
>
<
div
class
=
"paper-check-item"
>
<
p
>
注:重新提交后不可修改,请检查好作业内容再做提交。
<
/p
>
<
/div
>
<
template
#
footer
>
<
el
-
button
type
=
"primary"
@
click
=
"onReEdit"
>
重新编辑
<
/el-button
>
<
/template
>
<
/el-dialog
>
<
/div
>
<
/div
>
<
/template
>
<
/template
>
...
@@ -125,11 +152,9 @@ export default {
...
@@ -125,11 +152,9 @@ export default {
hasComment
:
false
,
// 是否评论
hasComment
:
false
,
// 是否评论
commentEndDate
:
''
,
commentEndDate
:
''
,
rules
:
{
rules
:
{
user_answer
:
[
user_answer
:
[{
required
:
true
,
message
:
'请输入'
,
trigger
:
'change'
}
]
{
required
:
true
,
message
:
'请输入'
,
trigger
:
'change'
}
}
,
//
{
max
:
1000
,
message
:
'最多输入1000个字符'
,
trigger
:
'change'
}
dialogVisible
:
false
]
}
}
}
}
,
}
,
watch
:
{
watch
:
{
...
@@ -179,7 +204,7 @@ export default {
...
@@ -179,7 +204,7 @@ export default {
}
,
}
,
hasScore
()
{
hasScore
()
{
// allow_score 1 显示 2隐藏
// allow_score 1 显示 2隐藏
return
this
.
detail
.
allow_score
!==
2
return
this
.
detail
.
allow_score
!==
2
&&
this
.
detail
.
score
}
,
}
,
// 显示作业评论
// 显示作业评论
showComment
()
{
showComment
()
{
...
@@ -188,11 +213,19 @@ export default {
...
@@ -188,11 +213,19 @@ export default {
return
this
.
hasComment
&&
currentTime
>
endTime
return
this
.
hasComment
&&
currentTime
>
endTime
}
,
}
,
disabled
()
{
disabled
()
{
if
(
this
.
detail
.
status
===
9
)
{
if
(
this
.
detail
.
status
===
1
)
{
return
false
return
false
}
}
// -1未处理 0已处理 1驳回 9重新编辑
// -1未处理 0已处理 1驳回
return
[
0
,
1
].
includes
(
this
.
detail
.
status
)
||
!
this
.
isWorkTime
return
this
.
detail
.
status
===
0
||
!
this
.
isWorkTime
}
,
dialogTitle
()
{
if
(
this
.
detail
.
status
===
1
)
{
return
'作业驳回'
}
if
(
this
.
detail
.
status2
===
1
)
{
return
'互评作业驳回'
}
}
}
}
,
}
,
methods
:
{
methods
:
{
...
@@ -213,6 +246,9 @@ export default {
...
@@ -213,6 +246,9 @@ export default {
.
getChapterHomework
(
this
.
sid
,
this
.
cid
,
this
.
resourceId
)
.
getChapterHomework
(
this
.
sid
,
this
.
cid
,
this
.
resourceId
)
.
then
(
response
=>
{
.
then
(
response
=>
{
this
.
detail
=
Array
.
isArray
(
response
)
?
{
}
:
response
this
.
detail
=
Array
.
isArray
(
response
)
?
{
}
:
response
if
(
this
.
detail
.
status
===
1
||
this
.
detail
.
status2
===
1
)
{
this
.
dialogVisible
=
true
}
if
(
this
.
detail
.
id
)
{
if
(
this
.
detail
.
id
)
{
const
parseAnswers
=
JSON
.
parse
(
this
.
detail
.
work_contents
)
const
parseAnswers
=
JSON
.
parse
(
this
.
detail
.
work_contents
)
// 设置答案
// 设置答案
...
@@ -336,7 +372,12 @@ export default {
...
@@ -336,7 +372,12 @@ export default {
}
,
}
,
// 重新编辑
// 重新编辑
onReEdit
()
{
onReEdit
()
{
this
.
detail
.
status
=
9
this
.
dialogVisible
=
false
if
(
this
.
detail
.
status2
===
1
)
{
window
.
location
.
hash
=
'#comment'
}
else
{
window
.
location
.
hash
=
'#work'
}
}
}
}
,
}
,
beforeMount
()
{
beforeMount
()
{
...
@@ -369,6 +410,7 @@ export default {
...
@@ -369,6 +410,7 @@ export default {
}
}
}
}
.
paper
-
check
-
item
{
.
paper
-
check
-
item
{
padding
:
5
px
0
;
display
:
flex
;
display
:
flex
;
b
{
b
{
white
-
space
:
nowrap
;
white
-
space
:
nowrap
;
...
...
src/modules/viewer/components/work/chapterWorkAnswerItem.vue
浏览文件 @
31decb36
...
@@ -3,11 +3,13 @@
...
@@ -3,11 +3,13 @@
<div
class=
"chapter-work-answer-item-hd"
>
{{
nickname
}}
:
</div>
<div
class=
"chapter-work-answer-item-hd"
>
{{
nickname
}}
:
</div>
<div
class=
"chapter-work-answer-item-bd"
>
<div
class=
"chapter-work-answer-item-bd"
>
<div
class=
"item"
v-for=
"item in workList"
:key=
"item.question_id"
>
<div
class=
"item"
v-for=
"item in workList"
:key=
"item.question_id"
>
<show-more>
<div
v-html=
"decode(item.descreption)"
></div>
<div
v-html=
"decode(item.descreption)"
></div>
<a
:href=
"item.file_url"
target=
"_blank"
class=
"file"
v-if=
"item.file_url"
>
<a
:href=
"item.file_url"
target=
"_blank"
class=
"file"
v-if=
"item.file_url"
>
<i
class=
"el-icon-document"
></i>
<i
class=
"el-icon-document"
></i>
{{
$t
(
'viewerWork.downloadName'
)
}}
{{
$t
(
'viewerWork.downloadName'
)
}}
</a>
</a>
</show-more>
</div>
</div>
</div>
</div>
<slot
/>
<slot
/>
...
@@ -16,12 +18,13 @@
...
@@ -16,12 +18,13 @@
<
script
>
<
script
>
import
Base64
from
'Base64'
import
Base64
from
'Base64'
import
showMore
from
'@/components/showMore'
export
default
{
export
default
{
props
:
{
props
:
{
index
:
{
type
:
Number
,
default
:
0
},
index
:
{
type
:
Number
,
default
:
0
},
data
:
{
type
:
Object
,
default
:
()
=>
({})
}
data
:
{
type
:
Object
,
default
:
()
=>
({})
}
},
},
components
:
{
showMore
},
data
()
{
data
()
{
return
{}
return
{}
},
},
...
...
src/modules/viewer/components/work/chapterWorkComment.vue
浏览文件 @
31decb36
...
@@ -119,6 +119,7 @@ export default {
...
@@ -119,6 +119,7 @@ export default {
.
then
(
response
=>
{
.
then
(
response
=>
{
this
.
$message
({
type
:
'success'
,
message
:
response
.
message
})
this
.
$message
({
type
:
'success'
,
message
:
response
.
message
})
this
.
getList
()
this
.
getList
()
this
.
$emit
(
'update'
)
})
})
.
catch
(
error
=>
{
.
catch
(
error
=>
{
this
.
$message
({
type
:
'error'
,
message
:
error
.
message
})
this
.
$message
({
type
:
'error'
,
message
:
error
.
message
})
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论