Merge pull request #11793 from dataease/pr@dev-v2@refactor_tab-refresh

Pr@dev v2@refactor tab refresh
This commit is contained in:
王嘉豪 2024-08-27 17:08:43 +08:00 committed by GitHub
commit a13f6e259b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 28 additions and 7 deletions

View File

@ -67,6 +67,11 @@ const props = defineProps({
required: false, required: false,
default: 1 default: 1
}, },
outerSearchCount: {
type: Number,
required: false,
default: 0
},
isSelector: { isSelector: {
type: Boolean, type: Boolean,
default: false default: false
@ -82,7 +87,8 @@ const {
showPosition, showPosition,
previewActive, previewActive,
downloadStatus, downloadStatus,
outerScale outerScale,
outerSearchCount
} = toRefs(props) } = toRefs(props)
const domId = 'preview-' + canvasId.value const domId = 'preview-' + canvasId.value
const scaleWidthPoint = ref(100) const scaleWidthPoint = ref(100)
@ -99,6 +105,9 @@ const dashboardActive = computed(() => {
return dvInfo.value.type === 'dashboard' return dvInfo.value.type === 'dashboard'
}) })
const curSearchCount = computed(() => {
return outerSearchCount.value + searchCount.value
})
// full // full
const dataVKeepRadio = computed(() => { const dataVKeepRadio = computed(() => {
return canvasStyleData.value?.screenAdaptor !== 'full' return canvasStyleData.value?.screenAdaptor !== 'full'
@ -133,9 +142,6 @@ const canvasStyle = computed(() => {
? changeStyleWithScale(canvasStyleData.value?.width, scaleHeightPoint.value) + 'px' ? changeStyleWithScale(canvasStyleData.value?.width, scaleHeightPoint.value) + 'px'
: '100%' : '100%'
} }
if (!dashboardActive.value) {
style['overflow-y'] = 'hidden'
}
return style return style
}) })
@ -414,7 +420,7 @@ defineExpose({
:config="item" :config="item"
:style="getShapeItemShowStyle(item)" :style="getShapeItemShowStyle(item)"
:show-position="showPosition" :show-position="showPosition"
:search-count="searchCount" :search-count="curSearchCount"
:scale="mobileInPc ? 100 : scaleMin" :scale="mobileInPc ? 100 : scaleMin"
:is-selector="props.isSelector" :is-selector="props.isSelector"
@userViewEnlargeOpen="userViewEnlargeOpen($event, item)" @userViewEnlargeOpen="userViewEnlargeOpen($event, item)"

View File

@ -74,6 +74,7 @@
:preview-active="editableTabsValue === tabItem.name" :preview-active="editableTabsValue === tabItem.name"
:show-position="showPosition" :show-position="showPosition"
:outer-scale="scale" :outer-scale="scale"
:outer-search-count="searchCount"
></de-preview> ></de-preview>
</el-tab-pane> </el-tab-pane>
</template> </template>
@ -164,10 +165,24 @@ const props = defineProps({
type: Number, type: Number,
required: false, required: false,
default: 1 default: 1
},
//
searchCount: {
type: Number,
required: false,
default: 0
} }
}) })
const { element, isEdit, showPosition, canvasStyleData, canvasViewInfo, dvInfo, scale } = const {
toRefs(props) element,
isEdit,
showPosition,
canvasStyleData,
canvasViewInfo,
dvInfo,
scale,
searchCount
} = toRefs(props)
const state = reactive({ const state = reactive({
activeTabName: '', activeTabName: '',