change
This commit is contained in:
@@ -0,0 +1,33 @@
|
||||
/* 社团信息维护列表页固定占满平台内容区,禁止页面主体产生纵向滚动条。 */
|
||||
#app .club-info-fixed-list-page {
|
||||
box-sizing: border-box;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
height: calc(100vh - 82px);
|
||||
min-height: 0;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
#app .club-info-fixed-query-card {
|
||||
flex: 0 0 auto;
|
||||
}
|
||||
|
||||
#app .club-info-fixed-list-card {
|
||||
flex: 1 1 auto;
|
||||
min-height: 0;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
#app .club-info-fixed-list-card > .el-card__body {
|
||||
box-sizing: border-box;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
height: 100%;
|
||||
min-height: 0;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
#app .club-info-fixed-list-card .ele-table-tool,
|
||||
#app .club-info-fixed-list-card .el-pagination-container {
|
||||
flex: 0 0 auto;
|
||||
}
|
||||
@@ -0,0 +1,71 @@
|
||||
/*
|
||||
* 社团信息维护列表页共用高度计算逻辑。
|
||||
* 查询卡片保持原始高度,列表表格占用工具栏与分页之外的全部剩余空间。
|
||||
*/
|
||||
const CLUB_INFO_FIXED_LIST_MIXIN = {
|
||||
data() {
|
||||
return {
|
||||
tableHeight: 300,
|
||||
clubInfoListResizeObserver: null,
|
||||
clubInfoListResizeHandler: null,
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
updateClubInfoListTableHeight() {
|
||||
this.$nextTick(() => {
|
||||
const page = this.$el.querySelector('.club-info-fixed-list-page')
|
||||
const cardBody = this.$el.querySelector('.club-info-fixed-list-card > .el-card__body')
|
||||
if (!page || !cardBody || cardBody.clientHeight <= 0) {
|
||||
return
|
||||
}
|
||||
const getOuterHeight = element => {
|
||||
if (!element) {
|
||||
return 0
|
||||
}
|
||||
const style = window.getComputedStyle(element)
|
||||
return element.offsetHeight
|
||||
+ (parseFloat(style.marginTop) || 0)
|
||||
+ (parseFloat(style.marginBottom) || 0)
|
||||
}
|
||||
const bodyStyle = window.getComputedStyle(cardBody)
|
||||
const bodyPadding = (parseFloat(bodyStyle.paddingTop) || 0)
|
||||
+ (parseFloat(bodyStyle.paddingBottom) || 0)
|
||||
const tableTool = cardBody.querySelector('.ele-table-tool')
|
||||
const pagination = cardBody.querySelector('.el-pagination-container')
|
||||
const reservedHeight = bodyPadding + getOuterHeight(tableTool) + getOuterHeight(pagination)
|
||||
const nextHeight = Math.max(1, Math.floor(cardBody.clientHeight - reservedHeight))
|
||||
if (this.tableHeight !== nextHeight) {
|
||||
this.tableHeight = nextHeight
|
||||
}
|
||||
this.$nextTick(() => {
|
||||
if (this.$refs.tableRef) {
|
||||
this.$refs.tableRef.doLayout()
|
||||
}
|
||||
})
|
||||
})
|
||||
},
|
||||
},
|
||||
mounted() {
|
||||
this.updateClubInfoListTableHeight()
|
||||
const page = this.$el.querySelector('.club-info-fixed-list-page')
|
||||
if (window.ResizeObserver && page) {
|
||||
this.clubInfoListResizeObserver = new ResizeObserver(() => {
|
||||
this.updateClubInfoListTableHeight()
|
||||
})
|
||||
this.clubInfoListResizeObserver.observe(page)
|
||||
} else {
|
||||
this.clubInfoListResizeHandler = () => {
|
||||
this.updateClubInfoListTableHeight()
|
||||
}
|
||||
window.addEventListener('resize', this.clubInfoListResizeHandler)
|
||||
}
|
||||
},
|
||||
beforeDestroy() {
|
||||
if (this.clubInfoListResizeObserver) {
|
||||
this.clubInfoListResizeObserver.disconnect()
|
||||
}
|
||||
if (this.clubInfoListResizeHandler) {
|
||||
window.removeEventListener('resize', this.clubInfoListResizeHandler)
|
||||
}
|
||||
},
|
||||
}
|
||||
+65
@@ -0,0 +1,65 @@
|
||||
/*
|
||||
* 分工会预算列表页统一布局:页面固定占满平台内容区,
|
||||
* 查询区和工具栏保持原高度,超出的数据仅在表格内部滚动。
|
||||
*/
|
||||
#app .outlay-union-fixed-list-page {
|
||||
box-sizing: border-box;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
height: calc(100vh - 82px);
|
||||
min-height: 0;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
#app .outlay-union-fixed-query-card {
|
||||
flex: 0 0 auto;
|
||||
}
|
||||
|
||||
#app .outlay-union-fixed-list-card {
|
||||
flex: 1 1 auto;
|
||||
min-height: 0;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
#app .outlay-union-fixed-list-card > .el-card__body {
|
||||
box-sizing: border-box;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
height: 100%;
|
||||
min-height: 0;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
#app .outlay-union-fixed-list-card .ele-table-tool,
|
||||
#app .outlay-union-fixed-list-card .el-pagination-container,
|
||||
#app .outlay-union-fixed-list-card .outlay-union-summary-table {
|
||||
flex: 0 0 auto;
|
||||
}
|
||||
|
||||
#app .outlay-union-fixed-list-card .outlay-union-summary-table {
|
||||
margin-top: 0;
|
||||
}
|
||||
|
||||
#app .outlay-union-fixed-list-card .outlay-union-summary-table .el-table__body-wrapper {
|
||||
overflow: hidden !important;
|
||||
}
|
||||
|
||||
/* 合计行单独展示时不显示单元格网格线,避免与上方数据表格的边框重复。 */
|
||||
#app .outlay-union-fixed-list-card .outlay-union-summary-table,
|
||||
#app .outlay-union-fixed-list-card .outlay-union-summary-table::before,
|
||||
#app .outlay-union-fixed-list-card .outlay-union-summary-table::after,
|
||||
#app .outlay-union-fixed-list-card .outlay-union-summary-table .el-table__body,
|
||||
#app .outlay-union-fixed-list-card .outlay-union-summary-table .el-table__body tr,
|
||||
#app .outlay-union-fixed-list-card .outlay-union-summary-table .el-table__body td {
|
||||
border: none !important;
|
||||
}
|
||||
|
||||
/* 合计标签单元格保留完整边框,突出汇总行的起始位置。 */
|
||||
#app .outlay-union-fixed-list-card .outlay-union-summary-table .el-table__body td:first-child {
|
||||
border: 1px solid #ebeef5 !important;
|
||||
}
|
||||
|
||||
#app .outlay-union-fixed-list-card .outlay-union-fixed-table {
|
||||
flex: 1 1 auto;
|
||||
min-height: 0;
|
||||
}
|
||||
+75
@@ -0,0 +1,75 @@
|
||||
/*
|
||||
* 分工会预算列表页统一高度逻辑:表格高度按列表卡片剩余空间动态计算,
|
||||
* 窗口尺寸或平台内容区变化时重新布局,保证分页始终可见。
|
||||
*/
|
||||
const OUTLAY_UNION_FIXED_LIST_MIXIN = {
|
||||
data() {
|
||||
return {
|
||||
tableHeight: 300,
|
||||
outlayUnionResizeObserver: null,
|
||||
outlayUnionResizeHandler: null,
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
updateOutlayUnionTableHeight() {
|
||||
this.$nextTick(() => {
|
||||
const page = this.$el.querySelector('.outlay-union-fixed-list-page')
|
||||
const cardBody = this.$el.querySelector('.outlay-union-fixed-list-card > .el-card__body')
|
||||
if (!page || !cardBody || cardBody.clientHeight <= 0) {
|
||||
return
|
||||
}
|
||||
const getOuterHeight = (element) => {
|
||||
if (!element) {
|
||||
return 0
|
||||
}
|
||||
const style = window.getComputedStyle(element)
|
||||
return element.offsetHeight
|
||||
+ (parseFloat(style.marginTop) || 0)
|
||||
+ (parseFloat(style.marginBottom) || 0)
|
||||
}
|
||||
const bodyStyle = window.getComputedStyle(cardBody)
|
||||
const bodyPadding = (parseFloat(bodyStyle.paddingTop) || 0)
|
||||
+ (parseFloat(bodyStyle.paddingBottom) || 0)
|
||||
const tableTool = cardBody.querySelector('.ele-table-tool')
|
||||
const summaryTable = cardBody.querySelector('.outlay-union-summary-table')
|
||||
const pagination = cardBody.querySelector('.el-pagination-container')
|
||||
const reservedHeight = bodyPadding
|
||||
+ getOuterHeight(tableTool)
|
||||
+ getOuterHeight(summaryTable)
|
||||
+ getOuterHeight(pagination)
|
||||
const nextHeight = Math.max(1, Math.floor(cardBody.clientHeight - reservedHeight))
|
||||
if (this.tableHeight !== nextHeight) {
|
||||
this.tableHeight = nextHeight
|
||||
}
|
||||
this.$nextTick(() => {
|
||||
if (this.$refs.tableRef) {
|
||||
this.$refs.tableRef.doLayout()
|
||||
}
|
||||
})
|
||||
})
|
||||
},
|
||||
},
|
||||
mounted() {
|
||||
this.updateOutlayUnionTableHeight()
|
||||
const page = this.$el.querySelector('.outlay-union-fixed-list-page')
|
||||
if (window.ResizeObserver && page) {
|
||||
this.outlayUnionResizeObserver = new ResizeObserver(() => {
|
||||
this.updateOutlayUnionTableHeight()
|
||||
})
|
||||
this.outlayUnionResizeObserver.observe(page)
|
||||
} else {
|
||||
this.outlayUnionResizeHandler = () => {
|
||||
this.updateOutlayUnionTableHeight()
|
||||
}
|
||||
window.addEventListener('resize', this.outlayUnionResizeHandler)
|
||||
}
|
||||
},
|
||||
beforeDestroy() {
|
||||
if (this.outlayUnionResizeObserver) {
|
||||
this.outlayUnionResizeObserver.disconnect()
|
||||
}
|
||||
if (this.outlayUnionResizeHandler) {
|
||||
window.removeEventListener('resize', this.outlayUnionResizeHandler)
|
||||
}
|
||||
},
|
||||
}
|
||||
Reference in New Issue
Block a user