From c6f3173e5ee01013dfa2c2e8f4555df41f841ef0 Mon Sep 17 00:00:00 2001 From: xuan Date: Fri, 18 Nov 2022 17:43:21 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=8E=88=20perf(ID1000763):=20=E6=96=B0?= =?UTF-8?q?=E6=8A=A5=E5=B0=8F=E7=A8=8B=E5=BA=8F=E6=8A=A5=E8=A1=A8=E9=BB=98?= =?UTF-8?q?=E8=AE=A4=E5=85=A8=E9=83=A8=E9=94=80=E5=94=AE=E7=B1=BB=E5=9E=8B?= =?UTF-8?q?=EF=BC=8C=E4=B8=8D=E8=A6=81=E9=BB=98=E8=AE=A4=E8=B4=A7=E4=B8=BB?= =?UTF-8?q?=E8=87=AA=E8=90=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit https://www.tapd.cn/53459131/bugtrace/bugs/view/1153459131001000763 --- src/common/util.ts | 3 ++- src/pages/saleStatistic/index.tsx | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/common/util.ts b/src/common/util.ts index 4d5ae00..a7d93a9 100644 --- a/src/common/util.ts +++ b/src/common/util.ts @@ -44,7 +44,8 @@ export const throttle = (fn, delay) => { export const getFilterData = (val = {}, arr: string[] = []) => { let res = {} for (let key in val) { - if (val[key] !== undefined && val[key] !== null && val[key] !== '' && !arr.includes(key)) { + // undefined == null output: true + if (val[key] != null && val[key] !== '' && !arr.includes(key)) { if (typeof val[key] == 'number') { if (!isNaN(val[key])) { res[key] = val[key] diff --git a/src/pages/saleStatistic/index.tsx b/src/pages/saleStatistic/index.tsx index 8b17652..6d84e30 100644 --- a/src/pages/saleStatistic/index.tsx +++ b/src/pages/saleStatistic/index.tsx @@ -79,7 +79,7 @@ const FilterTimeOptions = { const saleStatistic = () => { const { fetchData } = SaleOrderDataFormApi() - const [saleType, setSaleType] = useState(0) + const [saleType, setSaleType] = useState(null) const [saleDepartmentId, setSaleDepartmentId] = useState(null) const [dateRange, setDateRange] = useState({ date_min: FilterTimeOptions[0].date_min, @@ -165,7 +165,7 @@ const saleStatistic = () => { - true} ref={selectSaleTypeRef}> + true} ref={selectSaleTypeRef}> true} ref={selectMarketingDepartmentRef}> true} defaultValue='0' timeOptions={FilterTimeOptions} ref={selectTimePickerRef}>