Commit 7aa337aa authored by 黄奎's avatar 黄奎

页面修改

parent d140b4a0
......@@ -108,7 +108,6 @@
<div class="text-h6">{{objOption.CourseId==0?'新增问题信息':'修改问题信息'}}</div>
</q-card-section>
<q-card-section class="q-pt-none scroll" style="max-height: 70vh">
<!-- <div class="text-caption q-mb-lg q-px-md text-grey-6">问题信息</div> -->
<div class="row wrap">
<div class="col-12" v-if="objOption.QuestionId==0" style="margin-bottom:20px">
题型
......@@ -159,12 +158,14 @@
:questionData="AnswerList" :setOption="objOption" @getChild="getChildData">
</entry-problem>
<!--连线题-->
<matching v-if="questionObj.Key=='matching'" :questionData="AnswerList" :setOption="objOption" @getChild="getChildData"></matching>
<matching v-if="questionObj.Key=='matching'" :questionData="AnswerList" :setOption="objOption"
@getChild="getChildData"></matching>
<!--排序题-->
<sorting-problem v-if="questionObj.Key=='sorting-problem'" :questionData="AnswerList" :setOption="objOption"
@getChild="getChildData"></sorting-problem>
<!--完型填空-->
<cloze v-if="questionObj.Key=='cloze'" :questionData="AnswerList" :setOption="objOption" @getChild="getChildData"></cloze>
<cloze v-if="questionObj.Key=='cloze'" :questionData="AnswerList" :setOption="objOption"
@getChild="getChildData"></cloze>
<!--阅读理解、听力题-->
<reading-comprehensio v-if="questionObj.Key=='reading-comprehensio'||questionObj.Key=='listening'"
:questionData="AnswerList" :setOption="objOption" @getChild="getChildData"></reading-comprehensio>
......@@ -354,7 +355,9 @@
this.objOption.QuestionTypeKey = item.Key;
var obj = CreateQuestion(item.Key);
this.AnswerList = obj;
this.objOption.QuestionContent = JSON.stringify(obj);
if (obj) {
this.objOption.QuestionContent = JSON.stringify(obj);
}
},
//获取题型列表
getQuestionType() {
......
......@@ -97,8 +97,22 @@
Content: "",
});
},
//获取答案
getAnswer() {
if (this.data && this.data.length > 0) {
var answer = "";
this.data.forEach(item => {
answer += "★" + item.Content;
})
if (answer != "") {
answer = answer.substring(1);
}
this.setOption.Answer = answer;
}
},
//返回数据到父组件
returnDataToParent() {
this.getAnswer();
this.$emit('getChild', this.data);
},
changeEdit(index) {
......
......@@ -59,6 +59,7 @@
})
}
item.IsAnswer = true;
this.getAnswer();
},
//获取正确答案
getAnswer() {
......
......@@ -119,6 +119,9 @@
questionData: {
type: Array,
},
setOption: {
type: Object,
}
},
components: {
UeEditor
......@@ -147,7 +150,7 @@
},
//删除选项
deleteOpion(index, subIndex) {
this.$q.dialog({
this.$q.dialog({
title: '提示信息',
message: '是否确定删除?',
cancel: true,
......@@ -160,8 +163,25 @@
this.data[2].splice(subIndex, 1);
}
this.data[index].splice(subIndex, 1);
this.commonIndex=-1;
this.commonIndex2=-1;
//删除的第二组
if (index == 1) {
var temp1 = this.data[1];
this.data[2].forEach(item => {
var isExists = false;
if (temp1 && temp1.length > 0) {
temp1.forEach(subItem => {
if (subItem.Name == item.Content) {
isExists = true;
}
})
}
if (!isExists) {
item.Content = "";
}
})
}
this.commonIndex = -1;
this.commonIndex2 = -1;
this.calcOptionTitle();
}).onCancel(() => {
......@@ -197,8 +217,23 @@
},
//返回数据到父组件
returnDataToParent() {
this.getAnswer();
this.$emit('getChild', this.data);
},
//获取正确答案
getAnswer() {
this.setOption.Answer = "";
if (this.data && this.data.length > 0) {
var answer = "";
this.data[2].forEach(item => {
answer += "," + item.Content;
})
if (answer != "") {
answer = answer.substring(1);
}
this.setOption.Answer = answer;
}
},
//点击切换输入
changeEdit(index) {
this.commonIndex = index;
......@@ -209,8 +244,7 @@
this.commonIndex = -1;
}
},
mounted() {
},
mounted() {},
watch: {
data: {
handler(newValue) {
......
......@@ -2,9 +2,11 @@
.page-content p {
margin: 16px 0 0 0 !important;
}
.quetion_Title span{
background: transparent!important;
.quetion_Title span {
background: transparent !important;
}
</style>
<template>
<div class="page-body">
......@@ -105,6 +107,12 @@
field: 'Title',
align: 'left'
},
{
name: 'CategoryName',
label: '大类',
field: 'CategoryName',
align: 'left',
},
{
name: 'QuestionTypeName',
label: '题型',
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment