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

This commit is contained in:
junjie 2021-06-23 17:44:47 +08:00
parent d8983a9547
commit 1663560f90
4 changed files with 21 additions and 7 deletions

View File

@ -6,6 +6,7 @@ import io.dataease.dto.chart.ChartCustomFilterDTO;
import io.dataease.dto.chart.ChartViewFieldDTO;
import io.dataease.provider.QueryProvider;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.ObjectUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;
@ -366,6 +367,9 @@ public class DorisQueryProvider extends QueryProvider {
for (ChartCustomFilterDTO request : requestList) {
String value = request.getValue();
DatasetTableField field = request.getField();
if (ObjectUtils.isEmpty(field)) {
continue;
}
if (field.getDeType() == 1 && field.getDeExtractType() != 1) {
filter.append(" AND FROM_UNIXTIME(cast(")
.append(field.getDataeaseName())

View File

@ -68,11 +68,12 @@ export function listDatasource() {
})
}
export function getTable(id) {
export function getTable(id, hideMsg = false) {
return request({
url: '/dataset/table/get/' + id,
loading: true,
method: 'post'
method: 'post',
hideMsg: hideMsg
})
}

View File

@ -1,5 +1,6 @@
<template>
<el-row style="height: 100%;overflow-y: hidden;width: 100%;">
<span v-show="false">{{ tableRefresh }}</span>
<el-row style="height: 26px;">
<el-popover
placement="right-start"
@ -92,6 +93,12 @@ export default {
tabStatus: false
}
},
computed: {
tableRefresh() {
this.initTable(this.param)
return this.$store.state.dataset.table
}
},
watch: {
'param': function() {
this.initTable(this.param)
@ -107,9 +114,11 @@ export default {
if (id !== null) {
this.fields = []
this.data = []
getTable(id).then(response => {
getTable(id, true).then(response => {
this.table = response.data
this.initPreviewData(this.page)
}).catch(res => {
this.$emit('switchComponent', { name: '' })
})
}
},

View File

@ -561,8 +561,8 @@ export default {
// this.tableTree()
this.refreshNodeBy(table.sceneId)
// this.$router.push('/dataset/home')
this.$emit('switchComponent', { name: '' })
this.$store.dispatch('dataset/setTable', null)
// this.$emit('switchComponent', { name: 'ViewTable', param: table.id })
this.$store.dispatch('dataset/setTable', new Date().getTime())
})
} else {
// this.$message({
@ -609,8 +609,8 @@ export default {
// this.tableTree()
this.refreshNodeBy(data.sceneId)
// this.$router.push('/dataset/home')
this.$emit('switchComponent', { name: '' })
this.$store.dispatch('dataset/setTable', null)
// this.$emit('switchComponent', { name: '' })
this.$store.dispatch('dataset/setTable', new Date().getTime())
})
}).catch(() => {
})