feat(数据集):编辑数据集修改

This commit is contained in:
junjie 2021-06-08 12:16:55 +08:00
parent c839b3cba4
commit ebe6f306c6
3 changed files with 21 additions and 8 deletions

View File

@ -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;
}

View File

@ -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);
});
}
}
}
}
}

View File

@ -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({