Skip to content

Commit

Permalink
feat: 检索的查询展开后页面滑动也能给结果以展示空间 --story=118753491
Browse files Browse the repository at this point in the history
  • Loading branch information
nanasikeai committed Sep 10, 2024
1 parent 8fdea25 commit d77d4f4
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 30 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,6 @@
IRequestResponsePaginationData,
} from '@utils/request';
import { getOffset } from '@/utils/assist';
interface Props {
columns: InstanceType<typeof Table>['$props']['columns'],
dataSource: (params: any)=> Promise<IRequestResponsePaginationData<any>>,
Expand All @@ -125,7 +123,7 @@
const pagination = reactive<IPagination>({
count: 0,
current: 1,
limit: 10,
limit: 50,
limitList: [10, 20, 50, 100],
align: 'right',
layout: ['total', 'limit', 'list'],
Expand Down Expand Up @@ -211,38 +209,13 @@
emits('clearSearch');
};
const tableHeaderHeight = 42;
const tableRowHeight = 42;
const calcPageLimit = () => {
const windowInnerHeight = window.innerHeight;
const pageOffsetTop = 185;
const tableFooterHeight = 60;
const copyrightHeight = 72;
const tableRowTotalHeight = windowInnerHeight
- pageOffsetTop
- tableHeaderHeight
- tableFooterHeight
- copyrightHeight;
const rowNum = Math.floor(tableRowTotalHeight / tableRowHeight);
const pageLimit = new Set([
...pagination.limitList,
rowNum,
]);
pagination.limit = rowNum;
pagination.limitList = [...pageLimit].sort((a, b) => a - b);
};
const calcTableHeight = _.throttle(() => {
const windowInnerHeight = window.innerHeight;
const { top } = getOffset(rootRef.value);
tableMaxHeight.value = windowInnerHeight - top - 120;
tableMaxHeight.value = windowInnerHeight - 250;
}, 100);
onMounted(() => {
parseURL();
calcPageLimit();
calcTableHeight();
window.addEventListener('resize', calcTableHeight);
const observer = new MutationObserver(() => {
Expand Down
4 changes: 3 additions & 1 deletion src/frontend/src/views/analysis-manage/list/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,9 @@
ref="resultRef"
:filter="searchModel"
@clear-search="handleClearSearch" />
<search-page-footer />
<div style="height: 52px; margin-top: 24px;">
<search-page-footer />
</div>
</div>
</skeleton-loading>
</template>
Expand Down

0 comments on commit d77d4f4

Please sign in to comment.