Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
C
center-qa
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
EzijingWeb
center-qa
Commits
c97143ce
提交
c97143ce
authored
2月 28, 2022
作者:
matian
浏览文件
操作
浏览文件
下载
差异文件
Merge remote-tracking branch 'origin/master'
上级
4018d931
6387fbc7
隐藏空白字符变更
内嵌
并排
正在显示
6 个修改的文件
包含
66 行增加
和
33 行删除
+66
-33
AddChidren.vue
src/modules/question/components/AddChidren.vue
+9
-10
Detail.vue
src/modules/question/components/Detail.vue
+23
-8
QTypeSituation.vue
src/modules/question/components/QTypeSituation.vue
+28
-6
QuestionsChidren.vue
src/modules/question/components/QuestionsChidren.vue
+5
-5
Create.vue
src/modules/question/views/Create.vue
+0
-2
List.vue
src/modules/question/views/List.vue
+1
-2
没有找到文件。
src/modules/question/components/AddChidren.vue
浏览文件 @
c97143ce
...
...
@@ -27,10 +27,10 @@
<
template
v-else
>
<div
class=
"radio-box"
>
<div
class=
"tips-tit"
>
请选择子题目类型:
</div>
<el-radio
v-model=
"type"
label=
"1"
>
单选题
</el-radio>
<el-radio
v-model=
"type"
label=
"2"
>
多选题
</el-radio>
<el-radio
v-model=
"type"
label=
"6"
>
判断题
</el-radio>
<el-radio
v-model=
"type"
label=
"3"
>
简答题
</el-radio>
<el-radio
v-model=
"type"
:label=
'1'
>
单选题
</el-radio>
<el-radio
v-model=
"type"
:label=
'2'
>
多选题
</el-radio>
<el-radio
v-model=
"type"
:label=
'6'
>
判断题
</el-radio>
<el-radio
v-model=
"type"
:label=
'3'
>
简答题
</el-radio>
</div>
<div
class=
"btn-box"
style=
"padding-top:50px;"
>
<el-button
type=
"primary"
@
click=
"addQuestionConfirm"
>
确定
</el-button>
...
...
@@ -60,7 +60,7 @@ export default {
filterInput
:
''
,
source
:
'1'
,
questionBank
:
'1'
,
type
:
'1'
,
type
:
1
,
visible
:
false
,
treeList
:
[],
defaultProps
:
''
,
...
...
@@ -172,12 +172,11 @@ export default {
handleSelectionChange
(
data
)
{
this
.
checkedList
=
data
.
reduce
((
a
,
b
)
=>
{
const
data
=
{}
console
.
log
(
typeof
b
.
child_question_type
)
data
.
question_title
=
b
.
question_title
data
.
child_question_type
=
b
.
child_question_type
||
'1'
data
.
child_question_type
=
b
.
child_question_type
||
1
data
.
question_content
=
b
.
question_content
data
.
question_analysis
=
b
.
question_analysis
if
(
this
.
type
!==
'3'
)
data
.
question_options
=
b
.
question_options
if
(
this
.
type
!==
3
)
data
.
question_options
=
b
.
question_options
a
.
push
(
data
)
return
a
},
[])
...
...
@@ -193,8 +192,8 @@ export default {
question_analysis
:
''
}
let
options
=
[]
if
(
this
.
type
!==
'3'
)
{
if
(
this
.
type
===
'1'
||
this
.
type
===
'2'
)
{
if
(
this
.
type
!==
3
)
{
if
(
this
.
type
===
1
||
this
.
type
===
2
)
{
options
=
[
{
option
:
''
,
checked
:
true
},
{
option
:
''
,
checked
:
false
},
...
...
src/modules/question/components/Detail.vue
浏览文件 @
c97143ce
<
template
>
<div>
<!--
<el-form
:model=
"ruleForm"
:rules=
"rules"
ref=
"ruleForm"
label-width=
"100px"
class=
"demo-ruleForm"
>
-->
<el-form
:
model=
"ruleForm"
:rules=
"rules"
ref=
"ruleForm"
label-width=
"100px"
class=
"demo-ruleForm"
>
<el-form
:
disabled=
"!!($route.query.type === 'view')"
:model=
"ruleForm"
:rules=
"rules"
ref=
"ruleForm"
label-width=
"100px"
class=
"demo-ruleForm"
>
<el-form-item
label=
"题库范围"
prop=
"permission"
>
<el-radio
v-model=
"ruleForm.permission"
label=
"1"
>
我的题库
</el-radio>
<el-radio
v-model=
"ruleForm.permission"
label=
"2"
>
公共题库
</el-radio>
...
...
@@ -22,7 +22,7 @@
<el-input
v-model=
"ruleForm.question_title"
></el-input>
</el-form-item>
<el-form-item
label=
"题干内容"
prop=
"question_content"
required
>
<v-editor
v-model=
"ruleForm.question_content"
></v-editor>
<v-editor
:disabled=
"!!($route.query.type === 'view')"
v-model=
"ruleForm.question_content"
></v-editor>
</el-form-item>
<el-form-item
label=
"选项"
prop=
"question_options"
v-if=
"ruleForm.question_type != 3"
>
<!-- 单选题 -->
...
...
@@ -36,7 +36,7 @@
<el-input
v-model=
"ruleForm.question_tag"
></el-input>
</el-form-item>
<el-form-item
label=
"题目解析"
prop=
"question_analysis"
>
<v-editor
v-model=
"ruleForm.question_analysis"
></v-editor>
<v-editor
:disabled=
"!!($route.query.type === 'view')"
v-model=
"ruleForm.question_analysis"
></v-editor>
</el-form-item>
<el-form-item
label=
"试题分类"
prop=
"question_category"
>
<div
class=
"filter-input"
>
...
...
@@ -112,7 +112,11 @@ export default {
question_difficulty
:
''
,
question_title
:
''
,
question_content
:
''
,
question_options
:
[],
question_options
:
[
{
option
:
''
,
checked
:
true
},
{
option
:
''
,
checked
:
false
},
{
option
:
''
,
checked
:
false
}
],
question_analysis
:
''
,
question_category
:
''
,
knowledge_point
:
''
,
...
...
@@ -139,24 +143,35 @@ export default {
}
}
},
moun
ted
()
{
crea
ted
()
{
if
(
this
.
detailData
)
{
this
.
ruleForm
=
this
.
detailData
this
.
treeValue
.
name
=
this
.
detailData
.
question_category
.
category_name
this
.
treeValue
.
id
=
this
.
detailData
.
question_category
.
id
this
.
ruleForm
.
question_category
=
this
.
detailData
.
question_category
.
id
this
.
pointOptions
.
push
(
this
.
detailData
.
knowledge_point
)
this
.
ruleForm
.
knowledge_point
=
this
.
detailData
.
knowledge_point
.
id
}
},
mounted
()
{
this
.
getTreeList
()
},
computed
:
{
activeProject
()
{
return
this
.
$store
.
state
.
activeProject
||
{}
}
},
methods
:
{
submitForm
(
formName
)
{
if
(
parseInt
(
this
.
ruleForm
.
question_type
)
!==
3
)
{
console
.
log
(
this
.
$refs
.
options
.
datas
,
'123'
)
const
isValue
=
this
.
$refs
.
options
.
datas
.
find
(
item
=>
item
.
option
===
''
)
if
(
!
isValue
)
this
.
ruleForm
.
question_options
=
this
.
$refs
.
options
.
datas
}
this
.
$refs
[
formName
].
validate
(
valid
=>
{
if
(
valid
)
{
// console.log(JSON.stringify(this.ruleForm))
if
(
this
.
$route
r
.
query
.
id
)
{
updateQuestion
(
this
.
ruleForm
).
then
(
res
=>
{
if
(
this
.
$route
.
query
.
id
)
{
updateQuestion
(
this
.
$route
.
query
.
id
,
this
.
ruleForm
).
then
(
res
=>
{
this
.
$router
.
push
({
path
:
'/question/list'
})
...
...
src/modules/question/components/QTypeSituation.vue
浏览文件 @
c97143ce
...
...
@@ -79,13 +79,16 @@
import
QuestionsChidren
from
'./QuestionsChidren.vue'
import
VEditor
from
'@/components/tinymce/Index.vue'
import
AddChidren
from
'./AddChidren.vue'
import
{
getQuestionCategory
,
searchTag
,
addQuestion
}
from
'../api'
import
{
getQuestionCategory
,
searchTag
,
addQuestion
,
updateQuestion
}
from
'../api'
export
default
{
components
:
{
AddChidren
,
VEditor
,
QuestionsChidren
},
props
:
{
questionTypeNumber
:
{
type
:
Number
,
default
:
1
},
detailData
:
{
type
:
Object
}
},
data
()
{
...
...
@@ -131,6 +134,18 @@ export default {
]
}
},
created
()
{
if
(
this
.
detailData
)
{
this
.
ruleForm
=
this
.
detailData
this
.
treeValue
.
name
=
this
.
detailData
.
question_category
.
category_name
this
.
treeValue
.
id
=
this
.
detailData
.
question_category
.
id
this
.
ruleForm
.
question_category
=
this
.
detailData
.
question_category
.
id
this
.
pointOptions
.
push
(
this
.
detailData
.
knowledge_point
)
this
.
ruleForm
.
knowledge_point
=
this
.
detailData
.
knowledge_point
.
id
this
.
chidrenList
=
this
.
ruleForm
.
children
console
.
log
(
this
.
ruleForm
,
'123'
)
}
},
mounted
()
{
this
.
ruleForm
.
question_type
=
this
.
questionTypeNumber
this
.
getTreeList
()
...
...
@@ -141,12 +156,19 @@ export default {
},
submitForm
(
formName
)
{
this
.
ruleForm
.
children
=
this
.
chidrenList
addQuestion
(
this
.
ruleForm
).
then
(
res
=>
{
// 11
this
.
$router
.
push
({
path
:
'/question/list'
if
(
this
.
$route
.
query
.
id
)
{
updateQuestion
(
this
.
$route
.
query
.
id
,
this
.
ruleForm
).
then
(
res
=>
{
this
.
$router
.
push
({
path
:
'/question/list'
})
})
})
}
else
{
addQuestion
(
this
.
ruleForm
).
then
(
res
=>
{
this
.
$router
.
push
({
path
:
'/question/list'
})
})
}
},
resetForm
(
formName
)
{
this
.
$refs
[
formName
].
validate
(
valid
=>
{
...
...
src/modules/question/components/QuestionsChidren.vue
浏览文件 @
c97143ce
...
...
@@ -9,10 +9,10 @@
</el-form-item>
<el-form-item
label=
"子题目类型"
prop=
"child_question_type"
>
<el-select
v-model=
"ruleForm.child_question_type"
disabled
placeholder=
"请选择活动区域"
>
<el-option
label=
"单选题"
value=
"1"
></el-option>
<el-option
label=
"多选题"
value=
"2"
></el-option>
<el-option
label=
"判断题"
value=
"6"
></el-option>
<el-option
label=
"问答题"
value=
"3"
></el-option>
<el-option
label=
"单选题"
:value=
'1'
></el-option>
<el-option
label=
"多选题"
:value=
'2'
></el-option>
<el-option
label=
"判断题"
:value=
'6'
></el-option>
<el-option
label=
"问答题"
:value=
'3'
></el-option>
</el-select>
</el-form-item>
<el-form-item
label=
"子题目标题"
prop=
"question_title"
>
...
...
@@ -71,7 +71,7 @@ export default {
},
mounted
()
{
this
.
dataList
=
this
.
chidrenList
console
.
log
(
this
.
chidrenList
)
console
.
log
(
this
.
chidrenList
,
'chi'
)
},
methods
:
{
removeChidren
(
n
)
{
...
...
src/modules/question/views/Create.vue
浏览文件 @
c97143ce
...
...
@@ -33,9 +33,7 @@ export default {
this
.
questionTypeNum
=
res
.
data
.
question_type
res
.
data
.
permission
=
res
.
data
.
permission
.
toString
()
res
.
data
.
question_difficulty
=
res
.
data
.
question_difficulty
.
toString
()
res
.
data
.
question_category
=
res
.
data
.
question_category
.
category_name
this
.
detailData
=
res
.
data
console
.
log
(
this
.
detailData
)
})
}
},
...
...
src/modules/question/views/List.vue
浏览文件 @
c97143ce
...
...
@@ -215,10 +215,9 @@ export default {
},
// 查看
handleView
(
row
)
{
this
.
$router
.
push
({
name
:
'appView'
,
params
:
{
id
:
row
.
id
},
query
:
{
appid
:
row
.
id
}
})
this
.
$router
.
push
({
path
:
'/question/create'
,
query
:
{
id
:
row
.
id
,
type
:
'view'
}
})
},
handleSettings
(
row
)
{
// tan ~~~~~
this
.
$router
.
push
({
path
:
'/question/create'
,
query
:
{
id
:
row
.
id
,
type
:
'edit'
}
})
},
handleNodeClick
(
data
)
{
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论