123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193 |
- <template>
- <section style="margin-top: 0px;">
- <el-form
- :model="formSearch"
- :inline="true"
- style="border-bottom: 1px solid rgb(221, 221, 221);margin-bottom: 10px;"
- >
- <el-form-item label="考试名称">
- <el-select
- v-model="formSearch.examId"
- :remote-method="getExams"
- @clear="getExams"
- placeholder="请选择"
- remote
- filterable
- clearable
- size="small"
- class="w180"
- >
- <el-option
- v-for="item in examList"
- :key="item.id"
- :label="item.name"
- :value="item.id"
- ></el-option>
- </el-select>
- </el-form-item>
- <el-form-item label="类型">
- <el-select
- v-model="formSearch.type"
- size="small"
- class="w180"
- placeholder="请选择"
- @clear="clearTypeValue"
- clearable
- >
- <el-option label="考试明细" value="EXAM_DETAIL"></el-option>
- <el-option label="成绩统计" value="SCORE_STATISTIC"></el-option>
- </el-select>
- </el-form-item>
- <el-form-item label="状态">
- <el-select
- v-model="formSearch.status"
- size="small"
- class="w180"
- placeholder="请选择"
- @clear="clearStatusValue"
- clearable
- >
- <el-option label="未开始" value="NONE"></el-option>
- <el-option label="导出中" value="EXPORTING"></el-option>
- <el-option label="成功" value="SUCCESS"></el-option>
- <el-option label="失败" value="ERROR"></el-option>
- </el-select>
- </el-form-item>
- <el-form-item>
- <el-button
- size="small"
- type="primary"
- icon="el-icon-search"
- @click="doSearch(1)"
- >查询
- </el-button>
- <el-button size="small" icon="el-icon-refresh" @click="resetSearchForm">
- 重置
- </el-button>
- </el-form-item>
- </el-form>
- <el-table
- v-loading="loading"
- :data="tableData"
- element-loading-text="数据加载中"
- style="width:100%;"
- border
- stripe
- >
- </el-table>
- <div class="page pull-right">
- <el-pagination
- @current-change="handlePagerNo"
- :current-page="formSearch.pageNo"
- @size-change="handlePagerSize"
- :page-size="formSearch.pageSize"
- :page-sizes="[10, 20, 50, 100, 200, 300]"
- :total="totalElements"
- layout="total, sizes, prev, pager, next, jumper"
- ></el-pagination>
- </div>
- </section>
- </template>
- <script>
- import { mapState } from "vuex";
- export default {
- data() {
- return {
- formSearch: {
- examId: "",
- type: null,
- status: null,
- pageNo: 1,
- pageSize: 10
- },
- loading: false,
- tableData: [],
- totalElements: 0,
- examList: []
- };
- },
- methods: {
- getExams(examName) {
- if (!examName) {
- examName = "";
- }
- this.$http
- .get("/api/ecs_exam_work/exam/queryByNameLike", {
- params: {
- name: examName,
- examTypes: "ONLINE#OFFLINE#ONLINE_HOMEWORK"
- }
- })
- .then(response => {
- this.examList = response.data;
- });
- },
- doSearch(pageNo) {
- this.formSearch.pageNo = pageNo;
- this.loading = true;
- let url = "/api/ecs_oe_admin/export/task/list";
- this.$http.post(url, this.formSearch).then(
- response => {
- this.tableData = response.data.content;
- this.totalElements = response.data.totalElements;
- this.loading = false;
- },
- error => {
- console.log(error);
- this.loading = false;
- }
- );
- },
- handlePagerNo(pageNo) {
- this.doSearch(pageNo);
- },
- handlePagerSize(pageSize) {
- this.formSearch.pageSize = pageSize;
- this.doSearch(1);
- },
- clearTypeValue() {
- this.formSearch.type = null;
- },
- clearStatusValue() {
- this.formSearch.status = null;
- },
- resetSearchForm() {
- this.formSearch.examId = "";
- this.formSearch.type = null;
- this.formSearch.status = null;
- this.doSearch(1);
- }
- },
- computed: {
- ...mapState({ user: state => state.user })
- },
- created() {
- this.getExams();
- this.doSearch(1);
- }
- };
- </script>
- <style scoped>
- .page {
- margin-top: 10px;
- }
- .pull-right {
- float: right;
- }
- .pull-left {
- float: left;
- }
- .w180 {
- width: 180px;
- }
- </style>
|