| | |
| | | <el-form-item label="试卷ID:"> |
| | | <el-input v-model="queryParam.id" clearable></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="学科:" > |
| | | <el-select |
| | | v-model="queryParam.subjectId" |
| | | placeholder="全部科目" |
| | | clearable |
| | | > |
| | | <el-option v-for="item in subjects" :key="item.id" :label="item.name" :value="item.id"/> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item> |
| | | <el-button type="primary" @click="submitForm">查询</el-button> |
| | | <router-link :to="{path:'/exam/paper/edit'}" class="link-left"> |
| | |
| | | </el-form> |
| | | <el-table v-loading="listLoading" :data="tableData" border fit highlight-current-row style="width: 100%"> |
| | | <el-table-column align="center" prop="id" label="Id" width="90px"/> |
| | | <el-table-column align="center" prop="subjectId" label="学科" width="120px" > |
| | | <template slot-scope="scope"> |
| | | {{ translate(scope.row.subjectId) }} |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column align="center" prop="name" label="名称" /> |
| | | <el-table-column |
| | | align="center" |
| | |
| | | }) |
| | | }, |
| | | // 获取科目 |
| | | getSubjects() { |
| | | getSubjects () { |
| | | subjectApi.list().then(re => { |
| | | this.subjects = re.data |
| | | }) |
| | | }, |
| | | translate(subjectId) { |
| | | translate (subjectId) { |
| | | const subject = this.subjects.find(subject => subject.id == subjectId); |
| | | return subject ? subject.name : '未知'; |
| | | } |