Merge pull request #11539 from dataease/refactor_tab-move

Refactor tab move
This commit is contained in:
王嘉豪
2024-08-14 11:01:39 +08:00
committed by GitHub
2 changed files with 12 additions and 10 deletions

View File

@@ -116,7 +116,7 @@ import { dvMainStoreWithOut } from '@/store/modules/data-visualization/dvMain'
import { storeToRefs } from 'pinia'
import { guid } from '@/views/visualized/data/dataset/form/util'
import eventBus from '@/utils/eventBus'
import { canvasChangeAdaptor, findComponentIndexById } from '@/utils/canvasUtils'
import { canvasChangeAdaptor, findComponentIndexById, isDashboard } from '@/utils/canvasUtils'
import DeCustomTab from '@/custom-component/de-tabs/DeCustomTab.vue'
import DePreview from '@/components/data-visualization/canvas/DePreview.vue'
import { useEmitt } from '@/hooks/web/useEmitt'
@@ -281,14 +281,16 @@ const componentMoveIn = component => {
if (refInstance) {
const matrixBase = refInstance.getBaseMatrixSize() //矩阵基础大小
canvasChangeAdaptor(component, matrixBase)
component.x = 1
component.y = 200
component.style.left = 0
component.style.top = 0
tabItem.componentData.push(component)
nextTick(() => {
component.x = 1
component.y = 1
component.style.left = 0
component.style.top = 0
refInstance.addItemBox(component) //在适当的时候初始化布局组件
})
if (isDashboard()) {
nextTick(() => {
refInstance.addItemBox(component) //在适当的时候初始化布局组件
})
}
}
}
})

View File

@@ -170,10 +170,10 @@ const initOpenHandler = newWindow => {
>PDF</el-dropdown-item
>
<el-dropdown-item style="width: 118px" @click="downloadAsAppTemplate('template')"
>模板</el-dropdown-item
>样式模板</el-dropdown-item
>
<el-dropdown-item style="width: 118px" @click="downloadAsAppTemplate('app')"
>应用</el-dropdown-item
>应用模板</el-dropdown-item
>
<el-dropdown-item @click="download('img')">{{
t('chart.image')