forked from github/dataease
Merge pull request #368 from dataease/pr@dev@fix_过滤器多条件异常问题;编辑数据集切换到添加数据集界面异常问题
fix: 过滤器多条件异常问题;编辑数据集切换到添加数据集界面异常问题
This commit is contained in:
commit
ce1cd9131c
@ -138,14 +138,16 @@ public class ChartViewService {
|
|||||||
}.getType());
|
}.getType());
|
||||||
List<ChartFieldCustomFilterDTO> fieldCustomFilter = new Gson().fromJson(view.getCustomFilter(), new TypeToken<List<ChartFieldCustomFilterDTO>>() {
|
List<ChartFieldCustomFilterDTO> fieldCustomFilter = new Gson().fromJson(view.getCustomFilter(), new TypeToken<List<ChartFieldCustomFilterDTO>>() {
|
||||||
}.getType());
|
}.getType());
|
||||||
List<ChartCustomFilterDTO> customFilter = fieldCustomFilter.stream().map(ele -> {
|
List<ChartCustomFilterDTO> customFilter = new ArrayList<>();
|
||||||
|
for (ChartFieldCustomFilterDTO ele : fieldCustomFilter) {
|
||||||
|
List<ChartCustomFilterDTO> collect = ele.getFilter().stream().map(f -> {
|
||||||
ChartCustomFilterDTO dto = new ChartCustomFilterDTO();
|
ChartCustomFilterDTO dto = new ChartCustomFilterDTO();
|
||||||
ele.getFilter().forEach(f -> {
|
|
||||||
BeanUtils.copyBean(dto, f);
|
BeanUtils.copyBean(dto, f);
|
||||||
dto.setField(dataSetTableFieldsService.get(f.getFieldId()));
|
dto.setField(dataSetTableFieldsService.get(f.getFieldId()));
|
||||||
});
|
|
||||||
return dto;
|
return dto;
|
||||||
}).collect(Collectors.toList());
|
}).collect(Collectors.toList());
|
||||||
|
customFilter.addAll(collect);
|
||||||
|
}
|
||||||
|
|
||||||
if (StringUtils.equalsIgnoreCase("text", view.getType()) || StringUtils.equalsIgnoreCase("gauge", view.getType())) {
|
if (StringUtils.equalsIgnoreCase("text", view.getType()) || StringUtils.equalsIgnoreCase("gauge", view.getType())) {
|
||||||
xAxis = new ArrayList<>();
|
xAxis = new ArrayList<>();
|
||||||
|
@ -88,6 +88,11 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
|
'param.tableId': {
|
||||||
|
handler: function() {
|
||||||
|
this.resetComponent()
|
||||||
|
}
|
||||||
|
},
|
||||||
'checkedList': function() {
|
'checkedList': function() {
|
||||||
// console.log(this.checkedList)
|
// console.log(this.checkedList)
|
||||||
this.getUnionData()
|
this.getUnionData()
|
||||||
@ -239,8 +244,15 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
dataReset() {
|
resetComponent() {
|
||||||
|
this.name = '自定义数据集'
|
||||||
|
this.table = {}
|
||||||
|
this.checkedList = []
|
||||||
|
this.unionData = []
|
||||||
|
this.height = 500
|
||||||
|
this.data = []
|
||||||
|
this.fields = []
|
||||||
|
this.customType = ['db', 'sql', 'excel']
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -163,6 +163,7 @@ export default {
|
|||||||
watch: {
|
watch: {
|
||||||
'param.tableId': {
|
'param.tableId': {
|
||||||
handler: function() {
|
handler: function() {
|
||||||
|
this.resetComponent()
|
||||||
this.initTableInfo()
|
this.initTableInfo()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -283,7 +284,7 @@ export default {
|
|||||||
cancel() {
|
cancel() {
|
||||||
// this.dataReset()
|
// this.dataReset()
|
||||||
if (this.param.tableId) {
|
if (this.param.tableId) {
|
||||||
this.$emit('switchComponent', { name: 'ViewTable', param: this.param.table})
|
this.$emit('switchComponent', { name: 'ViewTable', param: this.param.table })
|
||||||
} else {
|
} else {
|
||||||
this.$emit('switchComponent', { name: '' })
|
this.$emit('switchComponent', { name: '' })
|
||||||
}
|
}
|
||||||
@ -302,6 +303,20 @@ export default {
|
|||||||
// console.log(newCode)
|
// console.log(newCode)
|
||||||
this.sql = newCode
|
this.sql = newCode
|
||||||
this.$emit('codeChange', this.sql)
|
this.$emit('codeChange', this.sql)
|
||||||
|
},
|
||||||
|
|
||||||
|
resetComponent() {
|
||||||
|
this.dataSource = ''
|
||||||
|
this.options = []
|
||||||
|
this.name = ''
|
||||||
|
this.sql = ''
|
||||||
|
this.data = []
|
||||||
|
this.fields = []
|
||||||
|
this.mode = '0'
|
||||||
|
this.syncType = 'sync_now'
|
||||||
|
this.height = 500
|
||||||
|
this.kettleRunning = false
|
||||||
|
this.$refs.plxTable.reloadData(this.data)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user