forked from github/dataease
refactor(仪表板): 优化仪表板编辑按钮显示位置,优先在视图外测显示且可以左右位置自适应改变
This commit is contained in:
parent
b8727f9b5a
commit
2e55ebe6d7
@ -1,5 +1,5 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="bar-main">
|
<div class="bar-main" :class="showEditPosition">
|
||||||
<input id="input" ref="files" type="file" accept="image/*" hidden @click="e => {e.target.value = '';}" @change="handleFileChange">
|
<input id="input" ref="files" type="file" accept="image/*" hidden @click="e => {e.target.value = '';}" @change="handleFileChange">
|
||||||
<div v-if="linkageAreaShow" style="margin-right: -1px;width: 20px">
|
<div v-if="linkageAreaShow" style="margin-right: -1px;width: 20px">
|
||||||
<el-checkbox v-model="linkageInfo.linkageActive" size="medium" />
|
<el-checkbox v-model="linkageInfo.linkageActive" size="medium" />
|
||||||
@ -77,6 +77,7 @@ export default {
|
|||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
barWidth: 24,
|
||||||
componentType: null,
|
componentType: null,
|
||||||
linkageActiveStatus: false,
|
linkageActiveStatus: false,
|
||||||
editFilter: [
|
editFilter: [
|
||||||
@ -89,6 +90,22 @@ export default {
|
|||||||
mounted() {
|
mounted() {
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
|
showEditPosition() {
|
||||||
|
if (this.activeModel === 'edit') {
|
||||||
|
const toRight = (this.canvasStyleData.width - this.element.style.left - this.element.style.width) * this.curCanvasScale.scalePointWidth
|
||||||
|
const toLeft = this.element.style.left * this.curCanvasScale.scalePointWidth
|
||||||
|
if (this.barWidth < toRight) {
|
||||||
|
return 'bar-main-right'
|
||||||
|
} else if (this.barWidth > toRight && this.barWidth > toLeft) {
|
||||||
|
return 'bar-main-left-inner'
|
||||||
|
} else {
|
||||||
|
return 'bar-main-left-outer'
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
return 'bar-main-preview'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
showJumpFlag() {
|
showJumpFlag() {
|
||||||
return this.curComponent && this.curComponent.hyperlinks && this.curComponent.hyperlinks.enable
|
return this.curComponent && this.curComponent.hyperlinks && this.curComponent.hyperlinks.enable
|
||||||
},
|
},
|
||||||
@ -265,7 +282,6 @@ export default {
|
|||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
.bar-main{
|
.bar-main{
|
||||||
position: absolute;
|
position: absolute;
|
||||||
right: 0px;
|
|
||||||
float:right;
|
float:right;
|
||||||
z-index: 2;
|
z-index: 2;
|
||||||
border-radius:2px;
|
border-radius:2px;
|
||||||
@ -288,5 +304,22 @@ export default {
|
|||||||
.bar-main ::v-deep .el-checkbox__inner::after{
|
.bar-main ::v-deep .el-checkbox__inner::after{
|
||||||
width: 4.5px;
|
width: 4.5px;
|
||||||
}
|
}
|
||||||
|
.bar-main-right{
|
||||||
|
width: 22px;
|
||||||
|
right: -25px;
|
||||||
|
}
|
||||||
|
.bar-main-left-inner{
|
||||||
|
width: 22px;
|
||||||
|
left: 0px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.bar-main-left-outer{
|
||||||
|
width: 22px;
|
||||||
|
left: -25px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.bar-main-preview{
|
||||||
|
right: 0px;
|
||||||
|
}
|
||||||
|
|
||||||
</style>
|
</style>
|
||||||
|
Loading…
Reference in New Issue
Block a user