fix position style to contextual menu in data table. (#331)
parent
be0e3d8eec
commit
db731fcf97
|
@ -122,8 +122,8 @@
|
||||||
<el-main style="padding: 0px !important; overflow: hidden;">
|
<el-main style="padding: 0px !important; overflow: hidden;">
|
||||||
<table-context-menu
|
<table-context-menu
|
||||||
v-show="isParent ? getShowContextMenuTable : getShowContextMenuTabChildren"
|
v-show="isParent ? getShowContextMenuTable : getShowContextMenuTabChildren"
|
||||||
:style="{ left: left + 'px', top: top + 'px' }"
|
:style="{ left: leftContextualMenu + 'px', top: topContextualMenu + 'px' }"
|
||||||
class="contextmenu"
|
class="contextual-menu"
|
||||||
:container-uuid="containerUuid"
|
:container-uuid="containerUuid"
|
||||||
:parent-uuid="parentUuid"
|
:parent-uuid="parentUuid"
|
||||||
:panel-type="panelType"
|
:panel-type="panelType"
|
||||||
|
@ -309,8 +309,8 @@ export default {
|
||||||
activeName.push('1')
|
activeName.push('1')
|
||||||
}
|
}
|
||||||
return {
|
return {
|
||||||
top: 0,
|
topContextualMenu: 0,
|
||||||
left: 0,
|
leftContextualMenu: 0,
|
||||||
currentRowMenu: {},
|
currentRowMenu: {},
|
||||||
currentRow: null,
|
currentRow: null,
|
||||||
currentTable: 0,
|
currentTable: 0,
|
||||||
|
@ -575,18 +575,22 @@ export default {
|
||||||
const maxLeft = offsetWidth - menuMinWidth // left boundary
|
const maxLeft = offsetWidth - menuMinWidth // left boundary
|
||||||
const left = event.clientX - offsetLeft + 15 // 15: margin right
|
const left = event.clientX - offsetLeft + 15 // 15: margin right
|
||||||
|
|
||||||
this.left = left
|
this.leftContextualMenu = left
|
||||||
if (left > maxLeft) {
|
if (left > maxLeft) {
|
||||||
this.left = maxLeft
|
this.leftContextualMenu = maxLeft
|
||||||
}
|
}
|
||||||
|
|
||||||
this.top = event.clientY - event.screenY
|
const offsetTop = this.$el.getBoundingClientRect().top
|
||||||
if (this.isParent) {
|
let top = event.clientY - offsetTop
|
||||||
this.top = event.clientY - 100
|
if (this.panelType === 'browser' && this.getterPanel.isShowedCriteria) {
|
||||||
|
top = event.clientY - 200
|
||||||
}
|
}
|
||||||
|
this.topContextualMenu = top
|
||||||
|
|
||||||
this.currentRowMenu = row
|
this.currentRowMenu = row
|
||||||
this.visible = true
|
this.visible = true
|
||||||
|
|
||||||
|
// TODO: Verify use
|
||||||
this.$store.dispatch('showMenuTable', {
|
this.$store.dispatch('showMenuTable', {
|
||||||
isShowedTable: this.isParent
|
isShowedTable: this.isParent
|
||||||
})
|
})
|
||||||
|
@ -1007,7 +1011,7 @@ export default {
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss">
|
<style lang="scss">
|
||||||
.contextmenu {
|
.contextual-menu {
|
||||||
margin: 0;
|
margin: 0;
|
||||||
background: #fff;
|
background: #fff;
|
||||||
z-index: 3000;
|
z-index: 3000;
|
||||||
|
|
Loading…
Reference in New Issue