Commit 391b7868 authored by zhengke's avatar zhengke

修改

parent 26b67eae
...@@ -266,4 +266,28 @@ export function queryExaminationTemplatePage(data) { ...@@ -266,4 +266,28 @@ export function queryExaminationTemplatePage(data) {
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 @@ ...@@ -35,7 +35,6 @@
width: 61%; width: 61%;
min-height: 795px; min-height: 795px;
background: #fff; background: #fff;
padding: 0px 20px 0 0px;
border-radius: 3px; border-radius: 3px;
overflow-y: auto; overflow-y: auto;
border: 1px solid #d9d9d9; border: 1px solid #d9d9d9;
...@@ -115,8 +114,9 @@ ...@@ -115,8 +114,9 @@
} }
.List-bt { .List-bt {
width: 318px; width: 326px;
height: 27px; height: 27px;
margin-left: 1px;
background: #fdfdfd; background: #fdfdfd;
font-size: 14px; font-size: 14px;
line-height: 27px; line-height: 27px;
...@@ -139,6 +139,11 @@ ...@@ -139,6 +139,11 @@
color: #333; color: #333;
} }
.checkUl {
background: #a6a6a6;
color: #333;
}
.List-ul li:hover .exam_ListSHow { .List-ul li:hover .exam_ListSHow {
display: block; display: block;
} }
...@@ -260,17 +265,18 @@ ...@@ -260,17 +265,18 @@
v-if="gIndex!=0"></i> v-if="gIndex!=0"></i>
<i class="iconfont icon-xiayi" @click.stop="MoveFatherItem(gIndex,1)" <i class="iconfont icon-xiayi" @click.stop="MoveFatherItem(gIndex,1)"
v-if="gIndex!=DataObj.GroupList.length-1"></i> v-if="gIndex!=DataObj.GroupList.length-1"></i>
<i class="iconfont icon-shanchu2" style="margin-left:5px;" @click.stop="removeFather(gItem,gIndex)"></i>
</div> </div>
<ul class="List-ul" v-if="gItem.DetailsList&&gItem.DetailsList.length>0"> <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" <li class="" style="cursor:pointer;" :class="{'checkUl':dIndex==ComCheckIndex&&gIndex==ComOneIndex}"
@click="ClickItem(dItem)"> v-for="(dItem,dIndex) in gItem.DetailsList" :key="dIndex" @click="ClickItem(dItem,gIndex,dIndex)">
{{dIndex+1}}<span class="exam_DetailList" @click="ClickItem(dItem)" v-html="dItem.ShowTitle"></span> {{dIndex+1}}<span class="exam_DetailList" v-html="dItem.ShowTitle"></span>
<span class="exam_ListSHow"> <span class="exam_ListSHow">
<i class="iconfont icon-shangyi2" @click.stop="MoveChildItem(gIndex,dIndex,0)" <i class="iconfont icon-shangyi2" @click.stop="MoveChildItem(gIndex,dIndex,0)"
style="margin-right:5px;" v-if="dIndex!=0"></i> style="margin-right:5px;" v-if="dIndex!=0"></i>
<i class="iconfont icon-xiayi" @click.stop="MoveChildItem(gIndex,dIndex,1)" <i class="iconfont icon-xiayi" @click.stop="MoveChildItem(gIndex,dIndex,1)"
v-if="dIndex!=gItem.DetailsList.length-1"></i> 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> style="margin-left:5px;font-size:17px;"></i>
</span> </span>
</li> </li>
...@@ -420,7 +426,9 @@ ...@@ -420,7 +426,9 @@
queryQuestionTypeList, queryQuestionTypeList,
queryDifficultyType, queryDifficultyType,
queryQuestionCategory, queryQuestionCategory,
queryQuestionLevelType queryQuestionLevelType,
DeletePaperGroup,
DeletePaperDetails
} from '../../api/question/question' } from '../../api/question/question'
export default { export default {
components: { components: {
...@@ -442,6 +450,21 @@ ...@@ -442,6 +450,21 @@
meta: { meta: {
title: "考试" 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() { data() {
return { return {
config: { config: {
...@@ -475,7 +498,9 @@ ...@@ -475,7 +498,9 @@
isShowQuestion: false, isShowQuestion: false,
commonIndex: -1, commonIndex: -1,
examNum: 0, //题量 examNum: 0, //题量
examScore: 0 //总分 examScore: 0, //总分
ComOneIndex: -1,
ComCheckIndex: -1
} }
}, },
created() { created() {
...@@ -536,8 +561,31 @@ ...@@ -536,8 +561,31 @@
} }
}, },
//删除题目 //删除题目
delExam(item, index) { delExam(gitem,item,index) {
item.splice(index, 1); 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) { getNameEdit(item, index) {
...@@ -587,6 +635,7 @@ ...@@ -587,6 +635,7 @@
var tempArray = []; var tempArray = [];
tempArray.push(questionObj); tempArray.push(questionObj);
this.AddQuestion(tempArray); this.AddQuestion(tempArray);
this.calcPaper();
}, },
//添加问题 //添加问题
AddQuestion(qArray) { AddQuestion(qArray) {
...@@ -710,15 +759,18 @@ ...@@ -710,15 +759,18 @@
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 += y.Score; this.examScore += parseInt(y.Score);
}) })
} }
}) })
} }
}, },
//点击问题 //点击问题
ClickItem(questionItem) { ClickItem(questionItem, index, index2) {
this.ComOneIndex = index;
this.ComCheckIndex = index2;
this.ChooseItem = questionItem; this.ChooseItem = questionItem;
this.$forceUpdate();
}, },
//保存题目 //保存题目
SavePaper() { SavePaper() {
...@@ -780,6 +832,34 @@ ...@@ -780,6 +832,34 @@
}); });
} }
this.AddQuestion(tempArray); 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