import { useAjax } from '@/Hook/useAjax'; import { getCorpWechatAllApi } from '@/services/adqV3/global'; import { getCorpUserDayListApi, GetCorpUserDayListProps } from '@/services/adqV3/monitorEWList'; import { Button, Card, DatePicker, Input, InputNumber, Select, Table } from 'antd'; import React, { useEffect, useState } from 'react'; import moment from 'moment'; import { CorpUserDayListTableConfig } from './tableConfig'; import GroupUserEdit from '../tencenTasset/corpWechat/csgroup/components/group/groupUserEdit'; import { POOLTYPE } from '../tencenTasset/corpWechat/csgroup/const'; /** * 客服号加粉数据 * @returns */ const AstraSupport: React.FC<{ localCorpCsgroupList: { label: string, value: string, type: 0 | 1 }[] }> = ({ localCorpCsgroupList }) => { /*******************************************/ const [corpWechatList, setCorpWechatList] = useState<{ label: string, value: string }[]>([]); const [queryParamsNew, setQueryParamsNew] = useState({ pageNum: 1, pageSize: 20 }); const [queryParams, setQueryParams] = useState({ pageNum: 1, pageSize: 20 }); const [upDateAddFans, setUpDateAddFans] = useState<{ visible?: boolean, idList: number[] }>({ visible: false, idList: [] }) const getCorpWechatAll = useAjax((params) => getCorpWechatAllApi(params)) const getCorpUserDayList = useAjax((params) => getCorpUserDayListApi(params)) /*******************************************/ useEffect(() => { getCorpWechatAll.run({}).then((res) => { if (res && res.length > 0) { setCorpWechatList(res.map((item: { corpName: string; localCorpId: string; }) => ({ label: item.corpName, value: item.localCorpId }))); } }) }, []) useEffect(() => { getCorpUserDayList.run(queryParamsNew) }, [queryParamsNew]) const updateLimitAddFansOfDay = (data: any) => { setUpDateAddFans({ visible: true, idList: [data.signId] }) } return { setQueryParams({ ...queryParams, day: dateString, pageNum: 1 }) }} /> ((option?.label ?? '') as any).toLowerCase().includes(input.toLowerCase()) } style={{ width: 200 }} allowClear value={queryParams?.localCsgroupId} onChange={(e) => { setQueryParams({ ...queryParams, localCsgroupId: e, pageNum: 1 }) }} options={localCorpCsgroupList?.filter(item => item.type === 1)} /> setQueryParams({ ...queryParams, corpUserName: e.target.value, pageNum: 1 })} allowClear /> setQueryParams({ ...queryParams, addFansMin: e, pageNum: 1 })} /> setQueryParams({ ...queryParams, addFansMax: e, pageNum: 1 })} /> } headStyle={{ padding: '0 16px' }} bodyStyle={{ padding: 16 }} > { const { current, pageSize } = pagination const newQueryForm = JSON.parse(JSON.stringify(queryParams)) const newQueryFormNew = JSON.parse(JSON.stringify(queryParamsNew)) if (sorter && sorter?.order) { newQueryForm['sortAsc'] = sorter?.order === 'ascend' ? true : false newQueryForm['sortFiled'] = sorter?.field newQueryFormNew['sortAsc'] = sorter?.order === 'ascend' ? true : false newQueryFormNew['sortFiled'] = sorter?.field } else { delete newQueryForm['sortAsc'] delete newQueryForm['sortFiled'] delete newQueryFormNew['sortAsc'] delete newQueryFormNew['sortFiled'] } newQueryForm.pageNum = current || newQueryForm.pageNum newQueryForm.pageSize = pageSize || newQueryForm.pageSize newQueryFormNew.pageNum = current || newQueryFormNew.pageNum newQueryFormNew.pageSize = pageSize || newQueryFormNew.pageSize setQueryParamsNew({ ...newQueryFormNew }) setQueryParams({ ...newQueryForm }) }} /> {/* 修改单日限制加粉 */} {upDateAddFans?.visible && { setUpDateAddFans({ visible: false, idList: [] }) getCorpUserDayList.refresh() }} onClose={() => { setUpDateAddFans({ visible: false, idList: [] }) }} />} }; export default React.memo(AstraSupport);