forked from github/dataease
feat(数据集):编辑数据集修改
This commit is contained in:
parent
c839b3cba4
commit
ebe6f306c6
@ -16,8 +16,7 @@ public class DataSetTableRequest extends DatasetTable {
|
||||
private String sort;
|
||||
private List<String> tableNames;
|
||||
private String row = "1000";
|
||||
|
||||
private String userId;
|
||||
|
||||
private Integer editType;
|
||||
private Boolean isRename;
|
||||
}
|
||||
|
@ -114,12 +114,25 @@ public class DataSetTableService {
|
||||
}
|
||||
} else {
|
||||
int update = datasetTableMapper.updateByPrimaryKeySelective(datasetTable);
|
||||
// sql 更新
|
||||
if (update == 1) {
|
||||
if (StringUtils.equalsIgnoreCase(datasetTable.getType(), "sql") || StringUtils.equalsIgnoreCase(datasetTable.getType(), "custom")) {
|
||||
// 删除所有字段,重新抽象
|
||||
dataSetTableFieldsService.deleteByTableId(datasetTable.getId());
|
||||
saveTableField(datasetTable);
|
||||
if (datasetTable.getIsRename() == null || !datasetTable.getIsRename()) {
|
||||
// 更新数据和字段
|
||||
if (update == 1) {
|
||||
if (StringUtils.equalsIgnoreCase(datasetTable.getType(), "sql") || StringUtils.equalsIgnoreCase(datasetTable.getType(), "custom")) {
|
||||
// 删除所有字段,重新抽象
|
||||
dataSetTableFieldsService.deleteByTableId(datasetTable.getId());
|
||||
saveTableField(datasetTable);
|
||||
}
|
||||
if (StringUtils.equalsIgnoreCase(datasetTable.getType(), "excel")) {
|
||||
if (datasetTable.getEditType() == 0) {
|
||||
commonThreadPool.addTask(() -> {
|
||||
extractDataService.extractData(datasetTable.getId(), null, "all_scope", null);
|
||||
});
|
||||
} else if (datasetTable.getEditType() == 1) {
|
||||
commonThreadPool.addTask(() -> {
|
||||
extractDataService.extractData(datasetTable.getId(), null, "add_scope", null);
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -395,6 +395,7 @@ export default {
|
||||
table.mode = parseInt(table.mode)
|
||||
this.$refs['tableForm'].validate((valid) => {
|
||||
if (valid) {
|
||||
table.isRename = true
|
||||
addTable(table).then(response => {
|
||||
this.closeTable()
|
||||
this.$message({
|
||||
|
Loading…
Reference in New Issue
Block a user