feat:上传试题修改

This commit is contained in:
zty 2024-05-30 17:31:06 +08:00
parent f09effbcb0
commit f7083c7ee7
1 changed files with 49 additions and 11 deletions

View File

@ -48,16 +48,43 @@
<!-- <div> -->
<div style="display: flex;">
<el-button type="primary" @click="handleChoose" icon="el-icon-plus" style="margin-right: 10px;">选择试题</el-button>
<el-upload
:action="upUrl"
:on-success="handleUpSuccess"
:on-remove="handleRemove"
:headers="upHeaders"
:file-list="fileList"
:limit="1"
accept=".doc,.docx">
<el-button icon="el-icon-plus" type="primary" >上传试题</el-button>
</el-upload>
<el-button type="primary" @click="handleChoose1" icon="el-icon-plus" style="margin-right: 10px;">上传试题</el-button>
<el-dialog
:visible.sync="impDialogVisible"
title="上传试题"
:left="'200px'"
:close-on-click-modal="false"
:height="'600px'"
>
<el-row>
<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 v-for="(item, index) in questions">
<h4>
@ -103,12 +130,16 @@
panduan_count: 0
},
upUrl: upUrl(),
impDialogVisible: false,
fileList: [],
type_list:[],
upHeaders: upHeaders(),
submitLoding: false,
impForm:{
doc_path:''
doc_path:'',
question_type:'',
},
rules: {
name: [
{ required: true, message: "名称不能为空", trigger: "blur" }
@ -136,8 +167,15 @@
getQuestioncat() {
getQuestioncatList().then(response => {
this.workscopeData = response.data.results;
this.type_list = response.data.results;
});
},
handleChoose1(){
this.impDialogVisible = true;
},
closeDg() {
this.chooseVisible = false;
},
handleUpSuccess(res, file, filelist) {
let that =this;
if (res.code == 201){