Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
C
center-qa
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
EzijingWeb
center-qa
Commits
c8401632
提交
c8401632
authored
2月 25, 2022
作者:
王鹏飞
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
updates
上级
9fe2e086
全部展开
隐藏空白字符变更
内嵌
并排
正在显示
18 个修改的文件
包含
362 行增加
和
310 行删除
+362
-310
.eslintrc.js
.eslintrc.js
+1
-0
AppCard.vue
src/components/base/AppCard.vue
+1
-0
AppList.vue
src/components/base/AppList.vue
+1
-1
api.js
src/modules/paper/api.js
+36
-6
AddPaper.vue
src/modules/paper/components/AddPaper.vue
+0
-0
BatchSetting.vue
src/modules/paper/components/BatchSetting.vue
+1
-1
PaperQuestions.vue
src/modules/paper/components/PaperQuestions.vue
+103
-0
QuestionList.vue
src/modules/paper/components/QuestionList.vue
+0
-0
QuestionListItem.vue
src/modules/paper/components/QuestionListItem.vue
+127
-0
QuestionListItems.vue
src/modules/paper/components/QuestionListItems.vue
+0
-242
QuestionNum.vue
src/modules/paper/components/QuestionNum.vue
+30
-20
QuestionSelect.vue
src/modules/paper/components/QuestionSelect.vue
+1
-1
Detail.vue
src/modules/paper/views/Detail.vue
+0
-0
List.vue
src/modules/paper/views/List.vue
+40
-12
NewPaper.vue
src/modules/paper/views/NewPaper.vue
+1
-2
Detail.vue
src/modules/question/components/Detail.vue
+11
-15
List.vue
src/modules/question/views/List.vue
+9
-9
axios.js
src/utils/axios.js
+0
-1
没有找到文件。
.eslintrc.js
浏览文件 @
c8401632
...
...
@@ -4,6 +4,7 @@ module.exports = {
},
extends
:
[
'plugin:vue/essential'
,
'standard'
],
rules
:
{
'vue/no-mutating-props'
:
'off'
,
// 暂时关闭
'vue/comment-directive'
:
'off'
,
'vue/multi-word-component-names'
:
'off'
,
'space-before-function-paren'
:
'off'
...
...
src/components/base/AppCard.vue
浏览文件 @
c8401632
...
...
@@ -31,6 +31,7 @@ export default {
}
.app-card-hd
{
display
:
flex
;
align-items
:
flex-start
;
}
.app-card-hd__title
{
flex
:
1
;
...
...
src/components/base/AppList.vue
浏览文件 @
c8401632
...
...
@@ -147,7 +147,7 @@ export default {
// 翻页参数设置
if
(
this
.
hasPagination
)
{
params
.
page
=
this
.
page
.
currentPage
.
toString
()
params
.
page_size
=
this
.
page
.
size
.
toString
()
params
.
limit
=
this
.
page
.
size
.
toString
()
}
// 接口请求之前
if
(
beforeRequest
)
{
...
...
src/modules/paper/api.js
浏览文件 @
c8401632
import
httpRequest
from
'@/utils/axios'
/**
* 获取知识点/标签
*/
export
function
getKnowledge
(
params
)
{
return
httpRequest
.
get
(
'/admin/v1/knowledge-point/search/x1'
,
{
params
})
}
/**
* 获取试卷列表
*/
...
...
@@ -34,9 +28,45 @@ export function getPaper(params) {
return
httpRequest
.
get
(
`/api/qbs/admin/v1/question-paper/
${
params
.
id
}
`
,
{
params
})
}
/**
* 删除试卷
*/
export
function
batchDeletePaper
(
data
)
{
return
httpRequest
.
post
(
'/api/qbs/admin/v1/question-paper/batch-delete'
,
data
)
}
/**
* 获取试题列表
*/
export
function
getQuestionList
(
params
)
{
return
httpRequest
.
get
(
'/api/qbs/admin/v1/questions'
,
{
params
})
}
/**
* 批量获取试题列表
*/
export
function
batchGetQuestionList
(
data
)
{
return
httpRequest
.
post
(
'/api/qbs/admin/v1/questions/batch'
,
data
)
}
/**
* 设置组题规则
* 添加试题和设置试题分数
*/
export
function
updatePaperRules
(
data
)
{
return
httpRequest
.
post
(
`/api/qbs/admin/v1/question-paper/rules/
${
data
.
id
}
`
,
data
)
}
/**
* 获取试卷分类
*/
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
})
}
src/modules/paper/components/AddPaper.vue
浏览文件 @
c8401632
差异被折叠。
点击展开。
src/modules/paper/components/BatchSetting.vue
浏览文件 @
c8401632
<
template
>
<el-dialog
v-bind=
"$attrs"
v-on=
"$listeners"
:modal=
"false"
width=
"20%
"
>
<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>
...
...
src/modules/paper/components/PaperQuestions.vue
0 → 100644
浏览文件 @
c8401632
<
template
>
<div>
<el-row
:gutter=
"20"
style=
"margin-top: 20px"
>
<!-- 试题列表 -->
<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
>
<question-list
:list=
"questions"
>
<
template
v-slot:selection=
"item"
>
<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-button
type=
"primary"
@
click=
"handleSubmit"
>
保存试卷
</el-button>
</
template
>
</question-num>
</el-col>
</el-row>
<!-- 选题组卷 -->
<
template
v-if=
"data.paper_type === 1"
>
<addPaper
:visible
.
sync=
"visible"
:data=
"data"
@
update=
"handelUpdate"
v-if=
"visible"
/>
</
template
>
<!-- 自动组卷 -->
<
template
v-if=
"data.paper_type === 2"
>
<AutomaticPaper
:visible
.
sync=
"visible"
:data=
"data"
@
update=
"handelUpdate"
v-if=
"visible"
/>
</
template
>
</div>
</template>
<
script
>
import
QuestionList
from
'./QuestionList.vue'
import
QuestionNum
from
'./QuestionNum.vue'
import
AddPaper
from
'./AddPaper.vue'
import
AutomaticPaper
from
'./AutomaticPaper.vue'
import
{
updatePaperRules
}
from
'../api.js'
export
default
{
props
:
{
data
:
{
type
:
Object
,
default
:
()
=>
({})
}
},
components
:
{
QuestionList
,
QuestionNum
,
AddPaper
,
AutomaticPaper
},
data
()
{
return
{
visible
:
false
,
questions
:
[],
multipleSelection
:
[]
// 选择项
}
},
watch
:
{
data
:
{
immediate
:
true
,
handler
(
data
)
{
this
.
questions
=
data
.
questions
||
[]
}
}
},
computed
:
{},
methods
:
{
// 增加试题
handleAdd
()
{
this
.
visible
=
true
},
handleSelectionChange
(
checked
,
data
)
{
if
(
checked
)
{
this
.
multipleSelection
.
push
(
data
.
id
)
}
else
{
this
.
multipleSelection
=
this
.
multipleSelection
.
filter
(
id
=>
id
!==
data
.
id
)
}
},
// 删除选中试题
handleRemove
()
{
this
.
questions
=
this
.
questions
.
filter
(
item
=>
!
this
.
multipleSelection
.
includes
(
item
.
id
))
},
// 保存试卷
handleSubmit
()
{
const
rules
=
[]
this
.
questions
.
forEach
(
question
=>
{
rules
.
push
({
id
:
question
.
id
,
score
:
question
.
score
||
0
})
if
(
question
.
children
&&
question
.
children
.
length
)
{
question
.
children
.
forEach
(
question
=>
{
rules
.
push
({
id
:
question
.
id
,
score
:
question
.
score
||
0
})
})
}
})
const
parmas
=
{
id
:
this
.
data
.
id
,
rules
}
updatePaperRules
(
parmas
).
then
(
res
=>
{
this
.
$message
.
success
(
'保存成功'
)
})
},
// 更新详情数据
handelUpdate
()
{
this
.
$emit
(
'update'
)
}
}
}
</
script
>
src/modules/paper/components/QuestionList.vue
浏览文件 @
c8401632
差异被折叠。
点击展开。
src/modules/paper/components/QuestionListItem.vue
0 → 100644
浏览文件 @
c8401632
<
template
>
<el-card
style=
"margin-bottom: 20px"
shadow=
"hover"
>
<div
class=
"question-item"
>
<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.score"
style=
"width: 100px"
></el-input>
</div>
</div>
<!-- 题干 -->
<div
class=
"question-title"
v-html=
"data.question_content"
></div>
</div>
<slot>
<div
class=
"question-item-bd"
>
<!-- 单选题 -->
<template
v-if=
"questionType === 1"
>
<el-radio-group
:disabled=
"disabled"
:value=
"data.question_answer[0]"
>
<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>
</el-radio-group>
</
template
>
<!-- 多选题 -->
<
template
v-if=
"questionType === 2"
>
<el-checkbox-group
:disabled=
"disabled"
:value=
"data.question_answer"
>
<div
class=
"question-item-option"
v-for=
"item in data.question_options"
:key=
"item.id"
>
<el-checkbox
:label=
"item.id"
>
{{
item
.
option
}}
</el-checkbox>
</div>
</el-checkbox-group>
</
template
>
<!-- 问答题 -->
<
template
v-if=
"questionType === 3"
>
<v-editor></v-editor>
</
template
>
<!-- 判断题 -->
<
template
v-if=
"questionType === 6"
>
<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>
</el-radio-group>
</
template
>
</div>
</slot>
<div
class=
"question-item-ft"
></div>
</div>
</el-card>
</template>
<
script
>
import
VEditor
from
'@/components/tinymce/Index.vue'
export
default
{
props
:
{
index
:
{
type
:
Number
,
default
:
1
},
disabled
:
{
type
:
Boolean
,
default
:
false
},
data
:
{
type
:
Object
,
default
:
()
=>
({})
}
},
components
:
{
VEditor
},
data
()
{
return
{
question
:
{}
}
},
watch
:
{
data
:
{
immediate
:
true
,
handler
(
data
)
{
this
.
question
=
this
.
genQuestion
(
data
)
}
}
},
computed
:
{
// 试题类型
questionType
()
{
// 1单选,2多选,3简答,5案例题, 6判断, 7实操,8情景
return
this
.
data
.
child_question_type
||
this
.
data
.
question_type
},
// 26个英文字母
A_Z
()
{
const
result
=
[]
for
(
let
i
=
0
;
i
<
26
;
i
++
)
{
result
.
push
(
String
.
fromCharCode
(
65
+
i
))
}
return
result
},
// 选项类型
questionTypeText
()
{
const
map
=
{
1
:
'单选题'
,
2
:
'多选题'
,
3
:
'问答题'
,
5
:
'案例题'
,
6
:
'判断题'
,
7
:
'实操题'
,
8
:
'情景题'
}
return
map
[
this
.
questionType
]
}
},
methods
:
{
genQuestion
(
data
)
{}
}
}
</
script
>
<
style
lang=
"scss"
scoped
>
.question-item-hd-top
{
display
:
flex
;
.question-index
{
margin-left
:
10px
;
color
:
#c01c40
;
}
.question-type
{
flex
:
1
;
color
:
#c01c40
;
}
.question-score
{
display
:
flex
;
align-items
:
center
;
p
{
white-space
:
nowrap
;
}
}
}
.question-title
{
padding
:
10px
0
;
}
.question-item-option
{
margin
:
10px
0
;
}
</
style
>
src/modules/paper/components/QuestionListItems.vue
deleted
100644 → 0
浏览文件 @
9fe2e086
<
template
>
<div>
<div
v-for=
"(item, index) in questionList"
:key=
"index"
>
<!-- 简单题类型 [1,2,3,6] :根据判断题的类型渲染 -->
<el-card
class=
"boxCard"
v-if=
"signQuestionTypes.includes(item.question_type)"
:id=
"`page$
{index}`">
<div
class=
"boxHeader"
>
<div
class=
"headerLeft"
>
<div
class=
"check"
>
<input
type=
"checkbox"
class=
"checkInpt"
v-model=
"selectSubjects"
:value=
"item"
@
change=
"slectSubItem(item)"
/>
</div>
<div
class=
"title"
>
<div
class=
"titleType"
>
{{
index
+
1
}}
、
{{
item
.
question_title
}}
</div>
<div
class=
"titleDec"
v-html=
"item.question_content"
></div>
</div>
</div>
<div
class=
"pmty"
></div>
<div
class=
"headerRight"
>
<div
class=
"scoreValue"
>
<span
class=
"lableScore"
>
分数:
</span>
<el-input
v-model=
"item.score"
></el-input>
</div>
</div>
</div>
<div
class=
"boxMain"
>
<el-radio-group
class=
"options"
>
<el-radio
v-for=
"(v, index) in item.question_options"
:key=
"index"
:label=
"v.options"
class=
"option"
>
{{
v
.
options
}}
</el-radio>
</el-radio-group>
</div>
<div
class=
"boxFooter"
>
<div>
正确答案:
</div>
<div
class=
"boxAnswer"
>
{{
item
.
question_answer
}}
</div>
</div>
</el-card>
<!-- 复杂题类型 [5,7,8] :根据判断题的类型渲染 复杂利用上面的头部,内部重新写个页面渲染复杂题中的小题-->
<el-card
class=
"boxCard"
v-if=
"intricacyQuestionTypes.includes(item.question_type)"
:id=
"`page$
{index}`">
<div
class=
"boxHeader"
>
<div
class=
"headerLeft"
>
<div
class=
"check"
>
<input
type=
"checkbox"
class=
"checkInpt"
v-model=
"selectSubjects"
:value=
"item"
@
change=
"slectSubItem(item)"
/>
</div>
<div
class=
"title"
>
<div
class=
"titleType"
>
{{
index
+
1
}}
、
{{
item
.
question_title
}}
</div>
<div
class=
"titleDec"
v-html=
"item.question_content"
></div>
</div>
</div>
<div
class=
"headerRight"
>
<div
class=
"scoreValue"
>
<span
class=
"lableScore"
>
分数:
</span>
<el-input
:value=
"getSubScore(item)"
></el-input>
</div>
</div>
</div>
<div
class=
"intricacyBoxMain"
v-for=
"(v, index) in item.list"
:key=
"index"
style=
"margin-top: 20px"
>
<div
class=
"intricacyHeader"
>
<div
class=
"intricacyDsc"
>
<div
class=
"intricacyTitle"
>
{{
index
+
1
}}
、
{{
v
.
question_title
}}
</div>
<div
class=
"titleDec"
v-html=
"v.question_content"
></div>
</div>
<div
class=
"intricacyScoreValue"
>
<span
class=
"lableScore"
>
分数:
</span>
<el-input
v-model=
"v.score"
></el-input>
</div>
<div
class=
"empty"
></div>
</div>
<div
class=
"intricacyMain"
>
<el-radio-group
class=
"options"
>
<el-radio
v-for=
"(o, index) in v.question_options"
:key=
"index"
:label=
"o.options"
class=
"option"
>
{{
o
.
options
}}
</el-radio>
</el-radio-group>
</div>
<div
class=
"intricacyFooter"
>
<div>
正确答案:
</div>
<div
class=
"intricacyAnswer"
>
{{
v
.
question_answer
}}
</div>
</div>
</div>
</el-card>
</div>
</div>
</
template
>
<
script
>
export
default
{
// 问答、情景、案例
props
:
{
questionList
:
{
// 试题数据
type
:
Array
}
},
data
()
{
return
{
selectSubjects
:
[],
// 选中的题
signQuestionTypes
:
[
1
,
2
,
3
,
6
],
// 简单题类型
intricacyQuestionTypes
:
[
5
,
7
,
8
]
// 复杂题类型
}
},
methods
:
{
// 根据小题的分数计算大题的分数,以至于监听分数变化 s.score*1 是为了下次修改,返回的是字符串变成number类型才可以计算
getSubScore
(
item
)
{
return
item
?.
list
?.
map
(
s
=>
parseInt
(
s
.
score
)
*
1
).
reduce
((
pre
,
em
)
=>
pre
+
em
,
0
)
},
// 返回点击题号的offsettop
handleScroll
(
key
)
{
const
PageId
=
document
.
querySelector
(
'#page'
+
key
)
this
.
$emit
(
'handlePosition'
,
PageId
.
offsetTop
)
},
// 选中的数据回传
slectSubItem
(
item
)
{
console
.
log
(
item
)
this
.
$emit
(
'selectSubjectsChange'
,
this
.
selectSubjects
)
}
}
}
</
script
>
<
style
lang=
"scss"
>
.boxCard
{
margin-bottom
:
10px
;
.boxHeader
{
display
:
flex
;
justify-content
:
space-between
;
margin-bottom
:
30px
;
.headerLeft
{
flex
:
0
.75
;
display
:
flex
;
.check
{
margin-right
:
20px
;
}
.title
{
justify-content
:
space-around
;
.titleType
{
width
:
200px
;
color
:
#1890ff
;
}
}
.checkInpt
.title
{
display
:
inline-block
;
}
}
.pmty
{
flex
:
0
.05
;
}
.headerRight
{
flex
:
0
.2
;
display
:
flex
;
position
:
relative
;
.scoreValue
{
position
:
absolute
;
top
:
0px
;
display
:
flex
;
align-items
:
center
;
.lableScore
{
width
:
100px
;
}
}
}
}
.boxMain
{
padding-left
:
70px
;
.options
{
display
:
flex
;
flex-direction
:
column
;
.option
{
margin-bottom
:
5px
;
}
}
}
.boxFooter
{
margin-top
:
30px
;
padding-left
:
40px
;
display
:
flex
;
align-items
:
center
;
.boxAnswer
{
color
:
#1890ff
;
font-size
:
14px
;
}
}
.intricacyBoxMain
{
padding-left
:
70px
;
padding-top
:
20px
;
.options
{
display
:
flex
;
flex-direction
:
column
;
.option
{
margin-bottom
:
5px
;
}
}
.intricacyHeader
{
display
:
flex
;
align-items
:
center
;
.intricacyDsc
{
flex
:
0
.8
;
.intricacyTitle
{
width
:
200px
;
color
:
#949091
;
}
}
.intricacyScoreValue
{
flex
:
0
.2
;
margin-left
:
50px
;
display
:
flex
;
align-items
:
center
;
.lableScore
{
width
:
80px
;
}
}
}
.intricacyMain
{
padding-left
:
30px
;
}
.intricacyFooter
{
margin-top
:
10px
;
display
:
flex
;
align-items
:
center
;
.intricacyAnswer
{
color
:
#1890ff
;
font-size
:
14px
;
}
}
}
}
</
style
>
src/modules/paper/components/QuestionNum.vue
浏览文件 @
c8401632
<
template
>
<el-card>
<div
class=
"titleIndex"
>
<ul>
<li
:class=
"currentIndex === index ? `dotItem` : ''"
v-for=
"(item, index) in list"
:key=
"index"
@
click=
"TitleClick(index)"
>
{{
index
+
1
}}
</li>
</ul>
<div
style=
"margin-top: 10px; display: flex; justify-content: center; align-items: center"
>
<el-button
type=
"primary"
>
保存试卷
</el-button>
<app-card
class=
"fixed"
>
<div
class=
"question-num"
>
<div
class=
"question-num-bd"
>
<ul>
<li
:class=
"className"
v-for=
"(item, index) in list"
:key=
"index"
@
click=
"handleClick(index)"
>
{{
index
+
1
}}
</li>
</ul>
</div>
<div
class=
"question-num-ft"
>
<slot
name=
"footer"
></slot>
</div>
</div>
</
el
-card>
</
app
-card>
</
template
>
<
script
>
...
...
@@ -31,8 +28,13 @@ export default {
currentIndex
:
0
// 当前点击题号
}
},
computed
:
{
className
()
{
return
{}
}
},
methods
:
{
Tit
leClick
(
index
)
{
hand
leClick
(
index
)
{
this
.
currentIndex
=
index
this
.
$emit
(
'indexClick'
,
`
${
index
+
1
}
`
)
}
...
...
@@ -40,12 +42,15 @@ export default {
}
</
script
>
<
style
lang=
"scss"
>
.titleIndex
{
<
style
lang=
"scss"
scoped
>
.fixed
{
position
:
sticky
;
top
:
0
;
}
.question-num
{
ul
{
display
:
flex
;
justify-content
:
space-around
;
align-items
:
center
;
flex-wrap
:
wrap
;
li
{
border-radius
:
50px
;
width
:
24px
;
...
...
@@ -56,10 +61,15 @@ export default {
border
:
2px
solid
#ccc
;
color
:
#666
;
cursor
:
pointer
;
margin
:
10px
5px
;
}
.dotItem
{
background-color
:
rgb
(
243
,
190
,
190
);
}
}
}
.question-num-ft
{
margin-top
:
20px
;
text-align
:
center
;
}
</
style
>
src/modules/paper/components/QuestionSelect.vue
浏览文件 @
c8401632
<
template
>
<
el-dialog
title=
"添加试卷试题"
v-bind=
"$attrs"
v-on=
"$listeners"
></el-dialog
>
<
app-list
v-bind=
"tableOptions"
ref=
"list"
style=
"padding-left: 30px"
>
</app-list
>
</
template
>
<
script
>
...
...
src/modules/paper/views/Detail.vue
浏览文件 @
c8401632
差异被折叠。
点击展开。
src/modules/paper/views/List.vue
浏览文件 @
c8401632
...
...
@@ -3,7 +3,9 @@
<app-list
v-bind=
"tableOptions"
ref=
"list"
@
selection-change=
"handleSelectionChange"
>
<div
class=
"btn_operate"
>
<el-button
type=
"primary"
icon=
"el-icon-plus"
@
click=
"handleCreate"
>
新建试卷
</el-button>
<el-button
type=
"primary"
icon=
"el-icon-delete"
@
click=
"batchDelete"
>
批量删除
</el-button>
<el-button
type=
"primary"
icon=
"el-icon-delete"
:disabled=
"!multipleSelection.length"
@
click=
"handleBatchDelete"
>
批量删除
</el-button
>
</div>
<template
v-slot:filter-category=
"
{ params }">
<question-type-cascader
v-model=
"params.paper_category"
></question-type-cascader>
...
...
@@ -18,7 +20,7 @@
</template>
<
script
>
import
{
getPaperList
}
from
'../api'
import
{
getPaperList
,
batchDeletePaper
}
from
'../api'
import
QuestionTypeCascader
from
'@/components/base/QuestionTypeCascader.vue'
const
paperType
=
[
...
...
@@ -30,9 +32,7 @@ export default {
components
:
{
QuestionTypeCascader
},
data
()
{
return
{
visible
:
false
,
multipleSelection
:
[],
// 选择项
paperCategoryList
:
[]
multipleSelection
:
[]
// 选择项
}
},
computed
:
{
...
...
@@ -85,8 +85,15 @@ export default {
columns
:
[
{
type
:
'selection'
,
width
:
'50px'
,
fixed
:
'left'
},
{
type
:
'index'
,
label
:
'序号'
,
minWidth
:
'50px'
,
fixed
:
'left'
},
{
label
:
'组卷模式'
,
prop
:
'paper_type'
},
{
label
:
'试卷分类'
,
prop
:
'paper_category'
},
{
label
:
'组卷模式'
,
prop
:
'paper_type'
,
computed
:
({
row
})
=>
{
const
map
=
{
1
:
'选题组卷'
,
2
:
'自动组卷'
}
return
map
[
row
.
paper_type
]
||
row
.
paper_type
}
},
{
label
:
'试卷分类'
,
prop
:
'paper_category.category_name'
},
{
label
:
'试卷名称'
,
prop
:
'paper_title'
},
{
label
:
'总分'
,
prop
:
'paper_total_score'
},
{
label
:
'及格分数'
,
prop
:
'pass_score'
},
...
...
@@ -113,13 +120,34 @@ export default {
handleSelectionChange
(
val
)
{
this
.
multipleSelection
=
val
},
// 批量删除
batchDelete
()
{
console
.
log
(
'111'
)
},
// 单个删除
handleDelete
(
row
)
{
// this.$refs.list.refetch()
this
.
$confirm
(
'确定删除该试卷吗?'
,
'提示'
,
{
confirmButtonText
:
'确定'
,
cancelButtonText
:
'取消'
,
type
:
'warning'
}).
then
(()
=>
{
const
ids
=
[
row
.
id
]
this
.
batchDeletePaper
(
ids
)
})
},
// 批量删除
handleBatchDelete
()
{
this
.
$confirm
(
'确定删除所选试卷吗?'
,
'提示'
,
{
confirmButtonText
:
'确定'
,
cancelButtonText
:
'取消'
,
type
:
'warning'
}).
then
(()
=>
{
const
ids
=
this
.
multipleSelection
.
map
(
item
=>
item
.
id
)
this
.
batchDeletePaper
(
ids
)
})
},
// 批量删除
batchDeletePaper
(
ids
)
{
batchDeletePaper
({
ids
}).
then
(
res
=>
{
// 刷新列表
this
.
$refs
.
list
.
refetch
()
})
}
}
}
...
...
src/modules/paper/views/NewPaper.vue
浏览文件 @
c8401632
...
...
@@ -131,7 +131,6 @@
<el-button
type=
"primary"
@
click=
"handleSubmitSelect"
v-if=
"hasSelectQuestionButton"
>
保存并选择试题
</el-button>
</div>
</el-form>
<question-select
:visible
.
sync=
"questionSelectVisible"
></question-select>
</app-card>
</
template
>
...
...
@@ -141,7 +140,7 @@ import QuestionTypeCascader from '@/components/base/QuestionTypeCascader.vue'
export
default
{
props
:
{
id
:
{
type
:
String
}
},
components
:
{
QuestionTypeCascader
,
QuestionSelect
:
()
=>
import
(
'../components/QuestionSelect.vue'
)
},
components
:
{
QuestionTypeCascader
},
data
()
{
return
{
form
:
{
...
...
src/modules/question/components/Detail.vue
浏览文件 @
c8401632
...
...
@@ -53,13 +53,9 @@
remote
reserve-keyword
placeholder=
"请输入关键词"
:remote-method=
"remoteMethod"
>
<el-option
v-for=
"item in pointOptions"
:key=
"item.id"
:label=
"item.title"
:value=
"item.id"
>
</el-option>
:remote-method=
"remoteMethod"
>
<el-option
v-for=
"item in pointOptions"
:key=
"item.id"
:label=
"item.title"
:value=
"item.id"
>
</el-option>
</el-select>
</el-form-item>
<el-form-item>
...
...
@@ -67,13 +63,13 @@
<!--
<el-button
@
click=
"resetForm('ruleForm')"
>
重置
</el-button>
-->
</el-form-item>
</el-form>
<el-dialog
title=
"提示"
:visible
.
sync=
"dialogVisible
"
width=
"30%
"
:before-close=
"handleClose
"
>
<el-tree
:data=
"treeList"
:props=
"defaultProps"
@
node-click=
"handleNodeClick"
:expand-on-click-node=
"false"
></el-tree>
<el-dialog
title=
"提示"
:visible
.
sync=
"dialogVisible"
width=
"30%"
:before-close=
"handleClose"
>
<el-tree
:data=
"treeList
"
:props=
"defaultProps
"
@
node-click=
"handleNodeClick
"
:expand-on-click-node=
"false"
></el-tree>
<span
slot=
"footer"
class=
"dialog-footer"
>
<el-button
@
click=
"handleClose"
>
取 消
</el-button>
<el-button
type=
"primary"
@
click=
"dialogConfirm"
>
确 定
</el-button>
...
...
@@ -115,7 +111,7 @@ export default {
qType
:
[
{
label
:
'单选题'
,
value
:
1
},
{
label
:
'多选题'
,
value
:
2
},
{
label
:
'
简
答题'
,
value
:
3
},
{
label
:
'
问
答题'
,
value
:
3
},
{
label
:
'案例题'
,
value
:
5
},
{
label
:
'判断题'
,
value
:
6
},
{
label
:
'实操题'
,
value
:
7
},
...
...
src/modules/question/views/List.vue
浏览文件 @
c8401632
...
...
@@ -23,13 +23,13 @@
<el-button
type=
"text"
@
click=
"handleSettings(row)"
>
查看详情
</el-button>
<el-button
type=
"text"
@
click=
"handleSettings(row)"
>
删除
</el-button>
</
template
>
<el-dialog
title=
"提示"
:visible
.
sync=
"dialogVisible
"
width=
"30%
"
:before-close=
"handleClose
"
>
<el-tree
:data=
"treeList"
:props=
"defaultProps"
@
node-click=
"handleNodeClick"
:expand-on-click-node=
"false"
></el-tree>
<el-dialog
title=
"提示"
:visible
.
sync=
"dialogVisible"
width=
"30%"
:before-close=
"handleClose"
>
<el-tree
:data=
"treeList
"
:props=
"defaultProps
"
@
node-click=
"handleNodeClick
"
:expand-on-click-node=
"false"
></el-tree>
<span
slot=
"footer"
class=
"dialog-footer"
>
<el-button
@
click=
"handleClose"
>
取 消
</el-button>
<el-button
type=
"primary"
@
click=
"dialogConfirm"
>
确 定
</el-button>
...
...
@@ -73,7 +73,7 @@ export default {
options
:
[
{
label
:
'单选题'
,
value
:
1
},
{
label
:
'多选题'
,
value
:
2
},
{
label
:
'
简
答题'
,
value
:
3
},
{
label
:
'
问
答题'
,
value
:
3
},
{
label
:
'案例题'
,
value
:
5
},
{
label
:
'判断题'
,
value
:
6
},
{
label
:
'实操题'
,
value
:
7
},
...
...
@@ -123,7 +123,7 @@ export default {
const
questionType
=
{
1
:
'单选题'
,
2
:
'多选题'
,
3
:
'
简
答题'
,
3
:
'
问
答题'
,
5
:
'案例题'
,
6
:
'判断题'
,
7
:
'实操题'
,
...
...
src/utils/axios.js
浏览文件 @
c8401632
...
...
@@ -49,7 +49,6 @@ httpRequest.interceptors.request.use(
httpRequest
.
interceptors
.
response
.
use
(
function
(
response
)
{
const
{
data
}
=
response
console
.
log
(
response
)
// 正常返回
if
(
data
.
code
===
0
||
data
.
type
===
'application/vnd.ms-excel'
)
{
return
data
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论