Commit c50d45d6 authored by 郭志伟's avatar 郭志伟

fix(bottom-tip): 调整底部计算方式

parent 08d0bbc2
...@@ -27,21 +27,21 @@ export default class OperationPanel extends Mixins(TransformStyleMixin) { ...@@ -27,21 +27,21 @@ export default class OperationPanel extends Mixins(TransformStyleMixin) {
return this.pageData.elements.map(v => v.point); return this.pageData.elements.map(v => v.point);
} }
@Watch('layout', { deep: true }) // @Watch('layout', { deep: true })
onLayoutChange(val) { // onLayoutChange(val) {
const lastGridItemPoint = val[val.length - 1]; // const lastGridItemPoint = val[val.length - 1];
if (lastGridItemPoint && lastGridItemPoint.w) { // if (lastGridItemPoint && lastGridItemPoint.w) {
this.bottomInfo = { // this.bottomInfo = {
x: 0, // x: 0,
y: 0, // y: 0,
w: 375, // w: 375,
h: 60, // h: 60,
i: 'page-bottom-top' // i: 'page-bottom-top'
}; // };
if (lastGridItemPoint.w > this.bottomInfo.w) { this.bottomInfo.w = lastGridItemPoint.w; } // if (lastGridItemPoint.w > this.bottomInfo.w) { this.bottomInfo.w = lastGridItemPoint.w; }
this.bottomInfo.y = this.bottomInfo.y + lastGridItemPoint.y + lastGridItemPoint.h; // this.bottomInfo.y = this.bottomInfo.y + lastGridItemPoint.y + lastGridItemPoint.h;
} // }
} // }
@Emit('update:isDragIn') @Emit('update:isDragIn')
dragenter() { dragenter() {
...@@ -87,4 +87,21 @@ export default class OperationPanel extends Mixins(TransformStyleMixin) { ...@@ -87,4 +87,21 @@ export default class OperationPanel extends Mixins(TransformStyleMixin) {
toggle(val) { toggle(val) {
// //
} }
layoutUpdatedEvent() {
this.$nextTick(() => {
const lastGridItemPoint = this.layout[this.layout.length - 1];
if (lastGridItemPoint && lastGridItemPoint.w) {
this.bottomInfo = {
x: 0,
y: 0,
w: 375,
h: 60,
i: 'page-bottom-top'
};
if (lastGridItemPoint.w > this.bottomInfo.w) { this.bottomInfo.w = lastGridItemPoint.w; }
this.bottomInfo.y = this.bottomInfo.y + lastGridItemPoint.y + lastGridItemPoint.h;
}
});
}
} }
\ No newline at end of file
...@@ -13,6 +13,7 @@ ...@@ -13,6 +13,7 @@
:use-css-transforms="true" :use-css-transforms="true"
:style="transformStyle(pageData.commonStyle)" :style="transformStyle(pageData.commonStyle)"
@click.native.stop="toggle(false)" @click.native.stop="toggle(false)"
@layout-updated="layoutUpdatedEvent"
> >
<grid-item @click.native.stop="handleElementClick(index, null)" v-for="(item, index) in pageData.elements" <grid-item @click.native.stop="handleElementClick(index, null)" v-for="(item, index) in pageData.elements"
:x="item.point.x" :x="item.point.x"
......
...@@ -1491,9 +1491,9 @@ ...@@ -1491,9 +1491,9 @@
"integrity": "sha512-uOCUKu5mvX3PWee+7ZFXQSNIR1V5SN2JVE2yANmW9/wQOgpEct291gXGok8VMw0009HlTWB4JATURPwyOP2DFg==" "integrity": "sha512-uOCUKu5mvX3PWee+7ZFXQSNIR1V5SN2JVE2yANmW9/wQOgpEct291gXGok8VMw0009HlTWB4JATURPwyOP2DFg=="
}, },
"@qg/cherry-ui": { "@qg/cherry-ui": {
"version": "2.21.1-beta8", "version": "2.21.1-beta9",
"resolved": "http://npmprivate.quantgroups.com/@qg%2fcherry-ui/-/cherry-ui-2.21.1-beta8.tgz", "resolved": "http://npmprivate.quantgroups.com/@qg%2fcherry-ui/-/cherry-ui-2.21.1-beta9.tgz",
"integrity": "sha512-6bSv1iTQ73IF2NG5ssQbIg/DDwa3r3kv/t6DWfp/9y/aVB1Eyj4ddVesP3+TysSKf+S5ZN4unva/M5Lj3OPuHg==", "integrity": "sha512-evaqcwGPrg/RqgHZW3pFU2QpvmIlNZMA83QdGV7U58XrkTuQ4C4wE6FgB0M7kGTZzf/IpfjOZL5ZuGfSaOlGUw==",
"requires": { "requires": {
"@popperjs/core": "^2.5.4", "@popperjs/core": "^2.5.4",
"vue-lazyload": "^1.3.3", "vue-lazyload": "^1.3.3",
...@@ -1501,9 +1501,9 @@ ...@@ -1501,9 +1501,9 @@
} }
}, },
"@qg/citrus-ui": { "@qg/citrus-ui": {
"version": "0.1.15-beta4", "version": "0.1.15-beta5",
"resolved": "http://npmprivate.quantgroups.com/@qg%2fcitrus-ui/-/citrus-ui-0.1.15-beta4.tgz", "resolved": "http://npmprivate.quantgroups.com/@qg%2fcitrus-ui/-/citrus-ui-0.1.15-beta5.tgz",
"integrity": "sha512-DqLR4peJapLIOQrVjvDjRsWwve4qJ0/+IZczDNYSjr2b2XB2KRahf9vYNEDDjEiRwnbDFVQYRPlVrA/BKbn0uw==", "integrity": "sha512-IP0MI8wvs6hgpBKF0ruv8DYOJB0x5tWTISFjDGhCc4JqiPVM/wtOzNNRDFA5+nHaQrOYH+QpX4P/sRXdlWkChA==",
"requires": { "requires": {
"@better-scroll/core": "^2.1.1", "@better-scroll/core": "^2.1.1",
"@qg/cherry-ui": "^2.21.1-beta5", "@qg/cherry-ui": "^2.21.1-beta5",
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment