From 67f071ad79fb1a2cc5ce67006930387c4b020544 Mon Sep 17 00:00:00 2001 From: dataeaseShu Date: Thu, 6 Jun 2024 10:47:50 +0800 Subject: [PATCH 1/2] =?UTF-8?q?fix(=E5=B5=8C=E5=85=A5=E5=BC=8F):=20?= =?UTF-8?q?=E8=B7=B3=E8=BD=AC-=E4=BB=AA=E8=A1=A8=E6=9D=BF=E8=B7=B3?= =?UTF-8?q?=E8=BD=AC=E5=88=B0=E5=8F=A6=E4=B8=80=E4=B8=AA=E4=BB=AA=E8=A1=A8?= =?UTF-8?q?=E6=9D=BF=EF=BC=8C=E8=B7=B3=E8=BD=AC=E9=80=BB=E8=BE=91=E9=94=99?= =?UTF-8?q?=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/views/chart/components/views/index.vue | 17 ++++++++--------- .../views/data-visualization/PreviewCanvas.vue | 3 --- 2 files changed, 8 insertions(+), 12 deletions(-) diff --git a/core/core-frontend/src/views/chart/components/views/index.vue b/core/core-frontend/src/views/chart/components/views/index.vue index 2a790578a2..52443ebec1 100644 --- a/core/core-frontend/src/views/chart/components/views/index.vue +++ b/core/core-frontend/src/views/chart/components/views/index.vue @@ -411,18 +411,17 @@ const jumpClick = param => { const url = `${embeddedBaseUrl}#/preview?dvId=${ jumpInfo.targetDvId }&jumpInfoParam=${encodeURIComponent(Base64.encode(JSON.stringify(param)))}` - if (divSelf) { + + if (isIframe.value || isDataEaseBi.value) { embeddedStore.clearState() + } + if (divSelf) { embeddedStore.setDvId(jumpInfo.targetDvId) embeddedStore.setJumpInfoParam(encodeURIComponent(Base64.encode(JSON.stringify(param)))) divEmbedded('Preview') return } - if (isIframe.value) { - embeddedStore.clearState() - } - if (iframeSelf) { router.push(parseUrl(url)) return @@ -436,16 +435,16 @@ const jumpClick = param => { const colList = [...param.dimensionList, ...param.quotaList] let url = setIdValueTrans('id', 'value', jumpInfo.content, colList) url = checkAddHttp(url) - if (divSelf) { + + if (isIframe.value || isDataEaseBi.value) { embeddedStore.clearState() + } + if (divSelf) { embeddedStore.setOuterUrl(url) divEmbedded('Iframe') return } - if (isIframe.value) { - embeddedStore.clearState() - } windowsJump(url, jumpInfo.jumpType) } } else { diff --git a/core/core-frontend/src/views/data-visualization/PreviewCanvas.vue b/core/core-frontend/src/views/data-visualization/PreviewCanvas.vue index b48d8e7e5a..add5e237ce 100644 --- a/core/core-frontend/src/views/data-visualization/PreviewCanvas.vue +++ b/core/core-frontend/src/views/data-visualization/PreviewCanvas.vue @@ -73,8 +73,6 @@ const loadCanvasDataAsync = async (dvId, dvType) => { ElMessage.error(t('visualization.outer_param_decode_error')) } } - console.log('PreviewCanvas', dvId, jumpParam, attachParam) - initCanvasData( dvId, dvType, @@ -108,7 +106,6 @@ let p = null const XpackLoaded = () => p(true) onMounted(async () => { await new Promise(r => (p = r)) - console.log('embeddedStore', embeddedStore, router) const dvId = embeddedStore.dvId || router.currentRoute.value.query.dvId const { dvType, callBackFlag } = router.currentRoute.value.query if (dvId) { From 671f033eb04dc7814ef26c294435ff0a97c613bb Mon Sep 17 00:00:00 2001 From: jianneng-fit2cloud Date: Thu, 6 Jun 2024 11:26:29 +0800 Subject: [PATCH 2/2] =?UTF-8?q?style(=E5=9B=BE=E8=A1=A8-=E5=AF=B9=E7=A7=B0?= =?UTF-8?q?=E6=9D=A1=E5=BD=A2=E5=9B=BE):=20=E5=9E=82=E7=9B=B4=E6=96=B9?= =?UTF-8?q?=E5=90=91=E6=97=B6=E8=BD=B4=E7=BA=BF=E7=9A=84=E6=98=BE=E7=A4=BA?= =?UTF-8?q?=E6=A0=B7=E5=BC=8F=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/DualYAxisSelector.vue | 2 ++ .../components/DualYAxisSelectorInner.vue | 25 ++++++++++++++++--- .../editor-style/components/XAxisSelector.vue | 14 +++++++++-- .../js/panel/charts/bar/bidirectional-bar.ts | 3 ++- 4 files changed, 38 insertions(+), 6 deletions(-) diff --git a/core/core-frontend/src/views/chart/components/editor/editor-style/components/DualYAxisSelector.vue b/core/core-frontend/src/views/chart/components/editor/editor-style/components/DualYAxisSelector.vue index d517d7e56e..8b55883384 100644 --- a/core/core-frontend/src/views/chart/components/editor/editor-style/components/DualYAxisSelector.vue +++ b/core/core-frontend/src/views/chart/components/editor/editor-style/components/DualYAxisSelector.vue @@ -101,6 +101,7 @@ onMounted(() => { :themes="themes" type="left" :chart-type="chart.type" + :layout="chart.customAttr.basicStyle.layout" @on-change-y-axis-form="changeAxisStyle" /> @@ -120,6 +121,7 @@ onMounted(() => { :themes="themes" type="right" :chart-type="chart.type" + :layout="chart.customAttr.basicStyle.layout" @on-change-y-axis-form="changeSubAxisStyle" /> diff --git a/core/core-frontend/src/views/chart/components/editor/editor-style/components/DualYAxisSelectorInner.vue b/core/core-frontend/src/views/chart/components/editor/editor-style/components/DualYAxisSelectorInner.vue index a950e0d2a3..c859c97e7e 100644 --- a/core/core-frontend/src/views/chart/components/editor/editor-style/components/DualYAxisSelectorInner.vue +++ b/core/core-frontend/src/views/chart/components/editor/editor-style/components/DualYAxisSelectorInner.vue @@ -14,6 +14,7 @@ const props = withDefaults( propertyInner?: Array type?: 'left' | 'right' chartType?: string + layout?: string }>(), { themes: 'dark', @@ -75,6 +76,14 @@ const init = () => { const showProperty = prop => props.propertyInner?.includes(prop) +const isBidirectionalBar = computed(() => { + return props.chartType === 'bidirectional-bar' +}) + +const isVerticalLayout = computed(() => { + return props.layout === 'vertical' +}) + onMounted(() => { init() }) @@ -99,9 +108,19 @@ onMounted(() => { size="small" @change="changeAxisStyle('position')" > -
- {{ t('chart.text_pos_top') }} - {{ t('chart.text_pos_bottom') }} +
+
+ {{ t('chart.text_pos_left') }} + {{ + t('chart.text_pos_right') + }} +
+
+ {{ t('chart.text_pos_top') }} + {{ + t('chart.text_pos_bottom') + }} +
{{ t('chart.text_pos_left') }} diff --git a/core/core-frontend/src/views/chart/components/editor/editor-style/components/XAxisSelector.vue b/core/core-frontend/src/views/chart/components/editor/editor-style/components/XAxisSelector.vue index bd357bd5e2..cc8b6151e2 100644 --- a/core/core-frontend/src/views/chart/components/editor/editor-style/components/XAxisSelector.vue +++ b/core/core-frontend/src/views/chart/components/editor/editor-style/components/XAxisSelector.vue @@ -100,6 +100,14 @@ const init = () => { const showProperty = prop => props.propertyInner?.includes(prop) +const isBidirectionalBar = computed(() => { + return props.chart.type === 'bidirectional-bar' +}) + +const isHorizontalLayout = computed(() => { + return props.chart.customAttr.basicStyle.layout === 'horizontal' +}) + onMounted(() => { init() }) @@ -124,8 +132,10 @@ onMounted(() => { size="small" @change="changeAxisStyle('position')" > -
- {{ t('chart.text_pos_left') }} +
+ {{ + isHorizontalLayout ? t('chart.text_pos_left') : t('chart.text_pos_top') + }} {{ t('chart.text_pos_center') }} diff --git a/core/core-frontend/src/views/chart/components/js/panel/charts/bar/bidirectional-bar.ts b/core/core-frontend/src/views/chart/components/js/panel/charts/bar/bidirectional-bar.ts index f5ce555ec9..9da46bd810 100644 --- a/core/core-frontend/src/views/chart/components/js/panel/charts/bar/bidirectional-bar.ts +++ b/core/core-frontend/src/views/chart/components/js/panel/charts/bar/bidirectional-bar.ts @@ -325,8 +325,9 @@ export class BidirectionalHorizontalBar extends G2PlotChartView< valueExt: undefined } } + const layoutHorizontal = options.layout === 'horizontal' // 处理横轴标题方向不对 - if (yAxis && yAxis['title']) { + if (yAxis && yAxis['title'] && layoutHorizontal) { yAxis['title'].autoRotate = false } const yAxisTmp = parseJson(chart.customStyle).yAxis