陈志鹏
2 years ago
4 changed files with 386 additions and 4 deletions
@ -0,0 +1,359 @@
@@ -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> |
Loading…
Reference in new issue