1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465 |
- import { useAjax } from '@/Hook/useAjax'
- import {
- ListType, getPlanListApi, getTotalCostApi, getPlanCostApi, getCostSpeedApi, getUserGroupApi, getAllPlanListApi,
- allPlanProps, getDetailListApi, getMinuteListApi, downLoadUpAdApi, downLoadDetailApi,
- downLoadDetailMinuteApi, downLoadSpeedApi, downLoadAllAdListApi, addEditGroupApi, getAdGroupListApi, deleteAdGroupApi,
- getAccountListApi, AccountListProps, addDelAccountApi, getBookListAllApi, getAdqAccountListApi
- } from '@/services/adMonitor/adMonitor'
- export default function useMonitor() {
- /** 获取起量计划列表 */
- const getPlanList = useAjax((params: ListType) => getPlanListApi(params), { formatResult: true })
- /**获取起来计划列表明细*/
- const getPlanDetailList = useAjax((params: ListType) => getDetailListApi(params), { formatResult: true, debounceInterval: 100 })
- /**获取起来计划列表5min*/
- const getMinuteList = useAjax((params: ListType) => getMinuteListApi(params), { formatResult: true, debounceInterval: 100 })
- /** 获取今日计划总消耗图谱 */
- const getTotalCost = useAjax((params: ListType) => getTotalCostApi(params), { formatResult: true })
- /** 获取计划消耗图谱 */
- const getPlanCost = useAjax((params: ListType) => getPlanCostApi(params), { formatResult: true })
- /** 获取消耗速度详情(弹窗) */
- const getCostSpeed = useAjax((params: ListType) => getCostSpeedApi(params), { formatResult: true })
- /** 获取组员 */
- const getUserGroup = useAjax(() => getUserGroupApi(), { formatResult: true })
- /** 计划列表 */
- const getAllPlanList = useAjax((params: allPlanProps) => getAllPlanListApi(params), { formatResult: true, debounceInterval: 500 })
- const getBookListAll = useAjax(() => getBookListAllApi(), { formatResult: true })
- /** 下载 */
- const downLoadUpAd = useAjax((params: ListType) => downLoadUpAdApi(params), { formatResult: true })
- const downLoadDetail = useAjax((params: ListType) => downLoadDetailApi(params), { formatResult: true })
- const downLoadDetailMinute = useAjax((params: ListType) => downLoadDetailMinuteApi(params), { formatResult: true })
- const downLoadSpeed = useAjax((params: ListType) => downLoadSpeedApi(params), { formatResult: true })
- const downLoadAllAdList = useAjax((params: allPlanProps) => downLoadAllAdListApi(params), { formatResult: true })
- // 监控数据源
- const addEditGroup = useAjax((params: { groupName: string, id?: number, remark?: string }) => addEditGroupApi(params), { formatResult: true })
- const getAdGroupList = useAjax(() => getAdGroupListApi(), { formatResult: true })
- const deleteAdGroup = useAjax((params: { id: number }) => deleteAdGroupApi(params), { formatResult: true })
- const getAccountList = useAjax((params: AccountListProps) => getAccountListApi(params), { formatResult: true })
- const addDelAccount = useAjax((params: { accountIdList: number[], groupId: number, type: 0 | 1 }) => addDelAccountApi(params), { formatResult: true })
- // 获取广告账号列表
- const getAdqAccountList = useAjax(() => getAdqAccountListApi(), { formatResult: true })
- return {
- getPlanList,
- getTotalCost,
- getPlanCost,
- getCostSpeed,
- getUserGroup,
- getAllPlanList,
- getPlanDetailList,
- getMinuteList,
- downLoadUpAd,
- downLoadDetail,
- downLoadDetailMinute,
- downLoadSpeed,
- downLoadAllAdList,
- addEditGroup,
- getAdGroupList,
- deleteAdGroup,
- getAccountList,
- addDelAccount,
- getBookListAll,
- getAdqAccountList
- }
- }
|