wjx пре 2 година
родитељ
комит
fe9fc05f75

+ 1 - 1
src/pages/adMonitor/adMonitorList/components/planDetail.tsx

@@ -8,7 +8,7 @@ import { useModel } from "umi";
 import columns from './tableConfig'
 import { compare } from '@/utils/utils'
 import { formatDate, downloadFile1 } from '@/utils/downloadFile'
-import { downLoadSpeedApi } from '@/services/launch/adMonitor'
+import { downLoadSpeedApi } from "@/services/adMonitor/adMonitor";
 
 type Props = {
     visible?: boolean,

+ 13 - 13
src/pages/adMonitor/adMonitorList/monitor.tsx

@@ -143,11 +143,11 @@ function Monitor(props: { onChange: () => void }) {
 
     // 起量明细表 点击
     const getDetailList = useCallback((adgroup: any) => {
-        let { totalTimeUnit, planTimeUnit, timeUnit, pageNum, pageSize, sysUserId, accountId, ...newQueryForm } = queryForm
+        let { totalTimeUnit, planTimeUnit, timeUnit, pageNum, pageSize, adgroup: aa, sysUserId, accountId, ...newQueryForm } = queryForm
         if (adgroup) {
             setMode('detail')//切到明细
-            getPlanDetailList.run({ ...newQueryForm, pageNum: 1, pageSize: 20, adgroupId: adgroup, sysUserId, accountId: accountId?.join() }).then((res: any) => {
-                setPlanDetailList(res?.data?.records ? [...res?.data?.records] : [])
+            getPlanDetailList.run({ ...newQueryForm, adgroupId: adgroup, sysUserId, accountId: accountId?.join() }).then((res: any) => {
+                setPlanDetailList(res?.data ? [...res?.data] : [])
                 setQueryForm({ ...queryForm, adgroup })
             })
         }
@@ -161,11 +161,11 @@ function Monitor(props: { onChange: () => void }) {
 
     // 起量5min表
     const getMinuList = useCallback((adgroup: any) => {
-        let { totalTimeUnit, planTimeUnit, timeUnit, pageNum, pageSize, sysUserId, accountId, ...newQueryForm } = queryForm
+        let { totalTimeUnit, planTimeUnit, timeUnit, pageNum, pageSize, adgroup: aa, sysUserId, accountId, ...newQueryForm } = queryForm
         if (adgroup) {
             setMode('minute')
-            getMinuteList.run({ ...newQueryForm, pageNum: 1, pageSize: 20, adgroupId: adgroup, sysUserId, accountId: accountId?.join() }).then((res: any) => {
-                setMinuteList(res?.data?.records ? [...res?.data?.records] : [])
+            getMinuteList.run({ ...newQueryForm, adgroupId: adgroup, sysUserId, accountId: accountId?.join() }).then((res: any) => {
+                setMinuteList(res?.data ? [...res?.data] : [])
                 setQueryForm({ ...queryForm, adgroup })
             })
         }
@@ -209,15 +209,15 @@ function Monitor(props: { onChange: () => void }) {
         let { totalTimeUnit, planTimeUnit, timeUnit, sysUserId, accountId, adgroup, pageNum, pageSize, ...newQueryForm } = queryForm
         switch (mode) {
             case 'total':
-                params = { ...newQueryForm, sysUserId, accountId, adgroup }
+                params = { ...newQueryForm, sysUserId, accountId, adgroupId: adgroup }
                 ajax = downLoadUpAdApi
                 break;
             case 'detail':
-                params = { ...newQueryForm, adgroup, sysUserId, accountId }
+                params = { ...newQueryForm, adgroupId: adgroup, accountId }
                 ajax = downLoadDetailApi
                 break;
             case 'minute':
-                params = { ...newQueryForm, adgroup, sysUserId, accountId }
+                params = { ...newQueryForm, adgroupId: adgroup, accountId }
                 ajax = downLoadDetailMinuteApi
                 break;
         }
@@ -372,7 +372,7 @@ function Monitor(props: { onChange: () => void }) {
         <div className={'MYtable'}>
             <TableData
                 columns={columnsMonitor(planDetail, getDetailList, details, getMinuList, mode)}
-                dataSource={mode === 'total' ? getPlanList?.data?.data?.records?.map((item: any, index: number) => ({ ...item, id: item.id + '_' + index })) : mode === 'detail' ? getPlanDetailList?.data?.data?.records?.map((item: any, index: number) => ({ ...item, id: item.id + '_' + index })) : getMinuteList?.data?.data?.records?.map((item: any, index: number) => ({ ...item, id: item.id + '_' + index }))}
+                dataSource={mode === 'total' ? getPlanList?.data?.data?.records?.map((item: any, index: number) => ({ ...item, id: item.id + '_' + index })) : mode === 'detail' ? getPlanDetailList?.data?.data : getMinuteList?.data?.data}
                 loading={mode === 'total' ? getPlanList?.loading : mode === 'detail' ? getPlanDetailList?.loading : getMinuteList?.loading}
                 ajax={mode === 'total' ? getPlanList : mode === 'detail' ? getPlanDetailList : getMinuteList}
                 leftChild={
@@ -389,7 +389,7 @@ function Monitor(props: { onChange: () => void }) {
                     </Space>
                 }
                 fixed={{ left: 0, right: 2 }}
-                total={mode === 'total' ? getPlanList?.data?.data?.total : mode === 'detail' ? getPlanDetailList?.data?.data?.total : getMinuteList?.data?.data?.total}
+                total={mode === 'total' ? getPlanList?.data?.data?.total : mode === 'detail' ? getPlanDetailList?.data?.data?.length : getMinuteList?.data?.data?.length}
                 onChange={mode === 'total' ? (props: any) => {
                     let { sortData, pagination } = props
                     let { current, pageSize } = pagination
@@ -421,9 +421,9 @@ function Monitor(props: { onChange: () => void }) {
                     if (sortData && JSON.stringify('sortData') !== '{}') {
                         let { field, order } = sortData   // descend 降序 大到小  ascend 升序 小到大 planDetailList
                         if (mode === 'detail') {
-                            getPlanDetailList?.mutate({ records: order ? getPlanDetailList?.data?.data?.records?.sort(compare(field, order)) : [...planDetailList] })
+                            getPlanDetailList?.mutate({ data: order ? getPlanDetailList?.data?.data?.sort(compare(field, order)) : [...planDetailList] })
                         } else if (mode === 'minute') {
-                            getMinuteList?.mutate({ records: order ? getMinuteList?.data?.data?.records?.sort(compare(field, order)) : [...minuteList] })
+                            getMinuteList?.mutate({ data: order ? getMinuteList?.data?.data?.sort(compare(field, order)) : [...minuteList] })
                         }
                     }
                 }}

+ 11 - 2
src/pages/adMonitor/adMonitorList/planList.tsx

@@ -50,7 +50,7 @@ const PlanList: React.FC = () => {
     useEffect(() => {
         if (sessionStorage.getItem('ADIDORNAME')) {
             let data = JSON.parse(sessionStorage.getItem('ADIDORNAME') as any)
-            setQueryForm({ ...queryForm, adgroup: data.adgroupId, campaign: data.campaignId, sysUserId: data.putUserId, accountId: data?.accountId?.toString()?.split() })
+            setQueryForm({ ...queryForm, adgroup: data.adgroupId, campaign: data.campaignId, sysUserId: data.putUserId ? data.putUserId?.toString()?.split() : [], accountId: data?.accountId?.toString()?.split() })
             sessionStorage.removeItem('ADIDORNAME')
         }
     }, [])
@@ -116,6 +116,8 @@ const PlanList: React.FC = () => {
         }).catch(() => setDownLoadLoading(false))
     }, [queryForm, pichers, downLoadLoading])
 
+    console.log('queryForm--->', queryForm);
+    
     return <Space direction='vertical' style={{ width: '100%' }} className="planlist">
         {/* 详情弹窗 */}
         {visible && <PlanDetail visible={visible} onClose={() => { setVisible(false) }} data={adId} dataStartTime={queryForm?.dataStartTime} dataEndTime={queryForm?.dataEndTime} />}
@@ -128,7 +130,14 @@ const PlanList: React.FC = () => {
                         filterOption={(input, option) =>
                             (option?.children as any).toLowerCase().indexOf(input.toLowerCase()) >= 0
                         }
-                        value={queryForm.sysUserId?.map((s: any) => s.toString())} mode='multiple' maxTagCount={1} style={{ minWidth: 150 }} allowClear placeholder="请选择投手" onChange={(value: any[]) => { setQueryForm({ ...queryForm, pageNum: 1, sysUserId: value }) }}>
+                        value={queryForm?.sysUserId?.map((s: any) => s.toString())}
+                        mode='multiple'
+                        maxTagCount={1}
+                        style={{ minWidth: 150 }}
+                        allowClear
+                        placeholder="请选择投手"
+                        onChange={(value: any[]) => { setQueryForm({ ...queryForm, pageNum: 1, sysUserId: value }) }}
+                    >
                         {pichers?.map((item: { nickName: string, userId: number }, index: number) => <Select.Option value={item.userId.toString()} key={item.userId + '' + index}>{item.nickName}</Select.Option>)}
                     </Select>
                     <Select