数据库导出新窗口使用post方式提交,更加优雅
This commit is contained in:
@@ -250,7 +250,7 @@ public class DatabaseDocController {
|
|||||||
return DocDbResponseJson.ok();
|
return DocDbResponseJson.ok();
|
||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping(value = "/exportDatabase")
|
@PostMapping(value = "/exportDatabase")
|
||||||
public ResponseJson exportDatabase(HttpServletResponse response, Long sourceId, String dbName, String tableNames, Integer exportType) {
|
public ResponseJson exportDatabase(HttpServletResponse response, Long sourceId, String dbName, String tableNames, Integer exportType) {
|
||||||
this.judgeAuth(sourceId, DbAuthType.VIEW.getName(), "没有查看该库表信息的权限");
|
this.judgeAuth(sourceId, DbAuthType.VIEW.getName(), "没有查看该库表信息的权限");
|
||||||
if (StringUtils.isBlank(tableNames)) {
|
if (StringUtils.isBlank(tableNames)) {
|
||||||
|
|||||||
@@ -94,6 +94,7 @@ public class PoiUtil {
|
|||||||
document.createParagraph().createRun().setText("数据库名:" + dbName);
|
document.createParagraph().createRun().setText("数据库名:" + dbName);
|
||||||
document.createParagraph().createRun().setText("导出时间:" + DateTime.now().toString());
|
document.createParagraph().createRun().setText("导出时间:" + DateTime.now().toString());
|
||||||
document.createParagraph().createRun().setText("导出说明:本文档使用zyplayer-doc生成并导出");
|
document.createParagraph().createRun().setText("导出说明:本文档使用zyplayer-doc生成并导出");
|
||||||
|
document.createParagraph().createRun().setText("所有库表:");
|
||||||
List<List<String>> baseDataList = new LinkedList<>();
|
List<List<String>> baseDataList = new LinkedList<>();
|
||||||
baseDataList.add(Arrays.asList("表名", "说明"));
|
baseDataList.add(Arrays.asList("表名", "说明"));
|
||||||
for (TableColumnVo.TableInfoVo dto : tableList) {
|
for (TableColumnVo.TableInfoVo dto : tableList) {
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
<!DOCTYPE html><html lang=en><head><meta charset=utf-8><meta http-equiv=X-UA-Compatible content="IE=edge"><meta name=viewport content="width=device-width,initial-scale=1"><link rel=icon href=favicon-db.png><title>数据库文档管理</title><link href=css/app.9aaf8b21.css rel=preload as=style><link href=css/chunk-vendors.7be40bfc.css rel=preload as=style><link href=js/app.ff5f6236.js rel=preload as=script><link href=js/chunk-vendors.8274a50c.js rel=preload as=script><link href=css/chunk-vendors.7be40bfc.css rel=stylesheet><link href=css/app.9aaf8b21.css rel=stylesheet></head><body><noscript><strong>We're sorry but zyplayer-db-ui doesn't work properly without JavaScript enabled. Please enable it to continue.</strong></noscript><div id=app></div><script src=js/chunk-vendors.8274a50c.js></script><script src=js/app.ff5f6236.js></script></body></html>
|
<!DOCTYPE html><html lang=en><head><meta charset=utf-8><meta http-equiv=X-UA-Compatible content="IE=edge"><meta name=viewport content="width=device-width,initial-scale=1"><link rel=icon href=favicon-db.png><title>数据库文档管理</title><link href=css/app.9aaf8b21.css rel=preload as=style><link href=css/chunk-vendors.7be40bfc.css rel=preload as=style><link href=js/app.c76c831f.js rel=preload as=script><link href=js/chunk-vendors.8274a50c.js rel=preload as=script><link href=css/chunk-vendors.7be40bfc.css rel=stylesheet><link href=css/app.9aaf8b21.css rel=stylesheet></head><body><noscript><strong>We're sorry but zyplayer-db-ui doesn't work properly without JavaScript enabled. Please enable it to continue.</strong></noscript><div id=app></div><script src=js/chunk-vendors.8274a50c.js></script><script src=js/app.c76c831f.js></script></body></html>
|
||||||
File diff suppressed because one or more lines are too long
@@ -2,8 +2,8 @@
|
|||||||
ENV = 'development'
|
ENV = 'development'
|
||||||
|
|
||||||
# base api
|
# base api
|
||||||
# VUE_APP_BASE_API = 'http://local.zyplayer.com:8083/zyplayer-doc-manage'
|
VUE_APP_BASE_API = 'http://local.zyplayer.com:8083/zyplayer-doc-manage'
|
||||||
VUE_APP_BASE_API = 'http://doc.zyplayer.com/zyplayer-doc-manage'
|
# VUE_APP_BASE_API = 'http://doc.zyplayer.com/zyplayer-doc-manage'
|
||||||
|
|
||||||
VUE_CLI_BABEL_TRANSPILE_MODULES = true
|
VUE_CLI_BABEL_TRANSPILE_MODULES = true
|
||||||
|
|
||||||
|
|||||||
@@ -25,6 +25,9 @@
|
|||||||
<el-table-column prop="tableComment" label="表注释"></el-table-column>
|
<el-table-column prop="tableComment" label="表注释"></el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
</el-card>
|
</el-card>
|
||||||
|
<form method="post" ref="downloadForm" :action="downloadFormParam.url" target="_blank">
|
||||||
|
<input type="hidden" :name="key" :value="val" v-for="(val,key) in downloadFormParam.param">
|
||||||
|
</form>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@@ -47,6 +50,10 @@
|
|||||||
databaseList: [],
|
databaseList: [],
|
||||||
tableList: [],
|
tableList: [],
|
||||||
selectTables: [],
|
selectTables: [],
|
||||||
|
downloadFormParam: {
|
||||||
|
url: 'zyplayer-doc-db/doc-db/exportDatabase',
|
||||||
|
param: {}
|
||||||
|
},
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
mounted: function () {
|
mounted: function () {
|
||||||
@@ -66,17 +73,25 @@
|
|||||||
app.$message.info("请选择需要导出的表");
|
app.$message.info("请选择需要导出的表");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
var tableNames = "";
|
let tableNames = "";
|
||||||
for (var i = 0; i < this.selectTables.length; i++) {
|
for (let i = 0; i < this.selectTables.length; i++) {
|
||||||
if (tableNames !== "") {
|
if (tableNames !== "") {
|
||||||
tableNames += ",";
|
tableNames += ",";
|
||||||
}
|
}
|
||||||
tableNames += this.selectTables[i].tableName;
|
tableNames += this.selectTables[i].tableName;
|
||||||
}
|
}
|
||||||
window.open("zyplayer-doc-db/doc-db/exportDatabase?sourceId=" + this.choiceDatasourceId
|
// window.open("zyplayer-doc-db/doc-db/exportDatabase?sourceId=" + this.choiceDatasourceId
|
||||||
+ "&exportType=" + this.exportType
|
// + "&exportType=" + this.exportType
|
||||||
+ "&dbName=" + this.choiceDatabase
|
// + "&dbName=" + this.choiceDatabase
|
||||||
+ "&tableNames=" + tableNames);
|
// + "&tableNames=" + tableNames);
|
||||||
|
// 改为post方式提交下载
|
||||||
|
this.downloadFormParam.param = {
|
||||||
|
sourceId: this.choiceDatasourceId,
|
||||||
|
exportType: this.exportType,
|
||||||
|
dbName: this.choiceDatabase,
|
||||||
|
tableNames: tableNames,
|
||||||
|
};
|
||||||
|
setTimeout(() => this.$refs.downloadForm.submit(), 0);
|
||||||
},
|
},
|
||||||
loadGetTableList() {
|
loadGetTableList() {
|
||||||
datasourceApi.tableList({sourceId: this.choiceDatasourceId, dbName: this.choiceDatabase}).then(json => {
|
datasourceApi.tableList({sourceId: this.choiceDatasourceId, dbName: this.choiceDatabase}).then(json => {
|
||||||
|
|||||||
Reference in New Issue
Block a user