Commit c07399bf authored by 黄奎's avatar 黄奎

页面修改

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