Merge pull request #7202 from dataease/pr@dev-v2@fix_tab

fix: 修复预览时Tab组件也可修改标题问题
This commit is contained in:
王嘉豪 2023-12-18 20:13:14 +08:00 committed by GitHub
commit c5ed39bbba
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 3 deletions

View File

@ -214,6 +214,7 @@ const deepScale = computed(() => scale.value / 100)
:search-count="searchCount"
:scale="deepScale"
:disabled="true"
:is-edit="false"
/>
</div>
</div>

View File

@ -8,7 +8,7 @@
<de-custom-tab
v-model="editableTabsValue"
@tab-add="addTab"
:addable="isEdit"
:addable="isEditMode"
:font-color="fontColor"
:active-color="activeColor"
:border-color="noBorderColor"
@ -25,7 +25,7 @@
<template #label>
<span :style="titleStyle(tabItem.name)">{{ tabItem.title }}</span>
<el-dropdown
v-if="dropdownShow"
v-if="isEditMode"
style="line-height: 4 !important"
trigger="click"
@command="handleCommand"
@ -118,7 +118,7 @@ import DeCustomTab from '@/custom-component/de-tabs/DeCustomTab.vue'
import DePreview from '@/components/data-visualization/canvas/DePreview.vue'
import { useEmitt } from '@/hooks/web/useEmitt'
const dvMainStore = dvMainStoreWithOut()
const { tabMoveInActiveId, bashMatrixInfo } = storeToRefs(dvMainStore)
const { tabMoveInActiveId, bashMatrixInfo, editMode } = storeToRefs(dvMainStore)
const tabComponentRef = ref(null)
const props = defineProps({
@ -168,6 +168,8 @@ const editableTabsValue = ref(null)
const noBorderColor = ref('none')
let currentInstance
const isEditMode = computed(() => editMode.value === 'edit' && isEdit.value)
const calcTabLength = () => {
setTimeout(() => {
if (element.value.propValue.length > 1) {