import React, { useEffect, useState } from "react" import style from './index.less'; import { Avatar, Badge, Button, DatePicker, Drawer, Input, Modal, Select, Space, Table, Tabs, Tag } from "antd"; import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; import { faCommentDots } from "@fortawesome/free-solid-svg-icons"; import { useAjax } from "@/Hook/useAjax"; import { getProjectGroupsAllListApi } from "../../API/groupManage"; import { ExclamationCircleOutlined, SearchOutlined } from "@ant-design/icons"; import { getMomentCorpUserLogListApi, getMomentJobLogListApi, GetSendMomentLogListProps } from "../../API/logs"; import useNewToken from "@/Hook/useNewToken"; import SearchBox from "../../components/searchBox"; import dayJs from "dayjs"; import { copy } from "@/utils/utils"; interface Props { taskTotal: number todayAddTask: number todayFinishTaskRate: number todayFailTask: number } /** * 朋友圈 * @returns */ const MomentItem: React.FC = ({ taskTotal, todayAddTask, todayFinishTaskRate, todayFailTask }) => { /*************************************************/ const [visible, setVisible] = useState(false) const [activeKey, setActiveKey] = useState('2') const [groupList, setGroupList] = useState<{ label: string, value: number }[]>([]); const getProjectGroupsAllList = useAjax(() => getProjectGroupsAllListApi()) /*************************************************/ useEffect(() => { if (visible) { getProjectGroupsAllList.run().then(res => { setGroupList([{ label: '空项目组', value: 0 }, ...res?.data?.map(item => ({ label: item.name, value: item.id })) || []]) }) } }, [visible]) return <>
setVisible(true)}>
朋友圈
总任务数:{taskTotal || 0} | 今日新增:{todayAddTask || 0}
今日完成率:{((todayFinishTaskRate || 0) * 100).toFixed(2)} % 今日异常:{todayFailTask}
setVisible(false)} open={visible} width={'70%'} > { setActiveKey(key) }} activeKey={activeKey} type="card" items={[ { key: '2', label: '下发企微号', children: <> {activeKey == '2' && } }, { key: '4', label: '群发记录', children: <> {activeKey == '4' && } } ]} /> } /** * 下发企微号 * @param param0 * @returns */ const GroupXfCorpTabls: React.FC<{ groupList: { label: string, value: number }[] }> = ({ groupList }) => { /***********************************/ const [queryParams, setQueryParams] = useState({ pageNum: 1, pageSize: 20 }) const [oldQueryParams, setOldQueryParams] = useState({ pageNum: 1, pageSize: 20 }) const { token } = useNewToken() const [modal, contextHolder] = Modal.useModal(); const getMomentCorpUserLogList = useAjax((params) => getMomentCorpUserLogListApi(params)) /***********************************/ useEffect(() => { getMomentCorpUserLogList.run(queryParams) }, [queryParams]) return
{contextHolder} } > <> setOldQueryParams({ ...oldQueryParams, projectName: e.target.value })} value={oldQueryParams?.projectName} /> setOldQueryParams({ ...oldQueryParams, taskId: e.target.value })} value={oldQueryParams?.taskId} /> setOldQueryParams({ ...oldQueryParams, projectName: e.target.value })} value={oldQueryParams?.projectName} /> setOldQueryParams({ ...oldQueryParams, taskId: e.target.value })} value={oldQueryParams?.taskId} />