Commit 31e8dd5f authored by zhengke's avatar zhengke

修改

parent a4519573
...@@ -73,7 +73,7 @@ ...@@ -73,7 +73,7 @@
color: #6BA9FF; color: #6BA9FF;
} }
.InpDIV{ .InpDIV{
width: 765px; /* width: 765px; */
min-height: 38px; min-height: 38px;
border-radius: 4px; border-radius: 4px;
border: 1px solid #E1EAF4; border: 1px solid #E1EAF4;
......
...@@ -184,12 +184,10 @@ ...@@ -184,12 +184,10 @@
//关闭弹窗 //关闭弹窗
closeSaveForm() { closeSaveForm() {
this.$emit('close') this.$emit('close')
this.persistent = false;
}, },
//确认问题 //确认问题
sureQuestion() { sureQuestion() {
this.$emit('success', this.selectedQuestion) this.$emit('success', this.selectedQuestion)
this.persistent = false;
}, },
}, },
} }
......
...@@ -639,7 +639,6 @@ ...@@ -639,7 +639,6 @@
}, },
//添加问题 //添加问题
AddQuestion(qArray) { AddQuestion(qArray) {
console.log("qArray", qArray)
if (this.DataObj) { if (this.DataObj) {
if (!this.DataObj.GroupList) { if (!this.DataObj.GroupList) {
this.DataObj.GroupList = []; this.DataObj.GroupList = [];
...@@ -760,7 +759,9 @@ ...@@ -760,7 +759,9 @@
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 => {
this.examScore += parseInt(y.Score); if(y.Score){
this.examScore += parseInt(y.Score);
}
}) })
} }
}) })
...@@ -772,32 +773,106 @@ ...@@ -772,32 +773,106 @@
this.ComCheckIndex = index2; this.ComCheckIndex = index2;
this.ChooseItem = questionItem; this.ChooseItem = questionItem;
        this.$refs.UE_Title.reloadNewValue();         this.$refs.UE_Title.reloadNewValue();
console.log(this.ChooseItem,'choose')
this.$forceUpdate(); this.$forceUpdate();
}, },
//保存题目 //保存题目
SavePaper() { SavePaper() {
savePaperInfo(this.DataObj).then(res => { console.log(this.DataObj,'dataobj');
if (res.Code == 1) { console.log(this.validateType());
this.$q.notify({ return
icon: 'iconfont icon-chenggong', if(this.validateType()){
color: 'accent', savePaperInfo(this.DataObj).then(res => {
timeout: 2000, if (res.Code == 1) {
message: '操作成功!', this.$q.notify({
position: 'top' icon: 'iconfont icon-chenggong',
}) color: 'accent',
this.$router.push({ timeout: 2000,
path: '/exam/examManagement', message: '操作成功!',
query: {} position: 'top'
}); })
} else { this.$router.push({
this.$q.notify({ path: '/exam/examManagement',
type: 'negative', query: {}
position: "top", });
message: `操作失败!` } else {
}) this.$q.notify({
type: 'negative',
position: "top",
message: `操作失败!`
})
}
})
}
},
//验证
validateType() {
var result = true;
for(let k=0;k<this.DataObj.GroupList.length;k++){
//连线题
if (this.DataObj.GroupList[k].QuestionTypeKey == 'matching') {
for(let j=0;j<this.DataObj.GroupList[k].DetailsList.length;j++){
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++){
if (this.DataObj.GroupList[k].DetailsList[j].QuestionContentObj[0][p].Content == '') {
this.$q.notify({
type: 'negative',
position: "top",
message: `第一组第${p+1}行数据内容为空!`
})
result = false;
return;
}
}
}
}
} }
}) }
return result;
},
//js 判断重复
isRepeat(Arr, type) {
var result = true;
var msg = '';
switch (type) {
case 1:
msg = '第1组数据选项不能相同'
break;
case 2:
msg = '第2组数据选项不能相同'
break;
case 3:
msg = '选项内容不能相同'
break;
case 4:
msg = '题干内容不能相同!';
break;
default:
}
let num = 0;
for (var i = 0; i < Arr.length - 1; i++) {
for (var j = i + 1; j < Arr.length; j++) {
if (Arr[i].Content === Arr[j].Content) {
this.$q.notify({
type: 'negative',
position: "top",
message: msg
})
num++;
}
}
}
if (num > 0) {
result = false;
} else {
result = true;
}
return result;
}, },
closeQuestForm() { closeQuestForm() {
this.isShowQuestion = false; this.isShowQuestion = false;
}, },
...@@ -809,6 +884,7 @@ ...@@ -809,6 +884,7 @@
var qObj = this.getDetailsObj(); var qObj = this.getDetailsObj();
qObj.QuestionId = eItem.QuestionId; qObj.QuestionId = eItem.QuestionId;
qObj.Title = eItem.SourceTitle; qObj.Title = eItem.SourceTitle;
qObj.ShowTitle = eItem.SourceTitle;
qObj.QuestionContent = eItem.QuestionContent; qObj.QuestionContent = eItem.QuestionContent;
qObj.DifficultyType = eItem.DifficultyType; qObj.DifficultyType = eItem.DifficultyType;
qObj.AnswerParse = eItem.AnswerParse; qObj.AnswerParse = eItem.AnswerParse;
...@@ -834,6 +910,7 @@ ...@@ -834,6 +910,7 @@
}); });
} }
this.AddQuestion(tempArray); this.AddQuestion(tempArray);
this.isShowQuestion = false;
}, },
//删除分组及问题 //删除分组及问题
removeFather(item, index) { removeFather(item, index) {
......
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