forked from github/dataease
Merge pull request #11539 from dataease/refactor_tab-move
Refactor tab move
This commit is contained in:
commit
0bdc710e1b
@ -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) //在适当的时候初始化布局组件
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
|
@ -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')
|
||||
|
Loading…
Reference in New Issue
Block a user