From 163fc3e22e5d3591e5579d0203b3ed749f5b2651 Mon Sep 17 00:00:00 2001 From: Jimmy Liow Date: Fri, 8 Mar 2024 16:03:52 +0800 Subject: [PATCH] =?UTF-8?q?=E9=AB=98=E7=BA=A7=E6=9F=A5=E8=AF=A2=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0=E5=BF=85=E9=A1=BB=E8=BE=93=E5=85=A5=E4=B8=80=E4=B8=AA?= =?UTF-8?q?=E6=9D=A1=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/OrderFollow.jsx | 38 ++++++++++++++++++++++++++++++-------- 1 file changed, 30 insertions(+), 8 deletions(-) diff --git a/src/views/OrderFollow.jsx b/src/views/OrderFollow.jsx index d45f784..921f4a9 100644 --- a/src/views/OrderFollow.jsx +++ b/src/views/OrderFollow.jsx @@ -8,6 +8,7 @@ import dayjs from 'dayjs' import { Conditional } from '@/components/Conditional' import useOrderStore from '@/stores/OrderStore' import useAuthStore from '@/stores/AuthStore' +import { copy } from '@/utils/commons' const { RangePicker } = DatePicker @@ -206,17 +207,38 @@ function OrderGroupTable({ formValues }) { const { loginUser } = useAuthStore() useEffect(() => { - setLoading(true) - fetchOrderList(formValues, loginUser) - .finally(() => setLoading(false)) - .catch(reason => { - notification.error({ - message: '查询出错', - description: reason.message, + let canSearch = true + + if (formValues.type === 'advance') { + const copyObject = copy(formValues) + delete copyObject.type + const allEmpty = Object.values(copyObject).every(val => { + return val === null || val === '' || val === undefined + }) + if (allEmpty) { + canSearch = false + notification.warning({ + message: '温馨提示', + description: '请输入至少一个条件', placement: 'top', duration: 60, }) - }) + } + } + + if (canSearch) { + setLoading(true) + fetchOrderList(formValues, loginUser) + .finally(() => setLoading(false)) + .catch(reason => { + notification.error({ + message: '查询出错', + description: reason.message, + placement: 'top', + duration: 60, + }) + }) + } }, [formValues]) const paginationProps = {