Commit c07399bf authored by 黄奎's avatar 黄奎

页面修改

parent efc6234b
......@@ -243,12 +243,24 @@ export function saveBatchQuestionLevel(data) {
}
/**
* 根据题库编号获取题库题型分类列表【试卷组卷使用】
* 根据题库编号获取题库题型列表(单选题、多选题、等)【试卷组卷使用】
* @param {*} data
*/
export function queryQuestionCategoryList(data) {
export function queryQuestionTypeStaticList(data) {
return request({
url: '/Question/GetQuestionCategoryList',
url: '/Question/GetQuestionTypeStaticList',
method: 'post',
data
})
}
/**
* 根据题库编号获取题库题型分类列表(读音选择题、汉字选择题等)【试卷组卷使用】
* @param {*} data
*/
export function queryQuestionCategoryStaticList(data) {
return request({
url: '/Question/GetQuestionCategoryStaticList',
method: 'post',
data
})
......
......@@ -314,9 +314,9 @@
methods: {
//是否可修改
isEdit(item) {
// if (this.currentUserInfo.Id == 1) {
// return true;
// }
if (this.currentUserInfo.Id == 1) {
return true;
}
return this.currentUserInfo.Id == item.CreateBy &&
(item.ExamineStatus == 0 || item.ExamineStatus == 3 || item.ExamineStatus == 4)
},
......
......@@ -20,7 +20,8 @@
</template>
<template v-slot:body-cell-optioned="props">
<q-td :props="props">
<q-btn flat size="xs" v-if="props.row.IsEdit==1" color="accent" style="font-weight: 400" label="修改" @click="publishExam(props.row)" />
<!--v-if="props.row.IsEdit==1"-->
<q-btn flat size="xs" color="accent" style="font-weight: 400" label="修改" @click="publishExam(props.row)" />
<q-btn-dropdown flat size="xs" color="dark" label="更多" style="margin-left: 10px">
<q-list>
<q-item clickable v-close-popup @click="submitExamAudit(props.row)"
......
This diff is collapsed.
......@@ -280,6 +280,11 @@
<q-radio v-model="DataObj.IsOpen" :val="1" label="私有" />
<q-radio v-model="DataObj.IsOpen" :val="2" label="公开" />
</div>
<div style="margin:8px 0 0 20px">
组卷类型:
<q-radio v-model="DataObj.GroupType" :val="1" label="问题类型" />
<q-radio v-model="DataObj.GroupType" :val="2" label="题目大类" />
</div>
</div>
<div style="width:20%;text-align:right;">
<q-btn color="accent" size="sm" class="q-mr-md" label="预览" style="display:none;" />
......@@ -292,6 +297,16 @@
<p class="Left-ptitel">
<span>题量:<i>{{examNum}}</i></span>
<span>  总分:<i>{{examScore.toFixed(2)}}</i></span>
<q-btn-dropdown color="primary" label="添加分类">
<q-list>
<q-item clickable v-close-popup @click="onCategoryItemClick(item)"
v-for="(item,index) in newQuestionCategoryList" :key="index">
<q-item-section>
<q-item-label>{{item.Name}}</q-item-label>
</q-item-section>
</q-item>
</q-list>
</q-btn-dropdown>
</p>
<div class="Left-list">
<template v-if="DataObj&&DataObj.GroupList&&DataObj.GroupList.length>0">
......@@ -299,9 +314,11 @@
<div class="List-bt">
<div class="paperEdit_Top">
<template v-if="!gItem.isShowEdit">
<div>{{gIndex+1}}</div>&nbsp;
<div class="paper_GroupName" :title="gItem.GroupName">{{gItem.GroupName}}</div>
<div>(共{{ gItem.DetailsList?gItem.DetailsList.length:0 }}题,{{gItem.GScore}}分)</div>
<div @click="GetGroupItem(gItem)">
<div>{{gIndex+1}}</div>&nbsp;
<div class="paper_GroupName" :title="gItem.GroupName">{{gItem.GroupName}}</div>
<div>(共{{ gItem.DetailsList?gItem.DetailsList.length:0 }}题,{{gItem.GScore}}分)</div>
</div>
</template>
<template v-else>
<el-input v-model="gItem.GroupName" size="small" maxlength="50"
......@@ -575,7 +592,9 @@
PaperType: 2, //试卷类型(1-文件夹,2-试卷)
ParentId: 0, //父节点编号,
GroupList: [], //试卷答题分类
IsOpen: 1 //(1-私有,2-开放)
IsOpen: 1, //(1-私有,2-开放)
GroupType: 1, //组卷类型
PaperScore:0,//试卷总分数
},
//点击问题对象
ChooseItem: null,
......@@ -594,6 +613,25 @@
ComCheckIndex: -1,
savePaperLoading: false,
isShowPoint: false, //选择知识点
clickGroupItem: null, //选择的分组
}
},
computed: {
//获取计算后的问题分类(读音选择题、汉字选择题等)
newQuestionCategoryList() {
let newArray = JSON.parse(JSON.stringify(this.questionCategoryList));
if (newArray && newArray.length > 0) {
if (this.DataObj.GroupList && this.DataObj.GroupList.length > 0) {
this.DataObj.GroupList.forEach(x => {
newArray.forEach((qItem, index) => {
if (x.QuestionTypeId == qItem.Id) {
newArray.splice(index, 1);
}
})
})
}
}
return newArray;
}
},
created() {
......@@ -619,6 +657,22 @@
}
},
methods: {
GetGroupItem(gItem) {
this.clickGroupItem = gItem;
},
//添加分类
onCategoryItemClick(qObj) {
this.DataObj.GroupList.push({
GId: 0, //大题分组编号
PaperId: 0, //试卷编号
GroupName: qObj.Name,
QuestionTypeId: qObj.Id,
QuestionTypeKey: "",
GSortNum: 0,
GScore: 0, //分数
DetailsList: [], //问题列表
});
},
//关闭知识点弹窗
closeQuestionPoint() {
this.isShowPoint = false;
......@@ -840,26 +894,42 @@
}
if (qArray && qArray.length > 0) {
qArray.forEach(qItem => {
if (!this.checkGroupExists(qItem.QuestionTypeId)) {
this.DataObj.GroupList.push({
GId: 0, //大题分组编号
PaperId: 0, //试卷编号
GroupName: qItem.GroupName,
QuestionTypeId: qItem.QuestionTypeId,
QuestionTypeKey: qItem.QuestionTypeKey,
GSortNum: 0,
GScore: 0, //分数
DetailsList: [], //问题列表
});
var gObj = {
GId: 0, //大题分组编号
PaperId: 0, //试卷编号
GroupName: qItem.GroupName,
QuestionTypeId: qItem.QuestionTypeId,
QuestionTypeKey: qItem.QuestionTypeKey,
GSortNum: 0,
GScore: 0, //分数
DetailsList: [], //问题列表
}
this.DataObj.GroupList.forEach((gItem, gIndex) => {
if (gItem.QuestionTypeId == qItem.QuestionTypeId) {
if (!gItem.DetailsList) {
gItem.DetailsList = [];
//题目类型
if (!this.checkGroupExists(qItem.QuestionTypeId) && this.DataObj.GroupType == 1) {
this.DataObj.GroupList.push(gObj);
}
if (this.DataObj.GroupType == 1) {
this.DataObj.GroupList.forEach((gItem, gIndex) => {
if (gItem.QuestionTypeId == qItem.QuestionTypeId) {
if (!gItem.DetailsList) {
gItem.DetailsList = [];
}
gItem.DetailsList.push(qItem);
}
gItem.DetailsList.push(qItem);
})
}
//题目分类
else if (this.DataObj.GroupType == 2) {
if (!this.clickGroupItem) {
this.$q.notify({
type: 'negative',
position: "top",
message: `请选择左侧分类!`
})
} else {
this.clickGroupItem.DetailsList.push(qItem);
}
})
}
})
}
}
......@@ -940,6 +1010,7 @@
this.DataObj.PaperType = tempData.PaperType;
this.DataObj.ParentId = tempData.ParentId;
this.DataObj.IsOpen = tempData.IsOpen;
this.DataObj.GroupType = tempData.GroupType;
if (tempData.GroupList && tempData.GroupList.length > 0) {
this.DataObj.GroupList = tempData.GroupList;
}
......@@ -1025,6 +1096,7 @@
//保存题目
SavePaper() {
if (this.validateType()) {
this.DataObj.PaperScore=this.examScore;
this.savePaperLoading = true;
savePaperInfo(this.DataObj).then(res => {
this.savePaperLoading = false;
......
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