Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
C
center-qa
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
EzijingWeb
center-qa
Commits
2e2e967a
提交
2e2e967a
authored
3月 01, 2022
作者:
lihuihui
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
修改选项
上级
2e3003dc
隐藏空白字符变更
内嵌
并排
正在显示
4 个修改的文件
包含
27 行增加
和
50 行删除
+27
-50
Detail.vue
src/modules/question/components/Detail.vue
+14
-7
QTypeCheckbox.vue
src/modules/question/components/QTypeCheckbox.vue
+5
-24
QTypeJudgment.vue
src/modules/question/components/QTypeJudgment.vue
+4
-17
QTypeRadio.vue
src/modules/question/components/QTypeRadio.vue
+4
-2
没有找到文件。
src/modules/question/components/Detail.vue
浏览文件 @
2e2e967a
...
...
@@ -26,11 +26,11 @@
</el-form-item>
<el-form-item
label=
"选项"
prop=
"question_options"
v-if=
"ruleForm.question_type != 3"
>
<!-- 单选题 -->
<radio
ref=
"options"
:option=
"ruleForm.question_options"
v-if=
"ruleForm.question_type == 1"
></radio>
<radio
:option=
"ruleForm.question_options"
v-if=
"ruleForm.question_type == 1"
></radio>
<!-- 多选题 -->
<checkbox
ref=
"options"
:option=
"ruleForm.question_options"
v-if=
"ruleForm.question_type == 2"
></checkbox>
<checkbox
:option=
"ruleForm.question_options"
v-if=
"ruleForm.question_type == 2"
></checkbox>
<!-- 判断题 -->
<judgment
ref=
"options"
:option=
"ruleForm.question_options"
v-if=
"ruleForm.question_type == 6"
></judgment>
<judgment
:option=
"ruleForm.question_options"
v-if=
"ruleForm.question_type == 6"
></judgment>
</el-form-item>
<el-form-item
label=
"标签"
prop=
"question_tag"
>
<el-input
v-model=
"ruleForm.question_tag"
></el-input>
...
...
@@ -163,10 +163,11 @@ export default {
},
methods
:
{
submitForm
(
formName
)
{
if
(
parseInt
(
this
.
ruleForm
.
question_type
)
!==
3
)
{
const
isValue
=
this
.
$refs
.
options
.
datas
.
find
(
item
=>
item
.
option
===
''
)
if
(
!
isValue
)
this
.
ruleForm
.
question_options
=
this
.
$refs
.
options
.
datas
}
// if (parseInt(this.ruleForm.question_type) !== 3) {
// const isValue = this.$refs.options.datas.find(item => item.option === '')
// if (!isValue) this.ruleForm.question_options = this.$refs.options.datas
// }
console
.
log
(
this
.
ruleForm
.
question_options
)
this
.
$refs
[
formName
].
validate
(
valid
=>
{
if
(
valid
)
{
// console.log(JSON.stringify(this.ruleForm))
...
...
@@ -244,6 +245,12 @@ export default {
})
},
questionTypeChange
()
{
if
(
parseInt
(
this
.
ruleForm
.
question_type
)
===
6
)
{
this
.
ruleForm
.
question_options
=
[
{
option
:
'正确'
,
checked
:
true
},
{
option
:
'错误'
,
checked
:
false
}
]
}
this
.
$emit
(
'questionType'
,
this
.
ruleForm
.
question_type
)
}
}
...
...
src/modules/question/components/QTypeCheckbox.vue
浏览文件 @
2e2e967a
...
...
@@ -6,8 +6,10 @@
<el-tag>
{{
A_Z
()[
index
]
}}
</el-tag>
<el-input
v-model=
"item.option"
maxlength=
"80"
show-word-limit
></el-input>
</el-checkbox>
<i
class=
"el-icon-remove-outline icon-style"
v-if=
"index != option.length - 1"
@
click=
"remove(index)"
></i>
<i
class=
"el-icon-circle-plus-outline icon-style"
v-else
@
click=
"add"
></i>
<template
v-if=
"!!!($route.query.type === 'view')"
>
<i
class=
"el-icon-remove-outline icon-style"
v-if=
"index != option.length - 1"
@
click=
"remove(index)"
></i>
<i
class=
"el-icon-circle-plus-outline icon-style"
v-else
@
click=
"add"
></i>
</
template
>
</div>
</template>
</div>
...
...
@@ -22,35 +24,14 @@ export default {
},
data
()
{
return
{
checkboxValue
:
[
0
],
datas
:
[
{
checked
:
true
,
option
:
''
},
{
checked
:
false
,
option
:
''
},
{
checked
:
false
,
option
:
''
},
{
checked
:
false
,
option
:
''
}
]
checkboxValue
:
[
0
]
}
},
mounted
()
{
// if (this.option) {
// this.datas = this.option
this
.
checkboxValue
=
[
0
]
this
.
option
.
forEach
((
item
,
index
)
=>
{
if
(
item
.
checked
)
this
.
checkboxValue
.
push
(
index
)
})
// }
},
methods
:
{
add
()
{
...
...
src/modules/question/components/QTypeJudgment.vue
浏览文件 @
2e2e967a
...
...
@@ -14,30 +14,17 @@ export default {
},
data
()
{
return
{
radio
:
0
,
datas
:
[
{
option
:
'正确'
,
checked
:
true
},
{
option
:
'错误'
,
checked
:
false
}
]
radio
:
0
}
},
mounted
()
{
if
(
this
.
option
)
{
this
.
datas
=
this
.
option
this
.
radio
=
this
.
datas
.
findIndex
(
item
=>
item
.
checked
)
}
this
.
radio
=
this
.
option
.
findIndex
(
item
=>
item
.
checked
)
},
methods
:
{
radioChange
()
{
this
.
datas
.
map
(
item
=>
{
this
.
option
.
map
(
item
=>
{
item
.
checked
=
false
this
.
datas
[
this
.
radio
].
checked
=
true
this
.
option
[
this
.
radio
].
checked
=
true
return
item
})
}
...
...
src/modules/question/components/QTypeRadio.vue
浏览文件 @
2e2e967a
...
...
@@ -6,8 +6,10 @@
<el-tag>
{{
A_Z
()[
index
]
}}
</el-tag>
<el-input
v-model=
"item.option"
maxlength=
"80"
show-word-limit
></el-input>
</el-radio>
<i
class=
"el-icon-remove-outline icon-style"
v-if=
"index != option.length - 1"
@
click=
"remove(index)"
></i>
<i
class=
"el-icon-circle-plus-outline icon-style"
v-else
@
click=
"add"
></i>
<template
v-if=
"!!!($route.query.type === 'view')"
>
<i
class=
"el-icon-remove-outline icon-style"
v-if=
"index != option.length - 1"
@
click=
"remove(index)"
></i>
<i
class=
"el-icon-circle-plus-outline icon-style"
v-else
@
click=
"add"
></i>
</
template
>
</div>
</template>
</div>
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论