|
@@ -19,14 +19,39 @@
|
|
|
</BasicTable>
|
|
</BasicTable>
|
|
|
|
|
|
|
|
<div class="pagination-bar">
|
|
<div class="pagination-bar">
|
|
|
- <AnalysisPagination
|
|
|
|
|
- :total="pagination.total"
|
|
|
|
|
- :current="pagination.current"
|
|
|
|
|
- :page-size="pagination.pageSize"
|
|
|
|
|
- :page-size-options="pageSizeOptions"
|
|
|
|
|
- :loading="paginationLoading"
|
|
|
|
|
- @change="handlePaginationChange"
|
|
|
|
|
- />
|
|
|
|
|
|
|
+ <div class="analysis-pagination">
|
|
|
|
|
+ <div class="analysis-pagination__total">共 {{ pagination.total }} 条</div>
|
|
|
|
|
+ <Pagination
|
|
|
|
|
+ :current="pagination.current"
|
|
|
|
|
+ :total="pagination.total"
|
|
|
|
|
+ :page-size="pagination.pageSize"
|
|
|
|
|
+ :show-size-changer="false"
|
|
|
|
|
+ :show-quick-jumper="false"
|
|
|
|
|
+ :disabled="paginationLoading"
|
|
|
|
|
+ @change="handlePaginationChange"
|
|
|
|
|
+ />
|
|
|
|
|
+ <Select
|
|
|
|
|
+ :value="String(pagination.pageSize)"
|
|
|
|
|
+ :options="pageSizeSelectOptions"
|
|
|
|
|
+ :disabled="paginationLoading"
|
|
|
|
|
+ :get-popup-container="sizeDropdownContainer"
|
|
|
|
|
+ placement="topLeft"
|
|
|
|
|
+ class="analysis-pagination__size"
|
|
|
|
|
+ @change="handlePageSizeChange"
|
|
|
|
|
+ />
|
|
|
|
|
+ <span v-if="showQuickJumper" class="analysis-pagination__jumper">
|
|
|
|
|
+ 跳至
|
|
|
|
|
+ <Input
|
|
|
|
|
+ v-model:value="jumpPageText"
|
|
|
|
|
+ size="small"
|
|
|
|
|
+ class="analysis-pagination__jump-input"
|
|
|
|
|
+ :disabled="paginationLoading"
|
|
|
|
|
+ @pressEnter="handleJumpPage"
|
|
|
|
|
+ @blur="handleJumpPage"
|
|
|
|
|
+ />
|
|
|
|
|
+ 页
|
|
|
|
|
+ </span>
|
|
|
|
|
+ </div>
|
|
|
</div>
|
|
</div>
|
|
|
|
|
|
|
|
<CleanLogModal
|
|
<CleanLogModal
|
|
@@ -38,10 +63,9 @@
|
|
|
</div>
|
|
</div>
|
|
|
</template>
|
|
</template>
|
|
|
<script lang="ts" setup name="ViewsSysEmpUserList">
|
|
<script lang="ts" setup name="ViewsSysEmpUserList">
|
|
|
- import { h, onBeforeUnmount, onMounted, ref, watch } from 'vue';
|
|
|
|
|
|
|
+ import { computed, h, onBeforeUnmount, onMounted, ref, watch } from 'vue';
|
|
|
import type { PropType } from 'vue';
|
|
import type { PropType } from 'vue';
|
|
|
- import { Popconfirm } from 'ant-design-vue';
|
|
|
|
|
- import AnalysisPagination from '@/core/components/AnalysisPagination/src/AnalysisPagination.vue';
|
|
|
|
|
|
|
+ import { Input, Pagination, Popconfirm, Select } from 'ant-design-vue';
|
|
|
import { Icon } from '@/core/components/Icon';
|
|
import { Icon } from '@/core/components/Icon';
|
|
|
import { BasicTable, BasicColumn, useTable } from '@/core/components/Table';
|
|
import { BasicTable, BasicColumn, useTable } from '@/core/components/Table';
|
|
|
import { useDesign } from '@/core/hooks/web/useDesign';
|
|
import { useDesign } from '@/core/hooks/web/useDesign';
|
|
@@ -96,6 +120,13 @@
|
|
|
label: value,
|
|
label: value,
|
|
|
value: Number(value),
|
|
value: Number(value),
|
|
|
}));
|
|
}));
|
|
|
|
|
+ const pageSizeSelectOptions = computed(() =>
|
|
|
|
|
+ pageSizeOptions.map((item) => ({ label: `${item.value} 条/页`, value: String(item.value) })),
|
|
|
|
|
+ );
|
|
|
|
|
+ const showQuickJumper = computed(() => pagination.value.total > pagination.value.pageSize);
|
|
|
|
|
+ const jumpPageText = ref('');
|
|
|
|
|
+ /** 页码下拉挂到 body,避免被文件卡片/分页条的 overflow:hidden 裁剪 */
|
|
|
|
|
+ const sizeDropdownContainer = () => document.body;
|
|
|
|
|
|
|
|
const normalizeSearchParams = (params: Recordable = {}) => {
|
|
const normalizeSearchParams = (params: Recordable = {}) => {
|
|
|
const nextParams: Recordable = { ...params };
|
|
const nextParams: Recordable = { ...params };
|
|
@@ -413,6 +444,27 @@
|
|
|
}
|
|
}
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
|
|
+ /** 自定义页码下拉:走 body 容器,避免被卡片 overflow 裁剪 */
|
|
|
|
|
+ const handlePageSizeChange = (value: string | number) => {
|
|
|
|
|
+ const size = Number(value);
|
|
|
|
|
+ if (!Number.isFinite(size) || size === pagination.value.pageSize) return;
|
|
|
|
|
+ void handlePaginationChange(1, size);
|
|
|
|
|
+ };
|
|
|
|
|
+
|
|
|
|
|
+ /** 自定义“跳至 X 页”,行为与 Ant Pagination 的 quick jumper 一致 */
|
|
|
|
|
+ const handleJumpPage = () => {
|
|
|
|
|
+ const raw = jumpPageText.value.trim();
|
|
|
|
|
+ jumpPageText.value = '';
|
|
|
|
|
+ if (!raw) return;
|
|
|
|
|
+ const target = Number(raw);
|
|
|
|
|
+ if (!Number.isFinite(target)) return;
|
|
|
|
|
+ const maxPage = Math.max(1, Math.ceil(pagination.value.total / pagination.value.pageSize));
|
|
|
|
|
+ const page = Math.min(Math.max(1, Math.trunc(target)), maxPage);
|
|
|
|
|
+ if (page !== pagination.value.current) {
|
|
|
|
|
+ void handlePaginationChange(page, pagination.value.pageSize);
|
|
|
|
|
+ }
|
|
|
|
|
+ };
|
|
|
|
|
+
|
|
|
const syncTableLayout = () => {
|
|
const syncTableLayout = () => {
|
|
|
if (!props.active) return;
|
|
if (!props.active) return;
|
|
|
requestAnimationFrame(() => {
|
|
requestAnimationFrame(() => {
|
|
@@ -894,5 +946,23 @@
|
|
|
overflow: hidden;
|
|
overflow: hidden;
|
|
|
box-sizing: border-box;
|
|
box-sizing: border-box;
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+ .analysis-pagination__size {
|
|
|
|
|
+ width: 100px;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ .analysis-pagination__jumper {
|
|
|
|
|
+ display: inline-flex;
|
|
|
|
|
+ align-items: center;
|
|
|
|
|
+ gap: 4px;
|
|
|
|
|
+ color: #6b7280;
|
|
|
|
|
+ font-size: 12px;
|
|
|
|
|
+ white-space: nowrap;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ .analysis-pagination__jump-input {
|
|
|
|
|
+ width: 44px;
|
|
|
|
|
+ text-align: center;
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
</style>
|
|
</style>
|