Kaynağa Gözat

1-30-zl-前端

林小张 2 ay önce
ebeveyn
işleme
cdf6ec82c0
1 değiştirilmiş dosya ile 15 ekleme ve 1 silme
  1. 15 1
      src/views/platform/decoration/floor/manage.vue

+ 15 - 1
src/views/platform/decoration/floor/manage.vue

@@ -149,6 +149,13 @@
             </template>
           </el-table-column>
         </el-table>
+        <pagination
+          v-show="productTotal > 0"
+          v-model:page="productPageNum"
+          v-model:limit="productPageSize"
+          :total="productTotal"
+          @pagination="handleSearchProduct"
+        />
       </div>
     </div>
 
@@ -260,6 +267,9 @@ const productCardList = ref<any[]>([]);
 const productQuery = ref('');
 const productList = ref<any[]>([]);
 const productLoading = ref(false);
+const productPageNum = ref(1);
+const productPageSize = ref(10);
+const productTotal = ref(0);
 
 // 广告编辑弹框
 const adDialog = reactive({ visible: false });
@@ -472,12 +482,16 @@ const handleRemoveProductCard = async (index: number) => {
 const handleSearchProduct = async () => {
   productLoading.value = true;
   try {
-    const params: any = { pageSize: 10 };
+    const params: any = {
+      pageNum: productPageNum.value,
+      pageSize: productPageSize.value
+    };
     if (productQuery.value) {
       params.productNo = productQuery.value;
     }
     const res = await listProductBase(params);
     productList.value = res.rows || [];
+    productTotal.value = res.total || 0;
   } catch (e) {
     console.error('搜索产品失败', e);
   } finally {