提交 c2cb12c7 authored 作者: junjie's avatar junjie

feat(fix):添加db数据集,默认加上数据源名称

上级 f837c0ed
...@@ -102,10 +102,6 @@ public class DataSetTableService { ...@@ -102,10 +102,6 @@ public class DataSetTableService {
datasetTable.setCreateBy(AuthUtils.getUser().getUsername()); datasetTable.setCreateBy(AuthUtils.getUser().getUsername());
datasetTable.setCreateTime(System.currentTimeMillis()); datasetTable.setCreateTime(System.currentTimeMillis());
DataTableInfoDTO dataTableInfoDTO = new DataTableInfoDTO(); DataTableInfoDTO dataTableInfoDTO = new DataTableInfoDTO();
if (StringUtils.equalsIgnoreCase("db", datasetTable.getType())) {
dataTableInfoDTO.setTable(datasetTable.getName());
datasetTable.setInfo(new Gson().toJson(dataTableInfoDTO));
}
int insert = datasetTableMapper.insert(datasetTable); int insert = datasetTableMapper.insert(datasetTable);
// 添加表成功后,获取当前表字段和类型,抽象到dataease数据库 // 添加表成功后,获取当前表字段和类型,抽象到dataease数据库
if (insert == 1) { if (insert == 1) {
......
...@@ -120,17 +120,24 @@ export default { ...@@ -120,17 +120,24 @@ export default {
save() { save() {
// console.log(this.checkTableList); // console.log(this.checkTableList);
// console.log(this.scene); // console.log(this.scene);
let ds = {}
this.options.forEach(ele => {
if (ele.id === this.dataSource) {
ds = ele
}
})
const sceneId = this.param.id const sceneId = this.param.id
const dataSourceId = this.dataSource const dataSourceId = this.dataSource
const tables = [] const tables = []
const mode = this.mode const mode = this.mode
this.checkTableList.forEach(function(name) { this.checkTableList.forEach(function(name) {
tables.push({ tables.push({
name: name, name: ds.name + '_' + name,
sceneId: sceneId, sceneId: sceneId,
dataSourceId: dataSourceId, dataSourceId: dataSourceId,
type: 'db', type: 'db',
mode: parseInt(mode) mode: parseInt(mode),
info: JSON.stringify({ table: name })
}) })
}) })
post('/dataset/table/batchAdd', tables).then(response => { post('/dataset/table/batchAdd', tables).then(response => {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论