mirror of
https://github.com/dataease/dataease.git
synced 2025-02-25 03:52:59 +08:00
feat(仪表板): 增加配置项,下钻和联动可同时触发 #8701
This commit is contained in:
parent
a0354cf297
commit
60f56c909c
@ -8,6 +8,10 @@
|
|||||||
top="10vh"
|
top="10vh"
|
||||||
trigger="click"
|
trigger="click"
|
||||||
>
|
>
|
||||||
|
<linkage-set-option
|
||||||
|
v-if="curComponent && curComponent.actionSelection"
|
||||||
|
:action-selection="customLinkageActive"
|
||||||
|
></linkage-set-option>
|
||||||
<div v-loading="loading" @keydown.stop @keyup.stop v-if="state.initState" style="height: 550px">
|
<div v-loading="loading" @keydown.stop @keyup.stop v-if="state.initState" style="height: 550px">
|
||||||
<el-row style="flex-direction: row">
|
<el-row style="flex-direction: row">
|
||||||
<div class="top-area">
|
<div class="top-area">
|
||||||
@ -198,8 +202,11 @@ import {
|
|||||||
import { getDatasetDetails } from '@/api/dataset'
|
import { getDatasetDetails } from '@/api/dataset'
|
||||||
import { findAllViewsId } from '@/utils/canvasUtils'
|
import { findAllViewsId } from '@/utils/canvasUtils'
|
||||||
import { snapshotStoreWithOut } from '@/store/modules/data-visualization/snapshot'
|
import { snapshotStoreWithOut } from '@/store/modules/data-visualization/snapshot'
|
||||||
|
import LinkageSetOption from '@/components/visualization/LinkageSetOption.vue'
|
||||||
|
import { deepCopy } from '@/utils/utils'
|
||||||
|
import { ACTION_SELECTION } from '@/custom-component/component-list'
|
||||||
const dvMainStore = dvMainStoreWithOut()
|
const dvMainStore = dvMainStoreWithOut()
|
||||||
const { dvInfo, canvasViewInfo, componentData } = storeToRefs(dvMainStore)
|
const { dvInfo, canvasViewInfo, componentData, curComponent } = storeToRefs(dvMainStore)
|
||||||
const linkageInfoTree = ref(null)
|
const linkageInfoTree = ref(null)
|
||||||
const { t } = useI18n()
|
const { t } = useI18n()
|
||||||
const dialogShow = ref(false)
|
const dialogShow = ref(false)
|
||||||
@ -221,6 +228,8 @@ const state = reactive({
|
|||||||
linkageInfo: null
|
linkageInfo: null
|
||||||
})
|
})
|
||||||
|
|
||||||
|
const customLinkageActive = ref(deepCopy(ACTION_SELECTION))
|
||||||
|
|
||||||
const dialogInit = viewItem => {
|
const dialogInit = viewItem => {
|
||||||
state.showSelected = false
|
state.showSelected = false
|
||||||
dialogShow.value = true
|
dialogShow.value = true
|
||||||
@ -277,6 +286,7 @@ const init = viewItem => {
|
|||||||
state.curDatasetInfo = res || {}
|
state.curDatasetInfo = res || {}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
customLinkageActive.value = curComponent.value.actionSelection
|
||||||
linkageSetting(state.viewId)
|
linkageSetting(state.viewId)
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -314,6 +324,7 @@ const saveLinkageSetting = () => {
|
|||||||
loading.value = true
|
loading.value = true
|
||||||
saveLinkage(request)
|
saveLinkage(request)
|
||||||
.then(() => {
|
.then(() => {
|
||||||
|
curComponent.value.actionSelection.linkageActive = customLinkageActive.value.linkageActive
|
||||||
snapshotStore.recordSnapshotCache()
|
snapshotStore.recordSnapshotCache()
|
||||||
ElMessage.success('保存成功')
|
ElMessage.success('保存成功')
|
||||||
// 刷新联动信息
|
// 刷新联动信息
|
||||||
|
@ -0,0 +1,59 @@
|
|||||||
|
<script setup lang="ts">
|
||||||
|
import { ref, toRefs } from 'vue'
|
||||||
|
import { propTypes } from '@/utils/propTypes'
|
||||||
|
|
||||||
|
const props = defineProps({
|
||||||
|
title: propTypes.string,
|
||||||
|
baseWidth: {
|
||||||
|
required: false,
|
||||||
|
type: Number,
|
||||||
|
default: 300
|
||||||
|
},
|
||||||
|
actionSelection: {
|
||||||
|
required: true,
|
||||||
|
type: Object
|
||||||
|
},
|
||||||
|
themes: {
|
||||||
|
type: String,
|
||||||
|
default: 'dark'
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
const selection = ref()
|
||||||
|
|
||||||
|
const selectionChange = () => {
|
||||||
|
// do selection
|
||||||
|
}
|
||||||
|
|
||||||
|
const { title, themes, actionSelection } = toRefs(props)
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<el-popover placement="right-start" :width="baseWidth" trigger="click" :show-arrow="false">
|
||||||
|
<template #reference>
|
||||||
|
<el-icon class="option-set"><Setting /></el-icon>
|
||||||
|
</template>
|
||||||
|
<el-row>
|
||||||
|
如果联动维度已配置钻取,点击维度将
|
||||||
|
<el-radio-group
|
||||||
|
style="margin-top: 12px"
|
||||||
|
v-model="actionSelection.linkageActive"
|
||||||
|
@change="selectionChange"
|
||||||
|
>
|
||||||
|
<el-radio label="custom"
|
||||||
|
><span style="font-weight: normal">弹出浮框,由用户选择联动或者下钻</span></el-radio
|
||||||
|
>
|
||||||
|
<el-radio label="auto"
|
||||||
|
><span style="font-weight: normal">同时触发联动和下钻</span></el-radio
|
||||||
|
>
|
||||||
|
</el-radio-group>
|
||||||
|
</el-row>
|
||||||
|
</el-popover>
|
||||||
|
</template>
|
||||||
|
<style lang="less" scoped>
|
||||||
|
.option-set {
|
||||||
|
position: absolute;
|
||||||
|
left: 90px;
|
||||||
|
top: 30px;
|
||||||
|
}
|
||||||
|
</style>
|
@ -30,6 +30,10 @@ export const defaultStyleValue = {
|
|||||||
headFontActiveColor: '#000000'
|
headFontActiveColor: '#000000'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export const ACTION_SELECTION = {
|
||||||
|
linkageActive: 'custom'
|
||||||
|
}
|
||||||
|
|
||||||
export const COMMON_COMPONENT_BACKGROUND_BASE = {
|
export const COMMON_COMPONENT_BACKGROUND_BASE = {
|
||||||
backgroundColorSelect: true,
|
backgroundColorSelect: true,
|
||||||
backgroundImageEnable: false,
|
backgroundImageEnable: false,
|
||||||
@ -134,6 +138,7 @@ const list = [
|
|||||||
innerType: 'bar',
|
innerType: 'bar',
|
||||||
editing: false,
|
editing: false,
|
||||||
canvasActive: false,
|
canvasActive: false,
|
||||||
|
actionSelection: ACTION_SELECTION,
|
||||||
x: 1,
|
x: 1,
|
||||||
y: 1,
|
y: 1,
|
||||||
sizeX: 18,
|
sizeX: 18,
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
import { cloneDeep } from 'lodash-es'
|
import { cloneDeep } from 'lodash-es'
|
||||||
import componentList, {
|
import componentList, {
|
||||||
|
ACTION_SELECTION,
|
||||||
COMMON_COMPONENT_BACKGROUND_DARK,
|
COMMON_COMPONENT_BACKGROUND_DARK,
|
||||||
COMMON_COMPONENT_BACKGROUND_LIGHT
|
COMMON_COMPONENT_BACKGROUND_LIGHT
|
||||||
} from '@/custom-component/component-list'
|
} from '@/custom-component/component-list'
|
||||||
@ -16,6 +17,7 @@ import { getPanelAllLinkageInfo } from '@/api/visualization/linkage'
|
|||||||
import { queryVisualizationJumpInfo } from '@/api/visualization/linkJump'
|
import { queryVisualizationJumpInfo } from '@/api/visualization/linkJump'
|
||||||
import { getViewConfig } from '@/views/chart/components/editor/util/chart'
|
import { getViewConfig } from '@/views/chart/components/editor/util/chart'
|
||||||
import { snapshotStoreWithOut } from '@/store/modules/data-visualization/snapshot'
|
import { snapshotStoreWithOut } from '@/store/modules/data-visualization/snapshot'
|
||||||
|
import { deepCopy } from '@/utils/utils'
|
||||||
const dvMainStore = dvMainStoreWithOut()
|
const dvMainStore = dvMainStoreWithOut()
|
||||||
const { curBatchOptComponents, dvInfo, canvasStyleData, componentData, canvasViewInfo } =
|
const { curBatchOptComponents, dvInfo, canvasStyleData, componentData, canvasViewInfo } =
|
||||||
storeToRefs(dvMainStore)
|
storeToRefs(dvMainStore)
|
||||||
@ -118,6 +120,9 @@ export function initCanvasDataPrepare(dvId, busiFlag, callBack) {
|
|||||||
}
|
}
|
||||||
componentItem['maintainRadio'] = componentItem['maintainRadio'] || false
|
componentItem['maintainRadio'] = componentItem['maintainRadio'] || false
|
||||||
componentItem['aspectRatio'] = componentItem['aspectRatio'] || 1
|
componentItem['aspectRatio'] = componentItem['aspectRatio'] || 1
|
||||||
|
if (componentItem.component === 'UserView') {
|
||||||
|
componentItem.actionSelection = componentItem.actionSelection || deepCopy(ACTION_SELECTION)
|
||||||
|
}
|
||||||
})
|
})
|
||||||
const curPreviewGap =
|
const curPreviewGap =
|
||||||
dvInfo.type === 'dashboard' && canvasStyleResult['dashboard'].gap === 'yes'
|
dvInfo.type === 'dashboard' && canvasStyleResult['dashboard'].gap === 'yes'
|
||||||
|
Loading…
Reference in New Issue
Block a user