refactor(数据大屏): 优化新建组件主题适配问题

This commit is contained in:
wangjiahao 2024-06-14 14:11:42 +08:00
parent ec31351791
commit ca02042b94
3 changed files with 7 additions and 5 deletions

View File

@ -115,10 +115,10 @@ export const copyStore = defineStore('copy', {
newComponent.canvasId = 'canvas-main'
}
dvMainStore.addCopyComponent(newComponent, idMap, copyDataTemp.copyCanvasViewInfo)
if (dvMainStore.multiplexingStyleAdapt && copyDataTemp.copyFrom === 'multiplexing') {
adaptCurThemeCommonStyle(newComponent)
}
if (dvInfo.value.type === 'dashboard') {
if (dvMainStore.multiplexingStyleAdapt && copyDataTemp.copyFrom === 'multiplexing') {
adaptCurThemeCommonStyle(newComponent)
}
eventBus.emit('addDashboardItem-' + newComponent.canvasId, newComponent)
}
if (i === dataArray.length - 1) {

View File

@ -164,7 +164,7 @@ const menuList = computed(() => {
})
const dvId = embeddedStore.dvId || router.currentRoute.value.query.dvId
if (dvId) {
if (dvId && showPosition.value === 'preview') {
selectedNodeKey.value = dvId
returnMounted.value = true
}

View File

@ -2,6 +2,7 @@
import { computed, nextTick, onBeforeMount, reactive, ref, toRefs, watch } from 'vue'
import { dvMainStoreWithOut } from '@/store/modules/data-visualization/dvMain'
import { getCanvasStyle } from '@/utils/style'
import EmptyBackground from '../../components/empty-background/src/EmptyBackground.vue'
const dvMainStore = dvMainStoreWithOut()
const viewShow = ref(true)
@ -138,7 +139,7 @@ onBeforeMount(() => {
class="custom-tree"
menu
ref="multiplexInfoTree"
:empty-text="'暂无可用图表'"
:empty-text="'暂无可用组件'"
:filter-node-method="filterNodeMethod"
:data="curMultiplexTargetComponentsInfo"
node-key="targetViewId"
@ -184,6 +185,7 @@ onBeforeMount(() => {
:dv-info="dvInfo"
:canvas-view-info="canvasViewInfo"
/>
<empty-background v-else description="当前未选择组件" img-type="select" />
</div>
</div>
</el-col>