fix(仪表板): 修复过滤组件无法作用于Tab内的问题

This commit is contained in:
wangjiahao 2024-04-16 18:22:07 +08:00
parent 41bfdda936
commit 37f5e5e425
2 changed files with 7 additions and 2 deletions

View File

@ -452,6 +452,7 @@ export default {
return this.componentDataShow || []
},
...mapState([
'sourceComponentData',
'previewCanvasScale',
'isClickComponent'
]),
@ -824,10 +825,16 @@ export default {
formatPoint(value, pointScale) {
return value * pointScale
},
findSourceComponent(id) {
return this.sourceComponentData.filter(element => element.id === id)[0]
},
handleScaleChange() {
if (this.componentData) {
const componentData = deepCopy(this.componentData)
componentData.forEach(component => {
if (component.type === 'custom') {
component.style = deepCopy(this.findSourceComponent(component.id).style)
}
Object.keys(component.style).forEach(key => {
if (this.needToChangeHeight.includes(key)) {
component.style[key] = this.format(component.style[key], this.scaleHeight)

View File

@ -309,8 +309,6 @@ export function imgUrlTrans(url) {
export function getNowCanvasComponentData(canvasId, showPosition) {
if (showPosition && (showPosition.includes('email-task') || showPosition.includes('multiplexing'))) {
return store.state.previewComponentData.filter(item => item.canvasId === canvasId)
} else if (showPosition === 'preview') {
return deepCopy(store.state.sourceComponentData.filter(item => item.canvasId === canvasId))
} else {
return store.state.componentData.filter(item => item.canvasId === canvasId)
}