@@ -198,8 +202,11 @@ import {
import { getDatasetDetails } from '@/api/dataset'
import { findAllViewsId } from '@/utils/canvasUtils'
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 { dvInfo, canvasViewInfo, componentData } = storeToRefs(dvMainStore)
+const { dvInfo, canvasViewInfo, componentData, curComponent } = storeToRefs(dvMainStore)
const linkageInfoTree = ref(null)
const { t } = useI18n()
const dialogShow = ref(false)
@@ -221,6 +228,8 @@ const state = reactive({
linkageInfo: null
})
+const customLinkageActive = ref(deepCopy(ACTION_SELECTION))
+
const dialogInit = viewItem => {
state.showSelected = false
dialogShow.value = true
@@ -277,6 +286,7 @@ const init = viewItem => {
state.curDatasetInfo = res || {}
})
}
+ customLinkageActive.value = curComponent.value.actionSelection
linkageSetting(state.viewId)
}
@@ -314,6 +324,7 @@ const saveLinkageSetting = () => {
loading.value = true
saveLinkage(request)
.then(() => {
+ curComponent.value.actionSelection.linkageActive = customLinkageActive.value.linkageActive
snapshotStore.recordSnapshotCache()
ElMessage.success('保存成功')
// 刷新联动信息
diff --git a/core/core-frontend/src/components/visualization/LinkageSetOption.vue b/core/core-frontend/src/components/visualization/LinkageSetOption.vue
new file mode 100644
index 0000000000..c96b9ce83c
--- /dev/null
+++ b/core/core-frontend/src/components/visualization/LinkageSetOption.vue
@@ -0,0 +1,59 @@
+
+
+
+
+
+
+
+
+ 如果联动维度已配置钻取,点击维度将
+
+ 弹出浮框,由用户选择联动或者下钻
+ 同时触发联动和下钻
+
+
+
+
+
diff --git a/core/core-frontend/src/custom-component/component-list.ts b/core/core-frontend/src/custom-component/component-list.ts
index 823b5647c2..fc47aca5f6 100644
--- a/core/core-frontend/src/custom-component/component-list.ts
+++ b/core/core-frontend/src/custom-component/component-list.ts
@@ -30,6 +30,10 @@ export const defaultStyleValue = {
headFontActiveColor: '#000000'
}
+export const ACTION_SELECTION = {
+ linkageActive: 'custom'
+}
+
export const COMMON_COMPONENT_BACKGROUND_BASE = {
backgroundColorSelect: true,
backgroundImageEnable: false,
@@ -134,6 +138,7 @@ const list = [
innerType: 'bar',
editing: false,
canvasActive: false,
+ actionSelection: ACTION_SELECTION,
x: 1,
y: 1,
sizeX: 18,
diff --git a/core/core-frontend/src/utils/canvasUtils.ts b/core/core-frontend/src/utils/canvasUtils.ts
index 1857783079..75b88ad309 100644
--- a/core/core-frontend/src/utils/canvasUtils.ts
+++ b/core/core-frontend/src/utils/canvasUtils.ts
@@ -1,5 +1,6 @@
import { cloneDeep } from 'lodash-es'
import componentList, {
+ ACTION_SELECTION,
COMMON_COMPONENT_BACKGROUND_DARK,
COMMON_COMPONENT_BACKGROUND_LIGHT
} from '@/custom-component/component-list'
@@ -16,6 +17,7 @@ import { getPanelAllLinkageInfo } from '@/api/visualization/linkage'
import { queryVisualizationJumpInfo } from '@/api/visualization/linkJump'
import { getViewConfig } from '@/views/chart/components/editor/util/chart'
import { snapshotStoreWithOut } from '@/store/modules/data-visualization/snapshot'
+import { deepCopy } from '@/utils/utils'
const dvMainStore = dvMainStoreWithOut()
const { curBatchOptComponents, dvInfo, canvasStyleData, componentData, canvasViewInfo } =
storeToRefs(dvMainStore)
@@ -118,6 +120,9 @@ export function initCanvasDataPrepare(dvId, busiFlag, callBack) {
}
componentItem['maintainRadio'] = componentItem['maintainRadio'] || false
componentItem['aspectRatio'] = componentItem['aspectRatio'] || 1
+ if (componentItem.component === 'UserView') {
+ componentItem.actionSelection = componentItem.actionSelection || deepCopy(ACTION_SELECTION)
+ }
})
const curPreviewGap =
dvInfo.type === 'dashboard' && canvasStyleResult['dashboard'].gap === 'yes'