|
@@ -1,12 +1,12 @@
|
|
|
import { useAjax } from "@/Hook/useAjax"
|
|
|
-import { getProjectLogListApi } from "@/pages/weComTask/API/groupChat"
|
|
|
+import { getProjectLogDetailsListApi, getProjectLogListApi, getProjectTaskLogListApi } from "@/pages/weComTask/API/groupChat"
|
|
|
import FilterUserTooltip from "@/pages/weComTask/components/filterUser/filterUserTooltip";
|
|
|
-import { Badge, Drawer, Popover, Space, Table, Typography } from "antd"
|
|
|
-import React, { useEffect } from "react"
|
|
|
+import { Badge, Button, Drawer, Flex, Modal, Popover, Space, Table, Typography } from "antd"
|
|
|
+import React, { useEffect, useState } from "react"
|
|
|
import { QuestionCircleFilled } from "@ant-design/icons"
|
|
|
import { businessPlanData, TIME_TYPE_ZJ } from "../../businessPlan/create/const";
|
|
|
import PreviewTime from "@/pages/weComTask/components/previewTime";
|
|
|
-const { Text, Paragraph } = Typography;
|
|
|
+const { Text, Paragraph, Title } = Typography;
|
|
|
|
|
|
interface Props {
|
|
|
data: any,
|
|
@@ -23,12 +23,14 @@ const Details: React.FC<Props> = ({ data, bookPlatForm, bookList, visible, onClo
|
|
|
/*******************************************/
|
|
|
|
|
|
useEffect(() => {
|
|
|
- console.log(data.id)
|
|
|
getProjectLogList.run(data.id)
|
|
|
}, [])
|
|
|
|
|
|
return <Drawer
|
|
|
- title={<strong>{data.taskName} 任务详情</strong>}
|
|
|
+ title={<Space>
|
|
|
+ <strong>{data.taskName} 运营计划</strong>
|
|
|
+ <Button type="link" onClick={() => getProjectLogList.refresh()}>刷新</Button>
|
|
|
+ </Space>}
|
|
|
onClose={onClose}
|
|
|
open={visible}
|
|
|
width={1400}
|
|
@@ -73,6 +75,7 @@ const Details: React.FC<Props> = ({ data, bookPlatForm, bookList, visible, onClo
|
|
|
content={<div>
|
|
|
<PreviewTime
|
|
|
{...records}
|
|
|
+ sendTime={records?.sendTime || records?.repeatSendTime}
|
|
|
/>
|
|
|
</div>}
|
|
|
styles={{ body: { width: 300, overflow: 'hidden', overflowY: 'auto', maxHeight: 400 } }}
|
|
@@ -97,12 +100,12 @@ const Details: React.FC<Props> = ({ data, bookPlatForm, bookList, visible, onClo
|
|
|
},
|
|
|
{
|
|
|
title: '进群对象',
|
|
|
- dataIndex: 'externalUserFilter',
|
|
|
- key: 'externalUserFilter',
|
|
|
+ dataIndex: 'corpCondition',
|
|
|
+ key: 'corpCondition',
|
|
|
width: 90,
|
|
|
align: 'center',
|
|
|
render(value) {
|
|
|
- return value ? <div style={{ display: 'flex', alignItems: 'center' }}>
|
|
|
+ return !value?.[0]?.allCorpUser ? <div style={{ display: 'flex', alignItems: 'center' }}>
|
|
|
<div style={{ flex: '1 0', overflow: 'hidden' }}>
|
|
|
<Text ellipsis>指定</Text>
|
|
|
</div>
|
|
@@ -112,8 +115,8 @@ const Details: React.FC<Props> = ({ data, bookPlatForm, bookList, visible, onClo
|
|
|
mouseEnterDelay={0.5}
|
|
|
content={<FilterUserTooltip
|
|
|
bookCityList={bookPlatForm?.map(item => ({ label: item.platformName, value: item.platformKey }))}
|
|
|
- configName={value?.configName}
|
|
|
- data={value?.configContent}
|
|
|
+ configName={'进群对象'}
|
|
|
+ data={value?.[0]}
|
|
|
/>}
|
|
|
>
|
|
|
<a style={{ color: '#000' }}><QuestionCircleFilled /></a>
|
|
@@ -167,13 +170,13 @@ const Details: React.FC<Props> = ({ data, bookPlatForm, bookList, visible, onClo
|
|
|
},
|
|
|
{
|
|
|
title: '群聊关联公众号',
|
|
|
- dataIndex: 'weChatAppid',
|
|
|
- key: 'weChatAppid',
|
|
|
+ dataIndex: 'mpAccountInfo',
|
|
|
+ key: 'mpAccountInfo',
|
|
|
width: 100,
|
|
|
align: 'center',
|
|
|
ellipsis: true,
|
|
|
render(value) {
|
|
|
- return value || '--'
|
|
|
+ return value?.name || '--'
|
|
|
},
|
|
|
},
|
|
|
{
|
|
@@ -188,8 +191,8 @@ const Details: React.FC<Props> = ({ data, bookPlatForm, bookList, visible, onClo
|
|
|
},
|
|
|
{
|
|
|
title: '拉群完成后群聊智能标签',
|
|
|
- dataIndex: 'tagDTO',
|
|
|
- key: 'tagDTO',
|
|
|
+ dataIndex: 'msgTagDTO',
|
|
|
+ key: 'msgTagDTO',
|
|
|
width: 200,
|
|
|
ellipsis: true,
|
|
|
render(value) {
|
|
@@ -225,8 +228,152 @@ const Details: React.FC<Props> = ({ data, bookPlatForm, bookList, visible, onClo
|
|
|
}
|
|
|
}
|
|
|
]}
|
|
|
+ expandable={{
|
|
|
+ fixed: 'left',
|
|
|
+ expandRowByClick: true,
|
|
|
+ expandedRowRender: (record) => <ExpandedRow record={record} />
|
|
|
+ }}
|
|
|
/>
|
|
|
</Drawer>
|
|
|
}
|
|
|
|
|
|
+const ExpandedRow: React.FC<{ record: any }> = ({ record }) => {
|
|
|
+
|
|
|
+ /*****************************************/
|
|
|
+ const [detalisData, setDetalisData] = useState<{visible?: boolean, taskLogId?: number}>()
|
|
|
+ const [queryForm, setQueryForm] = useState<{ pageNum: number, pageSize: number }>({ pageNum: 1, pageSize: 20 })
|
|
|
+ const getProjectTaskLogList = useAjax((params) => getProjectTaskLogListApi(params))
|
|
|
+ /*****************************************/
|
|
|
+
|
|
|
+ useEffect(() => {
|
|
|
+ getProjectTaskLogList.run({ ...queryForm, taskId: record.id })
|
|
|
+ }, [record.id, queryForm])
|
|
|
+
|
|
|
+ return <div style={{ maxHeight: 450 }}>
|
|
|
+ <Flex gap={20} align="center" style={{ marginBottom: 10, marginTop: 5 }}>
|
|
|
+ <Title level={4} style={{ margin: 0 }}>{record?.taskName} 任务列表</Title>
|
|
|
+ <Button type="link" onClick={() => getProjectTaskLogList.refresh()}>刷新</Button>
|
|
|
+ </Flex>
|
|
|
+ <Table
|
|
|
+ size='small'
|
|
|
+ bordered
|
|
|
+ rowKey={'id'}
|
|
|
+ dataSource={getProjectTaskLogList?.data?.data?.records}
|
|
|
+ loading={getProjectTaskLogList.loading}
|
|
|
+ scroll={{ x: 400, y: 350 }}
|
|
|
+ columns={[
|
|
|
+ {
|
|
|
+ title: '操作',
|
|
|
+ dataIndex: 'cz',
|
|
|
+ key: 'cz',
|
|
|
+ width: 80,
|
|
|
+ align: 'center',
|
|
|
+ render(_, record: any) {
|
|
|
+ return <a onClick={() => setDetalisData({ visible: true, taskLogId: record.id })}>详情</a>
|
|
|
+ }
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '预计拉群数',
|
|
|
+ dataIndex: 'pullGroupCount',
|
|
|
+ key: 'pullGroupCount',
|
|
|
+ width: 120
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '预计拉群客户数',
|
|
|
+ dataIndex: 'pullGroupUserCount',
|
|
|
+ key: 'pullGroupUserCount',
|
|
|
+ width: 120
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '执行时间',
|
|
|
+ dataIndex: 'createTime',
|
|
|
+ key: 'createTime'
|
|
|
+ }
|
|
|
+ ]}
|
|
|
+ pagination={{
|
|
|
+ total: getProjectTaskLogList?.data?.data?.total || 0,
|
|
|
+ current: queryForm.pageNum,
|
|
|
+ pageSize: queryForm.pageSize,
|
|
|
+ showTotal: (total) => `共 ${total} 条数据`,
|
|
|
+ onChange: (pageNum, pageSize) => setQueryForm({ pageNum, pageSize })
|
|
|
+ }}
|
|
|
+ />
|
|
|
+
|
|
|
+ {/* 详情 */}
|
|
|
+ {detalisData?.visible && <TaskDetails
|
|
|
+ {...detalisData}
|
|
|
+ onClose={() => setDetalisData(undefined)}
|
|
|
+ />}
|
|
|
+ </div>
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+const TaskDetails: React.FC<{
|
|
|
+ visible?: boolean,
|
|
|
+ taskLogId?: number,
|
|
|
+ onClose?: () => void
|
|
|
+}> = ({visible, taskLogId, onClose}) => {
|
|
|
+
|
|
|
+ /*******************************************/
|
|
|
+ const getProjectLogDetailsList = useAjax((params) => getProjectLogDetailsListApi(params))
|
|
|
+ /*******************************************/
|
|
|
+
|
|
|
+ useEffect(() => {
|
|
|
+ getProjectLogDetailsList.run(taskLogId)
|
|
|
+ }, [taskLogId])
|
|
|
+
|
|
|
+ return <Modal
|
|
|
+ title={<strong>任务详情</strong>}
|
|
|
+ open={visible}
|
|
|
+ onCancel={onClose}
|
|
|
+ width={900}
|
|
|
+ footer={null}
|
|
|
+ >
|
|
|
+ <Table
|
|
|
+ size='small'
|
|
|
+ bordered
|
|
|
+ rowKey={'id'}
|
|
|
+ dataSource={getProjectLogDetailsList?.data?.data || []}
|
|
|
+ scroll={{ y: 1000 }}
|
|
|
+ columns={[
|
|
|
+ {
|
|
|
+ title: '群名称',
|
|
|
+ dataIndex: 'chatName',
|
|
|
+ key: 'chatName',
|
|
|
+ width: 120,
|
|
|
+ ellipsis: true,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '群主号名称',
|
|
|
+ dataIndex: 'corpUserName',
|
|
|
+ key: 'corpUserName',
|
|
|
+ width: 120,
|
|
|
+ ellipsis: true,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '预计拉群客户数',
|
|
|
+ dataIndex: 'pullGroupUserCount',
|
|
|
+ key: 'pullGroupUserCount',
|
|
|
+ width: 80,
|
|
|
+ align: 'center'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '实际拉群客户数',
|
|
|
+ dataIndex: 'actualPullGroupUserCount',
|
|
|
+ key: 'actualPullGroupUserCount',
|
|
|
+ width: 80,
|
|
|
+ align: 'center'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '删除或拉黑客户数',
|
|
|
+ dataIndex: 'deleteOrBlockUserCount',
|
|
|
+ key: 'deleteOrBlockUserCount',
|
|
|
+ width: 80,
|
|
|
+ align: 'center'
|
|
|
+ }
|
|
|
+ ]}
|
|
|
+ />
|
|
|
+ </Modal>
|
|
|
+}
|
|
|
+
|
|
|
export default React.memo(Details)
|