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

页面修改

parent d140b4a0
...@@ -108,7 +108,6 @@ ...@@ -108,7 +108,6 @@
<div class="text-h6">{{objOption.CourseId==0?'新增问题信息':'修改问题信息'}}</div> <div class="text-h6">{{objOption.CourseId==0?'新增问题信息':'修改问题信息'}}</div>
</q-card-section> </q-card-section>
<q-card-section class="q-pt-none scroll" style="max-height: 70vh"> <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="row wrap">
<div class="col-12" v-if="objOption.QuestionId==0" style="margin-bottom:20px"> <div class="col-12" v-if="objOption.QuestionId==0" style="margin-bottom:20px">
题型 题型
...@@ -159,12 +158,14 @@ ...@@ -159,12 +158,14 @@
:questionData="AnswerList" :setOption="objOption" @getChild="getChildData"> :questionData="AnswerList" :setOption="objOption" @getChild="getChildData">
</entry-problem> </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" <sorting-problem v-if="questionObj.Key=='sorting-problem'" :questionData="AnswerList" :setOption="objOption"
@getChild="getChildData"></sorting-problem> @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'" <reading-comprehensio v-if="questionObj.Key=='reading-comprehensio'||questionObj.Key=='listening'"
:questionData="AnswerList" :setOption="objOption" @getChild="getChildData"></reading-comprehensio> :questionData="AnswerList" :setOption="objOption" @getChild="getChildData"></reading-comprehensio>
...@@ -354,7 +355,9 @@ ...@@ -354,7 +355,9 @@
this.objOption.QuestionTypeKey = item.Key; this.objOption.QuestionTypeKey = item.Key;
var obj = CreateQuestion(item.Key); var obj = CreateQuestion(item.Key);
this.AnswerList = obj; this.AnswerList = obj;
if (obj) {
this.objOption.QuestionContent = JSON.stringify(obj); this.objOption.QuestionContent = JSON.stringify(obj);
}
}, },
//获取题型列表 //获取题型列表
getQuestionType() { getQuestionType() {
......
...@@ -97,8 +97,22 @@ ...@@ -97,8 +97,22 @@
Content: "", 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() { returnDataToParent() {
this.getAnswer();
this.$emit('getChild', this.data); this.$emit('getChild', this.data);
}, },
changeEdit(index) { changeEdit(index) {
......
...@@ -59,6 +59,7 @@ ...@@ -59,6 +59,7 @@
}) })
} }
item.IsAnswer = true; item.IsAnswer = true;
this.getAnswer();
}, },
//获取正确答案 //获取正确答案
getAnswer() { getAnswer() {
......
...@@ -119,6 +119,9 @@ ...@@ -119,6 +119,9 @@
questionData: { questionData: {
type: Array, type: Array,
}, },
setOption: {
type: Object,
}
}, },
components: { components: {
UeEditor UeEditor
...@@ -160,8 +163,25 @@ ...@@ -160,8 +163,25 @@
this.data[2].splice(subIndex, 1); this.data[2].splice(subIndex, 1);
} }
this.data[index].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(); this.calcOptionTitle();
}).onCancel(() => { }).onCancel(() => {
...@@ -197,8 +217,23 @@ ...@@ -197,8 +217,23 @@
}, },
//返回数据到父组件 //返回数据到父组件
returnDataToParent() { returnDataToParent() {
this.getAnswer();
this.$emit('getChild', this.data); 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) { changeEdit(index) {
this.commonIndex = index; this.commonIndex = index;
...@@ -209,8 +244,7 @@ ...@@ -209,8 +244,7 @@
this.commonIndex = -1; this.commonIndex = -1;
} }
}, },
mounted() { mounted() {},
},
watch: { watch: {
data: { data: {
handler(newValue) { handler(newValue) {
......
...@@ -2,9 +2,11 @@ ...@@ -2,9 +2,11 @@
.page-content p { .page-content p {
margin: 16px 0 0 0 !important; margin: 16px 0 0 0 !important;
} }
.quetion_Title span{
background: transparent!important; .quetion_Title span {
background: transparent !important;
} }
</style> </style>
<template> <template>
<div class="page-body"> <div class="page-body">
...@@ -105,6 +107,12 @@ ...@@ -105,6 +107,12 @@
field: 'Title', field: 'Title',
align: 'left' align: 'left'
}, },
{
name: 'CategoryName',
label: '大类',
field: 'CategoryName',
align: 'left',
},
{ {
name: 'QuestionTypeName', name: 'QuestionTypeName',
label: '题型', 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