diff --git a/app/components/shared/ProductFilter.vue b/app/components/shared/ProductFilter.vue index dc09d52..c59c76d 100644 --- a/app/components/shared/ProductFilter.vue +++ b/app/components/shared/ProductFilter.vue @@ -101,19 +101,19 @@ defineProps({ productTypeOptions: { - type: Array as () => Array<{ id: number; name: string }>, + type: Array as () => Array<{ id: string; name: string }>, default: () => [], }, productOptions: { - type: Array as () => Array<{ id: number; name: string }>, + type: Array as () => Array<{ id: string; name: string }>, default: () => [], }, }); const model = defineModel<{ keyword: string; - selectedType: number | null; - selectedProduct: number | null; + selectedType: string | null; + selectedProduct: string | null; }>(); diff --git a/app/pages/support/documents.vue b/app/pages/support/documents.vue index 63519eb..c03e8ea 100644 --- a/app/pages/support/documents.vue +++ b/app/pages/support/documents.vue @@ -15,7 +15,16 @@ :product-type-options="productTypeOptions" :product-options="productOptions" /> - + + + @@ -30,11 +39,14 @@ ]; const filters = reactive({ - selectedType: null as number | null, - selectedProduct: null as number | null, + selectedType: null as string | null, + selectedProduct: null as string | null, keyword: '', }); + const page = ref(1); + const documentsPerPage = 10; + const { data: documents, pending, error } = await useDocumentList(); const productTypeOptions = computed(() => { @@ -92,6 +104,13 @@ }); }); + const paginatedDocuments = computed(() => { + return filteredDocuments.value.slice( + (page.value - 1) * documentsPerPage, + page.value * documentsPerPage + ); + }); + watch( () => filters.selectedType, () => { @@ -153,4 +172,35 @@ height: 40px; font-size: 0.9rem; } + + .pagination-container { + margin-top: 2rem; + } + + :deep(.el-pagination) { + .btn-prev, + .btn-next { + .el-icon { + font-size: 24px; + } + } + + .el-pager { + gap: 0.5rem; + } + .el-pager li { + font-size: 1rem; + /* border: 1px solid #409eff; */ + border-radius: 50%; + + &:hover { + background-color: #ecf5ff; + } + + &.is-active { + background-color: var(--el-color-primary); + color: #fff; + } + } + } diff --git a/app/pages/support/faq.vue b/app/pages/support/faq.vue index dafe3c8..df53b44 100644 --- a/app/pages/support/faq.vue +++ b/app/pages/support/faq.vue @@ -17,7 +17,16 @@ :product-options="productOptions" /> - + + + @@ -25,13 +34,21 @@