Merge pull request #13203 from dataease/pr@dev-v2@refactor_hidden

refactor(数据大屏): 数据大屏支持批量隐藏
This commit is contained in:
王嘉豪 2024-11-07 16:53:24 +08:00 committed by GitHub
commit 575e747ea2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 21 additions and 2 deletions

View File

@ -81,14 +81,26 @@ const copy = () => {
}
const hide = () => {
if (curComponent.value && !isGroupArea.value) {
layerStore.hideComponentWithComponent()
} else if (areaData.value.components.length) {
areaData.value.components.forEach(component => {
layerStore.hideComponentWithComponent(component.id)
})
}
snapshotStore.recordSnapshotCache()
layerStore.hideComponent()
menuOpt('hide')
}
const show = () => {
if (curComponent.value && !isGroupArea.value) {
layerStore.showComponent()
} else if (areaData.value.components.length) {
areaData.value.components.forEach(component => {
layerStore.showComponent(component.id)
})
}
snapshotStore.recordSnapshotCache()
layerStore.showComponent()
menuOpt('show')
}
const categoryChange = type => {

View File

@ -60,6 +60,13 @@ export const layerStore = defineStore('layer', {
}
},
hideComponentWithComponent(componentId?) {
const targetComponent = getComponentById(componentId)
// 隐藏
if (targetComponent) {
targetComponent.isShow = false
}
},
hideComponent(componentId?) {
const targetComponent = getComponentById(componentId)
// 隐藏