|
@@ -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] })
|
|
|
}
|
|
|
}
|
|
|
}}
|