forked from github/dataease
feat(fix):添加db数据集,默认加上数据源名称
This commit is contained in:
parent
f837c0edf4
commit
c2cb12c73b
@ -102,10 +102,6 @@ public class DataSetTableService {
|
||||
datasetTable.setCreateBy(AuthUtils.getUser().getUsername());
|
||||
datasetTable.setCreateTime(System.currentTimeMillis());
|
||||
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);
|
||||
// 添加表成功后,获取当前表字段和类型,抽象到dataease数据库
|
||||
if (insert == 1) {
|
||||
|
@ -120,17 +120,24 @@ export default {
|
||||
save() {
|
||||
// console.log(this.checkTableList);
|
||||
// console.log(this.scene);
|
||||
let ds = {}
|
||||
this.options.forEach(ele => {
|
||||
if (ele.id === this.dataSource) {
|
||||
ds = ele
|
||||
}
|
||||
})
|
||||
const sceneId = this.param.id
|
||||
const dataSourceId = this.dataSource
|
||||
const tables = []
|
||||
const mode = this.mode
|
||||
this.checkTableList.forEach(function(name) {
|
||||
tables.push({
|
||||
name: name,
|
||||
name: ds.name + '_' + name,
|
||||
sceneId: sceneId,
|
||||
dataSourceId: dataSourceId,
|
||||
type: 'db',
|
||||
mode: parseInt(mode)
|
||||
mode: parseInt(mode),
|
||||
info: JSON.stringify({ table: name })
|
||||
})
|
||||
})
|
||||
post('/dataset/table/batchAdd', tables).then(response => {
|
||||
|
Loading…
Reference in New Issue
Block a user