Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
C
center-qa
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
EzijingWeb
center-qa
Commits
e527f099
提交
e527f099
authored
2月 28, 2022
作者:
王鹏飞
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
updates
上级
15bafdeb
显示空白字符变更
内嵌
并排
正在显示
16 个修改的文件
包含
563 行增加
和
1206 行删除
+563
-1206
style.scss
src/assets/theme/style.scss
+4
-0
AppList.vue
src/components/base/AppList.vue
+1
-1
QuestionTypeCascader.vue
src/components/base/QuestionTypeCascader.vue
+9
-6
api.js
src/modules/paper/api.js
+8
-2
AddPaper.vue
src/modules/paper/components/AddPaper.vue
+78
-114
AutomaticPaper.vue
src/modules/paper/components/AutomaticPaper.vue
+189
-479
BatchSetting.vue
src/modules/paper/components/BatchSetting.vue
+28
-9
PaperQuestions.vue
src/modules/paper/components/PaperQuestions.vue
+49
-14
QuestionList.vue
src/modules/paper/components/QuestionList.vue
+2
-2
QuestionListItem.vue
src/modules/paper/components/QuestionListItem.vue
+24
-6
QuestionNum.vue
src/modules/paper/components/QuestionNum.vue
+1
-5
QuestionSelect.vue
src/modules/paper/components/QuestionSelect.vue
+119
-3
index.js
src/modules/paper/index.js
+2
-2
Detail.vue
src/modules/paper/views/Detail.vue
+31
-547
List.vue
src/modules/paper/views/List.vue
+8
-5
Update.vue
src/modules/paper/views/Update.vue
+10
-11
没有找到文件。
src/assets/theme/style.scss
浏览文件 @
e527f099
$--color-primary
:
#c01c40
;
$--color-info
:
#3c4043
;
// border
$--border-radius-small
:
8px
!
default
;
// checkbox
$--checkbox-border-radius
:
2px
!
default
;
// dialog
$--message-close-size
:
20px
!
default
;
...
...
src/components/base/AppList.vue
浏览文件 @
e527f099
...
...
@@ -143,7 +143,7 @@ export default {
return
}
// 参数设置
let
params
=
this
.
params
let
params
=
{
...
this
.
params
}
// 翻页参数设置
if
(
this
.
hasPagination
)
{
params
.
page
=
this
.
page
.
currentPage
.
toString
()
...
...
src/components/base/QuestionTypeCascader.vue
浏览文件 @
e527f099
...
...
@@ -13,17 +13,20 @@ import { getQuestionCategory } from '@/api/base.js'
export
default
{
data
()
{
return
{
options
:
[],
defaultProps
:
{
label
:
'category_name'
,
value
:
'id'
,
checkStrictly
:
true
}
options
:
[]
}
},
computed
:
{
activeProject
()
{
return
this
.
$store
.
state
.
activeProject
||
{}
},
defaultProps
()
{
return
{
label
:
'category_name'
,
value
:
'id'
,
checkStrictly
:
true
,
multiple
:
this
.
$attrs
.
multiple
||
false
}
}
},
beforeMount
()
{
...
...
src/modules/paper/api.js
浏览文件 @
e527f099
...
...
@@ -57,16 +57,22 @@ export function updatePaperRules(data) {
return
httpRequest
.
post
(
`/api/qbs/admin/v1/question-paper/rules/
${
data
.
id
}
`
,
data
)
}
/**
* 搜索试题数量--自动组卷
*/
export
function
getQuestionCount
(
params
)
{
return
httpRequest
.
get
(
'/api/qbs/admin/v1/question/search/count'
,
{
params
})
}
/**
* 获取试卷分类
*/
export
function
getPaperCategory
(
params
)
{
return
httpRequest
.
get
(
`/api/qbs/admin/v1/question-category/tree/
${
params
.
project_prefix
}
`
,
{
params
})
}
/**
* 获取知识点/标签
*/
export
function
getKnowledge
(
params
)
{
return
httpRequest
.
get
(
'/admin/v1/knowledge-point/search/x1'
,
{
params
})
return
httpRequest
.
get
(
'/a
pi/a
dmin/v1/knowledge-point/search/x1'
,
{
params
})
}
src/modules/paper/components/AddPaper.vue
浏览文件 @
e527f099
...
...
@@ -3,8 +3,10 @@
<div
style=
"margin: 0 20px"
>
<!-- 选题组卷添加试卷第一步 -->
<div
v-show=
"step === 1"
>
<app-list
v-bind=
"tableOptions"
ref=
"list"
@
selection-change=
"handleSelectionChange"
></app-list>
<el-button
type=
"primary"
class=
"nextStep"
@
click=
"nextStep"
>
下一步
</el-button>
<question-select
@
selection-change=
"handleSelectionChange"
></question-select>
<div
class=
"buttons"
>
<el-button
type=
"primary"
@
click=
"nextStep"
>
下一步
</el-button>
</div>
</div>
<!-- 选题组卷添加试卷第二步 -->
<div
v-show=
"step === 2"
>
...
...
@@ -19,136 +21,65 @@
<el-form-item
label=
"此次试卷总分:"
>
{{
data
.
paper_total_score
}}
</el-form-item>
<el-form-item
label=
"已设置试题总分:"
>
{{
addedQuestionsScore
}}
</el-form-item>
<el-divider></el-divider>
<template
v-if=
"setMethod === 1"
>
<el-form-item
:label=
"item.question_type_name + ':'"
v-for=
"(item, index) in questionTypeGroups"
:key=
"index"
v-for=
"(item, index) in questionTypeGroups"
>
<span>
数量:
{{
item
.
total
}}
</span>
<span
style=
"margin-left: 20px"
>
分值:
<el-input
v-model=
"item.score"
style=
"width: 100px"
></el-input>
{{
item
.
score
}}
</span
<ul>
<li>
数量:
{{
item
.
total
}}
</li>
<li>
分值:
{{
item
.
score
}}
</li>
<li>
<template
v-if=
"canBatchSetting(item.question_type)"
>
<el-button
type=
"primary"
class=
"settingScore"
@
click=
"showBatchSetting(item)"
>
批量设置分数
</el-button
>
<!--
<template
v-if=
"canBatchSetting(item.question_type)"
>
<el-button
type=
"primary"
class=
"settingScore"
@
click=
"batchSetting"
>
批量设置分数
</el-button>
</
template
>
<
template
v-else
>
<span
class=
"settingScore"
>
此题型只能在试卷详情页面逐一设置
</span>
</
template
>
-->
</
template
>
</li>
</ul>
</el-form-item>
<el-button
type=
"primary"
@
click=
"prevStep"
>
上一步
</el-button>
<el-button
type=
"primary"
style=
"margin-left: 20px"
@
click=
"handleSubmit"
>
保存
</el-button>
</template>
</el-form>
<div
class=
"buttons"
>
<el-button
type=
"primary"
@
click=
"prevStep"
>
上一步
</el-button>
<el-button
type=
"primary"
style=
"margin-left: 20px"
@
click=
"handleSave"
>
保存
</el-button>
</div>
<BatchSetting
:visible
.
sync=
"visible"
/>
</div>
<BatchSetting
:visible
.
sync=
"visible"
:data=
"questionTypeGroups[batchSettingQuestionType]"
@
update=
"handleUpdateScore"
v-if=
"visible"
/>
</div>
</el-drawer>
</template>
<
script
>
import
QuestionSelect
from
'./QuestionSelect.vue'
import
BatchSetting
from
'./BatchSetting.vue'
import
{
getQuestionList
,
batchGetQuestionList
,
updatePaperRules
}
from
'../api.js'
import
{
batchGetQuestionList
,
updatePaperRules
}
from
'../api.js'
export
default
{
props
:
{
data
:
{
type
:
Object
,
default
:
()
=>
({})
}
},
components
:
{
BatchSetting
},
components
:
{
QuestionSelect
,
BatchSetting
},
data
()
{
return
{
visible
:
false
,
multipleSelection
:
[],
// 选择项
multipleSelection
:
[],
// 选择的试题,不包含子题
setMethod
:
1
,
// 设置方式
step
:
1
,
questions
:
[],
// 试题列表
questionTypeGroups
:
{}
// 试题类型组
questions
:
[],
// 选择的完整试题列表
questionTypeGroups
:
{},
// 试题类型组
visible
:
false
,
batchSettingQuestionType
:
null
// 批量设置试题类型
}
},
computed
:
{
tableOptions
()
{
return
{
remote
:
{
httpRequest
:
getQuestionList
,
params
:
{
question_type
:
''
,
question_title
:
''
,
question_difficulty
:
''
,
question_category
:
''
}
},
filters
:
[
{
type
:
'select'
,
prop
:
'question_type'
,
placeholder
:
'请选择题目类型'
,
options
:
[
{
label
:
'单选题'
,
value
:
'1'
},
{
label
:
'多选题'
,
value
:
'2'
},
{
label
:
'问答题'
,
value
:
'3'
},
{
label
:
'案例题'
,
value
:
'5'
},
{
label
:
'判断题'
,
value
:
'6'
},
{
label
:
'实操题'
,
value
:
'7'
},
{
label
:
'情景题'
,
value
:
'8'
}
],
label
:
'题目类型'
},
{
type
:
'select'
,
prop
:
'question_difficulty'
,
placeholder
:
'请选择题目难度等级'
,
options
:
[
{
label
:
'易'
,
value
:
'1'
},
{
label
:
'中'
,
value
:
'2'
},
{
label
:
'难'
,
value
:
'3'
}
],
label
:
'难度等级'
},
{
type
:
'input'
,
prop
:
'question_category'
,
placeholder
:
'请选择试题分类'
,
options
:
this
.
staffList
,
label
:
'试题分类'
},
{
type
:
'input'
,
prop
:
'question_title'
,
label
:
'题目标题'
,
placeholder
:
'请输入题目标题'
},
{
type
:
'input'
,
prop
:
'name4'
,
label
:
'题干内容'
,
placeholder
:
'请输入题干内容'
},
{
type
:
'input'
,
prop
:
'name5'
,
label
:
'知识点'
,
placeholder
:
'请输入知识点'
}
],
columns
:
[
{
type
:
'selection'
},
{
type
:
'index'
,
label
:
'序号'
},
{
label
:
'题目类型'
,
prop
:
'question_type'
,
computed
:
({
row
})
=>
{
const
map
=
{
1
:
'单选题'
,
2
:
'多选题'
,
3
:
'问答题'
,
5
:
'案例题'
,
6
:
'判断题'
,
7
:
'实操题'
,
8
:
'情景题'
}
return
map
[
row
.
question_type
]
||
row
.
question_type
}
},
{
label
:
'试卷分类'
,
prop
:
'question_category.category_name'
},
{
label
:
'题目标题'
,
prop
:
'question_title'
},
{
label
:
'知识点'
,
prop
:
'knowledge_point.title'
},
{
label
:
'难度等级'
,
prop
:
'question_difficulty'
,
computed
:
({
row
})
=>
{
const
map
=
{
1
:
'易'
,
2
:
'中'
,
3
:
'难'
}
return
map
[
row
.
question_difficulty
]
||
row
.
question_difficulty
}
},
{
label
:
'更新人'
,
prop
:
'operator.realname'
}
]
}
},
// 已添加的试题
addedQuestions
()
{
return
this
.
data
.
questions
||
[]
...
...
@@ -161,8 +92,8 @@ export default {
}
},
methods
:
{
handleSelectionChange
(
val
)
{
this
.
multipleSelection
=
val
handleSelectionChange
(
val
ue
)
{
this
.
multipleSelection
=
val
ue
},
// 下一步
nextStep
()
{
...
...
@@ -193,7 +124,7 @@ export default {
total
:
1
,
question_type
:
item
.
question_type
,
question_type_name
:
map
[
item
.
question_type
],
score
:
''
,
score
:
'
0
'
,
questions
:
[
item
]
}
}
...
...
@@ -205,18 +136,44 @@ export default {
canBatchSetting
(
value
)
{
return
[
1
,
2
,
6
].
includes
(
value
)
},
batchSetting
()
{
// 批量设置分数
showBatchSetting
(
data
)
{
this
.
visible
=
true
this
.
batchSettingQuestionType
=
data
.
question_type
},
handleUpdateScore
(
data
)
{
const
{
question_type
:
questionType
,
score
}
=
data
this
.
questionTypeGroups
[
questionType
].
score
=
score
},
// 保存
handleSave
()
{
// 批量设置分数
if
(
this
.
setMethod
===
1
)
{
this
.
questions
=
this
.
questions
.
map
(
item
=>
{
return
{
...
item
,
score
:
this
.
questionTypeGroups
[
item
.
question_type
].
score
}
})
}
// 合并已添加和选择的试题,新的替换旧的
const
questionList
=
this
.
addedQuestions
.
reduce
((
result
,
item
)
=>
{
if
(
!
result
.
find
(
item2
=>
item2
.
id
===
item
.
id
))
{
result
.
unshift
(
item
)
}
return
result
},
this
.
questions
)
// 更新详情页的试题
this
.
$emit
(
'update'
,
questionList
)
// 关闭弹框
this
.
$emit
(
'update:visible'
,
false
)
},
// 保存,更新试卷规则
handleSubmit
()
{
const
rules
=
[]
Object
.
values
(
this
.
questionTypeGroups
).
forEach
(
item
=>
{
item
.
questions
.
forEach
(
question
=>
{
rules
.
push
({
id
:
question
.
id
,
score
:
item
.
score
||
0
})
rules
.
push
({
id
:
question
.
id
,
score
:
item
.
score
})
if
(
item
.
children
&&
item
.
children
.
length
)
{
item
.
children
.
forEach
(
question
=>
{
rules
.
push
({
id
:
question
.
id
,
score
:
item
.
score
||
0
})
rules
.
push
({
id
:
question
.
id
,
score
:
item
.
score
})
})
}
})
...
...
@@ -232,13 +189,20 @@ export default {
}
</
script
>
<
style
lang=
"scss"
scoped
>
.
nextStep
{
.
buttons
{
position
:
absolute
;
left
:
50%
;
bottom
:
1
0px
;
bottom
:
3
0px
;
transform
:
translateX
(
-50%
);
text-align
:
center
;
}
.settingScore
{
margin-left
:
120px
;
ul
{
display
:
flex
;
li
{
margin-right
:
20px
;
min-width
:
140px
;
line-height
:
32px
;
color
:
#606266
;
}
}
</
style
>
src/modules/paper/components/AutomaticPaper.vue
浏览文件 @
e527f099
<
template
>
<el-drawer
size=
"80%"
v-bind=
"$attrs"
v-on=
"$listeners"
>
<div
slot=
"header"
class=
"clearfix"
>
<span>
试卷列表
</span>
</div>
<el-form
:model=
"form"
style=
"padding-left: 30px"
>
<el-drawer
title=
"试卷列表"
size=
"80%"
v-bind=
"$attrs"
v-on=
"$listeners"
>
<div
style=
"margin: 0 20px"
>
<el-form
:model=
"form"
>
<!-- 组卷题库 -->
<el-form-item
label=
"组卷题库:"
>
<el-radio-group
v-model=
"form.paperType
"
>
<el-radio
label=
"0
"
>
我的题库
</el-radio>
<el-radio
label=
"1
"
>
公共题库
</el-radio>
<el-radio-group
v-model=
"form.permission
"
>
<el-radio
label=
"1
"
>
我的题库
</el-radio>
<el-radio
label=
"2
"
>
公共题库
</el-radio>
</el-radio-group>
</el-form-item>
<!-- 自动组卷规则 -->
<el-form-item
label=
"自动组卷规则:"
>
<el-table
ref=
"mytable"
:data=
"table_data"
style=
"width: 100%"
class=
"paperRule
"
>
<el-table-column
align=
"center"
v-for=
"(item, index, key) in table_columns"
:item=
"item"
:key=
"key
"
:index=
"index
"
<el-table
ref=
"mytable"
:data=
"questionList"
style=
"width: 100%
"
>
<el-table-column
align=
"center"
label=
"题目类型"
>
<template
slot-scope=
"
{ row, $index }">
<el-select
v-model=
"row.question_type"
@
change=
"getQuestionMaxCount($index, row)"
>
<el-option
v-for=
"item in questionTypeMap
"
:key=
"item.value
"
:label=
"item.label"
>
<template
slot-scope=
"scope"
>
<!-- 多选 -->
<el-select
v-model=
"scope.row[item.prop]"
v-if=
"scope.row.edit && item.type === 'select'"
>
{{
scope
.
row
[
item
.
prop
]
}}
<el-option
v-for=
"(el, index) in item.options"
:key=
"index"
:label=
"el.label"
:value=
"el.value"
>
</el-option>
:value=
"item.value"
></el-option>
</el-select>
<!-- 数量 -->
</
template
>
</el-table-column>
<el-table-column
align=
"center"
label=
"难度"
>
<
template
slot-scope=
"{ row, $index }"
>
<el-select
v-model=
"row.question_difficulty"
@
change=
"getQuestionMaxCount($index, row)"
>
<el-option
v-for=
"item in questionDifficultyMap"
:key=
"item.value"
:label=
"item.label"
:value=
"item.value"
></el-option>
</el-select>
</
template
>
</el-table-column>
<el-table-column
align=
"center"
label=
"题目类别"
>
<
template
slot-scope=
"{ row, $index }"
>
<question-type-cascader
v-model=
"row.question_categories"
@
change=
"getQuestionMaxCount($index, row)"
></question-type-cascader>
</
template
>
</el-table-column>
<el-table-column
align=
"center"
label=
"数量"
>
<
template
slot-scope=
"{ row }"
>
<el-input-number
v-if=
"scope.row.edit && item.type === 'input' && item.prop === 'question_num'"
size=
"small"
v-model=
"scope.row[item.prop]"
:placeholder=
"'请输入' + item.label"
:min=
"1"
:max=
"20"
v-model=
"row.question_num"
:min=
"0"
:max=
"row.max_question_num"
:step-strictly=
"true"
></el-input-number>
</
template
>
</el-table-column>
<!-- 分值 -->
<el-input-number
v-if=
"scope.row.edit && item.type === 'input' && item.prop === 'question_score'"
size=
"small"
v-model=
"scope.row[item.prop]"
:placeholder=
"'请输入' + item.label"
:min=
"1"
:max=
"30"
>
</el-input-number>
<span
v-if=
"!scope.row.edit && item.prop === 'questionType'"
>
{{
subOptionType
[
scope
.
row
[
item
.
prop
]]
}}
</span>
<span
v-if=
"!scope.row.edit && item.prop === 'difficulty'"
>
{{
difficultyOptionType
[
scope
.
row
[
item
.
prop
]]
}}
</span>
<span
v-if=
"!scope.row.edit && item.prop === 'question_num'"
>
{{
scope
.
row
[
item
.
prop
]
}}
</span>
<span
v-if=
"!scope.row.edit && item.prop === 'question_score'"
>
{{
scope
.
row
[
item
.
prop
]
}}
</span>
<el-table-column
align=
"center"
label=
"每题分值"
>
<
template
slot-scope=
"{ row }"
>
<el-input-number
v-model=
"row.question_score"
:min=
"0"
:step-strictly=
"true"
></el-input-number>
</
template
>
</el-table-column>
<el-table-column
label=
"操作"
>
<el-table-column
align=
"center"
label=
"操作"
>
<
template
slot-scope=
"scope"
>
<!-- 编辑 -->
<el-button
type=
"primary"
icon=
"el-icon-edit"
circle
size=
"mini"
v-if=
"!scope.row.edit"
@
click=
"handleEdit(scope.$index, scope.row)"
></el-button>
<!-- 保存 -->
<el-button
style=
"margin-left: 10px"
circle
icon=
"el-icon-plus"
size=
"mini"
type=
"success"
:plain=
"true"
icon=
"el-icon-check"
v-if=
"scope.row.edit"
@
click=
"handleSave(scope.$index, scope.row)"
type=
"danger"
@
click=
"handleAdd(scope.$index, scope.row)"
></el-button>
<el-button
...
...
@@ -89,56 +84,7 @@
:plain=
"true"
type=
"danger"
@
click=
"handleDelete(scope.$index, scope.row)"
></el-button>
</
template
>
</el-table-column>
</el-table>
<!-- editData -->
<el-table
:data=
"editData"
:show-header=
"false"
>
<el-table-column
align=
"center"
v-for=
"(item, index, key) in add_columns"
:item=
"item"
:key=
"key"
:index=
"index"
:label=
"item.label"
>
<
template
slot-scope=
"scope"
>
<!-- 多选 -->
<el-select
v-model=
"scope.row[item.prop]"
v-if=
"item.type === 'select'"
>
<el-option
v-for=
"(el, index) in item.options"
:key=
"index"
:label=
"el.label"
:value=
"el.value"
>
</el-option>
</el-select>
<!-- 数量 -->
<el-input-number
v-if=
"item.type === 'input' && item.prop === 'question_num_add'"
size=
"small"
v-model=
"scope.row[item.prop]"
:placeholder=
"'请输入' + item.label"
:min=
"1"
:max=
"20"
></el-input-number>
<!-- 分值 -->
<el-input-number
v-if=
"item.type === 'input' && item.prop === 'question_score_add'"
size=
"small"
v-model=
"scope.row[item.prop]"
:placeholder=
"'请输入' + item.label"
:min=
"1"
:max=
"30"
>
</el-input-number>
</
template
>
</el-table-column>
<el-table-column>
<
template
slot-scope=
"scope"
>
<el-button
type=
"primary"
icon=
"el-icon-plus"
circle
slot=
"reference"
@
click=
"saveEdit(scope.row)"
v-if=
"questionList.length > 1"
></el-button>
</
template
>
</el-table-column>
...
...
@@ -148,387 +94,171 @@
<el-form-item
label=
"您计划自动组卷的试题情况:"
>
<!-- 您计划自动组卷的试题情况 -->
<div
class=
"automatic"
>
<div
class=
"automatic_questionNum"
>
试题数量总数:{{ getTotalQuestionNum }}
</div>
<div
class=
"automatic_totalScore"
>
试卷总分:XXX
</div>
<div
class=
"automatic_questionNum"
>
试题数量总数:{{ questionTotalNum }}
</div>
<div
class=
"automatic_totalScore"
>
试卷总分:{{ questionTotalScore }}
</div>
</div>
<el-table
ref=
"mytable"
:data=
"totalQuestionList"
style=
"width: 100%"
>
<el-table-column
align=
"center"
label=
"题目类型"
prop=
"question_type_name"
></el-table-column>
<el-table-column
align=
"center"
label=
"难度 / 数量 / 分值"
>
<
template
slot-scope=
"{ row }"
>
<div
v-for=
"(item, index) in row.children"
:key=
"index"
>
{{
item
.
question_difficulty_name
}}
/
{{
item
.
question_num
}}
/
{{
item
.
question_score
}}
</div>
<div>
<el-table
ref=
"mytable"
:data=
"getSituationData"
style=
"width: 100%"
>
<el-table-column
align=
"center"
v-for=
"(item, index, key) in situation_columns"
:item=
"item"
:key=
"key"
:index=
"index"
:label=
"item.label"
>
<
template
slot-scope=
"scope"
>
<span
v-if=
"item.prop === 'questionType'"
>
{{
subOptionType
[
scope
.
row
.
questionType
]
}}
</span>
<span
v-if=
"item.prop === 'questionDesc'"
>
难 /
{{
scope
.
row
.
newItem
.
items
[
0
].
num
}}
/
{{
scope
.
row
.
newItem
.
items
[
0
].
score
}}
易 /
{{
scope
.
row
.
newItem
.
items
[
1
].
num
}}
/
{{
scope
.
row
.
newItem
.
items
[
1
].
score
}}
中 /
{{
scope
.
row
.
newItem
.
items
[
2
].
num
}}
/
{{
scope
.
row
.
newItem
.
items
[
2
].
score
}}
</span>
<span
v-if=
"item.prop === 'questionTotal'"
>
{{
scope
.
row
.
newItem
.
tNum
}}
/
{{
scope
.
row
.
newItem
.
tScore
}}
</span
>
</
template
>
</el-table-column>
<el-table-column
align=
"center"
label=
"小计(数量 / 分值)"
>
<
template
slot-scope=
"{ row }"
>
{{
row
.
question_num
}}
/
{{
row
.
question_score
}}
</
template
>
</el-table-column>
</el-table>
</div>
</el-form-item>
<el-form-item>
<el-button
type=
"primary"
class=
"autoClick"
@
click=
"autoClick"
:disabled=
"table_data.length < 1"
>
自动组卷
</el-button
>
</el-form-item>
<div
style=
"text-align: center"
>
<el-button
type=
"primary"
@
click=
"handleSubmit"
>
自动组卷
</el-button>
</div>
</el-form>
</div>
</el-drawer>
</template>
<
script
>
import
QuestionTypeCascader
from
'@/components/base/QuestionTypeCascader.vue'
import
{
getQuestionCount
,
updatePaperRules
}
from
'../api.js'
export
default
{
data
()
{
return
{
// 组卷题库
form
:
{
paperType
:
'0'
},
// 组卷规则默认输入框值
editData
:
[
{
questionType_add
:
''
,
difficulty_add
:
''
,
question_num_add
:
1
,
question_score_add
:
1
,
question_category_add
:
''
,
edit
:
false
}
],
is_delete
:
true
,
// 是否可删除
// 自动组卷规则:
table_columns
:
[
{
prop
:
'questionType'
,
label
:
'题目类型'
,
type
:
'select'
,
options
:
[
{
value
:
'0'
,
label
:
'单选题'
},
{
value
:
'1'
,
label
:
'多选题'
},
{
value
:
'2'
,
label
:
'判断题'
},
{
value
:
'3'
,
label
:
'问答题'
},
{
value
:
'4'
,
label
:
'情景题'
},
{
value
:
'5'
,
label
:
'案例题'
}
]
},
{
prop
:
'difficulty'
,
label
:
'难度'
,
type
:
'select'
,
options
:
[
{
value
:
'0'
,
label
:
'难'
},
{
value
:
'1'
,
label
:
'易'
},
{
value
:
'2'
,
label
:
'中'
}
]
},
{
prop
:
'question_num'
,
label
:
'数量'
,
type
:
'input'
props
:
{
data
:
{
type
:
Object
,
default
:
()
=>
({})
}
},
{
prop
:
'question_score'
,
label
:
'分值'
,
type
:
'input'
},
{
prop
:
'question_category'
,
label
:
'题目类别'
,
type
:
'select'
,
options
:
[
{
value
:
'0'
,
label
:
'难'
},
{
value
:
'0'
,
label
:
'易'
},
{
value
:
'0'
,
label
:
'高'
}
]
}
],
// 自动组卷规则编辑框属性
add_columns
:
[
{
prop
:
'questionType_add'
,
label
:
'题目类型'
,
type
:
'select'
,
options
:
[
{
value
:
'0'
,
label
:
'单选题'
},
{
value
:
'1'
,
label
:
'多选题'
},
{
value
:
'2'
,
label
:
'判断题'
},
{
value
:
'3'
,
label
:
'问答题'
},
{
value
:
'4'
,
label
:
'情景题'
},
{
value
:
'5'
,
label
:
'案例题'
}
]
},
{
prop
:
'difficulty_add'
,
label
:
'难度'
,
type
:
'select'
,
options
:
[
{
value
:
'0'
,
label
:
'难'
},
{
value
:
'1'
,
label
:
'易'
},
{
value
:
'2'
,
label
:
'中'
}
components
:
{
QuestionTypeCascader
},
data
()
{
const
questionTypeMap
=
[
{
value
:
'1'
,
label
:
'单选题'
},
{
value
:
'2'
,
label
:
'多选题'
},
{
value
:
'3'
,
label
:
'问答题'
},
{
value
:
'5'
,
label
:
'案例题'
},
{
value
:
'6'
,
label
:
'判断题'
},
{
value
:
'7'
,
label
:
'实操题'
},
{
value
:
'8'
,
label
:
'情景题'
}
]
},
{
prop
:
'question_num_add'
,
label
:
'数量'
,
type
:
'input'
},
{
prop
:
'question_score_add'
,
label
:
'分值'
,
type
:
'input'
},
{
prop
:
'question_category_add'
,
label
:
'题目类别'
,
type
:
'select'
,
options
:
[
{
value
:
'0'
,
label
:
'难'
},
{
value
:
'1'
,
label
:
'易'
},
{
value
:
'2'
,
label
:
'高'
}
const
questionDifficultyMap
=
[
{
value
:
'1'
,
label
:
'易'
},
{
value
:
'2'
,
label
:
'中'
},
{
value
:
'3'
,
label
:
'难'
}
]
const
defaultItem
=
{
question_type
:
''
,
question_difficulty
:
''
,
question_num
:
''
,
question_score
:
''
,
question_categories
:
''
,
edit
:
true
,
max_question_num
:
0
}
],
// 计划组卷试题情况
situation_columns
:
[
{
prop
:
'questionType'
,
label
:
'题目类型'
},
{
prop
:
'questionDesc'
,
label
:
'难度 / 数量 / 分值'
},
{
prop
:
'questionTotal'
,
label
:
'小计 (数量 / 分值)'
}
],
// 表格数据
table_data
:
[],
// select之后回显数据
subOptionType
:
{
0
:
'单选题'
,
1
:
'多选题'
,
2
:
'判断题'
,
3
:
'问答题'
,
4
:
'情景题'
,
5
:
'案例题'
},
// 题难度回显
difficultyOptionType
:
{
0
:
'难'
,
1
:
'易'
,
2
:
'中'
}
return
{
questionTypeMap
,
questionDifficultyMap
,
defaultItem
,
// 组卷题库
form
:
{
permission
:
'1'
},
questionList
:
[{
...
defaultItem
}]
}
},
computed
:
{
// 试题数量总数
getTotalQuestionNum
()
{
const
totalNum
=
this
.
table_data
.
map
(
item
=>
item
.
question_num
)
const
r
=
totalNum
.
reduce
((
pre
,
item
)
=>
(
pre
+=
item
),
0
)
// 计算数组总和
return
r
questionTotalNum
()
{
return
this
.
getQuestionTotalNumberByProp
(
'question_num'
)
},
// 试题情况
getSituationData
()
{
// 对每次天加的数据进行计算分值和数量
const
getNumsAndScores
=
(
diffValue
,
type
)
=>
{
const
data
=
this
.
table_data
if
(
type
===
'num'
)
{
// 数量
const
numArray
=
data
?.
filter
(
item
=>
item
.
difficulty
===
diffValue
).
map
(
val
=>
val
.
question_num
)
const
init
=
0
const
totalNum
=
numArray
.
reduce
((
prev
,
cur
)
=>
prev
+
cur
,
init
)
return
totalNum
}
else
if
(
type
===
'score'
)
{
// 分值
const
numArray
=
data
?.
filter
(
item
=>
item
.
difficulty
===
diffValue
).
map
(
val
=>
val
.
question_score
)
const
init
=
0
const
totalScore
=
numArray
.
reduce
((
prev
,
cur
)
=>
prev
+
cur
,
init
)
return
totalScore
}
}
const
getLastData
=
()
=>
{
const
newItem
=
{
items
:
[
{
type
:
'难'
,
num
:
getNumsAndScores
(
'0'
,
'num'
),
score
:
getNumsAndScores
(
'0'
,
'score'
)
// 试题总分
questionTotalScore
()
{
return
this
.
questionList
.
reduce
((
result
,
item
)
=>
{
return
result
+
parseInt
(
item
.
question_score
)
*
parseInt
(
item
.
question_num
)
},
0
)
},
{
type
:
'易'
,
num
:
getNumsAndScores
(
'1'
,
'num'
),
score
:
getNumsAndScores
(
'1'
,
'score'
)
},
{
type
:
'中'
,
num
:
getNumsAndScores
(
'2'
,
'num'
),
score
:
getNumsAndScores
(
'2'
,
'score'
)
// 试题情况
totalQuestionList
()
{
const
result
=
[]
this
.
questionList
.
forEach
(
item
=>
{
if
(
item
.
question_type
&&
item
.
question_num
&&
!
result
.
find
(
item2
=>
item2
.
question_type
===
item
.
question_type
)
)
{
// 当前类型的试题列表
const
currentTypeQuestionList
=
this
.
questionList
.
filter
(
item2
=>
item2
.
question_type
===
item
.
question_type
)
// 难度列表
const
questionDifficultyList
=
this
.
questionDifficultyMap
.
map
(
item
=>
{
// 当前难度的试题列表
const
currentDifficultyQuestionList
=
currentTypeQuestionList
.
filter
(
item2
=>
item2
.
question_difficulty
===
item
.
value
)
return
{
question_difficulty
:
item
.
value
,
question_difficulty_name
:
item
.
label
,
question_num
:
this
.
getQuestionTotalNumberByProp
(
'question_num'
,
currentDifficultyQuestionList
),
question_score
:
this
.
getQuestionTotalNumberByProp
(
'question_score'
,
currentDifficultyQuestionList
)
}
],
tNum
:
getNumsAndScores
(
'0'
,
'num'
)
+
getNumsAndScores
(
'1'
,
'num'
)
+
getNumsAndScores
(
'2'
,
'num'
),
tScore
:
getNumsAndScores
(
'0'
,
'score'
)
+
getNumsAndScores
(
'1'
,
'score'
)
+
getNumsAndScores
(
'2'
,
'score'
)
})
const
temp
=
{
question_type
:
item
.
question_type
,
question_type_name
:
this
.
questionTypeMap
.
find
(
type
=>
type
.
value
===
item
.
question_type
)?.
label
,
question_num
:
this
.
getQuestionTotalNumberByProp
(
'question_num'
,
currentTypeQuestionList
),
question_score
:
this
.
getQuestionTotalNumberByProp
(
'question_score'
,
currentTypeQuestionList
),
children
:
questionDifficultyList
.
filter
(
item
=>
item
.
question_num
)
// 难度列表
}
this
.
table_data
.
forEach
(
item
=>
{
item
.
newItem
=
newItem
})
// 每次添加的数据进行加上newItem选项
return
this
.
deteleObjectItem
(
this
.
table_data
)
// 去重,添加每个题型会累加,需要根据题的类型去重
result
.
push
(
temp
)
}
const
data
=
getLastData
()
// 赋值
return
data
})
return
result
}
},
methods
:
{
// 去重方法 ---根据题的类型去重
deteleObjectItem
(
obj
)
{
const
newArr
=
[]
const
newIndex
=
[]
obj
.
forEach
(
item
=>
{
if
(
newIndex
.
indexOf
(
item
.
questionType
)
===
-
1
)
{
newIndex
.
push
(
item
.
questionType
)
newArr
.
push
(
item
)
}
})
return
newArr
},
autoClick
()
{},
// 新增列表项
saveEdit
(
row
)
{
console
.
log
(
row
)
const
newData
=
{
questionType
:
row
.
questionType_add
,
difficulty
:
row
.
difficulty_add
,
question_num
:
row
.
question_num_add
,
question_score
:
row
.
question_score_add
,
question_category
:
row
.
question_category_add
,
edit
:
false
}
if
(
newData
?.
questionType
&&
newData
?.
difficulty
&&
newData
?.
question_num
>=
1
&&
newData
?.
question_score
>=
1
)
{
this
.
table_data
.
push
(
newData
)
const
addData
=
[
{
questionType_add
:
null
,
difficulty_add
:
null
,
question_num_add
:
1
,
question_score_add
:
1
,
question_category_add
:
null
,
edit
:
false
}
]
this
.
editData
=
addData
// 重置
}
else
{
getQuestionTotalNumberByProp
(
prop
,
list
=
this
.
questionList
)
{
return
list
.
reduce
((
result
,
item
)
=>
{
return
result
+
parseInt
(
item
[
prop
])
},
0
)
},
// 新增
handleAdd
(
index
,
row
)
{
if
(
!
row
.
question_categories
||
!
row
.
question_difficulty
||
!
row
.
question_type
)
{
this
.
$message
({
message
:
'试题规则不能为空!'
,
type
:
'warning'
})
}
else
{
this
.
questionList
.
push
({
...
this
.
defaultItem
})
}
},
// 编辑
handleEdit
(
index
,
row
)
{
console
.
log
(
row
,
'----'
)
row
.
edit
=
true
},
// 删除
handleDelete
(
index
,
row
)
{
console
.
log
(
index
,
row
)
this
.
table_data
.
splice
(
index
,
1
)
// 前端删除
// 下面掉接口删除-------
this
.
$message
({
message
:
'删除成功!'
,
type
:
'success'
})
handleDelete
(
index
)
{
this
.
questionList
.
splice
(
index
,
1
)
// 前端删除
},
// 保存
handleSave
(
index
,
row
)
{
console
.
log
(
index
,
row
)
row
.
edit
=
false
delete
this
.
table_data
[
index
].
add
this
.
$message
({
message
:
'保存成功!'
,
type
:
'success'
},
// 自动组卷
handleSubmit
()
{
const
rules
=
[]
this
.
questionList
.
forEach
(
question
=>
{
rules
.
push
(
Object
.
assign
({},
question
,
{
question_categories
:
[
question
.
question_categories
]
}))
})
const
parmas
=
{
id
:
this
.
data
.
id
,
permission
:
this
.
form
.
permission
,
rules
}
updatePaperRules
(
parmas
).
then
(
res
=>
{
this
.
$message
.
success
(
'保存成功'
)
this
.
$emit
(
'update'
)
this
.
$emit
(
'update:visible'
,
false
)
})
},
// 获取试题最大数量
getQuestionMaxCount
(
index
,
row
)
{
const
params
=
Object
.
assign
({},
this
.
form
,
row
)
if
(
!
row
.
question_categories
||
!
row
.
question_difficulty
||
!
row
.
question_type
)
{
return
}
params
.
question_categories
=
[
row
.
question_categories
]
getQuestionCount
(
params
).
then
(
res
=>
{
row
.
max_question_num
=
res
.
data
.
count
if
(
row
.
question_num
>
row
.
max_question_num
)
{
row
.
question_num
=
row
.
max_question_num
}
})
}
}
...
...
@@ -536,33 +266,13 @@ export default {
</
script
>
<
style
lang=
"scss"
scoped
>
.autoClick
{
position
:
absolute
;
left
:
50%
;
transform
:
translateX
(
-50%
);
}
.editList
{
// padding-left: 100px;
display
:
flex
;
justify-content
:
space-around
;
align-items
:
center
;
}
.automatic
{
display
:
flex
;
justify-content
:
center
;
align-items
:
center
;
margin-top
:
100px
;
margin-bottom
:
50px
;
color
:
#909399
;
font-size
:
16px
;
.automatic_questionNum
{
margin-right
:
50px
;
justify-content
:
center
;
margin
:
50px
0
50px
;
div
{
margin
:
0
20px
;
}
}
::v-deep
.paperRule
.el-table__empty-text
{
display
:
none
;
}
::v-deep
.paperRule
.el-table__empty-block
{
min-height
:
0
;
}
</
style
>
src/modules/paper/components/BatchSetting.vue
浏览文件 @
e527f099
<
template
>
<el-dialog
title=
"批量设置分数"
v-bind=
"$attrs"
v-on=
"$listeners"
append-to-body
width=
"400px"
>
<el-form>
<el-form-item>
单选题
</el-form-item>
<el-form-item>
数量:8
</el-form-item>
<el-form-item
label=
"每道试题分值"
>
<el-input></el-input></el-form-item>
<el-dialog
title=
"批量设置分数"
v-bind=
"$attrs"
v-on=
"$listeners"
append-to-body
:close-on-click-modal=
"false"
width=
"400px"
>
<el-form
:model=
"form"
:rules=
"rules"
ref=
"form"
>
<el-form-item
label=
"单选题"
></el-form-item>
<el-form-item
label=
"数量"
>
8
</el-form-item>
<el-form-item
label=
"每道试题分值"
prop=
"score"
><el-input
v-model=
"form.score"
></el-input></el-form-item>
<el-form-item>
<el-button
type=
"primary"
@
click=
"
saveSetting
"
>
保存
</el-button>
<el-button
type=
"primary"
@
click=
"
handleSubmit
"
>
保存
</el-button>
</el-form-item>
</el-form>
</el-dialog>
...
...
@@ -13,12 +20,24 @@
<
script
>
export
default
{
props
:
{
data
:
{
type
:
Object
,
default
:
()
=>
({})
}
},
data
()
{
return
{
form
:
{
score
:
'0'
},
rules
:
{
score
:
[{
required
:
true
,
message
:
'请输入试题分值'
,
trigger
:
'blur'
}]
}
}
},
methods
:
{
saveSetting
()
{
handleSubmit
()
{
this
.
$refs
.
form
.
validate
().
then
(()
=>
{
this
.
$emit
(
'update'
,
Object
.
assign
({},
this
.
data
,
this
.
form
))
this
.
$emit
(
'update:visible'
,
false
)
})
}
}
}
</
script
>
<
style
></
style
>
src/modules/paper/components/PaperQuestions.vue
浏览文件 @
e527f099
...
...
@@ -5,20 +5,27 @@
<el-col
:span=
"18"
>
<app-card
title=
"试题列表"
>
<template
#
header-aside
>
<el-button
type=
"primary"
@
click=
"handleAdd"
>
添加试题
</el-button>
<el-button
type=
"primary"
@
click=
"handleRemove"
>
删除选中试题
</el-button>
<template
v-if=
"data.paper_type === 1"
>
<el-button
type=
"primary"
@
click=
"showSelectQuestion"
>
添加试题
</el-button>
<el-button
type=
"primary"
:disabled=
"!multipleSelection.length"
@
click=
"handleRemove"
>
删除选中试题
</el-button
>
</
template
>
<
template
v-if=
"data.paper_type === 2"
>
<el-button
type=
"primary"
@
click=
"showSelectQuestion"
>
自动组卷
</el-button>
</
template
>
</template>
<question-list
:list=
"questions"
>
<
template
v-slot:selection=
"item"
>
<question-list
:list=
"questions"
:disableScore=
"data.paper_type === 2"
style=
"margin-top: 20px"
>
<
template
v-slot:selection=
"item"
v-if=
"data.paper_type === 1"
>
<el-checkbox
@
change=
"handleSelectionChange(arguments[0], item)"
></el-checkbox>
</
template
>
</question-list>
</app-card>
</el-col>
<!-- 试题序号 -->
<el-col
:span=
"6"
>
<question-num
:list=
"questions"
>
<
template
#
footer
>
<el-col
:span=
"6"
ref=
"questionNumWrapper"
>
<question-num
:list=
"questions"
ref=
"questionNum"
:style=
"`position:relative;top:${top}px`"
>
<
template
#
footer
v-if=
"data.paper_type === 1"
>
<el-button
type=
"primary"
@
click=
"handleSubmit"
>
保存试卷
</el-button>
</
template
>
</question-num>
...
...
@@ -26,11 +33,11 @@
</el-row>
<!-- 选题组卷 -->
<
template
v-if=
"data.paper_type === 1"
>
<addPaper
:visible
.
sync=
"visible"
:data=
"data"
@
update=
"hand
el
Update"
v-if=
"visible"
/>
<addPaper
:visible
.
sync=
"visible"
:data=
"data"
@
update=
"hand
le
Update"
v-if=
"visible"
/>
</
template
>
<!-- 自动组卷 -->
<
template
v-if=
"data.paper_type === 2"
>
<AutomaticPaper
:visible
.
sync=
"visible"
:data=
"data"
@
update=
"
handelUpdate
"
v-if=
"visible"
/>
<AutomaticPaper
:visible
.
sync=
"visible"
:data=
"data"
@
update=
"
$emit('update')
"
v-if=
"visible"
/>
</
template
>
</div>
</template>
...
...
@@ -50,7 +57,8 @@ export default {
return
{
visible
:
false
,
questions
:
[],
multipleSelection
:
[]
// 选择项
multipleSelection
:
[],
// 选择项
top
:
0
}
},
watch
:
{
...
...
@@ -59,12 +67,29 @@ export default {
handler
(
data
)
{
this
.
questions
=
data
.
questions
||
[]
}
},
'$route.query.select'
:
{
immediate
:
true
,
handler
(
value
)
{
value
&&
this
.
showSelectQuestion
()
}
}
},
computed
:
{},
mounted
()
{
const
questionNumWrapper
=
this
.
$refs
.
questionNumWrapper
.
$el
const
parentTop
=
questionNumWrapper
.
getBoundingClientRect
().
top
document
.
addEventListener
(
'scroll'
,
()
=>
{
const
scrollTop
=
document
.
documentElement
.
scrollTop
||
document
.
body
.
scrollTop
if
(
scrollTop
>
parentTop
)
{
this
.
top
=
scrollTop
-
parentTop
+
84
}
else
{
this
.
top
=
0
}
})
},
methods
:
{
// 增加试题
handleAdd
()
{
showSelectQuestion
()
{
this
.
visible
=
true
},
handleSelectionChange
(
checked
,
data
)
{
...
...
@@ -95,9 +120,19 @@ export default {
})
},
// 更新详情数据
handelUpdate
()
{
this
.
$emit
(
'update'
)
handleUpdate
(
list
)
{
this
.
questions
=
list
// this.$emit('update')
}
}
}
</
script
>
<
style
lang=
"scss"
scoped
>
.fixed
{
position
:
relative
;
top
:
64px
;
right
:
0
;
z-index
:
100
;
}
</
style
>
src/modules/paper/components/QuestionList.vue
浏览文件 @
e527f099
<
template
>
<div
class=
"question-list"
>
<template
v-for=
"(item, index) in list"
>
<question-list-item
:data=
"item"
:index=
"index + 1"
:key=
"item.id"
v-on=
"$listeners"
>
<question-list-item
:data=
"item"
:index=
"index + 1"
:key=
"item.id"
v-
bind=
"$attrs"
v-
on=
"$listeners"
>
<template
v-if=
"item.children && item.children.length"
>
<question-list
:list=
"item.children"
:key=
"item.id"
v-on=
"$listeners"
>
<question-list
:list=
"item.children"
:key=
"item.id"
v-
bind=
"$attrs"
v-
on=
"$listeners"
>
<template
#
selection
>
<slot
name=
"selection"
v-bind=
"item"
></slot>
</
template
>
...
...
src/modules/paper/components/QuestionListItem.vue
浏览文件 @
e527f099
<
template
>
<el-card
style=
"margin-bottom: 20px"
shadow=
"hover"
>
<div
class=
"question-item"
>
<div
class=
"question-item-selection"
>
<slot
name=
"selection"
></slot>
</div>
<div
class=
"question-item-main"
>
<div
class=
"question-item-hd"
>
<div
class=
"question-item-hd-top"
>
<slot
name=
"selection"
></slot>
<div
class=
"question-index"
>
{{
index
}}
、
</div>
<div
class=
"question-type"
>
{{
questionTypeText
}}
</div>
<div
class=
"question-score"
>
<p>
分数:
</p>
<el-input
v-model=
"data.s
core"
style=
"width: 100px"
></el-input>
<el-input
v-model=
"data.score"
:disabled=
"disableS
core"
style=
"width: 100px"
></el-input>
</div>
</div>
<!-- 题干 -->
...
...
@@ -18,7 +21,7 @@
<div
class=
"question-item-bd"
>
<!-- 单选题 -->
<template
v-if=
"questionType === 1"
>
<el-radio-group
:disabled=
"disabled"
:value=
"data.question_answer[0]
"
>
<el-radio-group
:disabled=
"disabled"
:value=
"data.question_answer
"
>
<div
class=
"question-item-option"
v-for=
"item in data.question_options"
:key=
"item.id"
>
<el-radio
:label=
"item.id"
>
{{
item
.
option
}}
</el-radio>
</div>
...
...
@@ -48,6 +51,7 @@
</slot>
<div
class=
"question-item-ft"
></div>
</div>
</div>
</el-card>
</template>
...
...
@@ -57,7 +61,8 @@ export default {
props
:
{
index
:
{
type
:
Number
,
default
:
1
},
disabled
:
{
type
:
Boolean
,
default
:
false
},
data
:
{
type
:
Object
,
default
:
()
=>
({})
}
data
:
{
type
:
Object
,
default
:
()
=>
({})
},
disableScore
:
{
type
:
Boolean
,
default
:
false
}
},
components
:
{
VEditor
},
data
()
{
...
...
@@ -69,7 +74,7 @@ export default {
data
:
{
immediate
:
true
,
handler
(
data
)
{
this
.
question
=
this
.
genQuestion
(
data
)
//
this.question = this.genQuestion(data)
}
}
},
...
...
@@ -100,10 +105,23 @@ export default {
</
script
>
<
style
lang=
"scss"
scoped
>
.question-item
{
display
:
flex
;
}
.question-item-selection
{
margin-right
:
10px
;
padding-top
:
3px
;
}
.question-item-selection
:empty
{
margin
:
0
;
}
.question-item-main
{
flex
:
1
;
}
.question-item-hd-top
{
display
:
flex
;
align-items
:
center
;
.question-index
{
margin-left
:
10px
;
color
:
#c01c40
;
}
.question-type
{
...
...
src/modules/paper/components/QuestionNum.vue
浏览文件 @
e527f099
<
template
>
<app-card
class=
"fixed"
>
<app-card>
<div
class=
"question-num"
>
<div
class=
"question-num-bd"
>
<ul>
...
...
@@ -43,10 +43,6 @@ export default {
</
script
>
<
style
lang=
"scss"
scoped
>
.fixed
{
position
:
sticky
;
top
:
0
;
}
.question-num
{
ul
{
display
:
flex
;
...
...
src/modules/paper/components/QuestionSelect.vue
浏览文件 @
e527f099
<
template
>
<app-list
v-bind=
"tableOptions"
ref=
"list"
style=
"padding-left: 30px"
>
</app-list>
<app-list
v-bind=
"tableOptions"
ref=
"list"
v-on=
"$listeners"
>
<template
v-slot:filter-permission=
"
{ params }">
<el-radio-group
v-model=
"params.permission"
@
change=
"refetchList"
>
<el-radio
label=
"1"
>
我的题库
</el-radio>
<el-radio
label=
"2"
>
公共题库
</el-radio>
</el-radio-group>
</
template
>
<
template
v-slot:filter-category=
"{ params }"
>
<question-type-cascader
v-model=
"params.question_category"
@
change=
"refetchList"
></question-type-cascader>
</
template
>
</app-list>
</template>
<
script
>
import
{
getQuestionList
}
from
'../api.js'
import
QuestionTypeCascader
from
'@/components/base/QuestionTypeCascader.vue'
export
default
{
props
:
{
data
:
{
type
:
Object
,
default
:
()
=>
({})
}
},
components
:
{
QuestionTypeCascader
},
data
()
{
return
{}
},
computed
:
{
tableOptions
()
{
return
{
limit
:
10
,
remote
:
{
httpRequest
:
getQuestionList
,
params
:
{
permission
:
'1'
,
question_type
:
''
,
question_title
:
''
,
question_difficulty
:
''
,
question_category
:
''
}
},
filters
:
[
{
prop
:
'permission'
,
label
:
'题库范围'
,
slots
:
'filter-permission'
},
{
type
:
'select'
,
prop
:
'question_type'
,
placeholder
:
'请选择题目类型'
,
options
:
[
{
label
:
'单选题'
,
value
:
'1'
},
{
label
:
'多选题'
,
value
:
'2'
},
{
label
:
'问答题'
,
value
:
'3'
},
{
label
:
'案例题'
,
value
:
'5'
},
{
label
:
'判断题'
,
value
:
'6'
},
{
label
:
'实操题'
,
value
:
'7'
},
{
label
:
'情景题'
,
value
:
'8'
}
],
label
:
'题目类型'
},
{
type
:
'select'
,
prop
:
'question_difficulty'
,
placeholder
:
'请选择题目难度等级'
,
options
:
[
{
label
:
'易'
,
value
:
'1'
},
{
label
:
'中'
,
value
:
'2'
},
{
label
:
'难'
,
value
:
'3'
}
],
label
:
'难度等级'
},
{
prop
:
'question_category'
,
label
:
'试题分类'
,
slots
:
'filter-category'
},
{
type
:
'input'
,
prop
:
'question_title'
,
label
:
'题目标题'
,
placeholder
:
'请输入题目标题'
},
{
type
:
'input'
,
prop
:
'name4'
,
label
:
'题干内容'
,
placeholder
:
'请输入题干内容'
},
{
type
:
'input'
,
prop
:
'name5'
,
label
:
'知识点'
,
placeholder
:
'请输入知识点'
}
],
columns
:
[
{
type
:
'selection'
},
{
type
:
'index'
,
label
:
'序号'
},
{
label
:
'题目类型'
,
prop
:
'question_type'
,
computed
:
({
row
})
=>
{
const
map
=
{
1
:
'单选题'
,
2
:
'多选题'
,
3
:
'问答题'
,
5
:
'案例题'
,
6
:
'判断题'
,
7
:
'实操题'
,
8
:
'情景题'
}
return
map
[
row
.
question_type
]
||
row
.
question_type
}
},
{
label
:
'试卷分类'
,
prop
:
'question_category.category_name'
},
{
label
:
'题目标题'
,
prop
:
'question_title'
},
{
label
:
'知识点'
,
prop
:
'knowledge_point.title'
},
{
label
:
'难度等级'
,
prop
:
'question_difficulty'
,
computed
:
({
row
})
=>
{
const
map
=
{
1
:
'易'
,
2
:
'中'
,
3
:
'难'
}
return
map
[
row
.
question_difficulty
]
||
row
.
question_difficulty
}
},
{
label
:
'更新人'
,
prop
:
'operator.realname'
}
]
}
}
},
methods
:
{
// 刷新列表
refetchList
()
{
// 刷新列表
this
.
$refs
.
list
.
refetch
()
}
}
}
</
script
>
<
style
></
style
>
src/modules/paper/index.js
浏览文件 @
e527f099
...
...
@@ -15,13 +15,13 @@ const routes = [
{
name
:
'createPaper'
,
path
:
'create'
,
component
:
()
=>
import
(
'./views/
NewPaper
.vue'
),
component
:
()
=>
import
(
'./views/
Update
.vue'
),
meta
:
{
title
:
'新建试卷'
}
},
{
name
:
'editPaper'
,
path
:
'update/:id'
,
component
:
()
=>
import
(
'./views/
NewPaper
.vue'
),
component
:
()
=>
import
(
'./views/
Update
.vue'
),
meta
:
{
title
:
'编辑试卷'
},
props
:
true
},
...
...
src/modules/paper/views/Detail.vue
浏览文件 @
e527f099
<
template
>
<div>
<div
v-loading=
"loading"
>
<!-- 试卷描述 -->
<app-card
title=
"试卷信息"
>
<template
#
header-aside
>
...
...
@@ -9,23 +9,24 @@
<el-descriptions-item
label=
"试卷名称"
>
{{ detail.paper_title }}
</el-descriptions-item>
<el-descriptions-item
label=
"标签"
>
{{ detail.paper_labels }}
</el-descriptions-item>
<el-descriptions-item
label=
"试卷分类"
>
{{ detail.paper_category.category_name }}
</el-descriptions-item>
<el-descriptions-item
label=
"组卷模式"
>
{{ detail.paper_type }}
</el-descriptions-item>
<el-descriptions-item
label=
"组卷模式"
>
{{ detail.paper_type
_name
}}
</el-descriptions-item>
<el-descriptions-item
label=
"试卷总分"
>
{{ detail.paper_total_score }}
</el-descriptions-item>
<el-descriptions-item
label=
"及格分数"
>
{{ detail.pass_score }}
</el-descriptions-item>
<el-descriptions-item
label=
"考试时长"
>
{{ detail.paper_times }}分钟
</el-descriptions-item>
<el-descriptions-item
label=
"最短交卷时长"
>
{{ detail.minimum_paper_handing_time }}分钟
</el-descriptions-item>
<el-descriptions-item
label=
"试题顺序"
>
{{ detail.paper_question_order }}
</el-descriptions-item>
<el-descriptions-item
label=
"多次考试"
>
{{ detail.is_multiple_exams }}
</el-descriptions-item>
<el-descriptions-item
label=
"多次考试成绩计算规则"
>
{{ detail.multiple_test_score_rule }}
</el-descriptions-item>
<el-descriptions-item
label=
"试题顺序"
>
{{ detail.paper_question_order_name }}
</el-descriptions-item>
<el-descriptions-item
label=
"多次考试"
>
{{ detail.is_multiple_exams_name }}
</el-descriptions-item>
<el-descriptions-item
label=
"多次考试成绩计算规则"
>
{{
detail.multiple_test_score_rule_name
}}
</el-descriptions-item>
</el-descriptions>
</app-card>
<!-- 试卷列表 -->
<paper-questions
:data=
"detail"
:list=
"detail.questions"
@
update=
"getDetail"
></paper-questions>
<paper-questions
:data=
"detail"
@
update=
"getDetail"
></paper-questions>
</div>
</template>
<
script
>
// import QuestionList from '../components/QuestionList.vue'
import
PaperQuestions
from
'../components/PaperQuestions.vue'
import
{
getPaper
}
from
'../api.js'
export
default
{
...
...
@@ -33,553 +34,38 @@ export default {
components
:
{
PaperQuestions
},
data
()
{
return
{
loading
:
true
,
detail
:
{
paper_category
:
{},
questions
:
[]
}
// detail: {
// id: '355310262572814336',
// project_prefix: 'x1',
// paper_uses: 1,
// paper_title: '测试试卷',
// paper_labels: '',
// paper_type: 1,
// paper_contents: [
// {
// id: '355016409588379649',
// score: 20
// },
// {
// id: '355014384641318913',
// score: 20
// },
// {
// id: '355666309116432384',
// score: 10
// },
// {
// id: '355666267181780992',
// score: 10
// },
// {
// id: '355666228921339905',
// score: 10
// },
// {
// id: '354948368938758145',
// score: 10
// },
// {
// id: '355016685372256256',
// score: 20
// },
// {
// id: '355016686743793664',
// score: 10
// },
// {
// id: '355016685909127168',
// score: 10
// }
// ],
// paper_category: '7223',
// paper_times: 10,
// paper_total_score: 100,
// pass_score: 60,
// paper_question_order: 1,
// minimum_paper_handing_time: 1,
// is_multiple_exams: 0,
// multiple_test_score_rule: 1,
// operator: {
// id: '6653195831513972736',
// username: '王诒正',
// nickname: '王诒正',
// realname: '王诒正',
// email: 'wangyizheng@ezijing.com',
// mobile: '18435134258',
// country_code: '86'
// },
// created_by: {
// id: '6653195831513972736',
// username: '王诒正',
// nickname: '王诒正',
// realname: '王诒正',
// email: 'wangyizheng@ezijing.com',
// mobile: '18435134258',
// country_code: '86'
// },
// created_at: '2022-02-24 11:16:07',
// updated_at: '2022-02-25 10:57:08',
// deleted_at: null,
// questions: [
// {
// id: '354948368938758145',
// project_prefix: 'x1',
// permission: 2,
// question_type: 3,
// question_title: '问答题测试题1',
// question_content: '问答题测试题1',
// common_content: '',
// question_options: [],
// question_category: {},
// question_answer: {},
// question_analysis: '',
// question_difficulty: 3,
// status: 1,
// operator: {
// id: '6653195831513972736',
// username: '王诒正',
// nickname: '王诒正',
// realname: '王诒正',
// email: 'wangyizheng@ezijing.com',
// mobile: '18435134258',
// country_code: '86'
// },
// group_id: '0',
// question_order: 0,
// question_tag: 'test',
// is_parent: 1,
// child_question_type: 0,
// created_by: {
// id: '6653195831513972736',
// username: '王诒正',
// nickname: '王诒正',
// realname: '王诒正',
// email: 'wangyizheng@ezijing.com',
// mobile: '18435134258',
// country_code: '86'
// },
// created_at: '2022-02-23 11:18:05',
// updated_at: '2022-02-23 11:18:05',
// score: 10,
// children: []
// },
// {
// id: '355016409588379649',
// project_prefix: 'x1',
// permission: 2,
// question_type: 1,
// question_title: '单选题测试题1',
// question_content: '单选题测试题1',
// common_content: '',
// question_options: [
// {
// option: '正确',
// checked: true,
// id: '6902157182012227584'
// },
// {
// option: '错误',
// checked: false,
// id: '6902157182012227585'
// }
// ],
// question_category: {},
// question_answer: ['6902157182012227584'],
// question_analysis: '',
// question_difficulty: 3,
// status: 1,
// operator: {
// id: '6653195831513972736',
// username: '王诒正',
// nickname: '王诒正',
// realname: '王诒正',
// email: 'wangyizheng@ezijing.com',
// mobile: '18435134258',
// country_code: '86'
// },
// group_id: '0',
// question_order: 0,
// question_tag: 'test',
// is_parent: 1,
// child_question_type: 0,
// created_by: {
// id: '6653195831513972736',
// username: '王诒正',
// nickname: '王诒正',
// realname: '王诒正',
// email: 'wangyizheng@ezijing.com',
// mobile: '18435134258',
// country_code: '86'
// },
// created_at: '2022-02-23 15:48:27',
// updated_at: '2022-02-23 15:48:27',
// score: 20,
// children: []
// },
// {
// id: '355014384641318913',
// project_prefix: 'x1',
// permission: 2,
// question_type: 1,
// question_title: '单选题测试题1',
// question_content: '单选题测试题1',
// common_content: '',
// question_options: [
// {
// option: '正确',
// checked: true,
// id: '6902155157220360192'
// },
// {
// option: '错误',
// checked: false,
// id: '6902155157220360193'
// }
// ],
// question_category: {},
// question_answer: ['6902155157220360192'],
// question_analysis: '',
// question_difficulty: 3,
// status: 1,
// operator: {
// id: '6653195831513972736',
// username: '王诒正',
// nickname: '王诒正',
// realname: '王诒正',
// email: 'wangyizheng@ezijing.com',
// mobile: '18435134258',
// country_code: '86'
// },
// group_id: '0',
// question_order: 0,
// question_tag: 'test',
// is_parent: 1,
// child_question_type: 0,
// created_by: {
// id: '6653195831513972736',
// username: '王诒正',
// nickname: '王诒正',
// realname: '王诒正',
// email: 'wangyizheng@ezijing.com',
// mobile: '18435134258',
// country_code: '86'
// },
// created_at: '2022-02-23 15:40:25',
// updated_at: '2022-02-23 15:40:25',
// score: 20,
// children: []
// },
// {
// id: '355666309116432384',
// project_prefix: 'x1',
// permission: 2,
// question_type: 2,
// question_title: '多选题测试题3',
// question_content: '多选题测试题3',
// common_content: '',
// question_options: [
// {
// option: '正确',
// checked: true,
// id: '6902807082072801280'
// },
// {
// option: '错误',
// checked: false,
// id: '6902807082072801281'
// }
// ],
// question_category: {
// id: '7223',
// category_name: '测试使用的分类',
// name: '题目分类/测试使用的分类'
// },
// question_answer: ['6902807082072801280'],
// question_analysis: '',
// question_difficulty: 3,
// status: 1,
// operator: {
// id: '6653195831513972736',
// username: '王诒正',
// nickname: '王诒正',
// realname: '王诒正',
// email: 'wangyizheng@ezijing.com',
// mobile: '18435134258',
// country_code: '86'
// },
// group_id: '0',
// question_order: 0,
// question_tag: 'test',
// is_parent: 1,
// child_question_type: 0,
// created_by: {
// id: '6653195831513972736',
// username: '王诒正',
// nickname: '王诒正',
// realname: '王诒正',
// email: 'wangyizheng@ezijing.com',
// mobile: '18435134258',
// country_code: '86'
// },
// created_at: '2022-02-25 10:50:56',
// updated_at: '2022-02-25 10:50:56',
// score: 10,
// children: []
// },
// {
// id: '355666267181780992',
// project_prefix: 'x1',
// permission: 2,
// question_type: 2,
// question_title: '多选题测试题2',
// question_content: '多选题测试题2',
// common_content: '',
// question_options: [
// {
// option: '正确',
// checked: true,
// id: '6902807040146538496'
// },
// {
// option: '错误',
// checked: false,
// id: '6902807040146538497'
// }
// ],
// question_category: {
// id: '7223',
// category_name: '测试使用的分类',
// name: '题目分类/测试使用的分类'
// },
// question_answer: ['6902807040146538496'],
// question_analysis: '',
// question_difficulty: 3,
// status: 1,
// operator: {
// id: '6653195831513972736',
// username: '王诒正',
// nickname: '王诒正',
// realname: '王诒正',
// email: 'wangyizheng@ezijing.com',
// mobile: '18435134258',
// country_code: '86'
// },
// group_id: '0',
// question_order: 0,
// question_tag: 'test',
// is_parent: 1,
// child_question_type: 0,
// created_by: {
// id: '6653195831513972736',
// username: '王诒正',
// nickname: '王诒正',
// realname: '王诒正',
// email: 'wangyizheng@ezijing.com',
// mobile: '18435134258',
// country_code: '86'
// },
// created_at: '2022-02-25 10:50:46',
// updated_at: '2022-02-25 10:50:46',
// score: 10,
// children: []
// },
// {
// id: '355666228921339905',
// project_prefix: 'x1',
// permission: 2,
// question_type: 2,
// question_title: '多选题测试题1',
// question_content: '多选题测试题1',
// common_content: '',
// question_options: [
// {
// option: '正确',
// checked: true,
// id: '6902807001823182848'
// },
// {
// option: '错误',
// checked: false,
// id: '6902807001823182849'
// }
// ],
// question_category: {
// id: '7223',
// category_name: '测试使用的分类',
// name: '题目分类/测试使用的分类'
// },
// question_answer: ['6902807001823182848'],
// question_analysis: '',
// question_difficulty: 3,
// status: 1,
// operator: {
// id: '6653195831513972736',
// username: '王诒正',
// nickname: '王诒正',
// realname: '王诒正',
// email: 'wangyizheng@ezijing.com',
// mobile: '18435134258',
// country_code: '86'
// },
// group_id: '0',
// question_order: 0,
// question_tag: 'test',
// is_parent: 1,
// child_question_type: 0,
// created_by: {
// id: '6653195831513972736',
// username: '王诒正',
// nickname: '王诒正',
// realname: '王诒正',
// email: 'wangyizheng@ezijing.com',
// mobile: '18435134258',
// country_code: '86'
// },
// created_at: '2022-02-25 10:50:36',
// updated_at: '2022-02-25 10:50:36',
// score: 10,
// children: []
// },
// {
// id: '355016685372256256',
// project_prefix: 'x1',
// permission: 1,
// question_type: 5,
// question_title: '案例题测试2',
// question_content: '',
// common_content: '案例题测试2',
// question_options: [],
// question_category: {},
// question_answer: {},
// question_analysis: {},
// question_difficulty: 1,
// status: 1,
// operator: {
// id: '6653195831513972736',
// username: '王诒正',
// nickname: '王诒正',
// realname: '王诒正',
// email: 'wangyizheng@ezijing.com',
// mobile: '18435134258',
// country_code: '86'
// },
// group_id: '6902157457808687104',
// question_order: 0,
// question_tag: 'test2',
// is_parent: 1,
// child_question_type: 0,
// created_by: {},
// created_at: '2022-02-23 15:49:33',
// updated_at: '2022-02-23 15:49:33',
// score: 20,
// children: [
// {
// id: '355016686743793664',
// project_prefix: 'x1',
// permission: 1,
// question_type: 5,
// question_title: '案例-单选题测试题1',
// question_content: '案例-单选题测试题1',
// common_content: '案例题测试2',
// question_options: [
// {
// option: '正确',
// checked: true,
// id: '6902157458941149184'
// },
// {
// option: '错误',
// checked: false,
// id: '6902157458941149185'
// }
// ],
// question_category: {},
// question_answer: ['6902157458941149184'],
// question_analysis: '',
// question_difficulty: 1,
// status: 1,
// operator: {
// id: '6653195831513972736',
// username: '王诒正',
// nickname: '王诒正',
// realname: '王诒正',
// email: 'wangyizheng@ezijing.com',
// mobile: '18435134258',
// country_code: '86'
// },
// group_id: '6902157457808687104',
// question_order: 3,
// question_tag: 'test2',
// is_parent: 0,
// child_question_type: 1,
// created_by: {
// id: '6653195831513972736',
// username: '王诒正',
// nickname: '王诒正',
// realname: '王诒正',
// email: 'wangyizheng@ezijing.com',
// mobile: '18435134258',
// country_code: '86'
// },
// created_at: '2022-02-23 15:49:34',
// updated_at: '2022-02-23 15:49:34',
// score: 10
// },
// {
// id: '355016685909127168',
// project_prefix: 'x1',
// permission: 1,
// question_type: 5,
// question_title: '案例-判断题测试题1',
// question_content: '案例-判断题测试题1',
// common_content: '案例题测试2',
// question_options: [
// {
// option: '正确',
// checked: true,
// id: '6902157458161008640'
// },
// {
// option: '错误',
// checked: false,
// id: '6902157458161008641'
// }
// ],
// question_category: {},
// question_answer: '6902157458161008640',
// question_analysis: '',
// question_difficulty: 1,
// status: 1,
// operator: {
// id: '6653195831513972736',
// username: '王诒正',
// nickname: '王诒正',
// realname: '王诒正',
// email: 'wangyizheng@ezijing.com',
// mobile: '18435134258',
// country_code: '86'
// },
// group_id: '6902157457808687104',
// question_order: 1,
// question_tag: 'test2',
// is_parent: 0,
// child_question_type: 6,
// created_by: {
// id: '6653195831513972736',
// username: '王诒正',
// nickname: '王诒正',
// realname: '王诒正',
// email: 'wangyizheng@ezijing.com',
// mobile: '18435134258',
// country_code: '86'
// },
// created_at: '2022-02-23 15:49:33',
// updated_at: '2022-02-23 15:49:33',
// score: 10
// }
// ]
// }
// ]
// }
}
},
computed
:
{},
beforeMount
()
{
this
.
getDetail
()
},
methods
:
{
// 获取试卷详情
getDetail
()
{
getPaper
({
id
:
this
.
id
}).
then
(
res
=>
{
this
.
detail
=
Object
.
assign
({},
this
.
detail
,
res
.
data
)
this
.
loading
=
true
getPaper
({
id
:
this
.
id
})
.
then
(
res
=>
{
const
data
=
res
.
data
const
temp
=
{}
// 组卷模式
const
paperTypeMap
=
{
1
:
'选题组卷'
,
2
:
'自动组卷'
}
temp
.
paper_type_name
=
paperTypeMap
[
data
.
paper_type
]
||
data
.
paper_type
// 试题顺序
const
questionOrderMap
=
{
1
:
'固定'
,
2
:
'随机'
}
temp
.
paper_question_order_name
=
questionOrderMap
[
data
.
paper_question_order
]
||
data
.
paper_question_order
// 是否多次考试
const
isMultipleExamsMap
=
{
1
:
'是'
,
0
:
'否'
}
temp
.
is_multiple_exams_name
=
isMultipleExamsMap
[
data
.
is_multiple_exams
]
||
data
.
is_multiple_exams
// 多次考试成绩计算规则
const
multipleTestScoreRuleMap
=
{
1
:
'平均计算法'
,
2
:
'最高得分法'
}
temp
.
multiple_test_score_rule_name
=
multipleTestScoreRuleMap
[
data
.
multiple_test_score_rule
]
||
data
.
multiple_test_score_rule
this
.
detail
=
Object
.
assign
({},
this
.
detail
,
res
.
data
,
temp
)
})
.
finally
(()
=>
{
this
.
loading
=
false
})
},
// 编辑试卷
...
...
@@ -589,5 +75,3 @@ export default {
}
}
</
script
>
<
style
lang=
"scss"
scoped
></
style
>
src/modules/paper/views/List.vue
浏览文件 @
e527f099
...
...
@@ -8,7 +8,7 @@
>
</div>
<template
v-slot:filter-category=
"
{ params }">
<question-type-cascader
v-model=
"params.paper_category"
></question-type-cascader>
<question-type-cascader
v-model=
"params.paper_category"
@
change=
"refetchList"
></question-type-cascader>
</
template
>
<
template
v-slot:table-x=
"{ row }"
>
<el-button
type=
"text"
@
click=
"handleUpdate(row)"
>
编辑
</el-button>
...
...
@@ -74,10 +74,8 @@ export default {
placeholder
:
'请输入试卷标签'
,
label
:
'标签:'
},
{
type
:
'select'
,
prop
:
'paperType'
,
prop
:
'paper_category'
,
label
:
'试卷分类:'
,
slots
:
'filter-category'
}
...
...
@@ -146,8 +144,13 @@ export default {
batchDeletePaper
(
ids
)
{
batchDeletePaper
({
ids
}).
then
(
res
=>
{
// 刷新列表
this
.
$refs
.
list
.
refetch
()
this
.
refetchList
()
})
},
// 刷新列表
refetchList
()
{
// 刷新列表
this
.
$refs
.
list
.
refetch
()
}
}
}
...
...
src/modules/paper/views/
NewPaper
.vue
→
src/modules/paper/views/
Update
.vue
浏览文件 @
e527f099
...
...
@@ -172,14 +172,6 @@ export default {
questionSelectVisible
:
false
}
},
watch
:
{
'$route.query.select'
:
{
immediate
:
true
,
handler
(
value
)
{
value
&&
this
.
showSelectQuestion
()
}
}
},
computed
:
{
isEdit
()
{
return
!!
this
.
id
...
...
@@ -194,15 +186,21 @@ export default {
methods
:
{
// 取消
handleCancel
()
{
this
.
$router
.
replace
(
'/paper/list'
)
this
.
$router
.
back
(
)
},
// 保存
handleSubmit
()
{
this
.
$refs
.
form
.
validate
().
then
(()
=>
{
// 保存成功回到列表
if
(
this
.
isEdit
)
{
this
.
updatePaper
().
then
(
res
=>
{
this
.
$router
.
back
()
})
}
else
{
this
.
createPaper
().
then
(
res
=>
{
this
.
$router
.
replace
(
'/paper/list'
)
})
}
})
},
// 保存并选择试题
...
...
@@ -214,7 +212,7 @@ export default {
})
}
else
{
this
.
createPaper
(
res
=>
{
this
.
$router
.
replace
({
path
:
'/paper/
update
/'
+
res
.
data
.
id
,
query
:
{
select
:
true
}
})
this
.
$router
.
replace
({
path
:
'/paper/
detail
/'
+
res
.
data
.
id
,
query
:
{
select
:
true
}
})
})
}
})
...
...
@@ -247,7 +245,8 @@ export default {
// 获取试卷详情
getDetail
()
{
getPaper
({
id
:
this
.
id
}).
then
(
res
=>
{
this
.
form
=
Object
.
assign
({},
this
.
form
,
res
.
data
)
const
data
=
res
.
data
this
.
form
=
Object
.
assign
({},
this
.
form
,
data
,
{
paper_category
:
data
.
paper_category
.
id
})
})
}
}
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论