Commit a569b330 authored by 黄奎's avatar 黄奎

页面修改

parent cac9f151
......@@ -18,6 +18,7 @@
color: red;
cursor: pointer;
}
.setpaperCreat {
border: 1px dashed #E1E1E5;
padding-top: 12px;
......@@ -25,6 +26,7 @@
padding: 12px 4px 0 4px;
margin: 20px 0 10px 68px;
}
.setpaperCreat span {
display: inline-block;
background: #F2F5FA;
......@@ -48,17 +50,19 @@
<div class="setpaperCreat" v-if="QuestionArray.length>0">
<span v-for="(item,index) in QuestionArray" :key="index">{{item.BankName}}</span>
</div>
<q-btn color="accent" size="sm" style="margin-top:20px;" @click="showExamTemplate" class="q-mr-md" label="选择模板" /><br />
<q-btn color="accent" size="sm" style="margin-top:20px;"  @click="showExamTemplate"  class="q-mr-md"  label="选择模板"
  /><br />
<br />
<div class="row">
<q-input filled stack-label maxlength="100" :dense="false" v-model="templateMsg.TemplateName"
class="col-6 q-pb-lg q-pr-lg" label="试卷标题" />
<q-input filled stack-label maxlength="5" @keyup.native="checkInteger(templateMsg,'TemplateScore')" :dense="false" v-model="templateMsg.TemplateScore" class="col-6 q-pb-lg"
label="满分" />
<q-input filled stack-label maxlength="5" @keyup.native="checkInteger(templateMsg,'TemplateScore')" :dense="false"
v-model="templateMsg.TemplateScore" class="col-6 q-pb-lg" label="满分" />
</div>
<div class="row">
<q-input filled stack-label maxlength="5" :dense="false" ref="TemplateNum" v-model="templateMsg.TemplateNum"
class="col-6 q-pb-lg q-pr-lg" label="随机组卷数量" @keyup.native="checkInteger(templateMsg,'TemplateNum')" :rules="[val => !!val || '请填写随机组卷数量']" />
class="col-6 q-pb-lg q-pr-lg" label="随机组卷数量" @keyup.native="checkInteger(templateMsg,'TemplateNum')"
:rules="[val => !!val || '请填写随机组卷数量']" />
<q-select filled option-value="Id" option-label="Name" :options="questionDifficultyTypeList" emit-value
map-options label="难易程度" class="col-6" use-input clearable v-model="templateMsg.TemplateDifficultyType" />
</div>
......@@ -66,7 +70,8 @@
<template v-if="templateMsg&&templateMsg.TemplateData&&templateMsg.TemplateData.length>0">
<div v-for="(item,index) in templateMsg.TemplateData" :key="index" class="examTi_List">
<div class="examCreat_Top">
<span>{{item.QuestionTypeName}}</span> &nbsp;&nbsp;<i @click="delQuestion(templateMsg.TemplateData,index)" class="iconfont icon-img_delete_small"></i>
<span>{{item.QuestionTypeName}}</span> &nbsp;&nbsp;<i @click="delQuestion(templateMsg.TemplateData,index)"
class="iconfont icon-img_delete_small"></i>
</div>
<div style="padding:0 20px 10px 20px;">
<div class="row">
......@@ -79,7 +84,9 @@
<q-radio v-model="item.ChooseType" :val="1" label="从题库选题" />
<template v-if="item.ChooseType==1">
<span style="position:relative;top:2px;">{{item.QuestionTypeNum}} 道 抽
<el-input style="width:100px;" size="small" :disabled="item.QuestionTypeNum<=0" @input="getMaxInput(item)" v-model="item.ChooseNum" @keyup.native="checkInteger(item,'ChooseNum')" maxlength="5"></el-input>
<el-input style="width:100px;" size="small" :disabled="item.QuestionTypeNum<=0"
@input="getMaxInput(item)" v-model="item.ChooseNum" @keyup.native="checkInteger(item,'ChooseNum')"
maxlength="5"></el-input>
&nbsp;&nbsp;</span>
</template>
</span>
......@@ -90,7 +97,9 @@
<div style="margin:0 0 20px 40px;" v-for="(subItem,subIndex) in item.ChooseList" :key="subIndex">
{{subItem.DifficultyTypeName}} (共
{{subItem.DifficultyTypeCount}} 道) 抽
<el-input style="width:100px;" size="small" :disabled="subItem.DifficultyTypeCount<=0" @input="getMaxMiniInput(subItem)" @keyup.native="checkInteger(subItem,'ChooseNum')" v-model="subItem.ChooseNum" maxlength="5"></el-input>
<el-input style="width:100px;" size="small" :disabled="subItem.DifficultyTypeCount<=0"
@input="getMaxMiniInput(subItem)" @keyup.native="checkInteger(subItem,'ChooseNum')"
v-model="subItem.ChooseNum" maxlength="5"></el-input>
&nbsp;&nbsp;
</div>
</template>
......@@ -157,20 +166,22 @@
TemplateData: [],
TemplateBankIds: "",
IsSaveTemplate: false,
ParentId:0,
IsOpen:1 //(1-私有,2-开放)
ParentId: 0,
IsOpen: 1 //(1-私有,2-开放)
},
ShowBankName: "", //显示题库名称
BankList: [],
MoreQuestionTypeId: "", //更多题型
questionTypeList: [], //问题列表
saveLoading:false,
QuestionArray:[]
saveLoading: false,
QuestionArray: []
}
},
created() {
if(this.$route.query.ToParentId){
this.templateMsg.ParentId = parseInt(this.$route.query.ToParentId);
if (this.$route.query && this.$route.query.ToParentId) {
if (parseInt(this.$route.query.ToParentId) > 0) {
this.templateMsg.ParentId = parseInt(this.$route.query.ToParentId);
}
}
this.getQuestionType();
this.getDifficultyType();
......@@ -180,14 +191,14 @@
},
methods: {
//设置最大值
getMaxInput(item){
if(item.ChooseNum>item.QuestionTypeNum){
item.ChooseNum='';
getMaxInput(item) {
if (item.ChooseNum > item.QuestionTypeNum) {
item.ChooseNum = '';
}
},
getMaxMiniInput(item){
if(item.ChooseNum>item.DifficultyTypeCount){
item.ChooseNum='';
getMaxMiniInput(item) {
if (item.ChooseNum > item.DifficultyTypeCount) {
item.ChooseNum = '';
}
},
//获取题型列表
......@@ -253,13 +264,13 @@
{
DifficultyType: 2,
DifficultyTypeName: "中",
DifficultyTypeCount: 35,
DifficultyTypeCount: 0,
ChooseNum: 0
},
{
DifficultyType: 3,
DifficultyTypeName: "难",
DifficultyTypeCount: 36,
DifficultyTypeCount: 0,
ChooseNum: 0
}
]
......@@ -393,8 +404,8 @@
this.$refs.TemplateNum.validate()
if (!this.$refs.TemplateNum.hasError) {
let TotalNum = 0;
for(let i=0;i<this.templateMsg.TemplateData.length;i++){
if(this.templateMsg.TemplateData[i].ChooseType==1&&this.templateMsg.TemplateData[i].ChooseNum===''){
for (let i = 0; i < this.templateMsg.TemplateData.length; i++) {
if (this.templateMsg.TemplateData[i].ChooseType == 1 && this.templateMsg.TemplateData[i].ChooseNum === '') {
this.$q.notify({
type: 'negative',
position: "top",
......@@ -404,7 +415,7 @@
}
TotalNum += parseInt(this.templateMsg.TemplateData[i].QuestionScore);
}
if(TotalNum>this.templateMsg.TemplateScore){
if (TotalNum > this.templateMsg.TemplateScore) {
this.$q.notify({
type: 'negative',
position: "top",
......@@ -412,9 +423,9 @@
})
return
}
this.saveLoading=true;
this.saveLoading = true;
savePaperTemplate(this.templateMsg).then(res => {
this.saveLoading=false;
this.saveLoading = false;
if (res.Code == 1) {
this.$q.notify({
icon: 'iconfont icon-chenggong',
......@@ -438,7 +449,7 @@
}
},
//删除
delQuestion(item,index){
delQuestion(item, index) {
this.$q.dialog({
title: '提示信息',
message: "是否确定删除?",
......@@ -447,7 +458,7 @@
ok: "确定",
cancel: "取消",
}).onOk(() => {
item.splice(index,1);
item.splice(index, 1);
}).onCancel(() => {});
}
}
......
......@@ -507,7 +507,7 @@
PaperType: 2, //试卷类型(1-文件夹,2-试卷)
ParentId: 0, //父节点编号,
GroupList: [], //试卷答题分类
IsOpen:1 //(1-私有,2-开放)
IsOpen: 1 //(1-私有,2-开放)
},
//点击问题对象
ChooseItem: null,
......@@ -532,8 +532,10 @@
if (this.$route.query && this.$route.query.Id) {
this.msg.PaperId = decodeURI(this.$route.query.Id);
}
if (this.$route.query && this.$route.query.ToParentId){
this.DataObj.ParentId = parseInt(this.$route.query.ToParentId);
if (this.$route.query && this.$route.query.ToParentId) {
if (parseInt(this.$route.query.ToParentId) > 0) {
this.DataObj.ParentId = parseInt(this.$route.query.ToParentId);
}
}
this.getQuestionType();
this.getDifficultyType();
......@@ -581,7 +583,7 @@
sItem.Score = avgScore;
})
}
// this.calcPaper();
// this.calcPaper();
},
//上移下移(IsUp:0上移,1下移)
MoveFatherItem(subIndex, IsUp) {
......
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