1
0

2 Commits 8f8ff8926e ... 7e88017a4e

Autor SHA1 Nachricht Datum
  wjx 7e88017a4e ffff vor 1 Woche
  wjx b3888f45d6 fix vor 1 Woche
1 geänderte Dateien mit 9 neuen und 2 gelöschten Zeilen
  1. 9 2
      src/pages/launchSystemV3/adMonitorListV3/monitor.tsx

+ 9 - 2
src/pages/launchSystemV3/adMonitorListV3/monitor.tsx

@@ -15,6 +15,7 @@ import { columnsMonitor } from "./tableMonitorConfig";
 import { qiliangpaihanghour } from "./config";
 import { syncBatchApi } from "@/services/launchAdq/adqv3";
 import { useAjax } from "@/Hook/useAjax";
+import { useDebounce, useUpdateEffect } from "ahooks";
 interface newListType extends ListType {
     totalTimeUnit: 'total' | 'minute' | 'hour' | 'day',
     planTimeUnit: 'minute' | 'hour' | 'day'
@@ -47,6 +48,8 @@ function Monitor(props: { onChange: () => void }) {
     const [adgroupName, setAdgroupName] = useState<string>('')
     const [accountIdRule, setAccountIdRule] = useState<string>('')
     const [trendColumns, setTrendColumns] = useState<string[]>(['cost'])
+    const [adName, setAdName] = useState<string>();
+    const debouncedAdName = useDebounce(adName, { wait: 500 });
 
     const { totalTimeUnit, planTimeUnit, adgroup, accountId, sysUserId, groupAccountIds, adgroupName: qfadgroupName } = queryForm
     const configName = '起量广告排行明细3.0'
@@ -274,6 +277,10 @@ function Monitor(props: { onChange: () => void }) {
         }).catch(() => hide())
     }
 
+    useUpdateEffect(() => {
+        setQueryForm({ ...queryForm, adgroupName: debouncedAdName, pageNum: 1 })
+    }, [debouncedAdName])
+
     return <Space direction='vertical' style={{ width: '100%' }} className="monitor">
         <Card hoverable bodyStyle={{ padding: '12px 16px' }}>
             <div style={{ display: 'flex', justifyContent: 'space-between' }}>
@@ -283,9 +290,9 @@ function Monitor(props: { onChange: () => void }) {
                         allowClear
                         style={{ width: 150 }}
                         onChange={(e: any) => {
-                            setQueryForm({ ...queryForm, adgroupName: e.target.value, pageNum: 1 })
+                            setAdName(e.target.value)
                         }}
-                        value={queryForm?.adgroupName}
+                        value={adName}
                     />
                     <Select
                         showSearch