feat:上传试题修改
This commit is contained in:
parent
f09effbcb0
commit
f7083c7ee7
|
@ -48,16 +48,43 @@
|
||||||
<!-- <div> -->
|
<!-- <div> -->
|
||||||
<div style="display: flex;">
|
<div style="display: flex;">
|
||||||
<el-button type="primary" @click="handleChoose" icon="el-icon-plus" style="margin-right: 10px;">选择试题</el-button>
|
<el-button type="primary" @click="handleChoose" icon="el-icon-plus" style="margin-right: 10px;">选择试题</el-button>
|
||||||
<el-upload
|
<el-button type="primary" @click="handleChoose1" icon="el-icon-plus" style="margin-right: 10px;">上传试题</el-button>
|
||||||
:action="upUrl"
|
<el-dialog
|
||||||
:on-success="handleUpSuccess"
|
:visible.sync="impDialogVisible"
|
||||||
:on-remove="handleRemove"
|
title="上传试题"
|
||||||
:headers="upHeaders"
|
:left="'200px'"
|
||||||
:file-list="fileList"
|
:close-on-click-modal="false"
|
||||||
:limit="1"
|
:height="'600px'"
|
||||||
accept=".doc,.docx">
|
>
|
||||||
<el-button icon="el-icon-plus" type="primary" >上传试题</el-button>
|
<el-row>
|
||||||
</el-upload>
|
<el-col :span="12">
|
||||||
|
<el-select v-model="impForm.question_type" style="margin-right: 10px;" placeholder="题目分类">
|
||||||
|
<el-option
|
||||||
|
v-for="item in type_list"
|
||||||
|
:key="item.id"
|
||||||
|
:label="item.name"
|
||||||
|
:value="item.name">
|
||||||
|
</el-option>
|
||||||
|
</el-select>
|
||||||
|
</el-col>
|
||||||
|
<el-upload
|
||||||
|
:action="upUrl"
|
||||||
|
:on-success="handleUpSuccess"
|
||||||
|
:on-remove="handleRemove"
|
||||||
|
:headers="upHeaders"
|
||||||
|
:file-list="fileList"
|
||||||
|
:limit="1"
|
||||||
|
accept=".doc,.docx">
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-button icon="el-icon-plus" type="primary" style="margin-right: 10px;">上传试题</el-button>
|
||||||
|
</el-col>
|
||||||
|
</el-upload>
|
||||||
|
</el-row>
|
||||||
|
<div style="text-align: right">
|
||||||
|
<el-button type="danger" @click="impDialogVisible=false">取消</el-button>
|
||||||
|
<el-button type="primary" @click="impDialogVisible=false">确认</el-button>
|
||||||
|
</div>
|
||||||
|
</el-dialog>
|
||||||
</div>
|
</div>
|
||||||
<div v-for="(item, index) in questions">
|
<div v-for="(item, index) in questions">
|
||||||
<h4>
|
<h4>
|
||||||
|
@ -103,12 +130,16 @@
|
||||||
panduan_count: 0
|
panduan_count: 0
|
||||||
},
|
},
|
||||||
upUrl: upUrl(),
|
upUrl: upUrl(),
|
||||||
|
impDialogVisible: false,
|
||||||
fileList: [],
|
fileList: [],
|
||||||
|
type_list:[],
|
||||||
upHeaders: upHeaders(),
|
upHeaders: upHeaders(),
|
||||||
submitLoding: false,
|
submitLoding: false,
|
||||||
impForm:{
|
impForm:{
|
||||||
doc_path:''
|
doc_path:'',
|
||||||
|
question_type:'',
|
||||||
},
|
},
|
||||||
|
|
||||||
rules: {
|
rules: {
|
||||||
name: [
|
name: [
|
||||||
{ required: true, message: "名称不能为空", trigger: "blur" }
|
{ required: true, message: "名称不能为空", trigger: "blur" }
|
||||||
|
@ -136,8 +167,15 @@
|
||||||
getQuestioncat() {
|
getQuestioncat() {
|
||||||
getQuestioncatList().then(response => {
|
getQuestioncatList().then(response => {
|
||||||
this.workscopeData = response.data.results;
|
this.workscopeData = response.data.results;
|
||||||
|
this.type_list = response.data.results;
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
handleChoose1(){
|
||||||
|
this.impDialogVisible = true;
|
||||||
|
},
|
||||||
|
closeDg() {
|
||||||
|
this.chooseVisible = false;
|
||||||
|
},
|
||||||
handleUpSuccess(res, file, filelist) {
|
handleUpSuccess(res, file, filelist) {
|
||||||
let that =this;
|
let that =this;
|
||||||
if (res.code == 201){
|
if (res.code == 201){
|
||||||
|
|
Loading…
Reference in New Issue