Unverified 提交 e9c5201d authored 作者: XiaJunjie2020's avatar XiaJunjie2020 提交者: GitHub

Merge pull request #366 from dataease/pr@v1.1@fix_过滤器多条件问题;视图编辑字段问题

fix: 过滤器多条件问题;视图编辑字段问题
......@@ -136,33 +136,29 @@ public class ChartViewService {
}.getType());
List<ChartFieldCustomFilterDTO> fieldCustomFilter = new Gson().fromJson(view.getCustomFilter(), new TypeToken<List<ChartFieldCustomFilterDTO>>() {
}.getType());
List<ChartCustomFilterDTO> customFilter = fieldCustomFilter.stream().map(ele -> {
ChartCustomFilterDTO dto = new ChartCustomFilterDTO();
ele.getFilter().forEach(f -> {
List<ChartCustomFilterDTO> customFilter = new ArrayList<>();
for (ChartFieldCustomFilterDTO ele : fieldCustomFilter) {
List<ChartCustomFilterDTO> collect = ele.getFilter().stream().map(f -> {
ChartCustomFilterDTO dto = new ChartCustomFilterDTO();
BeanUtils.copyBean(dto, f);
dto.setField(dataSetTableFieldsService.get(f.getFieldId()));
});
return dto;
}).collect(Collectors.toList());
// if (StringUtils.equalsIgnoreCase("text", view.getType()) || StringUtils.equalsIgnoreCase("gauge", view.getType())) {
// xAxis = new ArrayList<>();
// if (CollectionUtils.isEmpty(yAxis)) {
// ChartViewDTO dto = new ChartViewDTO();
// BeanUtils.copyBean(dto, view);
// return dto;
// }
// } else {
// if (CollectionUtils.isEmpty(xAxis) || CollectionUtils.isEmpty(yAxis)) {
// ChartViewDTO dto = new ChartViewDTO();
// BeanUtils.copyBean(dto, view);
// return dto;
// }
// }
if (CollectionUtils.isEmpty(xAxis) && CollectionUtils.isEmpty(yAxis)) {
ChartViewDTO dto = new ChartViewDTO();
BeanUtils.copyBean(dto, view);
return dto;
return dto;
}).collect(Collectors.toList());
customFilter.addAll(collect);
}
if (StringUtils.equalsIgnoreCase("text", view.getType()) || StringUtils.equalsIgnoreCase("gauge", view.getType())) {
xAxis = new ArrayList<>();
if (CollectionUtils.isEmpty(yAxis)) {
ChartViewDTO dto = new ChartViewDTO();
BeanUtils.copyBean(dto, view);
return dto;
}
} else {
if (CollectionUtils.isEmpty(xAxis) && CollectionUtils.isEmpty(yAxis)) {
ChartViewDTO dto = new ChartViewDTO();
BeanUtils.copyBean(dto, view);
return dto;
}
}
// 过滤来自仪表板的条件
......
......@@ -88,6 +88,11 @@ export default {
}
},
watch: {
'param.tableId': {
handler: function() {
this.resetComponent()
}
},
'checkedList': function() {
// console.log(this.checkedList)
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: {
'param.tableId': {
handler: function() {
this.resetComponent()
this.initTableInfo()
}
}
......@@ -302,6 +303,20 @@ export default {
// console.log(newCode)
this.sql = newCode
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)
}
}
}
......
......@@ -129,7 +129,9 @@ export default {
}
},
watch: {
'param': function() {
this.initField()
}
},
mounted() {
window.onresize = () => {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论