commit
3842984a1b
@ -101,6 +101,7 @@ onMounted(() => {
|
||||
:themes="themes"
|
||||
type="left"
|
||||
:chart-type="chart.type"
|
||||
:layout="chart.customAttr.basicStyle.layout"
|
||||
@on-change-y-axis-form="changeAxisStyle"
|
||||
/>
|
||||
</el-tab-pane>
|
||||
@ -120,6 +121,7 @@ onMounted(() => {
|
||||
:themes="themes"
|
||||
type="right"
|
||||
:chart-type="chart.type"
|
||||
:layout="chart.customAttr.basicStyle.layout"
|
||||
@on-change-y-axis-form="changeSubAxisStyle"
|
||||
/>
|
||||
</el-tab-pane>
|
||||
|
||||
@ -14,6 +14,7 @@ const props = withDefaults(
|
||||
propertyInner?: Array<string>
|
||||
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')"
|
||||
>
|
||||
<div v-if="chartType === 'bidirectional-bar'">
|
||||
<el-radio :effect="props.themes" label="right">{{ t('chart.text_pos_top') }}</el-radio>
|
||||
<el-radio :effect="props.themes" label="left">{{ t('chart.text_pos_bottom') }}</el-radio>
|
||||
<div v-if="isBidirectionalBar">
|
||||
<div v-if="isVerticalLayout">
|
||||
<el-radio :effect="props.themes" label="left">{{ t('chart.text_pos_left') }}</el-radio>
|
||||
<el-radio :effect="props.themes" label="right">{{
|
||||
t('chart.text_pos_right')
|
||||
}}</el-radio>
|
||||
</div>
|
||||
<div v-else>
|
||||
<el-radio :effect="props.themes" label="right">{{ t('chart.text_pos_top') }}</el-radio>
|
||||
<el-radio :effect="props.themes" label="left">{{
|
||||
t('chart.text_pos_bottom')
|
||||
}}</el-radio>
|
||||
</div>
|
||||
</div>
|
||||
<div v-else>
|
||||
<el-radio :effect="props.themes" label="left">{{ t('chart.text_pos_left') }}</el-radio>
|
||||
|
||||
@ -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')"
|
||||
>
|
||||
<div v-if="chart.type === 'bidirectional-bar'">
|
||||
<el-radio :effect="props.themes" label="top">{{ t('chart.text_pos_left') }}</el-radio>
|
||||
<div v-if="isBidirectionalBar">
|
||||
<el-radio :effect="props.themes" label="top">{{
|
||||
isHorizontalLayout ? t('chart.text_pos_left') : t('chart.text_pos_top')
|
||||
}}</el-radio>
|
||||
<el-radio :effect="props.themes" label="bottom">{{
|
||||
t('chart.text_pos_center')
|
||||
}}</el-radio>
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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 {
|
||||
|
||||
@ -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) {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user