试题导入、模板下载

pg_adapter
dshclm 9 months ago
parent d7fe67930d
commit c8f165dd7d

@ -187,6 +187,7 @@ public class QuController extends BaseController {
@ApiOperation("导入Excel") @ApiOperation("导入Excel")
@RequiresPermissions("system:qu:import")
@ResponseBody @ResponseBody
@PostMapping( "/import") @PostMapping( "/import")
public AjaxResult importFile(@RequestParam("file") MultipartFile file) { public AjaxResult importFile(@RequestParam("file") MultipartFile file) {

@ -39,7 +39,7 @@
<a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()" shiro:hasPermission="system:qu:remove"> <a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()" shiro:hasPermission="system:qu:remove">
<i class="fa fa-remove"></i> 删除 <i class="fa fa-remove"></i> 删除
</a> </a>
<a class="btn btn-info" @click="toImport()"> <a class="btn btn-info" @click="toImport()" shiro:hasPermission="system:qu:import">
<i class="fa fa-upload"></i> 导入 <i class="fa fa-upload"></i> 导入
</a> </a>
</div> </div>
@ -110,6 +110,7 @@
// function toImport(){ // function toImport(){
// $.modal.open("试题导入", prefix + "/toImport",'500','300'); // $.modal.open("试题导入", prefix + "/toImport",'500','300');
// } // }
console.log(document.getElementsByClassName('fixed-sidebar'))
// 请求实例 // 请求实例
const instance = axios.create({ const instance = axios.create({
baseURL: ctx, baseURL: ctx,
@ -151,7 +152,12 @@
formData.append(key, data[key]) formData.append(key, data[key])
}) })
} }
const loading = this.$loading({
lock: true,
text: 'Loading',
spinner: 'el-icon-loading',
background: 'rgba(0, 0, 0, 0.7)'
});
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
instance.request({ instance.request({
url: url, url: url,
@ -159,6 +165,7 @@
data: formData, data: formData,
timeout: 1200000 timeout: 1200000
}).then(response => { }).then(response => {
loading.close();
console.log(response) console.log(response)
resolve(response) resolve(response)
}).catch(err => { }).catch(err => {

Loading…
Cancel
Save