fix: tabs组件中的视图全屏预览错误

This commit is contained in:
fit2cloud-chenyw 2022-02-24 12:33:37 +08:00
parent 2bd1c83e79
commit 0a63bf4e88
2 changed files with 31 additions and 2 deletions

View File

@ -35,7 +35,26 @@
</span>
<div v-if="activeTabName === item.name" class="de-tab-content">
<user-view v-if="item.content && item.content.propValue && item.content.propValue.viewId" :ref="item.name" :in-tab="true" :is-edit="isEdit" :active="active" :element="item.content" :filters="item.content.filters" :out-style="outStyle" />
<!-- <user-view
v-if="item.content && item.content.propValue && item.content.propValue.viewId"
:ref="item.name"
:in-tab="true"
:is-edit="isEdit"
:active="active"
:element="item.content"
:filters="item.content.filters"
:out-style="outStyle"
/> -->
<user-view
v-if="item.content && item.content.propValue && item.content.propValue.viewId"
:ref="item.name"
:in-tab="true"
:is-edit="isEdit"
:active="active"
:element="item.content"
:filters="filterMap[item.content.propValue && item.content.propValue.viewId]"
:out-style="outStyle"
/>
</div>
</el-tab-pane>
@ -96,7 +115,7 @@ import bus from '@/utils/bus'
import componentList from '@/components/canvas/custom-component/component-list'
import { mapState } from 'vuex'
import { chartCopy } from '@/api/chart/chart'
import { buildFilterMap } from '@/utils/conditionUtil'
export default {
name: 'DeTabls',
components: { ViewSelect },
@ -142,7 +161,12 @@ export default {
panelInfo() {
return this.$store.state.panel.panelInfo
},
filterMap() {
const map = buildFilterMap(this.componentData)
return map
},
...mapState([
'componentData',
'curComponent',
'mobileLayoutStatus'
])

View File

@ -46,6 +46,11 @@ export const buildFilterMap = panelItems => {
if (element.type === 'view') {
result[element.propValue.viewId] = []
}
if (element.type === 'de-tabs') {
element.options.tabList && element.options.tabList.forEach(tab => {
result[tab.content.propValue.viewId] = []
})
}
})
panelItems.forEach(element => {
if (element.type !== 'custom') {