Commit 2a9bf097 authored by 李苏's avatar 李苏 💬

新增试题管理

parent 5f4456dd
...@@ -860,19 +860,19 @@ export const powerRoutes=[ ...@@ -860,19 +860,19 @@ export const powerRoutes=[
name:'questionManage', name:'questionManage',
path:"questionManage" path:"questionManage"
}, },
// { {
// component:'train/testPaper/index', component:'train/testPaper/index',
// hidden:false, hidden:false,
// meta:{ meta:{
// "title": "考试试卷", "title": "考试试卷",
// "icon": "", "icon": "",
// "noCache": false, "noCache": false,
// "link": null, "link": null,
// "mkid":'test', "mkid":'test',
// }, },
// name:'testPaper', name:'testPaper',
// path:"testPaper" path:"testPaper"
// }, },
/*, /*,
......
<template> <template>
<RelDialog :type='type' :editApp='editApp' :app='app' :buttonApp='buttonApp'> <RelDialog :type='type' :editApp='editApp' :app='app' :buttonApp='buttonApp'>
<!-- 填写表单内容,slot=form必写--> <!-- 填写表单内容,slot=form必写-->
<el-form slot="form" ref="form" :model="form" label-width="80px" :rules="rules"> <el-form slot="form" ref="form" :model="form" label-width="80px" :rules="rules">
<el-row :gutter="20"> <el-row :gutter="20"> <el-col :span="24"> <el-form-item label="题目 " ref="cont" prop="cont"> <el-input :readonly="readonly" v-model="form.cont"></el-input>
<el-col :span="24"> </el-form-item> </el-col>
<el-form-item label="题目 " ref="cont" prop="cont"> <el-col :span="12">
<el-input :readonly="readonly" v-model="form.cont" ></el-input> <el-form-item label="试题类型 " ref="type" prop="type">
</el-form-item> <!-- <el-input :readonly="readonly" v-model="form.type" ></el-input> --> <RelSelect :readonly="readonly" filterable style="width: 100%;" clearable src='aqgl/pxgl/pxst/init/type'
</el-col> :match="{value:'id',label:'name'}" v-model='form.type'></RelSelect>
<el-col :span="12"> </el-form-item>
<el-form-item label="试题类型 " ref="type" prop="type"> </el-col>
<!-- <el-input :readonly="readonly" v-model="form.type" ></el-input> --> <el-col :span="12">
<RelSelect :readonly="readonly" filterable style="width: 100%;" clearable src='aqgl/pxgl/pxst/init/type' :match="{value:'id',label:'name'}" v-model='form.type' ></RelSelect> <el-form-item label="题库编码" ref="mid" prop="mid">
</el-form-item> <!-- <el-input :readonly="readonly" v-model="form.mid" ></el-input> --> <RelSelect :readonly="readonly" filterable style="width: 100%;" clearable src='aqgl/pxgl/pxxm/query'
</el-col> :match="{value:'id',label:'name'}" v-model='form.mid'></RelSelect>
<el-col :span="12"> </el-form-item>
<el-form-item label="题库编码" ref="mid" prop="mid"> </el-col>
<!-- <el-input :readonly="readonly" v-model="form.mid" ></el-input> -->
<RelSelect :readonly="readonly" filterable style="width: 100%;" clearable src='aqgl/pxgl/pxxm/query' :match="{value:'id',label:'name'}" v-model='form.mid' ></RelSelect> </el-row>
</el-form-item> <el-row :gutter="20"> <el-col :span="12">
</el-col> <el-form-item label="选项A" ref="opta" prop="opta">
<el-input :readonly="readonly" v-model="form.opta"></el-input> </el-form-item> </el-col>
</el-row> <el-col :span="12">
<el-row :gutter="20"> <el-form-item label="选项B" ref="optb" prop="optb">
<el-col :span="12"> <el-input :readonly="readonly" v-model="form.optb"></el-input>
<el-form-item label="选项A" ref="opta" prop="opta"> </el-form-item>
<el-input :readonly="readonly" v-model="form.opta" ></el-input> </el-col>
</el-form-item> <el-col :span="12">
</el-col> <el-form-item label="选项C" ref="optc" prop="optc">
<el-col :span="12"> <el-input :readonly="readonly" v-model="form.optc"></el-input>
<el-form-item label="选项B" ref="optb" prop="optb"> </el-form-item>
<el-input :readonly="readonly" v-model="form.optb" ></el-input> </el-col>
</el-form-item> <el-col :span="12">
</el-col> <el-form-item label="选项D" ref="optd" prop="optd">
<el-col :span="12"> <el-input :readonly="readonly" v-model="form.optd"></el-input>
<el-form-item label="选项C" ref="optc" prop="optc"> </el-form-item>
<el-input :readonly="readonly" v-model="form.optc" ></el-input> </el-col>
</el-form-item> </el-row>
</el-col> <el-row :gutter="20">
<el-col :span="12"> <el-col :span="12">
<el-form-item label="选项D" ref="optd" prop="optd"> <el-form-item label="选项E" ref="opte" prop="opte">
<el-input :readonly="readonly" v-model="form.optd" ></el-input> <el-input :readonly="readonly" v-model="form.opte"></el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> <el-col :span="12">
<el-row :gutter="20"> <el-form-item label="选项F" ref="optf" prop="optf">
<el-col :span="12"> <el-input :readonly="readonly" v-model="form.optf"></el-input>
<el-form-item label="选项E" ref="opte" prop="opte"> </el-form-item>
<el-input :readonly="readonly" v-model="form.opte" ></el-input> </el-col>
</el-form-item> <el-col :span="24">
</el-col> <el-form-item label="答案" ref="ans" prop="ans">
<el-col :span="12"> <el-input :readonly="readonly" v-model="form.ans"></el-input>
<el-form-item label="选项F" ref="optf" prop="optf"> </el-form-item>
<el-input :readonly="readonly" v-model="form.optf" ></el-input> </el-col>
</el-form-item> </el-row>
</el-col> <el-row :gutter="20">
<el-col :span="24"> <el-col :span="24">
<el-form-item label="答案" ref="ans" prop="ans"> <el-form-item label="答案描述" ref="desc" prop="desc">
<el-input :readonly="readonly" v-model="form.ans" ></el-input> <el-input type="textarea" :readonly="readonly" v-model="form.desc"></el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> <el-col :span="24">
<el-row :gutter="20"> <el-form-item label="备注" ref="bz" prop="bz">
<el-col :span="24"> <el-input type="textarea" :readonly="readonly" v-model="form.bz"></el-input>
<el-form-item label="答案描述" ref="desc" prop="desc"> </el-form-item>
<el-input type="textarea" :readonly="readonly" v-model="form.desc" ></el-input> </el-col>
</el-form-item> <!-- <el-col :span="8">
</el-col> <el-form-item label="系统版本" ref="sysversion" prop="sysversion">
<el-col :span="24"> <el-input :readonly="readonly" v-model="form.sysversion" ></el-input>
<el-form-item label="备注" ref="bz" prop="bz"> </el-form-item>
<el-input type="textarea" :readonly="readonly" v-model="form.bz" ></el-input> </el-col> -->
</el-form-item> </el-row>
</el-col> </el-form>
<!-- <el-col :span="8"> </RelDialog>
<el-form-item label="系统版本" ref="sysversion" prop="sysversion"> </template>
<el-input :readonly="readonly" v-model="form.sysversion" ></el-input> <script>
</el-form-item> import {
</el-col> --> editMixin
</el-row> } from 'common'
</el-form> export default {
</RelDialog> mixins: [editMixin],
</template> /* 存放index页面传递的额外参数*/
<script> mounted() {
import {editMixin} from 'common'
export default { },
mixins: [editMixin], /* 组件名称*/
/* 存放index页面传递的额外参数*/ name: "pxglPxstEdit",
mounted() { /* 传递props模式一样必填,用于index,button,REdialog之间的组件通信*/
}, data() {
/* 组件名称*/ return {
name: "pxglPxstEdit",
/* 传递props模式一样必填,用于index,button,REdialog之间的组件通信*/ /* 额外初始化,根据需求*/
systemType: [],
data() {
return { bmList: [],
/* 额外初始化,根据需求*/ /* 当前表单初始值,默认由RelDialog查询indexQuery赋值,copy时不赋值id,初始化时所有query的值都会赋值给form*/
systemType: [], form: { cont: '',
//ID
bmList: [], id: '',
//试题类型
/* 当前表单初始值,默认由RelDialog查询indexQuery赋值,copy时不赋值id,初始化时所有query的值都会赋值给form*/ type: '',
form: { //题库编码
cont:'', mid: '',
//ID //选项A
id:'', opta: '',
//试题类型 //选项B
type:'', optb: '',
//题库编码 //选项C
mid:'', optc: '',
//选项A //选项D
opta:'', optd: '',
//选项B //选项E
optb:'', opte: '',
//选项C //选项F
optc:'', optf: '',
//选项D //答案
optd:'', ans: '',
//选项E //答案描述
opte:'', desc: '',
//选项F //备注
optf:'', bz: '',
//答案
ans:'',
//答案描述 },
desc:'', /* form提交时的规则,具体规则参考官网*/
//备注 rules: {
bz:'', cont: [{
required: true
}, ],
}, type: [{
/* form提交时的规则,具体规则参考官网*/ required: true
rules: { }, ],
mid: [{
} required: true
} }, ],
}, ans: [{
methods: { required: true
}, ]
} }
} }
</script> },
methods: {
<style scoped lang="scss">
}
}
</script>
<style scoped lang="scss">
</style> </style>
......
...@@ -25,8 +25,47 @@ ...@@ -25,8 +25,47 @@
</div> </div>
</template> </template>
<script> <script>
import {
/* 测试*/
doQuery,
doAdd,
doUpdate,
doDelete,
pxxmQuery,
excelimport
} from '@/api/train/questionManage';
import Subject from './subject' import Subject from './subject'
export default{ export default{
created(){
let type={
'S':'DXT',
'F':'TKT',
'J':'PDT',
'M':'DXTS'
}
doQuery().then(res=>{
let oList=res.data.records||[]
/* 构建subjectList*/
this.subjectList=oList.map(item=>{
let newobj=Object.create({})
newobj.id=item.id
newobj.score=item.score||'暂无分值'
newobj.type=type[item.type]
newobj.subject=item.cont||'未设置问题'
newobj.options=Object.create({})
item['opta']&&(newobj.options.A=item.opta)
item['optb']&&(newobj.options.B=item.optb)
item['optc']&&(newobj.options.C=item.optc)
item['optd']&&(newobj.options.D=item.optd)
item['opte']&&(newobj.options.E=item.opte)
item['optf']&&(newobj.options.F=item.optf)
return newobj
})
})
},
mounted() { mounted() {
this.getRemain() this.getRemain()
...@@ -81,140 +120,7 @@ ...@@ -81,140 +120,7 @@
remaining:'', remaining:'',
title:'专八仪表考试测试1128(在线考试)', title:'专八仪表考试测试1128(在线考试)',
that:this, that:this,
subjectList:[ subjectList:[]
{id:'AE89',
subject:'下列营养物质中在人体不能产生能量的为',
score:'2',
type:'DXTS',
options:{
A:'蔗糖',
B:'果糖',
C:'木质素',
D:'酪蛋白'
}
},
{
id:'AE891',
subject:'从业人员在职业活动中,以公平、对等的态度对待领导、同事和顾客等人的行为是()',
score:'5',
type:'TKT',
options:{
}
},
{
id:'AE8914',
subject:'对于线性表(7,34,55,25,64,46,20,10)进行散列存储时,若选用H(K)=K %9作为散列函数,则散列地址为1的元素有()个。',
score:'2',
type:'DXT',
options:{
A:'1个',
B:'2个',
C:'3个',
D:'4个',
E:'5个'
}
},
{id:'AE89',
subject:'下列营养物质中在人体不能产生能量的为',
score:'2',
type:'DXT',
options:{
A:'蔗糖',
B:'果糖',
C:'木质素',
D:'酪蛋白'
}
},
{
id:'AE891',
subject:'从业人员在职业活动中,以公平、对等的态度对待领导、同事和顾客等人的行为是()',
score:'5',
type:'TKT',
options:{
}
},
{
id:'AE8914',
subject:'对于线性表(7,34,55,25,64,46,20,10)进行散列存储时,若选用H(K)=K %9作为散列函数,则散列地址为1的元素有()个。',
score:'2',
type:'DXTS',
options:{
A:'1个',
B:'2个',
C:'3个',
D:'4个',
E:'5个'
}
},
{id:'AE89',
subject:'下列营养物质中在人体不能产生能量的为',
score:'2',
type:'DXT',
options:{
A:'蔗糖',
B:'果糖',
C:'木质素',
D:'酪蛋白'
}
},
{
id:'AE891',
subject:'众所周知,()是世界上最帅的人。',
score:'5',
type:'TKT',
options:{
}
},
{
id:'AE8914',
subject:'对于线性表(7,34,55,25,64,46,20,10)进行散列存储时,若选用H(K)=K %9作为散列函数,则散列地址为1的元素有()个。',
score:'2',
type:'DXTS',
options:{
A:'1个',
B:'2个',
C:'3个',
D:'4个',
E:'5个'
}
},
{id:'AE89',
subject:'下列营养物质中在人体不能产生能量的为',
score:'2',
type:'DXT',
options:{
A:'蔗糖',
B:'果糖',
C:'木质素',
D:'酪蛋白'
}
},
{
id:'AE891',
subject:'从业人员在职业活动中,以公平、对等的态度对待领导、同事和顾客等人的行为是()',
score:'5',
type:'TKT',
options:{
}
},
{
id:'AE8914',
subject:'对于线性表(7,34,55,25,64,46,20,10)进行散列存储时,若选用H(K)=K %9作为散列函数,则散列地址为1的元素有()个。',
score:'2',
type:'DXT',
options:{
A:'1个',
B:'2个',
C:'3个',
D:'4个',
E:'5个'
}
}
]
} }
} }
} }
......
<template> <template>
<div class="examMain" :title="subject"> <div class="examMain">
<!-- 试题题目--> <!-- 试题题目-->
<template v-if="type!='TKT'"> <template v-if="type!='TKT'">
<span>{{`${index}.`}}</span> <span>{{`${index}.`}}</span>
...@@ -28,7 +28,12 @@ ...@@ -28,7 +28,12 @@
</el-checkbox-group> </el-checkbox-group>
</div> </div>
</div> </div>
<!-- 判断题 -->
<div v-if="type=='PDT'" class="options">
<div class="item" :key="index" v-for="(item,index) in options">
<el-radio v-model="value" :label="index"> {{`${index}.${item}`}}</el-radio>
</div>
</div>
</div> </div>
</template> </template>
...@@ -90,8 +95,10 @@ ...@@ -90,8 +95,10 @@
}, },
methods:{ methods:{
transTKT(val,fn){ transTKT(val,fn){
let nval
let template=`<input type='text' name='tktinput' class='tktinput'>` let template=`<input type='text' name='tktinput' class='tktinput'>`
let nval=val.replace('()',template) /* 判断有无()*/
val.indexOf('()')==-1?( nval=val+template):( nval=val.replace('()',template))
return nval return nval
} }
}, },
...@@ -100,7 +107,8 @@ ...@@ -100,7 +107,8 @@
let typeArry={ let typeArry={
'DXT':'(单选题)', 'DXT':'(单选题)',
'DXTS':'(多选题)', 'DXTS':'(多选题)',
'TKT':'(填空题)' 'TKT':'(填空题)',
'PDT':'(判断题)'
} }
let nval=typeArry[val] let nval=typeArry[val]
return nval||'其他' return nval||'其他'
......
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