Commit c3452f45 authored by 黄奎's avatar 黄奎

页面修改

parent 38d28fa4
...@@ -151,6 +151,12 @@ ...@@ -151,6 +151,12 @@
}, },
deep: true deep: true
}, },
questionData: {
handler(newValue) {
this.data = this.questionData;
},
deep: true
},
} }
}; };
......
...@@ -13,7 +13,6 @@ ...@@ -13,7 +13,6 @@
height: auto !important; height: auto !important;
overflow: hidden; overflow: hidden;
margin-top: 20px; margin-top: 20px;
/* min-width: 1280px; */
} }
.Exam-left { .Exam-left {
...@@ -305,12 +304,12 @@ ...@@ -305,12 +304,12 @@
</div> </div>
 <div>  <div>
<q-btn color="accent" size="sm" @click="isShowQuestion=true" class="q-mr-md" label="题库选题"  /> <q-btn color="accent" size="sm" @click="isShowQuestion=true" class="q-mr-md" label="题库选题"  />
 </div> </div>
</div> </div>
<div class="row wrap" v-if="ChooseItem" style="padding:20px;"> <div class="row wrap" v-if="ChooseItem" style="padding:20px;">
<div class="edit_stem"> <div class="edit_stem">
<q-input filled stack-label maxlength="5" :dense="false" @keyup.native="checkInteger(ChooseItem,'Score')" v-model="ChooseItem.Score" class="col-12 q-pb-lg" <q-input filled stack-label maxlength="5" :dense="false" @keyup.native="checkInteger(ChooseItem,'Score')"
label="分数" /> v-model="ChooseItem.Score" class="col-12 q-pb-lg" label="分数" />
</div> </div>
<div class="col-12"> <div class="col-12">
<template v-if="ChooseItem.QuestionTypeKey=='cloze'"> <template v-if="ChooseItem.QuestionTypeKey=='cloze'">
...@@ -457,14 +456,14 @@ ...@@ -457,14 +456,14 @@
}, },
deep: true deep: true
}, },
'ChooseItem.Score':{ 'ChooseItem.Score': {
handler(newValue) { handler(newValue) {
this.ChooseItem.Score = newValue; this.ChooseItem.Score = newValue;
this.calcPaper(); this.calcPaper();
}, },
deep: true deep: true
}, },
'ChooseItem.QuestionContentObj':{ 'ChooseItem.QuestionContentObj': {
handler(newValue) { handler(newValue) {
this.ChooseItem.QuestionContentObj = newValue; this.ChooseItem.QuestionContentObj = newValue;
}, },
...@@ -567,10 +566,10 @@ ...@@ -567,10 +566,10 @@
} }
}, },
//删除题目 //删除题目
delExam(gitem,item,index) { delExam(gitem, item, index) {
if(item.Id==0){ if (item.Id == 0) {
gitem.splice(index, 1); gitem.splice(index, 1);
}else{ } else {
this.$q.dialog({ this.$q.dialog({
title: '提示信息', title: '提示信息',
message: '是否确定删除', message: '是否确定删除',
...@@ -580,7 +579,7 @@ ...@@ -580,7 +579,7 @@
cancel: "取消", cancel: "取消",
}).onOk(() => { }).onOk(() => {
let msg = { let msg = {
Id:item.Id, Id: item.Id,
} }
DeletePaperDetails(msg).then(res => { DeletePaperDetails(msg).then(res => {
if (res.Code == 1) { if (res.Code == 1) {
...@@ -629,7 +628,6 @@ ...@@ -629,7 +628,6 @@
}, },
//题型点击【添加问题】 //题型点击【添加问题】
onItemClick(item, index) { onItemClick(item, index) {
console.log(item,'item');
var questionObj = this.getDetailsObj(); var questionObj = this.getDetailsObj();
questionObj.QuestionTypeId = item.QId; questionObj.QuestionTypeId = item.QId;
questionObj.QuestionTypeKey = item.Key; questionObj.QuestionTypeKey = item.Key;
...@@ -639,6 +637,7 @@ ...@@ -639,6 +637,7 @@
if (obj) { if (obj) {
questionObj.QuestionContent = JSON.stringify(obj); questionObj.QuestionContent = JSON.stringify(obj);
} }
console.log("onItemClick_questionObj", questionObj);
var tempArray = []; var tempArray = [];
tempArray.push(questionObj); tempArray.push(questionObj);
this.AddQuestion(tempArray); this.AddQuestion(tempArray);
...@@ -766,7 +765,7 @@ ...@@ -766,7 +765,7 @@
if (x.DetailsList && x.DetailsList.length > 0) { if (x.DetailsList && x.DetailsList.length > 0) {
this.examNum += x.DetailsList.length; this.examNum += x.DetailsList.length;
x.DetailsList.forEach(y => { x.DetailsList.forEach(y => {
if(y.Score){ if (y.Score) {
this.examScore += parseInt(y.Score); this.examScore += parseInt(y.Score);
} }
}) })
...@@ -776,18 +775,18 @@ ...@@ -776,18 +775,18 @@
}, },
//点击问题 //点击问题
ClickItem(questionItem, index, index2) { ClickItem(questionItem, index, index2) {
console.log("ClickItem",questionItem)
this.ChooseItem={};
this.ComOneIndex = index; this.ComOneIndex = index;
this.ComCheckIndex = index2; this.ComCheckIndex = index2;
this.ChooseItem = JSON.parse(JSON.stringify(questionItem)); this.ChooseItem = questionItem;
console.log(this.ChooseItem,'choose'); this.ChooseItem.QuestionContentObj=questionItem.QuestionContentObj;
        this.$refs.UE_Title.reloadNewValue(); this.$refs.UE_Title.reloadNewValue();
this.$forceUpdate(); this.$forceUpdate();
}, },
//保存题目 //保存题目
SavePaper() { SavePaper() {
console.log(this.DataObj,'data'); if (this.validateType()) {
// return
if(this.validateType()){
savePaperInfo(this.DataObj).then(res => { savePaperInfo(this.DataObj).then(res => {
if (res.Code == 1) { if (res.Code == 1) {
this.$q.notify({ this.$q.notify({
...@@ -814,12 +813,12 @@ ...@@ -814,12 +813,12 @@
//验证 //验证
validateType() { validateType() {
var result = true; var result = true;
for(let k=0;k<this.DataObj.GroupList.length;k++){ for (let k = 0; k < this.DataObj.GroupList.length; k++) {
//连线题 //连线题
if (this.DataObj.GroupList[k].QuestionTypeKey == 'matching') { if (this.DataObj.GroupList[k].QuestionTypeKey == 'matching') {
for(let j=0;j<this.DataObj.GroupList[k].DetailsList.length;j++){ for (let j = 0; j < this.DataObj.GroupList[k].DetailsList.length; j++) {
if(this.DataObj.GroupList[k].DetailsList[j].QuestionContentObj.length>0){ if (this.DataObj.GroupList[k].DetailsList[j].QuestionContentObj.length > 0) {
for(let p=0;p<this.DataObj.GroupList[k].DetailsList[j].QuestionContentObj[0].length;p++){ for (let p = 0; p < this.DataObj.GroupList[k].DetailsList[j].QuestionContentObj[0].length; p++) {
if (this.DataObj.GroupList[k].DetailsList[j].QuestionContentObj[0][p].Content == '') { if (this.DataObj.GroupList[k].DetailsList[j].QuestionContentObj[0][p].Content == '') {
this.$q.notify({ this.$q.notify({
type: 'negative', type: 'negative',
...@@ -834,10 +833,10 @@ ...@@ -834,10 +833,10 @@
} }
} }
//单选题 //单选题
if (this.DataObj.GroupList[k].QuestionTypeKey == 'single'){ if (this.DataObj.GroupList[k].QuestionTypeKey == 'single') {
var Num=0; var Num = 0;
for(let i=0;i<this.DataObj.GroupList[k].DetailsList.length;i++){ for (let i = 0; i < this.DataObj.GroupList[k].DetailsList.length; i++) {
if(this.DataObj.GroupList[k].DetailsList[i].Title==''){ if (this.DataObj.GroupList[k].DetailsList[i].Title == '') {
this.$q.notify({ this.$q.notify({
type: 'negative', type: 'negative',
position: "top", position: "top",
...@@ -846,8 +845,8 @@ ...@@ -846,8 +845,8 @@
result = false; result = false;
return; return;
} }
for(let j=0;j<this.DataObj.GroupList[k].DetailsList[i].QuestionContentObj.length;j++){ for (let j = 0; j < this.DataObj.GroupList[k].DetailsList[i].QuestionContentObj.length; j++) {
if(this.DataObj.GroupList[k].DetailsList[i].QuestionContentObj[j].Content==''){ if (this.DataObj.GroupList[k].DetailsList[i].QuestionContentObj[j].Content == '') {
this.$q.notify({ this.$q.notify({
type: 'negative', type: 'negative',
position: "top", position: "top",
...@@ -856,12 +855,12 @@ ...@@ -856,12 +855,12 @@
result = false; result = false;
return; return;
} }
if(this.DataObj.GroupList[k].DetailsList[i].QuestionContentObj[j].IsAnswer){ if (this.DataObj.GroupList[k].DetailsList[i].QuestionContentObj[j].IsAnswer) {
Num++ Num++
} }
} }
} }
if(Num==0){ if (Num == 0) {
this.$q.notify({ this.$q.notify({
type: 'negative', type: 'negative',
position: "top", position: "top",
...@@ -872,10 +871,8 @@ ...@@ -872,10 +871,8 @@
} }
} }
} }
return result; return result;
}, },
//js 判断重复 //js 判断重复
isRepeat(Arr, type) { isRepeat(Arr, type) {
var result = true; var result = true;
...@@ -915,7 +912,6 @@ ...@@ -915,7 +912,6 @@
} }
return result; return result;
}, },
closeQuestForm() { closeQuestForm() {
this.isShowQuestion = false; this.isShowQuestion = false;
}, },
...@@ -940,7 +936,6 @@ ...@@ -940,7 +936,6 @@
qObj.IsMutex = eItem.IsMutex; qObj.IsMutex = eItem.IsMutex;
qObj.Category = eItem.Category; qObj.Category = eItem.Category;
qObj.LevelType = eItem.LevelType; qObj.LevelType = eItem.LevelType;
qObj.Score = eItem.Score;
var tempType = this.allTypeList.find(x => x.QId == qObj.QuestionTypeId); var tempType = this.allTypeList.find(x => x.QId == qObj.QuestionTypeId);
if (tempType) { if (tempType) {
qObj.GroupName = tempType.Name; qObj.GroupName = tempType.Name;
...@@ -969,8 +964,8 @@ ...@@ -969,8 +964,8 @@
cancel: "取消", cancel: "取消",
}).onOk(() => { }).onOk(() => {
let msg = { let msg = {
GId:item.GId, GId: item.GId,
QuestionTypeId:item.QuestionTypeId QuestionTypeId: item.QuestionTypeId
} }
DeletePaperGroup(msg).then(res => { DeletePaperGroup(msg).then(res => {
if (res.Code == 1) { if (res.Code == 1) {
......
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