Merge pull request #10365 from dataease/pr@dev-v2@style_linkage-style

style(仪表板): 联动点击样式优化
This commit is contained in:
王嘉豪 2024-06-19 13:19:27 +08:00 committed by GitHub
commit 41f4d8dc76
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -65,7 +65,7 @@
node-key="targetViewId"
highlight-current
:props="state.treeProp"
@node-click="nodeClick"
@node-click="nodeClickPre($event, 'sameDs')"
>
<template #default="{ data }">
<span class="custom-tree-node">
@ -112,7 +112,7 @@
node-key="targetViewId"
highlight-current
:props="state.treeProp"
@node-click="nodeClick"
@node-click="nodeClickPre($event, 'diffDs')"
>
<template #default="{ data }">
<span class="custom-tree-node">
@ -474,6 +474,17 @@ const cancelLinkageSetting = () => {
dvMainStore.clearLinkageSettingInfo()
}
const nodeClickPre = (data, treeName) => {
if (treeName === 'sameDs') {
linkageInfoTree.value.setCurrentKey(data.targetViewId)
linkageInfoTreeDiffDs.value.setCurrentKey(null)
} else {
linkageInfoTree.value.setCurrentKey(null)
linkageInfoTreeDiffDs.value.setCurrentKey(data.targetViewId)
}
nodeClick(data)
}
const nodeClick = data => {
state.linkageInfo = data
}
@ -567,6 +578,7 @@ watch(
() => state.showSelected,
newValue => {
linkageInfoTree.value?.filter(newValue)
linkageInfoTreeDiffDs.value?.filter(newValue)
}
)