Merge remote-tracking branch 'origin/dev-3.1' into dev-3.1.1_theme
# Conflicts: # nezha-fronted/src/components/common/alert/alertLabel.vue # nezha-fronted/src/components/common/detailView/detailViewTopSearch.vue # nezha-fronted/src/components/common/i18n.js # nezha-fronted/src/components/common/labelFilter/clickSearch.vue # nezha-fronted/src/components/common/login.vue # nezha-fronted/src/components/common/popBox/topToolMoreOptions.vue
This commit is contained in:
@@ -257,12 +257,14 @@ export default {
|
||||
type: {},
|
||||
// labelLoading:{},
|
||||
that: {},
|
||||
detailList: Boolean
|
||||
detailList: Boolean,
|
||||
alertTableDialog: Boolean
|
||||
},
|
||||
data () {
|
||||
return {
|
||||
alertLabelData: null,
|
||||
loading: true
|
||||
loading: true,
|
||||
heightList: 0
|
||||
}
|
||||
},
|
||||
components: {
|
||||
@@ -292,30 +294,29 @@ export default {
|
||||
},
|
||||
computed: {
|
||||
calcPosition () {
|
||||
const self = this
|
||||
return function (position) {
|
||||
const clientHeight = (document.body.clientHeight < document.documentElement.clientHeight) ? document.body.clientHeight : document.documentElement.clientHeight
|
||||
const dialog = document.querySelector('#dialog-alert-massage .el-dialog')
|
||||
const dialogHeight = dialog.getBoundingClientRect()
|
||||
const leftOffSetView = this.detailList ? -80 : 10
|
||||
const topOffSetView = this.detailList ? 0 : 0
|
||||
const leftOffSet = this.detailList ? -80 : 10
|
||||
const topOffSet = this.detailList ? 70 : 0
|
||||
const elHeight = self.type === 'asset' ? 318 : (self.type === 'project' ? 70 : 70)
|
||||
if (position.top + elHeight > clientHeight) {
|
||||
const topOffSet = this.detailList ? 60 : 22
|
||||
if (position.top + this.heightList > clientHeight) {
|
||||
return {
|
||||
left: `${position.left + position.width + leftOffSet}px`,
|
||||
top: `${position.top - elHeight + topOffSet}px`
|
||||
top: `${position.top - this.heightList + topOffSet}px`
|
||||
}
|
||||
} else if (dialogHeight) {
|
||||
return {
|
||||
left: `${position.left + position.width + 10 - dialogHeight.x}px`,
|
||||
top: `${position.top - dialogHeight.y}px`
|
||||
} else if (this.alertTableDialog) {
|
||||
const dialog = document.querySelector('#dialog-alert-massage .el-dialog')
|
||||
const dialogHeight = dialog.getBoundingClientRect()
|
||||
if (dialogHeight) {
|
||||
return {
|
||||
left: `${position.left + position.width + 10 - dialogHeight.x}px`,
|
||||
top: `${position.top - dialogHeight.y}px`
|
||||
}
|
||||
}
|
||||
} else {
|
||||
return {
|
||||
left: `${position.left + position.width + leftOffSetView}px`,
|
||||
top: `${position.top + topOffSetView}px`
|
||||
top: `${position.top}px`
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -397,6 +398,12 @@ export default {
|
||||
return this.$t('asset.notInStock')
|
||||
}
|
||||
}
|
||||
},
|
||||
mounted () {
|
||||
this.heightList = this.$refs.alertLabels.getBoundingClientRect().height
|
||||
},
|
||||
beforeDestroy () {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user