forked from github/dataease
Merge pull request #1497 from dataease/pr@dev@refactor_panel-mb
fix: 编辑仪表板边界位置工具栏不完整问题
This commit is contained in:
commit
258282432e
@ -168,6 +168,7 @@ export default {
|
|||||||
predefineColors: COLOR_PANEL,
|
predefineColors: COLOR_PANEL,
|
||||||
showMain: true,
|
showMain: true,
|
||||||
innerOpacity: 0,
|
innerOpacity: 0,
|
||||||
|
mainWidthOffset: 600,
|
||||||
textAlignOptions: [
|
textAlignOptions: [
|
||||||
{
|
{
|
||||||
icon: 'iconfont icon-juzuo',
|
icon: 'iconfont icon-juzuo',
|
||||||
@ -318,11 +319,7 @@ export default {
|
|||||||
return this.$store.state.curComponent.style
|
return this.$store.state.curComponent.style
|
||||||
},
|
},
|
||||||
canvasWidth() {
|
canvasWidth() {
|
||||||
let scaleWidth = 1
|
return this.canvasStyleData.width * this.curCanvasScale.scalePointWidth
|
||||||
if (this.canvasStyleData.selfAdaption) {
|
|
||||||
scaleWidth = this.curCanvasScale.scaleWidth / 100
|
|
||||||
}
|
|
||||||
return this.canvasStyleData.width * scaleWidth
|
|
||||||
},
|
},
|
||||||
...mapState([
|
...mapState([
|
||||||
'curComponent',
|
'curComponent',
|
||||||
@ -355,11 +352,12 @@ export default {
|
|||||||
if (this.styleInfo['opacity']) {
|
if (this.styleInfo['opacity']) {
|
||||||
this.innerOpacity = this.styleInfo['opacity'] * 100
|
this.innerOpacity = this.styleInfo['opacity'] * 100
|
||||||
}
|
}
|
||||||
this.mainWidthOffset = document.getElementById('main-attr').offsetWidth - 50
|
|
||||||
if (this.curComponent.type === 'v-text') {
|
if (this.curComponent.type === 'v-text') {
|
||||||
this.mainWidthOffset = 600
|
this.mainWidthOffset = 600
|
||||||
} else if (this.curComponent.type === 'de-show-date') {
|
} else if (this.curComponent.type === 'de-show-date') {
|
||||||
this.mainWidthOffset = 600
|
this.mainWidthOffset = 600
|
||||||
|
} else {
|
||||||
|
this.mainWidthOffset = document.getElementById('main-attr').offsetWidth - 50
|
||||||
}
|
}
|
||||||
// console.log('mainWidthOffset:' + this.mainWidthOffset)
|
// console.log('mainWidthOffset:' + this.mainWidthOffset)
|
||||||
},
|
},
|
||||||
@ -378,14 +376,9 @@ export default {
|
|||||||
},
|
},
|
||||||
getPositionX(x) {
|
getPositionX(x) {
|
||||||
let ps = 0
|
let ps = 0
|
||||||
if (this.canvasStyleData.selfAdaption) {
|
ps = (x * this.curCanvasScale.scalePointWidth) + 60
|
||||||
ps = (x * this.curCanvasScale.scaleWidth / 100) + 60
|
|
||||||
} else {
|
|
||||||
ps = x + 60
|
|
||||||
}
|
|
||||||
// 防止toolbar超出边界
|
// 防止toolbar超出边界
|
||||||
const xGap = ps + this.mainWidthOffset - this.canvasWidth
|
const xGap = ps + this.mainWidthOffset - this.canvasWidth
|
||||||
// console.log('canvasWidth:' + this.canvasWidth + ';xGap:' + xGap)
|
|
||||||
if (xGap > 0) {
|
if (xGap > 0) {
|
||||||
return ps - xGap
|
return ps - xGap
|
||||||
} else {
|
} else {
|
||||||
@ -393,11 +386,7 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
getPositionY(y) {
|
getPositionY(y) {
|
||||||
if (this.canvasStyleData.selfAdaption) {
|
return y * this.curCanvasScale.scalePointHeight
|
||||||
return y * this.curCanvasScale.scaleHeight / 100
|
|
||||||
} else {
|
|
||||||
return y
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
styleChange() {
|
styleChange() {
|
||||||
this.$store.commit('recordStyleChange')
|
this.$store.commit('recordStyleChange')
|
||||||
|
Loading…
Reference in New Issue
Block a user