| | |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item> |
| | | <el-button type="primary" @click="exportQuestion">导出</el-button> |
| | | <el-button type="primary" @click="exportQuestion" v-loading="exportLoading">导出</el-button> |
| | | </el-form-item> |
| | | </el-form> |
| | | <el-button slot="reference" class="op-item" type="success">导出</el-button> |
| | |
| | | :show-file-list="false" |
| | | :file-list="fileList" |
| | | :before-upload="beforeAvatarUpload"> |
| | | <el-button type="primary">导入</el-button> |
| | | <el-button v-loading="importLoading" type="primary">导入</el-button> |
| | | <!-- <div slot="tip" class="el-upload__tip">只能上传Excel文件</div>--> |
| | | </el-upload> |
| | | </div> |
| | |
| | | components: { Pagination, QuestionShow }, |
| | | data () { |
| | | return { |
| | | importLoading: false, |
| | | exportLoading: false, |
| | | subjectIdList: [], |
| | | timeRange: [], |
| | | exportForm: { |
| | |
| | | methods: { |
| | | // 导出题目 |
| | | exportQuestion () { |
| | | this.exportLoading = true |
| | | questionApi.exportQuestion(this.exportForm).then(res => { |
| | | downloadExcel(res, '题目导出') |
| | | this.exportLoading = false |
| | | }) |
| | | }, |
| | | // 下载导入模板 |
| | |
| | | }) |
| | | }, |
| | | handlePreview (e) { |
| | | console.log(e) |
| | | this.importLoading = false |
| | | if (e.code === 1) { |
| | | this.search() |
| | | this.$message.success(e.message) |
| | |
| | | } |
| | | }, |
| | | beforeAvatarUpload (file) { |
| | | this.importLoading = true |
| | | let legalName = ['xlsx', 'xls'] |
| | | // 拿到后缀名 |
| | | let name = file.name.substring(file.name.lastIndexOf('.') + 1, file.name.length) |