feat(仪表板): 仪表板Tab组件支持移入移出自由布局

This commit is contained in:
wangjiahao 2022-10-24 14:51:27 +08:00
parent a04ac24086
commit 570af17d26
5 changed files with 14 additions and 24 deletions

View File

@ -677,7 +677,9 @@ export default {
'tabMoveInActiveId',
'tabActiveTabNameMap',
'mousePointShadowMap',
'tabMoveOutComponentId'
'tabMoveOutComponentId',
'tabCollisionActiveId',
'tabMoveInActiveId'
])
},
watch: {
@ -1922,8 +1924,8 @@ export default {
const left = this.left
const width = this.width
const height = this.height
// tab
if (this.isTabMoveCheck) {
// tab tabtab
if (this.isTabMoveCheck && this.element.type !== 'de-tabs') {
const nodes = this.$el.parentNode.childNodes //
for (const item of nodes) {
if (
@ -1953,7 +1955,7 @@ export default {
const brAndBr = (collisionT + collisionH) >= (top + height) && (collisionL + collisionW) >= (left + width)
if (tfAndTf && bfAndBf && trAndTr && brAndBr) {
this.$store.commit('setTabCollisionActiveId', item.getAttribute('component-id'))
} else {
} else if (this.tabCollisionActiveId === item.getAttribute('component-id')) {
this.$store.commit('setTabCollisionActiveId', null)
}
@ -1974,7 +1976,7 @@ export default {
const activeBrAndBr = (activeT + activeH) >= (top + height) && (activeL + activeW) >= (left + width)
if (activeTfAndTf && activeBfAndBf && activeTrAndTr && activeBrAndBr) {
this.$store.commit('setTabMoveInActiveId', item.getAttribute('component-id'))
} else {
} else if (this.tabMoveInActiveId === item.getAttribute('component-id')) {
this.$store.commit('setTabMoveInActiveId', null)
}

View File

@ -268,7 +268,6 @@ export default {
})
},
handleDragOver(e) {
// console.log("handleDragOver-"+this.canvasId)
e.preventDefault()
e.dataTransfer.dropEffect = 'copy'
this.$refs[this.editorRefName].handleDragOver(e)

View File

@ -1482,7 +1482,6 @@ export default {
}
},
handleDragOver(e) {
console.log('handleDragOver--x='+e.pageX+';y='+e.pageY)
this.dragComponentInfo.shadowStyle.x = e.pageX - 220
this.dragComponentInfo.shadowStyle.y = e.pageY - 90 + this.scrollTop
this.dragComponentInfo.style.left = this.dragComponentInfo.shadowStyle.x / this.scalePointWidth

View File

@ -45,14 +45,6 @@
{{ $t('detabs.eidttitle') }}
</el-dropdown-item>
<el-dropdown-item :command="beforeHandleCommand('selectView', item)">
{{ $t('detabs.selectview') }}
</el-dropdown-item>
<el-dropdown-item :command="beforeHandleCommand('selectOthers', item)">
{{ $t('detabs.selectOthers') }}
</el-dropdown-item>
<el-dropdown-item
v-if=" element.options.tabList.length > 1"
:command="beforeHandleCommand('deleteCur', item)"

View File

@ -229,7 +229,6 @@ const data = {
if (height || height === 0) curComponent.style.height = (height / curCanvasScaleSelf.scalePointHeight) + 0.0000001
if (rotate || rotate === 0) curComponent.style.rotate = rotate
}
// console.log("setShapeStyle==="+curComponent.style.width)
},
setShapeSingleStyle({ curComponent }, { key, value }) {
@ -764,7 +763,6 @@ const data = {
state.mousePointShadowMap.mouseY = mousePoint.mouseY
state.mousePointShadowMap.width = mousePoint.width
state.mousePointShadowMap.height = mousePoint.height
// console.log("mousePointMap:"+JSON.stringify(state.mousePointMap))
}
},
modules: {