提交 1663560f authored 作者: junjie's avatar junjie

fix:视图结果过滤器条件增加容错;数据集tree重命名、删除后,右侧界面优化

上级 d8983a95
...@@ -6,6 +6,7 @@ import io.dataease.dto.chart.ChartCustomFilterDTO; ...@@ -6,6 +6,7 @@ import io.dataease.dto.chart.ChartCustomFilterDTO;
import io.dataease.dto.chart.ChartViewFieldDTO; import io.dataease.dto.chart.ChartViewFieldDTO;
import io.dataease.provider.QueryProvider; import io.dataease.provider.QueryProvider;
import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.ObjectUtils;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
...@@ -366,6 +367,9 @@ public class DorisQueryProvider extends QueryProvider { ...@@ -366,6 +367,9 @@ public class DorisQueryProvider extends QueryProvider {
for (ChartCustomFilterDTO request : requestList) { for (ChartCustomFilterDTO request : requestList) {
String value = request.getValue(); String value = request.getValue();
DatasetTableField field = request.getField(); DatasetTableField field = request.getField();
if (ObjectUtils.isEmpty(field)) {
continue;
}
if (field.getDeType() == 1 && field.getDeExtractType() != 1) { if (field.getDeType() == 1 && field.getDeExtractType() != 1) {
filter.append(" AND FROM_UNIXTIME(cast(") filter.append(" AND FROM_UNIXTIME(cast(")
.append(field.getDataeaseName()) .append(field.getDataeaseName())
......
...@@ -68,11 +68,12 @@ export function listDatasource() { ...@@ -68,11 +68,12 @@ export function listDatasource() {
}) })
} }
export function getTable(id) { export function getTable(id, hideMsg = false) {
return request({ return request({
url: '/dataset/table/get/' + id, url: '/dataset/table/get/' + id,
loading: true, loading: true,
method: 'post' method: 'post',
hideMsg: hideMsg
}) })
} }
......
<template> <template>
<el-row style="height: 100%;overflow-y: hidden;width: 100%;"> <el-row style="height: 100%;overflow-y: hidden;width: 100%;">
<span v-show="false">{{ tableRefresh }}</span>
<el-row style="height: 26px;"> <el-row style="height: 26px;">
<el-popover <el-popover
placement="right-start" placement="right-start"
...@@ -92,6 +93,12 @@ export default { ...@@ -92,6 +93,12 @@ export default {
tabStatus: false tabStatus: false
} }
}, },
computed: {
tableRefresh() {
this.initTable(this.param)
return this.$store.state.dataset.table
}
},
watch: { watch: {
'param': function() { 'param': function() {
this.initTable(this.param) this.initTable(this.param)
...@@ -107,9 +114,11 @@ export default { ...@@ -107,9 +114,11 @@ export default {
if (id !== null) { if (id !== null) {
this.fields = [] this.fields = []
this.data = [] this.data = []
getTable(id).then(response => { getTable(id, true).then(response => {
this.table = response.data this.table = response.data
this.initPreviewData(this.page) this.initPreviewData(this.page)
}).catch(res => {
this.$emit('switchComponent', { name: '' })
}) })
} }
}, },
......
...@@ -561,8 +561,8 @@ export default { ...@@ -561,8 +561,8 @@ export default {
// this.tableTree() // this.tableTree()
this.refreshNodeBy(table.sceneId) this.refreshNodeBy(table.sceneId)
// this.$router.push('/dataset/home') // this.$router.push('/dataset/home')
this.$emit('switchComponent', { name: '' }) // this.$emit('switchComponent', { name: 'ViewTable', param: table.id })
this.$store.dispatch('dataset/setTable', null) this.$store.dispatch('dataset/setTable', new Date().getTime())
}) })
} else { } else {
// this.$message({ // this.$message({
...@@ -609,8 +609,8 @@ export default { ...@@ -609,8 +609,8 @@ export default {
// this.tableTree() // this.tableTree()
this.refreshNodeBy(data.sceneId) this.refreshNodeBy(data.sceneId)
// this.$router.push('/dataset/home') // this.$router.push('/dataset/home')
this.$emit('switchComponent', { name: '' }) // this.$emit('switchComponent', { name: '' })
this.$store.dispatch('dataset/setTable', null) this.$store.dispatch('dataset/setTable', new Date().getTime())
}) })
}).catch(() => { }).catch(() => {
}) })
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论