mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/learning-system-portal.git
synced 2025-12-09 02:46:44 +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="题干"
|
||||
clearable></el-input>
|
||||
</el-col>
|
||||
<el-col :span="14">
|
||||
<el-button type="primary" @click="getsearch(1)" style="margin-left: 20px" icon="el-icon-search" >搜索</el-button>
|
||||
<el-button icon="el-icon-refresh-right" type="primary" @click="reset"> 重置 </el-button>
|
||||
<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
|
||||
dir="files"
|
||||
text="导入"
|
||||
:loading="true"
|
||||
size="medium"
|
||||
url="/xboe/m/exam/question/import"
|
||||
:isShowTip="false"
|
||||
@success="uploadFile"
|
||||
@remove="removeFile" >
|
||||
</file-upload>
|
||||
<el-col :span="17" style="display:flex;justify-content: space-between;">
|
||||
<div style="flex: 1;">
|
||||
<el-button type="primary" @click="getsearch(1)" style="margin-left: 20px" icon="el-icon-search" >搜索</el-button>
|
||||
<el-button icon="el-icon-refresh-right" type="primary" @click="reset"> 重置 </el-button>
|
||||
<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
|
||||
dir="files"
|
||||
text="导入"
|
||||
:loading="true"
|
||||
size="medium"
|
||||
url="/xboe/m/exam/question/import"
|
||||
:isShowTip="false"
|
||||
@success="uploadFile"
|
||||
@remove="removeFile" >
|
||||
</file-upload>
|
||||
</div>
|
||||
</div>
|
||||
<div style="display: inline-block;margin-top: 10px;"><el-link @click="downloadTemplate">下载模板文件</el-link></div>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-header>
|
||||
@@ -380,6 +382,18 @@ export default {
|
||||
});
|
||||
},
|
||||
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) {
|
||||
this.loadData(1);
|
||||
setTimeout(this.$message.warning('请耐心等待片刻,正在导入'), 2000 );
|
||||
|
||||
Reference in New Issue
Block a user