Skip to content

Commit

Permalink
修复楼盘表样式Bug
Browse files Browse the repository at this point in the history
  • Loading branch information
qq10137383 committed Jun 13, 2023
1 parent 909876e commit b00197f
Show file tree
Hide file tree
Showing 8 changed files with 37 additions and 12 deletions.
4 changes: 2 additions & 2 deletions src/components/BuildingTable/HouseTooltip.vue
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export default {
// 延时显示tooltip时间(毫秒)
delayTime: {
type: Number,
default: 500
default: 1000
}
},
data() {
Expand Down Expand Up @@ -103,7 +103,7 @@ export default {
this.house = house;
this.show = true;
this.adjustEdge();
}, this.delayTime || 500)
}, this.delayTime)
},
updateTooltip(house) {
this.hoverState.current = house;
Expand Down
2 changes: 1 addition & 1 deletion src/components/BuildingTable/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,7 @@

| 参数 | 说明 | 类型 | 默认值 | 可选值 |
| --------- | ------------------------- | ------ | ------ | ------ |
| delayTime | 延时显示tooltip时间(毫秒) | Number | 500 | |
| delayTime | 延时显示tooltip时间(毫秒) | Number | 1000 | |


```html
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,8 @@ export default {
methods: {
// 设置楼盘表内容区域布局参数
setLayout() {
const hasGutter = this.$el.scrollHeight > this.$el.clientHeight;
const hasGutter = this.tableWidth >= this.$el.clientWidth
&& this.$el.scrollHeight > this.$el.clientHeight;
this.store.commit("setLayout", {
hasGutter,
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,8 @@ export default {
},
// 设置楼盘表内容区域布局参数和空楼层高度
setLayout() {
const hasGutter = this.$el.scrollHeight > this.$el.clientHeight;
const hasGutter = this.tableWidth >= this.$el.clientWidth
&& this.$el.scrollHeight > this.$el.clientHeight;
const scrollLeft = this.$el.scrollLeft;
this.store.commit("setLayout", {
hasGutter,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,9 @@ export default {
rowspan='1'
colspan='1'
class='building-td__header'
></td>
>
<div class="cell-fill"></div>
</td>
)
rowVNodes.push(this.renderUnitCell(unitInfo))
})
Expand All @@ -109,7 +111,9 @@ export default {
rowspan='1'
colspan='1'
class='building-td__gutter'
/>
>
<div class="cell-fill"></div>
</td>
)
}
return rowVNodes
Expand Down
4 changes: 4 additions & 0 deletions src/components/BuildingTable/style/common.scss
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,7 @@
vertical-align: 2px;
}
}

.cell-fill {
height: 100%;
}
9 changes: 7 additions & 2 deletions src/components/BuildingTable/style/house.scss
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,9 @@
}

.house-cell__block-title {
text-decoration: underline;
display: inline-block;
max-width: 100%;
text-decoration: underline;
}

.house-cell__block-item {
Expand Down Expand Up @@ -100,7 +101,10 @@
}

.floor-cell-wrap {
padding-right: 3px;
height: 100%;
display: flex;
justify-content: center;
align-items: center;
}

/* table布局样式*/
Expand All @@ -112,6 +116,7 @@

.building-td__floor {
@include primary-cell;
height: 1px;
}

.building-td__house {
Expand Down
16 changes: 13 additions & 3 deletions src/components/BuildingTable/style/unit.scss
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,23 @@
/* table布局样式*/
.unit-table-render {
.building-td__header,
.building-td__unit,
.building-td__gutter {
.building-td__unit {
@include primary-cell;
height: 1px;
}

.building-td__unit {
.building-td__gutter {
padding-left: 1px;
height: 1px;
background-color: $primary-color;
border-radius: 2px;
}

.unit-cell-wrap {
height: 100%;
display: flex;
align-items: center;
justify-content: center;
}
}

Expand Down

0 comments on commit b00197f

Please sign in to comment.