|
@@ -6,7 +6,7 @@ import { useAccess, useModel, useRequest } from '@umijs/max';
|
|
|
import { Card, message } from 'antd';
|
|
|
import React, { useEffect, useRef, useState } from 'react';
|
|
|
import columns12 from './tableConfig';
|
|
|
-import { getAccApi } from '@/services/dataStatisticsNovel';
|
|
|
+import { getChannelListApi } from '@/services/dataStatisticsNovel';
|
|
|
import moment from 'moment';
|
|
|
import { getLocalStoragePage } from '@/utils';
|
|
|
|
|
@@ -25,7 +25,7 @@ const TodayRanking: React.FC = () => {
|
|
|
const access = useAccess()
|
|
|
|
|
|
const getcHannelStatRankList = useRequest((params) => getcHannelStatRankListApi(params), { manual: true })
|
|
|
- const getAcc = useRequest((params) => getAccApi(params), { manual: true })
|
|
|
+ const getAcc = useRequest(() => getChannelListApi(), { manual: true })
|
|
|
/*****************************************/
|
|
|
|
|
|
useEffect(() => {
|
|
@@ -38,15 +38,16 @@ const TodayRanking: React.FC = () => {
|
|
|
}
|
|
|
|
|
|
// 点击公众号跳转
|
|
|
- const weChatJump = (data: any) => {
|
|
|
- getAcc.run({ user_id: initialState?.currentUser?.userId, name: data?.channel, pitcher_id: data.period_id }).then(res => {
|
|
|
- if (res && res?.data && res?.data?.length > 0) {
|
|
|
- if (res?.data?.data?.findIndex((item: { nick_name: string }) => item?.nick_name === data?.channel) === -1) {
|
|
|
+ const weChatJump = ({ channel, channel_id }: any) => {
|
|
|
+ getAcc.run().then(res => {
|
|
|
+ const data = res ? Object.keys(res).map(key => ({ label: res[key], value: Number(key) })) : []
|
|
|
+ if (data?.length) {
|
|
|
+ if (data?.findIndex((item: { label: string }) => item?.label === channel) === -1) {
|
|
|
message.error('没有这个公众号的权限')
|
|
|
return
|
|
|
}
|
|
|
const queryFormNovel = JSON.parse(localStorage.getItem('QUERYFORMNOVEL') || '{}')
|
|
|
- localStorage.setItem('QUERYFORMNOVEL', JSON.stringify({ ...queryFormNovel, channel_ids: [data.channel_id] }))
|
|
|
+ localStorage.setItem('QUERYFORMNOVEL', JSON.stringify({ ...queryFormNovel, channel_ids: [channel_id] }))
|
|
|
window.location.href = '#/dataStatisticsNovel/weChat/payTrend'
|
|
|
} else {
|
|
|
message.error('没有这个公众号的权限')
|