Pre Merge pull request !66 from luoyangxin/master

This commit is contained in:
luoyangxin 2025-04-27 07:13:27 +00:00 committed by Gitee
commit 29d3621ab9
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F

View File

@ -495,32 +495,40 @@
function camelToUnderscore(str) { function camelToUnderscore(str) {
return str.replace(/([A-Z])/g, '_$1').toLowerCase(); return str.replace(/([A-Z])/g, '_$1').toLowerCase();
} }
// //
const yHeight = ref(0); const yHeight = ref(0);
onMounted(() => {
resetGetHeight();
});
function resetGetHeight() { function resetGetHeight() {
// //
let doc = document.querySelector('.ant-form'); let doc = document.querySelector('.ant-form');
// //
let btn = document.querySelector('.smart-table-btn-block'); let btn = document.querySelector('.smart-table-btn-block');
// //
let tableCell = document.querySelector('.ant-table-cell'); let tableCell = document.querySelector('.ant-table-cell');
// //
let page = document.querySelector('.smart-query-table-page'); let page = document.querySelector('.smart-query-table-page');
// //
let box = document.querySelector('.admin-content'); let box = document.querySelector('.admin-content');
setTimeout(() => { setTimeout(() => {
let dueHeight = doc.offsetHeight + 10 + 24 + btn.offsetHeight + 15 + tableCell.offsetHeight + page.offsetHeight + 20; let dueHeight = doc.offsetHeight + 10 + 24 + btn.offsetHeight + 15 + tableCell.offsetHeight + page.offsetHeight + 20;
yHeight.value = box.offsetHeight - dueHeight; yHeight.value = box.offsetHeight - dueHeight;
}, 100); }, 100);
} }
window.addEventListener(
'resize', //
_.throttle(() => { let throttledResizeHandler;
resetGetHeight(); onMounted(() => {
}, 1000) resetGetHeight();
); throttledResizeHandler = _.throttle(() => {
resetGetHeight();
}, 1000);
window.addEventListener('resize', throttledResizeHandler);
});
// resize
onUnmounted(() => {
window.removeEventListener('resize', throttledResizeHandler);
});
</script> </script>