gaoluyang
2 天以前 f936f4a3b32a0bf2b99399ced63944f218e582b9
src/hooks/usePaginationApi.jsx
@@ -1,6 +1,7 @@
import { ref, reactive, watchEffect, unref } from "vue";
import useFormData from "@/hooks/useFormData";
import { deepClone, isEqual } from "@/utils/index.js"
import { ElMessage } from 'element-plus'
/**
 * 分页api
@@ -27,7 +28,7 @@
  /** 分页配置 */
  const pagination = reactive({
    pageSize: 10,
    pageSize: 100,
    currentPage: 1,
    pageSizes: [10, 15, 20],
    total: 0,
@@ -85,7 +86,7 @@
      ...getFinalParams(),
      current: pagination.currentPage,
      size: pagination.pageSize
    }).then(({ code, data, ...rest }) => {
    }).then(({ code, data, msg, ...rest }) => {
      if (code == 200) {
        // pagination.currentPage = meta.current_page;
        // pagination.pageSize = meta.per_page;
@@ -96,7 +97,7 @@
        loading.value = false;
      } else {
        loading.value = false;
        ElMessage({ message: data.msg, type: "error" });
        ElMessage({ message: msg, type: "error" });
      }
    });
  }