v3.8.0 新增通用方法简化下载使用

This commit is contained in:
YunaiV
2022-02-17 14:28:43 +08:00
parent fee6d00ecf
commit 02a0ab6d6d
28 changed files with 78 additions and 90 deletions

View File

@ -192,7 +192,7 @@ export default {
/** 生成代码操作 */
handleGenTable(row) {
downloadCodegen(row.id).then(response => {
this.downloadZip(response, 'codegen-' + row.tableName + '.zip');
this.$download.zip(response, 'codegen-' + row.tableName + '.zip');
})
},
/** 同步数据库操作 */

View File

@ -48,19 +48,19 @@ export default {
/** 处理导出 HTML */
handleExportHtml() {
exportHtml().then(response => {
this.downloadHtml(response, '数据库文档.html');
this.$download.html(response, '数据库文档.html');
})
},
/** 处理导出 Word */
handleExportWord() {
exportWord().then(response => {
this.downloadWord(response, '数据库文档.doc');
this.$download.word(response, '数据库文档.doc');
})
},
/** 处理导出 Markdown */
handleExportMarkdown() {
exportMarkdown().then(response => {
this.downloadMarkdown(response, '数据库文档.md');
this.$download.markdown(response, '数据库文档.md');
})
}
}

View File

@ -253,7 +253,7 @@ export default {
this.exportLoading = true;
return exportTestDemoExcel(params);
}).then(response => {
this.downloadExcel(response, '字典类型.xls');
this.$download.excel(response, '字典类型.xls');
this.exportLoading = false;
}).catch(() => {});
}