Commit 96837427 authored by 黄奎's avatar 黄奎

页面修改

parent 7eaf3c3f
...@@ -172,7 +172,6 @@ ...@@ -172,7 +172,6 @@
getQuestionList() { getQuestionList() {
this.loading = true; this.loading = true;
queryQuestionPageList(this.msg).then(res => { queryQuestionPageList(this.msg).then(res => {
console.log(res,'res');
this.loading = false; this.loading = false;
this.dataList = res.Data.PageData; this.dataList = res.Data.PageData;
this.pageCount = res.Data.PageCount; this.pageCount = res.Data.PageCount;
......
<template>
<q-dialog v-model="persistent" content-class="bg-grey-1" persistent transition-show="scale" transition-hide="scale">
<q-card style="width: 850px;max-width:900px;">
<q-card-section>
<div class="text-h6">题库信息</div>
</q-card-section>
<q-card-section class="q-pt-none scroll" style="max-height: 70vh">
<div class="page-search row items-center">
<div class="col row wrap q-mr-lg q-col-gutter-md">
<div class="col-12">
<q-input @input="research" clearable standout="bg-primary text-white" v-model="msg.BankName" label="关键字"
@clear="research" maxlength="20" />
</div>
</div>
</div>
<div class="page-content">
<q-table :pagination="msg" :loading="loading" no-data-label="暂无相关数据" flat
class="sticky-column-table sticky-right-column-table" separator="none" :data="dataList" :columns="columns"
row-key="BankId" selection="multiple" :selected.sync="selectedQuestionBank">
<template v-slot:top="props">
<div class="col-2 q-table__title">题库列表</div>
<q-space />
</template>
<template v-slot:body-cell-Title="props">
<td style="width:400px;">
<div @click="goDetail(props.row)" v-html="props.row.Title" class="quetion_Title">
</div>
</td>
</template>
<template v-slot:bottom>
<q-pagination class="full-width justify-end" v-model="msg.pageIndex" color="primary" :max="pageCount"
:input="true" @input="changePage" />
</template>
</q-table>
</div>
</q-card-section>
<q-separator />
<q-card-actions align="right" class="bg-white">
<q-btn label="取消" flat color="grey-10" style="font-weight:400 !important" @click="closeSaveForm" />
<q-btn label="确认选择" color="accent q-px-md" style="font-weight:400 !important" @click="sureQuestionBank" />
</q-card-actions>
</q-card>
</q-dialog>
</template>
<script>
import {
queryQuestionBankPage,
} from '../../api/question/question';
export default {
data() {
return {
persistent: true,
msg: {
pageIndex: 1,
pageSize: 12,
rowsPerPage: 12,
BankName: ''
},
pageCount: 0, //总页数
loading: false, //表格加载进度条
columns: [{
name: 'RowNum',
label: '编号',
field: 'RowNum',
align: 'left'
},
{
name: 'BankNo',
label: '题库序号',
field: 'BankNo',
align: 'left',
},
{
name: 'BankName',
label: '题库名称',
field: 'BankName',
align: 'left',
},
{
name: 'CreateByName',
label: '创建人',
field: 'CreateByName',
align: 'left'
},
{
name: 'QuestionCount',
label: '题量',
field: 'QuestionCount',
align: 'left'
},
],
dataList: [], //数据列表
selectedQuestionBank: [], //选择的题库
}
},
mounted() {
this.getQuestionBankPage();
},
methods: {
//获取题库分页列表
getQuestionBankPage() {
queryQuestionBankPage(this.msg).then(res => {
if (res.Code == 1) {
this.dataList = res.Data.PageData;
this.pageCount = res.Data.PageCount;
}
})
},
//翻页
changePage(val) {
this.msg.pageIndex = val;
this.getQuestionBankPage()
},
research() {
this.msg.pageIndex = 1;
this.getQuestionBankPage();
},
//关闭弹窗
closeSaveForm() {
this.$emit('close')
this.persistent = false
},
//确认选择
sureQuestionBank() {
this.persistent = false;
var tempArray = [];
if (this.selectedQuestionBank && this.selectedQuestionBank.length > 0) {
this.selectedQuestionBank.forEach(item => {
tempArray.push({
BankId: item.BankId,
BankName: item.BankName,
})
})
}
this.$emit('success', tempArray);
},
},
}
</script>
<!--组卷-->
<style>
.examCreate {
margin-left: 100px;
}
</style>
<template>
<div class="examCreate">
<br />
组卷题库(*): {{ShowBankName}} <a style="cursor:pointer;color:blue" @click="showQuestionBank">选择题库</a> <br />
<q-btn color="accent" size="sm" @click="postMsg.GenerateType==1" class="q-mr-md" label="智能组卷"  />
<q-btn color="accent" size="sm" @click="postMsg.GenerateType==2,setExamPaper" class="q-mr-md" label="手动组卷"  /> <br /> <br />
<template v-if="postMsg.GenerateType==1">
</template>
<template v-if="postMsg.GenerateType==2">
</template>
<questionbankForm v-if="isShowQuestionBank"  @close="closeQuestionBankForm"  @success="getBankData">
</questionbankForm>
</div>
</template>
<script>
import questionbankForm from '../../components/exam/questionbank-form'
import {
queryQuestionTypeList,
queryDifficultyType,
queryQuestionCategory,
queryQuestionLevelType
} from '../../api/question/question'
import {
savePaperInfo,
} from '../../api/teacher/index';
export default {
components: {
questionbankForm
},
meta: {
title: "组卷"
},
data() {
return {
isShowQuestionBank: false, //是否显示题库列表
postMsg: {
PaperId: 0, //试卷编号
PaperName: "新建试卷", //试卷名称
QuestionBandIds: "", //题库编号【多个逗号分割】
DifficultyType: 1, //难易程度
GenerateType: 0, //组卷类型(1-智能组卷,2-手动组卷,3-智能导入)
},
ShowBankName: "", //显示题库名称
}
},
created() {
},
mounted() {
},
methods: {
//显示题库
showQuestionBank() {
this.isShowQuestionBank = true;
},
//关闭题库
closeQuestionBankForm() {
this.isShowQuestionBank = false;
},
//获取选择的题库
getBankData(bankArray) {
this.isShowQuestionBank = false;
var qBankIds = "";
var sBankName = "";
if (bankArray && bankArray.length > 0) {
bankArray.forEach(item => {
qBankIds += "," + item.BankId;
sBankName += "," + item.BankName;
});
}
if (qBankIds.substr(0, 1) == ',') {
qBankIds = qBankIds.substr(1);
}
if (sBankName.substr(0, 1) == ',') {
sBankName = sBankName.substr(1);
}
this.postMsg.QuestionBandIds = qBankIds;
this.ShowBankName = sBankName;
},
//保存试卷信息
setExamPaper() {
savePaperInfo(this.postMsg).then(res => {
});
}
}
}
</script>
...@@ -82,7 +82,7 @@ ...@@ -82,7 +82,7 @@
width: 328px; width: 328px;
} }
.List-ul li{ .List-ul li {
display: block; display: block;
padding-left: 25px; padding-left: 25px;
line-height: 33px; line-height: 33px;
...@@ -93,7 +93,7 @@ ...@@ -93,7 +93,7 @@
text-decoration: none; text-decoration: none;
min-width: 250px; min-width: 250px;
overflow: hidden; overflow: hidden;
padding-right:20px; padding-right: 20px;
white-space: nowrap; white-space: nowrap;
text-overflow: ellipsis text-overflow: ellipsis
} }
...@@ -119,6 +119,7 @@ ...@@ -119,6 +119,7 @@
justify-content: space-between; justify-content: space-between;
align-items: center; align-items: center;
} }
.List-bt { .List-bt {
width: 318px; width: 318px;
height: 27px; height: 27px;
...@@ -127,34 +128,40 @@ ...@@ -127,34 +128,40 @@
line-height: 27px; line-height: 27px;
padding-left: 10px; padding-left: 10px;
} }
.List-ul li:hover{
.List-ul li:hover {
background: #a6a6a6; background: #a6a6a6;
color: #333; color: #333;
} }
.left-btn-list{
padding:5px 10px; .left-btn-list {
padding: 5px 10px;
display: inline-block; display: inline-block;
color: #555; color: #555;
border-radius: 3px; border-radius: 3px;
font-size:14px; font-size: 14px;
border:1px solid #999; border: 1px solid #999;
margin-right:10px; margin-right: 10px;
cursor: pointer; cursor: pointer;
} }
#btn1{
background: #26a69a!important; #btn1 {
background: #26a69a !important;
} }
.difficulty_Degree{
.difficulty_Degree {
display: inline-block; display: inline-block;
width:80px; width: 80px;
text-align: right; text-align: right;
line-height: 56px; line-height: 56px;
} }
.commonDalei{
.commonDalei {
display: flex; display: flex;
align-content: center; align-content: center;
margin-bottom:20px; margin-bottom: 20px;
} }
</style> </style>
<template> <template>
<div class="examPaper"> <div class="examPaper">
...@@ -164,8 +171,8 @@ ...@@ -164,8 +171,8 @@
<q-input filled label="标题" v-model="DataObj.PaperName" /> <q-input filled label="标题" v-model="DataObj.PaperName" />
</div> </div>
<div style="width:20%;"> <div style="width:20%;">
<q-select filled option-value="Id" option-label="Name" :options="easyList" emit-value map-options label="难度" <q-select filled option-value="Id" option-label="Name" :options="questionDifficultyTypeList" emit-value
use-input clearable v-model="DataObj.DifficultyType" /> map-options label="难度" use-input clearable v-model="DataObj.DifficultyType" />
</div> </div>
</div> </div>
<div style="width:20%;text-align:right;"> <div style="width:20%;text-align:right;">
...@@ -200,13 +207,10 @@ ...@@ -200,13 +207,10 @@
</div> </div>
<div class="Exam-right f1"> <div class="Exam-right f1">
<div class="Left-btn"> <div class="Left-btn">
          <div>           <div>
<!-- <template v-for="(fItem,fIndex) in firstTypeList">
<span class="left-btn-list" :key="fIndex" @click="onItemClick(fItem)">{{fItem.Name}}</span>
</template> -->
<template v-for="(fItem,fIndex) in firstTypeList"> <template v-for="(fItem,fIndex) in firstTypeList">
<q-btn :key="fIndex" color="accent" :id="commonIndex==fIndex?'btn1':''" size="sm" :label="fItem.Name" style="margin-left:5px;" <q-btn :key="fIndex" color="accent" :id="commonIndex==fIndex?'btn1':''" size="sm" :label="fItem.Name"
@click="onItemClick(fItem,fIndex)" /> style="margin-left:5px;" @click="onItemClick(fItem,fIndex)" />
</template> </template>
<q-btn-dropdown color="accent" size="sm" label="更多" style="margin-left:5px;"> <q-btn-dropdown color="accent" size="sm" label="更多" style="margin-left:5px;">
<q-list> <q-list>
...@@ -219,9 +223,10 @@ ...@@ -219,9 +223,10 @@
</q-list> </q-list>
</q-btn-dropdown> </q-btn-dropdown>
</div> </div>
          <div>           <div>
            <q-btn color="accent" size="sm" @click="isShowQuestion=true" class="q-mr-md" label="题库选题" />             
          </div> <q-btn color="accent" size="sm" @click="isShowQuestion=true" class="q-mr-md" label="题库选题"  />
          </div>
</div> </div>
<div class="row wrap" v-if="ChooseItem" style="padding:20px;"> <div class="row wrap" v-if="ChooseItem" style="padding:20px;">
<div class="edit_stem"> <div class="edit_stem">
...@@ -282,19 +287,19 @@ ...@@ -282,19 +287,19 @@
<div class="col-12 commonDalei" style="margin-top:20px;"> <div class="col-12 commonDalei" style="margin-top:20px;">
<span class="difficulty_Degree">难度:</span> <span class="difficulty_Degree">难度:</span>
<q-select filled option-value="Id" size="sm" style="display:inline-block;width:300px;" option-label="Name" <q-select filled option-value="Id" size="sm" style="display:inline-block;width:300px;" option-label="Name"
v-model="ChooseItem.DifficultyType" :options="questionDifficultyTypeList" emit-value map-options/> v-model="ChooseItem.DifficultyType" :options="questionDifficultyTypeList" emit-value map-options />
</div> </div>
<div class="col-12 commonDalei"> <div class="col-12 commonDalei">
<br /> <br />
<span class="difficulty_Degree">所属大类:</span> <span class="difficulty_Degree">所属大类:</span>
<q-select filled option-value="Id" size="sm" style="display:inline-block;width:300px;" option-label="Name" <q-select filled option-value="Id" size="sm" style="display:inline-block;width:300px;" option-label="Name"
v-model="ChooseItem.Category" :options="questionCategoryList" emit-value map-options/> v-model="ChooseItem.Category" :options="questionCategoryList" emit-value map-options />
</div> </div>
<div class="col-12 commonDalei"> <div class="col-12 commonDalei">
<br /> <br />
<span class="difficulty_Degree">考级程度:</span> <span class="difficulty_Degree">考级程度:</span>
<q-select filled option-value="Id" size="sm" style="display:inline-block;width:300px;" option-label="Name" <q-select filled option-value="Id" size="sm" style="display:inline-block;width:300px;" option-label="Name"
v-model="ChooseItem.LevelType" :options="questionLevalTypeList" emit-value map-options/> v-model="ChooseItem.LevelType" :options="questionLevalTypeList" emit-value map-options />
</div> </div>
<div class="col-12"> <div class="col-12">
<span class="difficulty_Degree">知识点:</span> <span class="difficulty_Degree">知识点:</span>
...@@ -328,7 +333,7 @@ ...@@ -328,7 +333,7 @@
import cloze from '../../components/questiontype/cloze' import cloze from '../../components/questiontype/cloze'
import readingComprehensio from '../../components/questiontype/reading-comprehensio' import readingComprehensio from '../../components/questiontype/reading-comprehensio'
import sharingChoose from '../../components/questiontype/sharing-choose' import sharingChoose from '../../components/questiontype/sharing-choose'
import questionForm from '../../components/exam/question-form' import questionForm from '../../components/exam/question-form'
import { import {
GetPaper, GetPaper,
savePaperInfo, savePaperInfo,
...@@ -365,16 +370,6 @@ ...@@ -365,16 +370,6 @@
initialFrameWidth: null, initialFrameWidth: null,
initialFrameHeight: 80, initialFrameHeight: 80,
}, },
easyList: [{
Id: 1,
Name: '难'
}, {
Id: 2,
Name: '中'
}, {
Id: 3,
Name: '易'
}],
msg: { msg: {
PaperId: 0 PaperId: 0
}, },
...@@ -388,8 +383,8 @@ ...@@ -388,8 +383,8 @@
choosePointArray: [], //选择知识点 choosePointArray: [], //选择知识点
firstTypeList: [], //第一类题型 firstTypeList: [], //第一类题型
secondTypeList: [], //第二类题型 secondTypeList: [], //第二类题型
isShowQuestion:false, isShowQuestion: false,
commonIndex:-1 commonIndex: -1
} }
}, },
created() { created() {
...@@ -418,7 +413,7 @@ ...@@ -418,7 +413,7 @@
}); });
}, },
//题型点击 //题型点击
onItemClick(item,index) { onItemClick(item, index) {
// this.AnswerList = []; // this.AnswerList = [];
// this.questionObj = item; // this.questionObj = item;
// this.objOption.QuestionTypeId = item.QId; // this.objOption.QuestionTypeId = item.QId;
...@@ -428,7 +423,7 @@ ...@@ -428,7 +423,7 @@
// if (obj) { // if (obj) {
// this.objOption.QuestionContent = JSON.stringify(obj); // this.objOption.QuestionContent = JSON.stringify(obj);
// } // }
this.commonIndex=index this.commonIndex = index
}, },
//获取问题大类 //获取问题大类
getQuestionCategory() { getQuestionCategory() {
...@@ -470,10 +465,10 @@ ...@@ -470,10 +465,10 @@
console.log("res", res); console.log("res", res);
}) })
}, },
closeQuestForm(){ closeQuestForm() {
this.isShowQuestion = false; this.isShowQuestion = false;
}, },
refreshPage(){ refreshPage() {
} }
} }
......
...@@ -47,7 +47,7 @@ ...@@ -47,7 +47,7 @@
<template v-slot:top="props"> <template v-slot:top="props">
<div class="col-2 q-table__title">试卷管理</div> <div class="col-2 q-table__title">试卷管理</div>
<q-space /> <q-space />
<q-btn color="accent" size="sm" class="q-mr-md" label="组卷" /> <q-btn color="accent" size="sm" class="q-mr-md" label="组卷" @click="CreatePaper()" />
</template> </template>
<template v-slot:bottom> <template v-slot:bottom>
<q-pagination class="full-width justify-end" v-model="msg.pageIndex" color="primary" :max="pageCount" <q-pagination class="full-width justify-end" v-model="msg.pageIndex" color="primary" :max="pageCount"
...@@ -139,6 +139,11 @@ ...@@ -139,6 +139,11 @@
this.getList(); this.getList();
}, },
methods: { methods: {
//创建试卷
CreatePaper() {
this.OpenNewUrl('/exam/examCreate', {
})
},
//翻页 //翻页
changePage(val) { changePage(val) {
this.msg.pageIndex = val; this.msg.pageIndex = val;
...@@ -162,13 +167,14 @@ ...@@ -162,13 +167,14 @@
}, },
//点击编辑 跳转 //点击编辑 跳转
goExameEdit(item) { goExameEdit(item) {
console.log("item",item); console.log("item", item);
this.OpenNewUrl('/exam/examEdit', { this.OpenNewUrl('/exam/examEdit', {
Id: item.PaperId Id: item.PaperId
}) })
} }
} }
} }
</script> </script>
<style lang="sass"> <style lang="sass">
@import url('~assets/css/table.sass') @import url('~assets/css/table.sass')
......
...@@ -1048,6 +1048,11 @@ const routes = [{ ...@@ -1048,6 +1048,11 @@ const routes = [{
component: () => component: () =>
import("pages/exam/examEdit") import("pages/exam/examEdit")
}, },
{
path: "/exam/examCreate", //考试组卷
component: () =>
import("pages/exam/examCreate")
},
{ {
path: "/teacher/testdatabase", //题库查询 path: "/teacher/testdatabase", //题库查询
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