From 787ef75b06f214b19d057576ff1690220c59c5a4 Mon Sep 17 00:00:00 2001 From: fit2cloudrd Date: Fri, 24 Dec 2021 17:54:28 +0800 Subject: [PATCH 1/7] =?UTF-8?q?refactor:=20=E4=BC=98=E5=8C=96PC=E7=A7=BB?= =?UTF-8?q?=E5=8A=A8=E7=AB=AF=E5=B8=83=E5=B1=80=E5=88=87=E6=8D=A2=EF=BC=8C?= =?UTF-8?q?=E9=98=B2=E6=AD=A2=E5=87=BA=E7=8E=B0=E9=94=99=E8=AF=AF=E4=BB=AA?= =?UTF-8?q?=E8=A1=A8=E6=9D=BF=E5=B8=83=E5=B1=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: wangjiahao <1522128093@qq.com> --- frontend/src/components/canvas/components/Toolbar.vue | 1 + frontend/src/store/index.js | 1 + frontend/src/views/panel/list/PanelList.vue | 2 ++ frontend/src/views/panel/list/PanelViewShow.vue | 3 --- 4 files changed, 4 insertions(+), 3 deletions(-) diff --git a/frontend/src/components/canvas/components/Toolbar.vue b/frontend/src/components/canvas/components/Toolbar.vue index 1bbdc16046..841b0350e5 100644 --- a/frontend/src/components/canvas/components/Toolbar.vue +++ b/frontend/src/components/canvas/components/Toolbar.vue @@ -376,6 +376,7 @@ export default { mobileDataObj[item.id] = item }) const sourceComponentData = JSON.parse(this.componentDataCache) + this.$store.commit('setComponentDataCache', null) sourceComponentData.forEach(item => { if (mobileDataObj[item.id]) { mobile2MainCanvas(item, mobileDataObj[item.id]) diff --git a/frontend/src/store/index.js b/frontend/src/store/index.js index 8d71afdb3f..2c97d20e39 100644 --- a/frontend/src/store/index.js +++ b/frontend/src/store/index.js @@ -348,6 +348,7 @@ const data = { }, // 启用移动端布局 openMobileLayout(state) { + state.componentDataCache = null state.componentDataCache = JSON.stringify(state.componentData) state.pcComponentData = state.componentData const mainComponentData = [] diff --git a/frontend/src/views/panel/list/PanelList.vue b/frontend/src/views/panel/list/PanelList.vue index 016da5f01f..1af58c1307 100644 --- a/frontend/src/views/panel/list/PanelList.vue +++ b/frontend/src/views/panel/list/PanelList.vue @@ -645,6 +645,8 @@ export default { this.lastActiveNodeData = data this.activeTree = data.panelType if (data.nodeType === 'panel') { + // 清理pc布局缓存 + this.$store.commit('setComponentDataCache', null) // 加载视图数据 findOne(data.id).then(response => { const componentDatas = JSON.parse(response.data.panelData) diff --git a/frontend/src/views/panel/list/PanelViewShow.vue b/frontend/src/views/panel/list/PanelViewShow.vue index 9f9672ee49..54d0643dd8 100644 --- a/frontend/src/views/panel/list/PanelViewShow.vue +++ b/frontend/src/views/panel/list/PanelViewShow.vue @@ -130,13 +130,11 @@ import { starStatus, saveEnshrine, deleteEnshrine } from '@/api/panel/enshrine' import bus from '@/utils/bus' import { queryAll } from '@/api/panel/pdfTemplate' import ShareHead from '@/views/panel/GrantAuth/ShareHead' -import JsPDF from 'jspdf' export default { name: 'PanelViewShow', components: { Preview, SaveToTemplate, PDFPreExport, ShareHead }, props: { - // eslint-disable-next-line vue/require-default-prop activeTab: { type: String, required: false @@ -208,7 +206,6 @@ export default { bus.$on('set-panel-show-type', type => { this.showType = type || 0 }) - this.initPdfTemplate() }, methods: { From f6a82359a760b2ee921ccf99d4713ec2d883f09b Mon Sep 17 00:00:00 2001 From: junjie Date: Fri, 24 Dec 2021 18:35:53 +0800 Subject: [PATCH 2/7] feat: doris field type --- .../provider/query/doris/DorisQueryProvider.java | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/backend/src/main/java/io/dataease/provider/query/doris/DorisQueryProvider.java b/backend/src/main/java/io/dataease/provider/query/doris/DorisQueryProvider.java index 4c25c8868b..c49c4eb381 100644 --- a/backend/src/main/java/io/dataease/provider/query/doris/DorisQueryProvider.java +++ b/backend/src/main/java/io/dataease/provider/query/doris/DorisQueryProvider.java @@ -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) From 26047142eaea394ed62b8dc40eca7c133b4c317e Mon Sep 17 00:00:00 2001 From: fit2cloud-chenyw Date: Fri, 24 Dec 2021 18:43:29 +0800 Subject: [PATCH 3/7] =?UTF-8?q?fix:=20=E8=BF=87=E6=BB=A4=E7=BB=84=E4=BB=B6?= =?UTF-8?q?=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../canvas/components/Editor/PreviewEject.vue | 5 +- .../components/canvas/components/Toolbar.vue | 7 +- .../canvas/mobile/PreviewMobile.vue | 93 ------------------- frontend/src/components/canvas/utils/utils.js | 3 +- 4 files changed, 12 insertions(+), 96 deletions(-) delete mode 100644 frontend/src/components/canvas/mobile/PreviewMobile.vue diff --git a/frontend/src/components/canvas/components/Editor/PreviewEject.vue b/frontend/src/components/canvas/components/Editor/PreviewEject.vue index 493c6efbe0..c742272618 100644 --- a/frontend/src/components/canvas/components/Editor/PreviewEject.vue +++ b/frontend/src/components/canvas/components/Editor/PreviewEject.vue @@ -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, diff --git a/frontend/src/components/canvas/components/Toolbar.vue b/frontend/src/components/canvas/components/Toolbar.vue index 1bbdc16046..28e4fb0cd7 100644 --- a/frontend/src/components/canvas/components/Toolbar.vue +++ b/frontend/src/components/canvas/components/Toolbar.vue @@ -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({ diff --git a/frontend/src/components/canvas/mobile/PreviewMobile.vue b/frontend/src/components/canvas/mobile/PreviewMobile.vue deleted file mode 100644 index 04805e2d47..0000000000 --- a/frontend/src/components/canvas/mobile/PreviewMobile.vue +++ /dev/null @@ -1,93 +0,0 @@ - - - - - diff --git a/frontend/src/components/canvas/utils/utils.js b/frontend/src/components/canvas/utils/utils.js index 6b39797de7..b93f77ba55 100644 --- a/frontend/src/components/canvas/utils/utils.js +++ b/frontend/src/components/canvas/utils/utils.js @@ -60,7 +60,8 @@ export function mobile2MainCanvas(mainSource, mobileSource) { export function panelInit(componentDatas) { componentDatas.forEach(item => { - item.filters = (item.filters || []) + /* item.filters = (item.filters || []) */ + item.filters = [] item.linkageFilters = (item.linkageFilters || []) item.auxiliaryMatrix = (item.auxiliaryMatrix || false) item.x = (item.x || 1) From 30564208cec8d825968e02a045ca4e6d1423ed9d Mon Sep 17 00:00:00 2001 From: fit2cloud-chenyw Date: Fri, 24 Dec 2021 19:04:05 +0800 Subject: [PATCH 4/7] =?UTF-8?q?fix:=20=E5=85=BC=E5=AE=B9=E8=80=81=E7=89=88?= =?UTF-8?q?=E6=9C=AC=E6=97=A5=E6=9C=9F=E6=8E=A7=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/components/canvas/utils/utils.js | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/frontend/src/components/canvas/utils/utils.js b/frontend/src/components/canvas/utils/utils.js index b93f77ba55..5b5ddc7643 100644 --- a/frontend/src/components/canvas/utils/utils.js +++ b/frontend/src/components/canvas/utils/utils.js @@ -60,8 +60,20 @@ export function mobile2MainCanvas(mainSource, mobileSource) { export function panelInit(componentDatas) { componentDatas.forEach(item => { - /* item.filters = (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) From 73ceca747744998286a8131f12aa45f229dbf5a0 Mon Sep 17 00:00:00 2001 From: fit2cloud-chenyw Date: Sat, 25 Dec 2021 14:42:07 +0800 Subject: [PATCH 5/7] =?UTF-8?q?feat:=20=E5=9C=B0=E5=9B=BE=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0=E7=BC=A9=E6=94=BE=E9=87=8D=E7=BD=AE=E6=8C=89=E9=92=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../views/chart/components/ChartComponent.vue | 151 ++++++++++++++---- 1 file changed, 116 insertions(+), 35 deletions(-) diff --git a/frontend/src/views/chart/components/ChartComponent.vue b/frontend/src/views/chart/components/ChartComponent.vue index 995784ef4e..c489fd602c 100644 --- a/frontend/src/views/chart/components/ChartComponent.vue +++ b/frontend/src/views/chart/components/ChartComponent.vue @@ -1,7 +1,27 @@ @@ -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) { @@ -193,25 +246,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 +337,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) } } } + From 8409f1dd65eab489cab638d3df32b19e1d696288 Mon Sep 17 00:00:00 2001 From: fit2cloud-chenyw Date: Sat, 25 Dec 2021 14:54:46 +0800 Subject: [PATCH 6/7] =?UTF-8?q?style:=20=E8=A7=A3=E5=86=B3=E4=BB=AA?= =?UTF-8?q?=E8=A1=A8=E6=9D=BF=E4=B8=AD=E7=BC=A9=E6=94=BE=E6=8C=89=E9=92=AE?= =?UTF-8?q?=E9=81=AE=E7=9B=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/views/chart/components/ChartComponent.vue | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/frontend/src/views/chart/components/ChartComponent.vue b/frontend/src/views/chart/components/ChartComponent.vue index c489fd602c..905b80a0e3 100644 --- a/frontend/src/views/chart/components/ChartComponent.vue +++ b/frontend/src/views/chart/components/ChartComponent.vue @@ -9,11 +9,11 @@ />
-
+
-
+
@@ -364,8 +364,8 @@ export default { .map-zoom-box { position: absolute; z-index: 999; - right: 2%; - top: 5%; + left: 2%; + bottom: 3%; box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1); text-align: center; padding: 5px; From 55d8022b5bcc1dbb741e319b21a198bc284bd2c8 Mon Sep 17 00:00:00 2001 From: fit2cloud-chenyw Date: Mon, 27 Dec 2021 11:12:21 +0800 Subject: [PATCH 7/7] =?UTF-8?q?fix:=20=E7=A9=BA=E5=9C=B0=E5=9B=BE=E8=AF=95?= =?UTF-8?q?=E5=9B=BE=E5=88=87=E6=8D=A2=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/views/chart/components/ChartComponent.vue | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/frontend/src/views/chart/components/ChartComponent.vue b/frontend/src/views/chart/components/ChartComponent.vue index 905b80a0e3..ec06a1d7d5 100644 --- a/frontend/src/views/chart/components/ChartComponent.vue +++ b/frontend/src/views/chart/components/ChartComponent.vue @@ -224,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]