Commit 391b7868 authored by zhengke's avatar zhengke

修改

parent 26b67eae
......@@ -266,4 +266,28 @@ export function queryExaminationTemplatePage(data) {
data
})
}
\ No newline at end of file
/**
* 删除分组及问题
* @param {*} data
*/
export function DeletePaperGroup(data) {
return request({
url: '/Exam/DeletePaperGroup',
method: 'post',
data
})
}
/**
* 删除问题
* @param {*} data
*/
export function DeletePaperDetails(data) {
return request({
url: '/Exam/DeletePaperDetails',
method: 'post',
data
})
}
......@@ -35,7 +35,6 @@
width: 61%;
min-height: 795px;
background: #fff;
padding: 0px 20px 0 0px;
border-radius: 3px;
overflow-y: auto;
border: 1px solid #d9d9d9;
......@@ -115,8 +114,9 @@
}
.List-bt {
width: 318px;
width: 326px;
height: 27px;
margin-left: 1px;
background: #fdfdfd;
font-size: 14px;
line-height: 27px;
......@@ -139,6 +139,11 @@
color: #333;
}
.checkUl {
background: #a6a6a6;
color: #333;
}
.List-ul li:hover .exam_ListSHow {
display: block;
}
......@@ -260,17 +265,18 @@
v-if="gIndex!=0"></i>
<i class="iconfont icon-xiayi" @click.stop="MoveFatherItem(gIndex,1)"
v-if="gIndex!=DataObj.GroupList.length-1"></i>
<i class="iconfont icon-shanchu2" style="margin-left:5px;" @click.stop="removeFather(gItem,gIndex)"></i>
</div>
<ul class="List-ul" v-if="gItem.DetailsList&&gItem.DetailsList.length>0">
<li class="" style="cursor:pointer;" v-for="(dItem,dIndex) in gItem.DetailsList" :key="dIndex"
@click="ClickItem(dItem)">
{{dIndex+1}}<span class="exam_DetailList" @click="ClickItem(dItem)" v-html="dItem.ShowTitle"></span>
<li class="" style="cursor:pointer;" :class="{'checkUl':dIndex==ComCheckIndex&&gIndex==ComOneIndex}"
v-for="(dItem,dIndex) in gItem.DetailsList" :key="dIndex" @click="ClickItem(dItem,gIndex,dIndex)">
{{dIndex+1}}<span class="exam_DetailList" v-html="dItem.ShowTitle"></span>
<span class="exam_ListSHow">
<i class="iconfont icon-shangyi2" @click.stop="MoveChildItem(gIndex,dIndex,0)"
style="margin-right:5px;" v-if="dIndex!=0"></i>
<i class="iconfont icon-xiayi" @click.stop="MoveChildItem(gIndex,dIndex,1)"
v-if="dIndex!=gItem.DetailsList.length-1"></i>
<i class="iconfont icon-shanchu2" @click.stop="delExam(gItem.DetailsList,dIndex)"
<i class="iconfont icon-shanchu2" @click.stop="delExam(gItem.DetailsList,dItem,dIndex)"
style="margin-left:5px;font-size:17px;"></i>
</span>
</li>
......@@ -420,7 +426,9 @@
queryQuestionTypeList,
queryDifficultyType,
queryQuestionCategory,
queryQuestionLevelType
queryQuestionLevelType,
DeletePaperGroup,
DeletePaperDetails
} from '../../api/question/question'
export default {
components: {
......@@ -442,6 +450,21 @@
meta: {
title: "考试"
},
watch: {
'ChooseItem.Title': {
handler(newValue) {
this.ChooseItem.ShowTitle = newValue;
},
immediate: true
},
'ChooseItem.Score':{
handler(newValue) {
this.ChooseItem.Score = newValue;
this.calcPaper();
},
immediate: true
}
},
data() {
return {
config: {
......@@ -475,7 +498,9 @@
isShowQuestion: false,
commonIndex: -1,
examNum: 0, //题量
examScore: 0 //总分
examScore: 0, //总分
ComOneIndex: -1,
ComCheckIndex: -1
}
},
created() {
......@@ -536,8 +561,31 @@
}
},
//删除题目
delExam(item, index) {
item.splice(index, 1);
delExam(gitem,item,index) {
if(item.Id==0){
gitem.splice(index, 1);
}else{
this.$q.dialog({
title: '提示信息',
message: '是否确定删除',
cancel: true,
persistent: true,
ok: "确定",
cancel: "取消",
}).onOk(() => {
let msg = {
Id:item.Id,
}
DeletePaperDetails(msg).then(res => {
if (res.Code == 1) {
this.GetPaperInfo();
}
})
}).onCancel(() => {
});
}
this.calcPaper();
},
//点击修改标题名字和分数
getNameEdit(item, index) {
......@@ -587,6 +635,7 @@
var tempArray = [];
tempArray.push(questionObj);
this.AddQuestion(tempArray);
this.calcPaper();
},
//添加问题
AddQuestion(qArray) {
......@@ -710,15 +759,18 @@
if (x.DetailsList && x.DetailsList.length > 0) {
this.examNum += x.DetailsList.length;
x.DetailsList.forEach(y => {
this.examScore += y.Score;
this.examScore += parseInt(y.Score);
})
}
})
}
},
//点击问题
ClickItem(questionItem) {
ClickItem(questionItem, index, index2) {
this.ComOneIndex = index;
this.ComCheckIndex = index2;
this.ChooseItem = questionItem;
this.$forceUpdate();
},
//保存题目
SavePaper() {
......@@ -780,6 +832,34 @@
});
}
this.AddQuestion(tempArray);
},
//删除分组及问题
removeFather(item, index) {
if (item.GId == 0) {
this.DataObj.GroupList.splice(index, 1);
} else {
this.$q.dialog({
title: '提示信息',
message: '是否确定删除',
cancel: true,
persistent: true,
ok: "确定",
cancel: "取消",
}).onOk(() => {
let msg = {
GId:item.GId,
QuestionTypeId:item.QuestionTypeId
}
DeletePaperGroup(msg).then(res => {
if (res.Code == 1) {
this.GetPaperInfo();
}
})
}).onCancel(() => {
});
}
this.calcPaper();
}
}
}
......
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