Commit c3452f45 authored by 黄奎's avatar 黄奎

页面修改

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