mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/learning-system-portal.git
synced 2025-12-10 03:16:42 +08:00
提交
This commit is contained in:
BIN
public/template/test-question-template.xlsx
Normal file
BIN
public/template/test-question-template.xlsx
Normal file
Binary file not shown.
@@ -28,23 +28,25 @@
|
|||||||
placeholder="题干"
|
placeholder="题干"
|
||||||
clearable></el-input>
|
clearable></el-input>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="14">
|
<el-col :span="17" style="display:flex;justify-content: space-between;">
|
||||||
<el-button type="primary" @click="getsearch(1)" style="margin-left: 20px" icon="el-icon-search" >搜索</el-button>
|
<div style="flex: 1;">
|
||||||
<el-button icon="el-icon-refresh-right" type="primary" @click="reset"> 重置 </el-button>
|
<el-button type="primary" @click="getsearch(1)" style="margin-left: 20px" icon="el-icon-search" >搜索</el-button>
|
||||||
<el-button type="primary" @click="addQuestion(1)" style="margin-left: 10px" icon="el-icon-plus"> 添加 </el-button>
|
<el-button icon="el-icon-refresh-right" type="primary" @click="reset"> 重置 </el-button>
|
||||||
<div style="display: inline-block;margin-left: 10px;">
|
<el-button type="primary" @click="addQuestion(1)" style="margin-left: 10px" icon="el-icon-plus"> 添加 </el-button>
|
||||||
|
<div style="display: inline-block;margin-left: 10px;">
|
||||||
<file-upload
|
<file-upload
|
||||||
dir="files"
|
dir="files"
|
||||||
text="导入"
|
text="导入"
|
||||||
:loading="true"
|
:loading="true"
|
||||||
size="medium"
|
size="medium"
|
||||||
url="/xboe/m/exam/question/import"
|
url="/xboe/m/exam/question/import"
|
||||||
:isShowTip="false"
|
:isShowTip="false"
|
||||||
@success="uploadFile"
|
@success="uploadFile"
|
||||||
@remove="removeFile" >
|
@remove="removeFile" >
|
||||||
</file-upload>
|
</file-upload>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div style="display: inline-block;margin-top: 10px;"><el-link @click="downloadTemplate">下载模板文件</el-link></div>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
</el-header>
|
</el-header>
|
||||||
@@ -380,6 +382,18 @@ export default {
|
|||||||
});
|
});
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
downloadTemplate(){
|
||||||
|
let fileName = "试题导入模板.xlsx";
|
||||||
|
let link = document.createElement('a'); //创建a标签
|
||||||
|
link.style.display = 'none'; //使其隐藏
|
||||||
|
link.download = this.webBaseUrl+'/template/test-question-template.xlsx';
|
||||||
|
link.setAttribute('target', '_blank');
|
||||||
|
link.href = this.webBaseUrl+'/template/test-question-template.xlsx'; //赋予文件下载地址
|
||||||
|
link.setAttribute('download', fileName); //设置下载属性 以及文件名
|
||||||
|
document.body.appendChild(link); //a标签插至页面中
|
||||||
|
link.click(); //强制触发a标签事件
|
||||||
|
document.body.removeChild(link);
|
||||||
|
},
|
||||||
uploadFile(file) {
|
uploadFile(file) {
|
||||||
this.loadData(1);
|
this.loadData(1);
|
||||||
setTimeout(this.$message.warning('请耐心等待片刻,正在导入'), 2000 );
|
setTimeout(this.$message.warning('请耐心等待片刻,正在导入'), 2000 );
|
||||||
|
|||||||
Reference in New Issue
Block a user