Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
C
center-qa
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
EzijingWeb
center-qa
Commits
b7f50005
提交
b7f50005
authored
2月 22, 2022
作者:
matian
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
代码提交
上级
d0d86881
隐藏空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
160 行增加
和
102 行删除
+160
-102
QuestionList.vue
src/modules/paper/components/QuestionList.vue
+61
-79
QuestionListItem.vue
src/modules/paper/components/QuestionListItem.vue
+17
-23
QuestionListItems.vue
src/modules/paper/components/QuestionListItems.vue
+82
-0
没有找到文件。
src/modules/paper/components/QuestionList.vue
浏览文件 @
b7f50005
...
...
@@ -12,16 +12,15 @@
<el-button
class=
"clearfix_add"
type=
"primary"
@
click=
"addPaper"
>
添加试题
</el-button>
</div>
<!-- 题目列表 -->
<!--
<el-card
v-for=
"(item, index) in questionList"
>
-->
<QuestionListItem
:questionList=
"questionList"
:key=
"index"
ref=
"listItemRef"
@
handlePosition=
"handlePosition"
@
selectSubjectsChange=
"selectSubjectsChange"
:disabled=
"selectQuestion.length === 0"
/>
<!--
</el-card>
-->
<div
v-for=
"(item, index) in questionList"
:key=
"index"
>
<QuestionListItems
:questionList=
"questionList"
ref=
"listItemRef"
@
handlePosition=
"handlePosition"
@
selectSubjectsChange=
"selectSubjectsChange"
:disabled=
"selectQuestion.length === 0"
/>
</div>
<!-- 选题组卷无数据情况下显示 -->
<div
class=
"nonePaper"
v-show=
"questionList.length === 0"
>
<el-result
icon=
"info"
subTitle=
"该试卷无试题,去添加试题吧"
></el-result>
...
...
@@ -51,12 +50,12 @@
</
template
>
<
script
>
import
QuestionListItem
from
'./QuestionListItem
.vue'
import
QuestionListItem
s
from
'./QuestionListItems
.vue'
import
AutomaticPaper
from
'./AutomaticPaper.vue'
import
addPaper
from
'./AddPaper.vue'
export
default
{
components
:
{
QuestionListItem
,
QuestionListItem
s
,
addPaper
,
AutomaticPaper
},
...
...
@@ -69,85 +68,68 @@ export default {
data
()
{
return
{
visible
:
false
,
// 控制增加试题弹框显示还是隐藏
// questionList: [],
questionList
:
[
{
id
:
'1'
,
tag
:
'1'
,
type
:
'单择题'
,
title
:
'hqduuhdqj'
,
answer
:
'11111'
,
radioList
:
[
{
desc
:
'fgweyfg'
,
id
:
'0'
},
{
desc
:
'1223'
,
id
:
'1'
}
],
score
:
5
},
{
id
:
'2'
,
tag
:
'2'
,
type
:
'多选题'
,
title
:
'hqduuhdqj'
,
answer
:
'hfgwhrfgiuwhfiu'
,
checkList
:
[
{
desc
:
'jdks'
,
id
:
'1'
},
{
desc
:
'fsf'
,
id
:
'2'
}
],
score
:
2
question_type
:
1
,
question_title
:
'xxxxx'
,
question_content
:
'这是一道单选题'
,
is_parent
:
1
,
child_question_type
:
0
,
question_answer
:
'答案就是你猜呀'
,
question_score
:
'3'
,
group_id
:
'0'
,
question_options
:
[
{
options
:
'fgweyfg'
,
id
:
'0'
,
checked
:
true
},
{
options
:
'1223'
,
id
:
'1'
,
checked
:
false
}
]
},
{
id
:
'3'
,
tag
:
'3'
,
type
:
'简答题'
,
title
:
'hqduuhdqj'
,
answer
:
'hfgwhrfgiuwhfiu'
,
score
:
1
question_type
:
2
,
question_title
:
'xxxxx'
,
question_content
:
'这是一道多选题'
,
is_parent
:
1
,
child_question_type
:
0
,
question_answer
:
'答案就是你猜呀'
,
question_score
:
'3'
,
group_id
:
'0'
,
question_options
:
[
{
options
:
'fgweyfg'
,
id
:
'0'
,
checked
:
true
},
{
options
:
'1223'
,
id
:
'1'
,
checked
:
true
}
]
},
{
id
:
'5'
,
tag
:
'1'
,
type
:
'判断题'
,
title
:
'hqduuhdqj'
,
answer
:
'hfgwhrfgiuwhfiu'
,
radioList
:
[
{
desc
:
'fgweyfg'
,
id
:
'0'
},
{
desc
:
'1223'
,
id
:
'1'
}
],
score
:
1
question_type
:
2
,
question_title
:
'xxxxx'
,
question_content
:
'这是一道情景题'
,
is_parent
:
0
,
child_question_type
:
''
,
question_answer
:
'答案就是你猜呀'
,
question_score
:
'3'
,
group_id
:
'0'
,
question_options
:
[]
},
{
id
:
'8'
,
tag
:
'7'
,
type
:
'情景题'
,
title
:
'hqduuhdqj'
,
answer
:
'hfgwhrfgiuwhfiu'
,
questionTtem
:
[
question_type
:
2
,
question_title
:
'xxxxx'
,
question_content
:
'这是一道单选题'
,
is_parent
:
1
,
child_question_type
:
1
,
question_answer
:
'答案就是你猜呀'
,
question_score
:
'3'
,
group_id
:
'0'
,
question_options
:
[
{
id
:
'6'
,
tag
:
'1'
,
type
:
'判断题'
,
title
:
'123234444'
,
answer
:
'hfgwhrfgiuwhfiu'
,
radioList
:
[
{
desc
:
'fgweyfg'
,
id
:
'0'
},
{
desc
:
'1223'
,
id
:
'1'
}
],
score
:
3
id
:
'0'
,
options
:
'123'
,
checked
:
'false'
},
{
id
:
'7'
,
tag
:
'1'
,
type
:
'判断题'
,
title
:
'5657567'
,
answer
:
'hfgwhrfgiuwhfiu'
,
radioList
:
[
{
desc
:
'fgweyfg'
,
id
:
'0'
},
{
desc
:
'1223'
,
id
:
'1'
}
],
score
:
4
id
:
'1'
,
options
:
'456'
,
checked
:
'true'
}
],
score
:
2
]
}
],
currentIndex
:
1
,
...
...
src/modules/paper/components/QuestionListItem.vue
浏览文件 @
b7f50005
<
template
>
<div>
<el-card
style=
"margin-top: 32px"
v-for=
"(item, index) in questionList"
:key=
"index"
:id=
"`page$
{index}`
">
<el-card
style=
"margin-top: 32px"
:key=
"index
"
>
<div
class=
"question_hd"
>
<div
class=
"question_hd_left"
>
<div
class=
"question_hd_left_type"
>
<!--
<span>
-->
{{
item
[
0
].
question_options
}}
<input
type=
"checkbox"
v-model=
"checkboxValue"
:value=
"item"
@
change=
"slectSubItem(item)"
/>
{{
index
+
1
}}
、
{{
item
.
type
}}
<!--
</span
>
-->
<span
class=
"question_hd_left_title"
>
{{
item
.
title
}}
</span>
{{
index
+
1
}}
、
{{
title
}}
<span
class=
"question_hd_left_title"
>
{{
item
[
0
].
question_content
}}
</span>
</div>
</div>
<div
class=
"question_hd_right"
>
<el-form
ref=
"form"
label-width=
"100px"
:model=
"item.form"
>
<el-form-item
label=
"分数"
>
<el-input
v-model=
"item.score"
></el-input>
</el-form-item>
</el-form>
</div>
<div
class=
"question_hd_right"
>
分数 :
<el-input
:value=
"item.score"
></el-input></div>
</div>
<div
class=
"question_bd"
>
<!-- 单选判断 -->
<template
v-if=
"item.tag === '1'"
>
<div
v-for=
"(item, i
ndex) in item.radioList"
:key=
"index
"
class=
"options"
>
<div
v-for=
"(item, i
d) in item[0].question_options"
:key=
"id
"
class=
"options"
>
<el-radio-group>
<el-radio
label=
"item.
id
"
class=
"question_bd_desc"
>
<span
class=
"question_bd_desc_item"
>
{{
item
.
desc
}}
</span>
<el-radio
label=
"item.
option
"
class=
"question_bd_desc"
>
<span
class=
"question_bd_desc_item"
>
{{
item
.
option
}}
</span>
</el-radio>
</el-radio-group>
</div>
...
...
@@ -48,20 +43,19 @@
<
script
>
export
default
{
props
:
{
questionList
:
{
type
:
Array
}
},
data
()
{
return
{
checkboxValue
:
[],
selectSubjects
:
[],
isChecked
:
false
checkboxValue
:
false
}
},
props
:
{
item
:
{
type
:
Object
},
title
:
{
type
:
String
}
},
mounted
()
{},
methods
:
{
handleScroll
(
key
)
{
const
PageId
=
document
.
querySelector
(
'#page'
+
key
)
...
...
src/modules/paper/components/QuestionListItems.vue
0 → 100644
浏览文件 @
b7f50005
<
template
>
<div>
<el-card
style=
"margin-top: 32px"
v-for=
"(item, index) in item.question_list"
:key=
"index"
:id=
"`page$
{index}`">
<div
class=
"question_hd"
>
<div
class=
"question_hd_left"
>
<div
class=
"question_hd_left_type"
>
<input
type=
"checkbox"
v-model=
"checkboxValue"
:value=
"item"
@
change=
"slectSubItem(item)"
/>
{{
index
+
1
}}
、
{{
title
}}
<span
class=
"question_hd_left_title"
>
{{
item
[
0
].
question_content
}}
</span>
</div>
</div>
</div>
<div
class=
"question_bd"
>
<question-list-item
:item=
"item"
></question-list-item>
</div>
</el-card>
</div>
</
template
>
<
script
>
export
default
{
data
()
{
return
{
checkboxValue
:
false
}
},
props
:
{
item
:
{
type
:
Object
},
title
:
{
type
:
String
}
},
methods
:
{
handleScroll
(
key
)
{
const
PageId
=
document
.
querySelector
(
'#page'
+
key
)
this
.
$emit
(
'handlePosition'
,
PageId
.
offsetTop
)
},
slectSubItem
(
item
)
{
console
.
log
(
item
)
this
.
$emit
(
'selectSubjectsChange'
,
this
.
checkboxValue
)
}
}
}
</
script
>
<
style
lang=
"scss"
scoped
>
.question_hd
{
display
:
flex
;
justify-content
:
space-between
;
align-items
:
flex-start
;
.question_hd_left
{
.question_hd_left_type
{
color
:
#c01c40
;
}
.question_hd_left_title
{
margin-left
:
20px
;
font-size
:
18px
;
}
}
}
.question_bd
{
// background: rgb(247, 244, 244);
padding-left
:
35px
;
.question_bd_desc
{
.question_bd_desc_item
{
font-size
:
18px
;
font-weight
:
400
;
color
:
#303133
;
}
}
}
::v-deep
.el-checkbox__label
{
color
:
#c01c40
;
}
input
{
-webkit-appearance
:
checkbox
;
}
</
style
>
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论