瀏覽代碼

fix: 客户列表选择弹窗search查询时清空列表

lanjianrong 5 年之前
父節點
當前提交
179c43dc18
共有 1 個文件被更改,包括 6 次插入1 次删除
  1. 6 1
      src/pages/Customer/Contact/components/CustomerModal/index.jsx

+ 6 - 1
src/pages/Customer/Contact/components/CustomerModal/index.jsx

@@ -27,7 +27,12 @@ const SearchModal = ({ clientId, onSelect }) => {
       code = -1
     } = await queryCustomers(params)
     if (code === consts.RET_CODE.SUCCESS) {
-      setState({ ...state, customer: state.customer.concat(customer), total, laoding: false })
+      if (params?.page === 1) {
+        // 请求的是第一页
+        setState({ ...state, customer, total, laoding: false })
+      } else {
+        setState({ ...state, customer: state.customer.concat(customer), total, laoding: false })
+      }
     }
   }