优化一些问题和代码

This commit is contained in:
zhuoda
2023-04-06 22:48:07 +08:00
parent f2d098d5d1
commit e2c6a83125
20 changed files with 257 additions and 89 deletions

View File

@@ -0,0 +1,30 @@
/**
* 计算表格自适应高度
*
* @param {*} heightRef
* @param {*} removeRefArray
* @param {*} extraRemoveHeight
* @returns
*/
import { useAppConfigStore } from '../store/modules/system/app-config';
export function calcTableHeight(heightRef, removeRefArray, extraRemoveHeight) {
let removeHeight = 0;
if (removeRefArray && removeRefArray.length > 0) {
for (const item of removeRefArray) {
removeHeight = removeHeight + item.value.$el.offsetHeight;
}
}
let due = 40;
if (useAppConfigStore().$state.pageTagFlag) {
due = due + 40;
}
if (useAppConfigStore().$state.footerFlag) {
due = due + 40;
}
removeHeight = removeHeight + extraRemoveHeight + due;
heightRef.value = document.querySelector('#smartAdminLayoutContent').offsetHeight - removeHeight;
}