Browse Source

提交习题集查询

master
陈志鹏 2 years ago
parent
commit
cb2d363881
  1. 4
      src/page/exercises/exercises-info.vue
  2. 359
      src/page/exercises/exercises-list.vue
  3. 12
      src/page/exercises/exercises.vue
  4. 15
      src/router/index.js

4
src/page/exercises/exercises-info.vue

@ -56,9 +56,9 @@
<el-form :inline="true"> <el-form :inline="true">
<div style="float: right;"> <div style="float: right;">
<el-row> <el-row>
<el-form-item style="float: left" label="关键:"> <el-form-item style="float: left" label="关键:">
<el-input v-model="dataForm.name" <el-input v-model="dataForm.name"
placeholder="关键" clearable></el-input> placeholder="关键" clearable></el-input>
</el-form-item> </el-form-item>
<el-form-item style="float: left" label="类型:"> <el-form-item style="float: left" label="类型:">
<el-select <el-select

359
src/page/exercises/exercises-list.vue

@ -0,0 +1,359 @@
<template>
<div style="margin-top: 20px">
<el-card shadow="never">
<div class="crud__left">
<el-form :inline="true">
<div style="float: right;">
<el-row>
<el-form-item style="float: left" label="习题集名称:">
<el-input v-model="dataForm.name"
placeholder="习题集名称" clearable></el-input>
</el-form-item>
<el-form-item style="float: left" label="类型:">
<el-select
clearable
v-model="dataForm.type"
placeholder="请选择"
>
<el-option
v-for="item in typeList"
:key="item.id"
:label="item.name"
:value="item.id"
>
</el-option>
</el-select>
</el-form-item>
<el-form-item style="float: left" label="科目:">
<el-select
clearable
multiple
v-model="dataForm.subjectIdList"
placeholder="请选择"
>
<el-option
v-for="item in subjectList"
:key="item.id"
:label="item.name"
:value="item.id"
>
</el-option>
</el-select>
</el-form-item>
<el-form-item style="float: left" label="状态:">
<el-select
clearable
v-model="dataForm.coursestatus"
placeholder="请选择"
>
<el-option
v-for="item in statusList"
:key="item.id"
:label="item.name"
:value="item.id"
>
</el-option>
</el-select>
</el-form-item>
</el-row>
<el-row>
<el-form-item style="float: left" label="创建时间:">
<el-date-picker
v-model="dataForm.time"
type="daterange"
range-separator="至"
start-placeholder="开始日期"
style="width: 320px"
end-placeholder="结束日期">
</el-date-picker>
</el-form-item>
<el-form-item style="float: right;">
<el-button type="primary"
@click="submitClick">查询
</el-button>
</el-form-item>
</el-row>
</div>
</el-form>
</div>
<div>
<el-table :data="dataList" max-height="800">
<el-table-column label="序号"
header-align="center" align="center" width="50">
<template slot-scope="scope">
<span>
{{ scope.$index + 1 }}
</span>
</template>
</el-table-column>
<el-table-column prop="name" label="习题集名称"
header-align="center" align="left" width="300">
</el-table-column>
<el-table-column prop="collectionType" label="类型"
header-align="center" align="center" width="150">
<template slot-scope="scope">
<b v-if="scope.row.collectionType === 'ORIGINAL'">真题演练</b>
<b v-if="scope.row.collectionType === 'FREE'">自组试卷</b>
<b v-if="scope.row.collectionType === 'EP'">随堂演练</b>
</template>
</el-table-column>
<el-table-column prop="subjectId" label="科目"
header-align="center" align="center" width="120">
<template slot-scope="scope">
<b>{{scope.row.subjectName}}</b>
</template>
</el-table-column>
<el-table-column prop="creationTime" label="创建时间"
header-align="center" align="center" width="200">
<template slot-scope="scope">
<b>{{scope.row.creationTime.toString().substr(0,10)}}</b>
</template>
</el-table-column>
<el-table-column prop="collectionNum" label="题目数"
header-align="center" align="center" width="120">
<template slot-scope="scope">
<b v-if="scope.row.original"></b>
<b v-else></b>
</template>
</el-table-column>
<el-table-column prop="status" label="状态"
header-align="center" align="center" width="150">
<template slot-scope="scope">
<b v-if="scope.row.status === 'ONGOING'">进行中</b>
<b v-if="scope.row.status === 'DRAFT'">草稿</b>
<b v-if="scope.row.status === 'COMMITED'">已提交</b>
</template>
</el-table-column>
<el-table-column label="操作" fixed="right" header-align="center" align="center"
width="150">
<template slot-scope="scope">
<el-button type="text" size="mini"
@click="updateCourse(scope.row)">查看
</el-button>
<el-button type="text" size="mini"
@click="updateRow(scope.row,'UP')">删除
</el-button>
</template>
</el-table-column>
</el-table>
<el-pagination
:current-page="page"
layout="total, sizes, prev, pager, next, jumper"
:page-size="limit"
:page-sizes="pageSizes"
:total="total"
@current-change="pageCurrentChangeHandle"
@size-change="pageSizeChangeHandle"/>
</div>
</el-card>
</div>
</template>
<script>
import { postRequest, getRequest, deleteRequest, putRequest, uploadFileRequest } from '../../utils/api'
export default {
data () {
return {
page: 1, //
limit: 10, //
total: 0, //
pageSizes: [10, 50, 100, 500, 1000], //
activeName: 'first',
dataForm: {
essential: '',
difficulty: '',
name: '',
teacherName: '',
type: '',
coursestatus: '',
time: [],
subjectIdList: []
},
typeList: [
{
id: '',
name: '全部'
},
{
id: 'ORIGINAL',
name: '真题演练'
},
{
id: 'FREE',
name: '自组试卷'
},
{
id: 'EP',
name: '随堂演练'
},
],
statusList: [
{
id: '',
name: '全部'
},
{
id: 'DRAFT',
name: '草稿'
},
{
id: 'ONGOING',
name: '进行中'
},
{
id: 'COMMITED',
name: '已提交'
},
],
dataFormType: {
name: ''
},
dataList: [],
subjectList: [],
teacherList: []
}
},
activated () {
this.submitClick()
this.getTypeList()
},
created () {
this.submitClick()
this.getTypeList()
this.getTeacherList()
},
mounted () {
},
methods: {
//-
pageCurrentChangeHandle (val) {
this.page = val
this.submitClick()
},
//-
pageSizeChangeHandle (val) {
this.page = 1
this.limit = val
this.submitClick()
},
//
submitClick: function () {
var _this = this;
this.loading = true;
var startTime = ''
var endTime = ''
if(this.dataForm.time !==null && this.dataForm.time.length>0){
startTime = this.dataForm.time[0]
endTime = this.dataForm.time[1]
}
var filter = {
filer: {
name: this.dataForm.name,
type: this.dataForm.type,
coursestatus: this.dataForm.coursestatus,
subjectIdList: this.dataForm.subjectIdList,
teacherName: this.dataForm.teacherName,
startTime: startTime,
endTime: endTime,
difficulty: this.dataForm.difficulty,
essential: this.dataForm.essential
},
pagination: {
pageNo: this.page,
pageSize: this.limit
}
}
postRequest('/edu/v1/mp/collectionList', JSON.stringify(filter)).then(resp=> {
_this.loading = false;
if (resp.status === 200) {
this.dataList = resp.data.data.list
this.total = resp.data.data.size
} else {
//
_this.$alert('');
}
}, resp=> {
});
},
getTypeList: function () {
var _this = this;
this.loading = true;
getRequest('/edu/v1/pc/subject/by/name', JSON.stringify({
mode: 'all',
})).then(resp=> {
_this.loading = false;
if (resp.status === 200) {
this.subjectList = resp.data.data
} else {
//
this.$alert('');
}
}, resp=> {
});
},
getTeacherList: function () {
var _this = this;
this.loading = true;
getRequest('/edu/v1/pc/school/schoolTeacher', JSON.stringify({
scope: '10010',
})).then(resp=> {
_this.loading = false;
if (resp.status === 200) {
this.teacherList = resp.data.data
} else {
//
_this.$alert('');
}
}, resp=> {
});
},
handleClick(tab, event) {
console.log(tab, event);
},
addCourse(){
//
this.$router.push({
path: "/add-coures",
query: {
}
});
},
updateCourse(row){
//
this.$router.push({
path: "/coures-info",
query: {
couresName: row.type,
id: row.id
}
});
},
dyOpenTab(){
//
this.$router.push({
path: "/subscribe",
query: {
}
});
}
}
}
</script>
<style type="text/css">
.crud__left {
display: -webkit-box;
display: -ms-flexbox;
display: flex;
float: left;
-webkit-box-pack: end;
-ms-flex-pack: end;
justify-content: flex-end
}
.crud__right {
display: -webkit-box;
display: -ms-flexbox;
display: flex;
-webkit-box-pack: end;
-ms-flex-pack: end;
justify-content: flex-end
}
</style>

12
src/page/exercises/exercises.vue

@ -20,8 +20,8 @@
<div style="padding-top: 10px;color: #ffffff">随堂练习</div> <div style="padding-top: 10px;color: #ffffff">随堂练习</div>
</div> </div>
<div style="display: flex"> <div style="display: flex">
<div style="margin-left: 93px;margin-top: 130px"> <div style="margin-left: 93px;margin-top: 90px">
<el-button type="primary">管理习题集</el-button> <el-button type="primary" @click="examinationList">管理习题集</el-button>
</div> </div>
</div> </div>
</div> </div>
@ -99,6 +99,14 @@ export default {
} }
}); });
}, },
examinationList(){
//
this.$router.push({
path: "/exercises-list",
query: {
}
});
},
} }
} }
</script> </script>

15
src/router/index.js

@ -13,6 +13,7 @@ import subscribe from '@/page/coures/subscribe' //课程管理
import examination from '@/page/examination/examination' //新建习题 import examination from '@/page/examination/examination' //新建习题
import examinationInfo from '@/page/examination/examination-info' //新建考试 import examinationInfo from '@/page/examination/examination-info' //新建考试
import exercisesInfo from '@/page/exercises/exercises-info' //习题库管理 import exercisesInfo from '@/page/exercises/exercises-info' //习题库管理
import exercisesList from '@/page/exercises/exercises-list' //习题集管理
import addCoures from '@/page/coures/add-coures' //新建习题 import addCoures from '@/page/coures/add-coures' //新建习题
Vue.use(Router) Vue.use(Router)
@ -124,6 +125,20 @@ export default new Router({
} }
] ]
}, },
{
path: '/home',
component: Home,
name: '习题集管理',
hidden: true,
children: [
{
path: '/exercises-list',
iconCls: 'fa fa-user-o',
name: '习题及管理',
component: exercisesList
}
]
},
{ {
path: '/home', path: '/home',
component: Home, component: Home,

Loading…
Cancel
Save