Merge pull request #13111 from dataease/pr@dev-v2@fix_screen_lock

fix(数据大屏): 修复数据大屏批量锁定失效问题 #12783
This commit is contained in:
王嘉豪 2024-11-05 09:57:54 +08:00 committed by GitHub
commit be256496ca
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 15 additions and 9 deletions

View File

@ -37,8 +37,14 @@ const popComponentDataLength = computed(
)
const lock = () => {
snapshotStore.recordSnapshotCache()
if (curComponent.value && !isGroupArea.value) {
lockStore.lock()
} else if (areaData.value.components.length) {
areaData.value.components.forEach(component => {
lockStore.lock(component)
})
}
snapshotStore.recordSnapshotCache()
menuOpt('lock')
}

View File

@ -7,19 +7,19 @@ const { curComponent } = storeToRefs(dvMainStore)
export const lockStore = defineStore('lock', {
actions: {
lock() {
curComponent.value.isLock = true
if (curComponent.value.component === 'Group') {
curComponent.value.propValue.forEach(component => {
lock(optComponent = curComponent.value) {
optComponent.isLock = true
if (optComponent.component === 'Group') {
optComponent.propValue.forEach(component => {
component.isLock = true
})
}
},
unlock() {
curComponent.value.isLock = false
if (curComponent.value.component === 'Group') {
curComponent.value.propValue.forEach(component => {
unlock(optComponent = curComponent.value) {
optComponent.isLock = false
if (optComponent.component === 'Group') {
optComponent.propValue.forEach(component => {
component.isLock = false
})
}