| | |
| | | <!-- <el-option v-for="item in levelEnum" :key="item.key" :value="item.key" :label="item.value"></el-option>--> |
| | | <!-- </el-select>--> |
| | | <!-- </el-form-item>--> |
| | | |
| | | |
| | | <el-form-item label="题型:"> |
| | | <el-select v-model="queryParam.questionType" clearable> |
| | | <el-option v-for="item in questionType" :key="item.key" :value="item.key" :label="item.value"></el-option> |
| | |
| | | </el-form-item> |
| | | <el-form-item> |
| | | <div style="display: flex"> |
| | | <el-button type="primary" @click="submitForm">查询</el-button> |
| | | <el-popover placement="bottom" trigger="click"> |
| | | <el-button type="warning" size="mini" v-for="item in editUrlEnum" :key="item.key" |
| | | <el-button class="op-item" type="primary" @click="submitForm">查询</el-button> |
| | | <el-popover class="op-item" placement="bottom" trigger="click"> |
| | | <el-button type="warning" size="mini" v-for="item in editUrlEnum" :key="item.key" |
| | | @click="$router.push({path:item.value})">{{item.name}} |
| | | </el-button> |
| | | <el-button slot="reference" type="primary" class="link-left">添加</el-button> |
| | | <el-button slot="reference" type="primary">添加</el-button> |
| | | |
| | | </el-popover> |
| | | <el-button class="op-item" type="danger" @click="downloadImportTemplate">下载导入模板</el-button> |
| | | <el-upload |
| | | class="upload-demo" |
| | | class="op-item" |
| | | :action="upLoadUrl" |
| | | :with-credentials="true" |
| | | :on-success="handlePreview" |
| | |
| | | import Pagination from '@/components/Pagination' |
| | | import QuestionShow from './components/Show' |
| | | import questionApi from '@/api/question' |
| | | import store from '@/store' |
| | | import {downloadExcel} from '@/utils/download' |
| | | |
| | | import Cookies from 'js-cookie' |
| | | export default { |
| | |
| | | this.subjectFilter = this.subjects |
| | | }, |
| | | methods: { |
| | | handlePreview(e){ |
| | | // 下载导入模板 |
| | | downloadImportTemplate () { |
| | | questionApi.downloadImportTemplate().then(res => { |
| | | downloadExcel(res, '题目导出') |
| | | }) |
| | | }, |
| | | handlePreview (e) { |
| | | console.log(e) |
| | | if (e.code==1){ |
| | | if (e.code === 1) { |
| | | this.search() |
| | | this.$message.success(e.message) |
| | | }else { |
| | | } else { |
| | | this.$message.error(e.message) |
| | | } |
| | | }, |
| | | beforeAvatarUpload(file) { |
| | | beforeAvatarUpload (file) { |
| | | let legalName = ['xlsx', 'xls'] |
| | | // 拿到后缀名 |
| | | let name = file.name.substring(file.name.lastIndexOf('.') + 1, file.name.length) |
| | |
| | | } |
| | | </script> |
| | | <style scoped lang="scss"> |
| | | .op-item { |
| | | margin-left: 5px; |
| | | } |
| | | .upload-demo{ |
| | | margin-left: 5px; |
| | | } |