forked from github/dataease
Merge remote-tracking branch 'origin/dev' into refactor_panel-edit
This commit is contained in:
commit
ebf8c155e6
@ -805,11 +805,13 @@ public class DorisQueryProvider extends QueryProvider {
|
||||
} else if (StringUtils.containsIgnoreCase(filterItemDTO.getTerm(), "like")) {
|
||||
whereValue = "'%" + value + "%'";
|
||||
} else {
|
||||
if (field.getDeExtractType() == 2 || field.getDeExtractType() == 3 || field.getDeExtractType() == 4) {
|
||||
// Doris field type test
|
||||
/*if (field.getDeExtractType() == 2 || field.getDeExtractType() == 3 || field.getDeExtractType() == 4) {
|
||||
whereValue = String.format(DorisConstants.WHERE_NUMBER_VALUE, value);
|
||||
} else {
|
||||
whereValue = String.format(DorisConstants.WHERE_VALUE_VALUE, value);
|
||||
}
|
||||
}*/
|
||||
whereValue = String.format(DorisConstants.WHERE_VALUE_VALUE, value);
|
||||
}
|
||||
list.add(SQLObj.builder()
|
||||
.whereField(whereName)
|
||||
@ -881,11 +883,13 @@ public class DorisQueryProvider extends QueryProvider {
|
||||
whereValue = String.format(DorisConstants.WHERE_BETWEEN, value.get(0), value.get(1));
|
||||
}
|
||||
} else {
|
||||
if (field.getDeExtractType() == 2 || field.getDeExtractType() == 3 || field.getDeExtractType() == 4) {
|
||||
// doris field type test
|
||||
/*if (field.getDeExtractType() == 2 || field.getDeExtractType() == 3 || field.getDeExtractType() == 4) {
|
||||
whereValue = String.format(DorisConstants.WHERE_NUMBER_VALUE, value.get(0));
|
||||
} else {
|
||||
whereValue = String.format(DorisConstants.WHERE_VALUE_VALUE, value.get(0));
|
||||
}
|
||||
}*/
|
||||
whereValue = String.format(DorisConstants.WHERE_VALUE_VALUE, value.get(0));
|
||||
}
|
||||
list.add(SQLObj.builder()
|
||||
.whereField(whereName)
|
||||
|
@ -9,6 +9,7 @@ import { uuid } from 'vue-uuid'
|
||||
import { findOne } from '@/api/panel/panel'
|
||||
import { getPanelAllLinkageInfo } from '@/api/panel/linkage'
|
||||
import { queryPanelJumpInfo, queryTargetPanelJumpInfo } from '@/api/panel/linkJump'
|
||||
import { panelInit } from '@/components/canvas/utils/utils'
|
||||
|
||||
export default {
|
||||
components: { Preview },
|
||||
@ -43,8 +44,10 @@ export default {
|
||||
}
|
||||
// 加载视图数据
|
||||
findOne(this.panelId).then(response => {
|
||||
const componentDatas = JSON.parse(response.data.panelData)
|
||||
panelInit(componentDatas)
|
||||
this.dataLoading = false
|
||||
this.$store.commit('setComponentData', this.resetID(JSON.parse(response.data.panelData)))
|
||||
this.$store.commit('setComponentData', this.resetID(componentDatas))
|
||||
this.$store.commit('setCanvasStyle', JSON.parse(response.data.panelStyle))
|
||||
const data = {
|
||||
id: response.data.id,
|
||||
|
@ -75,7 +75,6 @@ import { deepCopy, mobile2MainCanvas } from '@/components/canvas/utils/utils'
|
||||
import { panelSave } from '@/api/panel/panel'
|
||||
import { saveLinkage, getPanelAllLinkageInfo } from '@/api/panel/linkage'
|
||||
import bus from '@/utils/bus'
|
||||
|
||||
import {
|
||||
DEFAULT_COMMON_CANVAS_STYLE_STRING
|
||||
} from '@/views/panel/panel'
|
||||
@ -266,6 +265,12 @@ export default {
|
||||
panelStyle: JSON.stringify(this.canvasStyleData),
|
||||
panelData: JSON.stringify(this.componentData)
|
||||
}
|
||||
const components = deepCopy(this.componentData)
|
||||
components.forEach(view => {
|
||||
if (view.filters && view.filters.length > 0) { view.filters = [] }
|
||||
})
|
||||
// 无需保存条件
|
||||
requestInfo.panelData = JSON.stringify(components)
|
||||
panelSave(requestInfo).then(response => {
|
||||
this.$store.commit('refreshSaveStatus')
|
||||
this.$message({
|
||||
|
@ -1,93 +0,0 @@
|
||||
<template>
|
||||
<div v-loading="dataLoading" class="bg">
|
||||
<Preview v-if="!dataLoading" />
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import Preview from './Preview'
|
||||
import { uuid } from 'vue-uuid'
|
||||
import { findOne } from '@/api/panel/panel'
|
||||
import { getPanelAllLinkageInfo } from '@/api/panel/linkage'
|
||||
import { queryPanelJumpInfo, queryTargetPanelJumpInfo } from '@/api/panel/linkJump'
|
||||
|
||||
export default {
|
||||
components: { Preview },
|
||||
props: {
|
||||
panelId: {
|
||||
type: String,
|
||||
require: true
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
dataLoading: false
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.restore()
|
||||
},
|
||||
methods: {
|
||||
restore() {
|
||||
this.dataLoading = true
|
||||
// 加载视图数据
|
||||
findOne(this.panelId).then(response => {
|
||||
this.dataLoading = false
|
||||
this.$store.commit('setComponentData', this.resetID(JSON.parse(response.data.panelData)))
|
||||
this.$store.commit('setCanvasStyle', JSON.parse(response.data.panelStyle))
|
||||
const data = {
|
||||
id: response.data.id,
|
||||
name: response.data.name
|
||||
}
|
||||
// 刷新联动信息
|
||||
getPanelAllLinkageInfo(this.panelId).then(rsp => {
|
||||
this.$store.commit('setNowPanelTrackInfo', rsp.data)
|
||||
})
|
||||
// 刷新跳转信息
|
||||
queryPanelJumpInfo(this.panelId).then(rsp => {
|
||||
this.$store.commit('setNowPanelJumpInfo', rsp.data)
|
||||
})
|
||||
|
||||
// 如果含有跳转参数 进行触发
|
||||
const tempParam = localStorage.getItem('jumpInfoParam')
|
||||
if (tempParam) {
|
||||
localStorage.removeItem('jumpInfoParam')
|
||||
const jumpParam = JSON.parse(tempParam)
|
||||
const jumpRequestParam = {
|
||||
sourcePanelId: jumpParam.sourcePanelId,
|
||||
sourceViewId: jumpParam.sourceViewId,
|
||||
sourceFieldId: jumpParam.sourceFieldId,
|
||||
targetPanelId: this.panelId
|
||||
}
|
||||
this.dataLoading = true
|
||||
// 刷新跳转目标仪表板联动信息
|
||||
queryTargetPanelJumpInfo(jumpRequestParam).then(rsp => {
|
||||
this.dataLoading = false
|
||||
this.$store.commit('setNowTargetPanelJumpInfo', rsp.data)
|
||||
this.$store.commit('addViewTrackFilter', jumpParam)
|
||||
})
|
||||
}
|
||||
this.$store.dispatch('panel/setPanelInfo', data)
|
||||
})
|
||||
},
|
||||
resetID(data) {
|
||||
if (data) {
|
||||
data.forEach(item => {
|
||||
item.type !== 'custom' && (item.id = uuid.v1())
|
||||
})
|
||||
}
|
||||
return data
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.bg {
|
||||
width: 100%;
|
||||
height: 100vh!important;
|
||||
min-width: 800px;
|
||||
min-height: 600px;
|
||||
background-color: #f7f8fa;
|
||||
}
|
||||
</style>
|
||||
|
@ -60,7 +60,20 @@ export function mobile2MainCanvas(mainSource, mobileSource) {
|
||||
|
||||
export function panelInit(componentDatas) {
|
||||
componentDatas.forEach(item => {
|
||||
item.filters = (item.filters || [])
|
||||
if (item.component && item.component === 'de-date') {
|
||||
if (item.options.attrs && !item.options.attrs.default) {
|
||||
item.options.attrs.default = {
|
||||
isDynamic: false,
|
||||
dkey: 0,
|
||||
dynamicPrefix: 1,
|
||||
dynamicInfill: 'day',
|
||||
dynamicSuffix: 'before'
|
||||
}
|
||||
}
|
||||
}
|
||||
if (item.filters && item.filters.length > 0) {
|
||||
item.filters = []
|
||||
}
|
||||
item.linkageFilters = (item.linkageFilters || [])
|
||||
item.auxiliaryMatrix = (item.auxiliaryMatrix || false)
|
||||
item.x = (item.x || 1)
|
||||
|
@ -1,7 +1,27 @@
|
||||
<template>
|
||||
<div style="display: flex;">
|
||||
<view-track-bar ref="viewTrack" :track-menu="trackMenu" class="track-bar" :style="trackBarStyleTime" @trackClick="trackClick" />
|
||||
<view-track-bar
|
||||
ref="viewTrack"
|
||||
:track-menu="trackMenu"
|
||||
class="track-bar"
|
||||
:style="trackBarStyleTime"
|
||||
@trackClick="trackClick"
|
||||
/>
|
||||
<div :id="chartId" style="width: 100%;height: 100%;overflow: hidden;" :style="{ borderRadius: borderRadius}" />
|
||||
<div v-if="chart.type === 'map'" class="map-zoom-box">
|
||||
<div style="margin-bottom: 0.5em;">
|
||||
<el-button size="mini" icon="el-icon-plus" circle @click="roamMap(true)" />
|
||||
</div>
|
||||
|
||||
<div style="margin-bottom: 0.5em;">
|
||||
<el-button size="mini" icon="el-icon-refresh" circle @click="resetZoom()" />
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<el-button size="mini" icon="el-icon-minus" circle @click="roamMap(false)" />
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@ -19,24 +39,55 @@ import {
|
||||
BASE_TREEMAP,
|
||||
BASE_MIX
|
||||
} from '../chart/chart'
|
||||
import { baseBarOption, stackBarOption, horizontalBarOption, horizontalStackBarOption } from '../chart/bar/bar'
|
||||
import { baseLineOption, stackLineOption } from '../chart/line/line'
|
||||
import { basePieOption, rosePieOption } from '../chart/pie/pie'
|
||||
import { baseMapOption } from '../chart/map/map'
|
||||
import { baseFunnelOption } from '../chart/funnel/funnel'
|
||||
import { baseRadarOption } from '../chart/radar/radar'
|
||||
import { baseGaugeOption } from '../chart/gauge/gauge'
|
||||
import { baseScatterOption } from '../chart/scatter/scatter'
|
||||
import { baseTreemapOption } from '../chart/treemap/treemap'
|
||||
import { baseMixOption } from '@/views/chart/chart/mix/mix'
|
||||
// import eventBus from '@/components/canvas/utils/eventBus'
|
||||
import { uuid } from 'vue-uuid'
|
||||
import { geoJson } from '@/api/map/map'
|
||||
import {
|
||||
baseBarOption,
|
||||
stackBarOption,
|
||||
horizontalBarOption,
|
||||
horizontalStackBarOption
|
||||
} from '../chart/bar/bar'
|
||||
import {
|
||||
baseLineOption,
|
||||
stackLineOption
|
||||
} from '../chart/line/line'
|
||||
import {
|
||||
basePieOption,
|
||||
rosePieOption
|
||||
} from '../chart/pie/pie'
|
||||
import {
|
||||
baseMapOption
|
||||
} from '../chart/map/map'
|
||||
import {
|
||||
baseFunnelOption
|
||||
} from '../chart/funnel/funnel'
|
||||
import {
|
||||
baseRadarOption
|
||||
} from '../chart/radar/radar'
|
||||
import {
|
||||
baseGaugeOption
|
||||
} from '../chart/gauge/gauge'
|
||||
import {
|
||||
baseScatterOption
|
||||
} from '../chart/scatter/scatter'
|
||||
import {
|
||||
baseTreemapOption
|
||||
} from '../chart/treemap/treemap'
|
||||
import {
|
||||
baseMixOption
|
||||
} from '@/views/chart/chart/mix/mix'
|
||||
// import eventBus from '@/components/canvas/utils/eventBus'
|
||||
import {
|
||||
uuid
|
||||
} from 'vue-uuid'
|
||||
import {
|
||||
geoJson
|
||||
} from '@/api/map/map'
|
||||
import ViewTrackBar from '@/components/canvas/components/Editor/ViewTrackBar'
|
||||
|
||||
export default {
|
||||
name: 'ChartComponent',
|
||||
components: { ViewTrackBar },
|
||||
components: {
|
||||
ViewTrackBar
|
||||
},
|
||||
props: {
|
||||
chart: {
|
||||
type: Object,
|
||||
@ -110,7 +161,9 @@ export default {
|
||||
// 基于准备好的dom,初始化echarts实例
|
||||
// 渲染echart等待dom加载完毕,渲染之前先尝试销毁具有相同id的echart 放置多次切换仪表板有重复id情况
|
||||
const that = this
|
||||
new Promise((resolve) => { resolve() }).then(() => {
|
||||
new Promise((resolve) => {
|
||||
resolve()
|
||||
}).then(() => {
|
||||
// 此dom为echarts图标展示dom
|
||||
this.myChart = this.$echarts.getInstanceByDom(document.getElementById(this.chartId))
|
||||
if (!this.myChart) {
|
||||
@ -171,7 +224,10 @@ export default {
|
||||
|
||||
if (chart.type === 'map') {
|
||||
const customAttr = JSON.parse(chart.customAttr)
|
||||
if (!customAttr.areaCode) return
|
||||
if (!customAttr.areaCode) {
|
||||
this.myChart.clear()
|
||||
return
|
||||
}
|
||||
const cCode = this.dynamicAreaCode || customAttr.areaCode
|
||||
if (this.$store.getters.geoMap[cCode]) {
|
||||
const json = this.$store.getters.geoMap[cCode]
|
||||
@ -193,25 +249,25 @@ export default {
|
||||
},
|
||||
registerDynamicMap(areaCode) {
|
||||
this.dynamicAreaCode = areaCode
|
||||
// if (this.$store.getters.geoMap[areaCode]) {
|
||||
// const json = this.$store.getters.geoMap[areaCode]
|
||||
// this.myChart.dispose()
|
||||
// this.myChart = this.$echarts.getInstanceByDom(document.getElementById(this.chartId))
|
||||
// this.$echarts.registerMap('MAP', json)
|
||||
// return
|
||||
// }
|
||||
// geoJson(areaCode).then(res => {
|
||||
// this.$store.dispatch('map/setGeo', {
|
||||
// key: areaCode,
|
||||
// value: res
|
||||
// }).then(() => {
|
||||
// this.myChart.dispose()
|
||||
// this.myChart = this.$echarts.getInstanceByDom(document.getElementById(this.chartId))
|
||||
// this.$echarts.registerMap('MAP', res)
|
||||
// })
|
||||
// }).catch(() => {
|
||||
// this.downOrUp = true
|
||||
// })
|
||||
// if (this.$store.getters.geoMap[areaCode]) {
|
||||
// const json = this.$store.getters.geoMap[areaCode]
|
||||
// this.myChart.dispose()
|
||||
// this.myChart = this.$echarts.getInstanceByDom(document.getElementById(this.chartId))
|
||||
// this.$echarts.registerMap('MAP', json)
|
||||
// return
|
||||
// }
|
||||
// geoJson(areaCode).then(res => {
|
||||
// this.$store.dispatch('map/setGeo', {
|
||||
// key: areaCode,
|
||||
// value: res
|
||||
// }).then(() => {
|
||||
// this.myChart.dispose()
|
||||
// this.myChart = this.$echarts.getInstanceByDom(document.getElementById(this.chartId))
|
||||
// this.$echarts.registerMap('MAP', res)
|
||||
// })
|
||||
// }).catch(() => {
|
||||
// this.downOrUp = true
|
||||
// })
|
||||
},
|
||||
|
||||
initMapChart(geoJson, chart) {
|
||||
@ -284,11 +340,39 @@ export default {
|
||||
default:
|
||||
break
|
||||
}
|
||||
},
|
||||
roamMap(flag) {
|
||||
let targetZoom = 1
|
||||
const zoom = this.myChart.getOption().series[0].zoom
|
||||
if (flag) {
|
||||
targetZoom = zoom * 1.2
|
||||
} else {
|
||||
targetZoom = zoom / 1.2
|
||||
}
|
||||
const options = JSON.parse(JSON.stringify(this.myChart.getOption()))
|
||||
options.series[0].zoom = targetZoom
|
||||
this.myChart.setOption(options)
|
||||
},
|
||||
resetZoom() {
|
||||
const options = JSON.parse(JSON.stringify(this.myChart.getOption()))
|
||||
options.series[0].zoom = 1
|
||||
this.myChart.setOption(options)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.map-zoom-box {
|
||||
position: absolute;
|
||||
z-index: 999;
|
||||
left: 2%;
|
||||
bottom: 3%;
|
||||
box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
|
||||
text-align: center;
|
||||
padding: 5px;
|
||||
border-radius: 5px
|
||||
}
|
||||
|
||||
</style>
|
||||
|
Loading…
Reference in New Issue
Block a user