Commit 587d3386 authored by 黄奎's avatar 黄奎

页面修改

parent 04aec0d4
...@@ -273,7 +273,11 @@ ...@@ -273,7 +273,11 @@
default: null default: null
}, },
CourseId: { CourseId: {
type: String, type: String,//课程编号
default: "0",
},
BankId: {
type: String,//题库编号
default: "0", default: "0",
} }
}, },
...@@ -287,6 +291,7 @@ ...@@ -287,6 +291,7 @@
objOption: { objOption: {
QuestionId: 0, //问题编号 QuestionId: 0, //问题编号
CourseId: 0, //课程编号 CourseId: 0, //课程编号
BankId:0,//题库编号
Title: "", //问题名称 Title: "", //问题名称
DifficultyType: 1, //难易程度 DifficultyType: 1, //难易程度
AnswerParse: "", //答案解析JSON AnswerParse: "", //答案解析JSON
...@@ -402,6 +407,7 @@ ...@@ -402,6 +407,7 @@
//初始化表单 //初始化表单
initObj() { initObj() {
this.objOption.CourseId = this.CourseId; this.objOption.CourseId = this.CourseId;
this.objOption.BankId=this.BankId;
if (this.setingObj && this.setingObj.QuestionId > 0) { if (this.setingObj && this.setingObj.QuestionId > 0) {
queryQuestionInfo({ queryQuestionInfo({
QuestionId: this.setingObj.QuestionId QuestionId: this.setingObj.QuestionId
......
...@@ -55,12 +55,12 @@ ...@@ -55,12 +55,12 @@
<template <template
v-if=" subItem.QuestionKey=='single'||subItem.QuestionKey=='multiple'|| subItem.QuestionKey=='single-number'" v-if=" subItem.QuestionKey=='single'||subItem.QuestionKey=='multiple'|| subItem.QuestionKey=='single-number'"
v-for="childItem in subItem.SubAnwser"> v-for="childItem in subItem.SubAnwser">
<template v-if="childItem.Content.indexOf('<img')>0"> <template v-if="childItem.Content.indexOf('<img')>0">
<span>{{childItem.Name}}.<b v-html="childItem.Content"></b></span> <span>{{childItem.Name}}.<b v-html="childItem.Content"></b></span>
</template> </template>
<template v-else> <template v-else>
<span> {{childItem.Name}}. {{childItem.Content}}</span> <span> {{childItem.Name}}. {{childItem.Content}}</span>
</template> </template>
<br /> <br />
</template> </template>
</span> </span>
...@@ -142,7 +142,11 @@ ...@@ -142,7 +142,11 @@
default: 0 //1-模板导入(Excel),2-智能导入(Word) default: 0 //1-模板导入(Excel),2-智能导入(Word)
}, },
CourseId: { CourseId: {
type: String, type: String, //课程编号
default: "0",
},
BankId: {
type: String, //题库编号
default: "0", default: "0",
} }
}, },
...@@ -233,6 +237,7 @@ ...@@ -233,6 +237,7 @@
var fileParams = { var fileParams = {
Analysis: 1, Analysis: 1,
CourseId: this.CourseId, CourseId: this.CourseId,
BankId:this.BankId,
Uid: this.getLocalStorage().Id Uid: this.getLocalStorage().Id
} }
if (this.importType == 2) { if (this.importType == 2) {
...@@ -255,7 +260,8 @@ ...@@ -255,7 +260,8 @@
setQuestion() { setQuestion() {
if (this.questionData && this.questionData.length > 0) { if (this.questionData && this.questionData.length > 0) {
this.questionData.forEach(item => { this.questionData.forEach(item => {
item.CourseId = this.CourseId item.CourseId = this.CourseId;
item.BankId=this.BankId;
}) })
this.saveCourseLoading = true; this.saveCourseLoading = true;
saveQuestionBeatch(this.questionData).then(res => { saveQuestionBeatch(this.questionData).then(res => {
......
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
<q-input @change="research" clearable standout="bg-primary text-white" v-model="msg.Title" label="关键字" <q-input @change="research" clearable standout="bg-primary text-white" v-model="msg.Title" label="关键字"
@clear="research" maxlength="20" /> @clear="research" maxlength="20" />
</div> </div>
<div class="col-3"> <div class="col-3">
<q-select @input="research" standout="bg-primary text-white" option-value="Id" option-label="Name" <q-select @input="research" standout="bg-primary text-white" option-value="Id" option-label="Name"
v-model="msg.QCategoryId" :options="questionCategoryList" emit-value map-options label="分类" multiple v-model="msg.QCategoryId" :options="questionCategoryList" emit-value map-options label="分类" multiple
clearable /> clearable />
...@@ -82,19 +82,19 @@ ...@@ -82,19 +82,19 @@
@click="EditQuestion(props.row)" /> @click="EditQuestion(props.row)" />
<q-btn flat size="xs" icon="edit" color="negative" style="font-weight:400" label="删除" <q-btn flat size="xs" icon="edit" color="negative" style="font-weight:400" label="删除"
@click="setQuestionStatus(props.row)"></q-btn> @click="setQuestionStatus(props.row)"></q-btn>
<q-btn flat size="xs" icon="iconfont icon-shangyi2" v-if="props.row.isShowFirst" color="accent" title="上移" style="font-weight:400;" label="" <q-btn flat size="xs" icon="iconfont icon-shangyi2" v-if="props.row.isShowFirst" color="accent" title="上移"
@click="getUpStatus(props.row,1)"></q-btn> style="font-weight:400;" label="" @click="getUpStatus(props.row,1)"></q-btn>
<q-btn flat size="xs" icon="iconfont icon-xiayi" v-if="props.row.isShowLast" color="accent" title="下移" style="font-weight:400;" label="" <q-btn flat size="xs" icon="iconfont icon-xiayi" v-if="props.row.isShowLast" color="accent" title="下移"
@click="getUpStatus(props.row,2)"></q-btn> style="font-weight:400;" label="" @click="getUpStatus(props.row,2)"></q-btn>
<q-btn flat size="xs" icon="iconfont icon-fuzhi" color="accent" style="font-weight:400;" label="" <q-btn flat size="xs" icon="iconfont icon-fuzhi" color="accent" style="font-weight:400;" label=""
@click="getCopyItem(props.row)"></q-btn> @click="getCopyItem(props.row)"></q-btn>
</q-td> </q-td>
</template> </template>
</q-table> </q-table>
<question-form v-if="isShowQuestionForm" :CourseId="msg.CourseId" :seting-obj="questionObj" @close="closeQuestion" <question-form v-if="isShowQuestionForm" :CourseId="msg.CourseId" :BankId="msg.BankId" :seting-obj="questionObj"
@success="refreshQuestion"> @close="closeQuestion" @success="refreshQuestion">
</question-form> </question-form>
<question-upload v-if="isShowImportUpload" :CourseId="msg.CourseId" :importType="importType" <question-upload v-if="isShowImportUpload" :CourseId="msg.CourseId" :BankId="msg.BankId" :importType="importType"
@close="closeQuestion" @success="refreshQuestion"> @close="closeQuestion" @success="refreshQuestion">
</question-upload> </question-upload>
</div> </div>
...@@ -107,11 +107,17 @@ ...@@ -107,11 +107,17 @@
deleteQuestion, deleteQuestion,
queryDifficultyType, queryDifficultyType,
queryQuestionCategory, queryQuestionCategory,
setQuestionSort setQuestionSort,
CopyQuestion
} from '../../api/question/question'; } from '../../api/question/question';
import questionForm from '../question/question-form'; import questionForm from '../question/question-form';
import questionUpload from '../question/question-upload'; import questionUpload from '../question/question-upload';
export default { export default {
props: {
queryMsg: {
type: Object,
}
},
meta: { meta: {
title: "题库列表" title: "题库列表"
}, },
...@@ -122,6 +128,12 @@ ...@@ -122,6 +128,12 @@
data() { data() {
return { return {
columns: [{ columns: [{
name: 'Number',
label: '编号',
field: 'Number',
align: 'left'
},
{
name: 'Title', name: 'Title',
label: '题目', label: '题目',
field: 'Title', field: 'Title',
...@@ -170,11 +182,12 @@ ...@@ -170,11 +182,12 @@
pageSize: 12, pageSize: 12,
rowsPerPage: 12, rowsPerPage: 12,
CourseId: 0, CourseId: 0,
BankId: 0,
Title: "", Title: "",
PointName: "", //知识点 PointName: "", //知识点
QuestionTypeId: [], //题型 QuestionTypeId: [], //题型
DifficultyType: [], //难易程度 DifficultyType: [], //难易程度
QCategoryId:[],//分类 QCategoryId: [], //分类
}, },
pageCount: 0, pageCount: 0,
questionTypeList: [], //问题类型列表 questionTypeList: [], //问题类型列表
...@@ -187,8 +200,11 @@ ...@@ -187,8 +200,11 @@
} }
}, },
created() { created() {
if (this.$route.query) { if (this.queryMsg.BankId) {
this.msg.CourseId = this.$route.query.CourseId this.msg.BankId = this.queryMsg.BankId;
}
if (this.queryMsg.CourseId) {
this.msg.CourseId = this.queryMsg.CourseId;
} }
this.getQuestionType(); this.getQuestionType();
this.getDifficultyType(); this.getDifficultyType();
...@@ -282,16 +298,16 @@ ...@@ -282,16 +298,16 @@
this.loading = false; this.loading = false;
this.data = res.Data.PageData; this.data = res.Data.PageData;
this.pageCount = res.Data.PageCount; this.pageCount = res.Data.PageCount;
this.data.forEach((x,index)=>{ this.data.forEach((x, index) => {
if(index==0){ if (index == 0) {
x.isShowFirst=false x.isShowFirst = false
}else{ } else {
x.isShowFirst=true x.isShowFirst = true
} }
if(index==this.data.length-1){ if (index == this.data.length - 1) {
x.isShowLast=false x.isShowLast = false
}else{ } else {
x.isShowLast=true x.isShowLast = true
} }
}) })
}).catch(() => { }).catch(() => {
...@@ -321,24 +337,24 @@ ...@@ -321,24 +337,24 @@
this.importType = 0; this.importType = 0;
}, },
//上移 //上移
getUpStatus(item,num){ getUpStatus(item, num) {
var QuestionId = item.QuestionId; var QuestionId = item.QuestionId;
var index = -1; var index = -1;
for(var i=0;i<this.data.length;i++){ for (var i = 0; i < this.data.length; i++) {
if(this.data[i].QuestionId==QuestionId){ if (this.data[i].QuestionId == QuestionId) {
index=i; index = i;
break; break;
} }
} }
if(num==1){ //上移 if (num == 1) { //上移
var targetQId = this.data[index-1].QuestionId; var targetQId = this.data[index - 1].QuestionId;
} }
if(num==2){ //下移 if (num == 2) { //下移
var targetQId = this.data[index+1].QuestionId; var targetQId = this.data[index + 1].QuestionId;
} }
var msg = { var msg = {
curQId:QuestionId, curQId: QuestionId,
targetQId:targetQId targetQId: targetQId
} }
setQuestionSort(msg).then(res => { setQuestionSort(msg).then(res => {
if (res.Code == 1) { if (res.Code == 1) {
...@@ -347,8 +363,21 @@ ...@@ -347,8 +363,21 @@
}); });
}, },
//复制 //复制
getCopyItem(item){ getCopyItem(item) {
CopyQuestion({
QuestionId: item.QuestionId
}).then(res => {
if (res.Code == 1) {
this.$q.notify({
icon: 'iconfont icon-chenggong',
color: 'accent',
timeout: 2000,
message: '复制成功!',
position: 'top'
})
this.getQuestionList();
}
});
} }
} }
} }
......
<template> <template>
<div> <div>
<questionlist-form></questionlist-form> <questionlist-form :queryMsg="qMsg"></questionlist-form>
</div> </div>
</template> </template>
<script> <script>
import questionlistForm from '../../components/question/questionlist-form'; import questionlistForm from '../../components/question/questionlist-form';
export default { export default {
meta: { meta: {
title: "题库列表" title: "题库列表"
}, },
...@@ -14,14 +15,22 @@ ...@@ -14,14 +15,22 @@
}, },
data() { data() {
return { return {
qMsg: {
BankId: 0,
CourseId: 0
}
} }
}, },
created() { created() {
if (this.$route.query && this.$route.query.CourseId) {
this.qMsg.CourseId = this.$route.query.CourseId
}
if (this.$route.query && this.$route.query.BankId) {
this.qMsg.BankId = this.$route.query.BankId
}
}, },
mounted() { mounted() {},
}, methods: {}
methods: {
}
} }
</script> </script>
...@@ -451,6 +451,11 @@ const routes = [{ ...@@ -451,6 +451,11 @@ const routes = [{
component: () => component: () =>
import("pages/course/questionlist.vue") import("pages/course/questionlist.vue")
}, },
{
path: "/course/question", //题库列表
component: () =>
import("pages/course/question.vue")
},
{ {
path: "/course/courseinfo", path: "/course/courseinfo",
component: () => import("pages/course/courseinfo.vue"), component: () => import("pages/course/courseinfo.vue"),
...@@ -464,11 +469,6 @@ const routes = [{ ...@@ -464,11 +469,6 @@ const routes = [{
component: () => component: () =>
import("pages/course/chapter.vue") import("pages/course/chapter.vue")
}, },
{
path: "/course/question", //课程题库列表
component: () =>
import("pages/course/question.vue")
},
{ {
path: "/course/coursejob", //作业管理 path: "/course/coursejob", //作业管理
component: () => component: () =>
......
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