diff --git a/src/views/final/comp/FilterModal.vue b/src/views/final/comp/FilterModal.vue index 17cd96f..afbe8f1 100644 --- a/src/views/final/comp/FilterModal.vue +++ b/src/views/final/comp/FilterModal.vue @@ -1,255 +1,302 @@ - + 全部筛选值 @@ -258,7 +305,11 @@ const inputHandler = debounce((word) => { - + @@ -272,18 +323,25 @@ const inputHandler = debounce((word) => { @@ -316,7 +374,7 @@ const inputHandler = debounce((word) => { .n-input { width: 300px; - border: 1px solid gray + border: 1px solid gray; } } @@ -334,7 +392,7 @@ const inputHandler = debounce((word) => { position: relative; &:before { - background-color: #1980FF; + background-color: #1980ff; content: ""; width: 5px; border-radius: 2px; diff --git a/src/views/final/comp/RepeatTaskTableModal.vue b/src/views/final/comp/RepeatTaskTableModal.vue index 83faab4..2bda333 100644 --- a/src/views/final/comp/RepeatTaskTableModal.vue +++ b/src/views/final/comp/RepeatTaskTableModal.vue @@ -102,6 +102,25 @@ const pagination = reactive({ page: 1, pageCount: 1, pageSize: 10, + showSizePicker:true, + pageSizes: [ + { + label: "10 每页", + value: 10, + }, + { + label: "15 每页", + value: 15, + }, + { + label: "30 每页", + value: 30, + }, + { + label: "50 每页", + value: 50, + }, + ], }) const tableData = ref>([]) const selectionIds = ref([]) @@ -128,6 +147,14 @@ async function handlePageChange(currentPage) { const { pageSize } = pagination await query(currentPage, pageSize) } +async function handlePageSizeChange(currentPageSize) { + if (loading.value) return; + + const { page } = pagination; + pagination.pageSize = currentPageSize; + + await query(page, currentPageSize); +} function handleCheck(rowKeys: DataTableRowKey[]) { selectionIds.value = rowKeys @@ -217,6 +244,7 @@ query(pagination.page, pagination.pageSize) diff --git a/src/views/final/content/Content.vue b/src/views/final/content/Content.vue index 11a361f..2f7b966 100644 --- a/src/views/final/content/Content.vue +++ b/src/views/final/content/Content.vue @@ -369,6 +369,25 @@ const pagination = reactive({ page: 1, pageCount: 1, pageSize: 10, + showSizePicker:true, + pageSizes: [ + { + label: "10 每页", + value: 10, + }, + { + label: "15 每页", + value: 15, + }, + { + label: "30 每页", + value: 30, + }, + { + label: "50 每页", + value: 50, + }, + ], }) const tableData = ref>([]) const selectionIds = ref([]) @@ -402,6 +421,14 @@ async function handlePageChange(currentPage) { const { pageSize } = pagination await query(currentPage, pageSize) } +async function handlePageSizeChange(currentPageSize) { + if (loading.value) return; + + const { page } = pagination; + pagination.pageSize = currentPageSize; + + await query(page, currentPageSize); +} function handleCheck(rowKeys: DataTableRowKey[]) { selectionIds.value = rowKeys @@ -785,6 +812,7 @@ async function refreshHandler(searchId?: any) { :pagination="pagination" :row-key="rowKey" @update:page="handlePageChange" +@update-page-size="handlePageSizeChange" @update:checked-row-keys="handleCheck" /> diff --git a/src/views/home/aside/comp/modals/FilterModal.vue b/src/views/home/aside/comp/modals/FilterModal.vue index 1133223..886158d 100644 --- a/src/views/home/aside/comp/modals/FilterModal.vue +++ b/src/views/home/aside/comp/modals/FilterModal.vue @@ -79,6 +79,25 @@ const pagination = reactive({ page: 1, pageCount: 1, pageSize: 10, + showSizePicker:true, + pageSizes: [ + { + label: "10 每页", + value: 10, + }, + { + label: "15 每页", + value: 15, + }, + { + label: "30 每页", + value: 30, + }, + { + label: "50 每页", + value: 50, + }, + ], }); const tableData = ref>([]); const keyword = ref(""); @@ -167,6 +186,14 @@ async function handlePageChange(currentPage) { await query(currentPage, pageSize); } +async function handlePageSizeChange(currentPageSize) { + if (loading.value) return; + + const { page } = pagination; + pagination.pageSize = currentPageSize; + await query(page, currentPageSize); +} + function handleClick() { emit("showNewFilter"); show.value = false; @@ -296,6 +323,7 @@ const inputHandler = debounce((word) => { :pagination="pagination" :row-key="rowKey" @update:page="handlePageChange" +@update-page-size="handlePageSizeChange" @update:checked-row-keys="handleCheck" />