Преглед изворни кода

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 })
+      }
     }
   }