fix: 修复预览时Tab组件也可修改标题问题

This commit is contained in:
wangjiahao 2023-12-18 20:10:40 +08:00
parent 8616ecc1d5
commit dafad8e2e6
2 changed files with 6 additions and 3 deletions

View File

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

View File

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