import { Badge, Popover, Space, Typography } from "antd"; import { AnyObject } from "antd/es/_util/type" import { ColumnsType } from "antd/es/table" import { businessPlanData, TIME_TYPE } from "../../businessPlan/create/const"; import FilterUserTooltip from "@/pages/weComTask/components/filterUser/filterUserTooltip"; import { QuestionCircleFilled } from "@ant-design/icons"; const { Paragraph, Title, Text } = Typography; export const PreviewColumns = (bookPlatForm: TASK_CREATE.BookPlatFormProps[], bookList: TASK_CREATE.BookListProps[]): ColumnsType => { return [ { title: '企微号信息', dataIndex: 'corpUser', key: 'corpName', width: 150, fixed: 'left', render(value) { return <> {value?.corpName || '--'} {value?.name || '--'} } }, { title: '基础信息', dataIndex: 'taskName', key: 'taskName', width: 130, render(value, record) { return <> 标题:{value} {record?.bizType && 业务类型:{record?.bizType === 'novel' ? '小说' : record?.bizType === 'game' ? '游戏' : '<空>'}} {record?.platform && 书城:{record?.platform ? bookPlatForm?.find(item => item.id === record?.platform)?.platformName : '<空>'}} {record?.templateProductId && 适用产品:{record?.templateProductId ? bookList?.find(item => item.id === record?.templateProductId)?.bookName : '<空>'}} } }, { title: '群主号', dataIndex: 'corpUserChat', key: 'corpUserChat', width: 130, render(value) { return value.map((item, index) => {item.label}) } }, { title: '机器人客服号', dataIndex: 'robotCorpUsers', key: 'robotCorpUsers', width: 130, render(value) { return value?.length > 0 ? value?.map((item, index) => {item.name}({item.corpName})) : '--' } }, { title: '策略信息', dataIndex: 'strategyData', key: 'strategyData', width: 200, render(_, record) { return <> 策略{record.strategyIndex + 1} 名称:{record?.strategyName || '<空>'} 执行类型:{TIME_TYPE[record?.timeRepeatType]} {record?.sendDay && 执行时间:{record?.sendDay}} {record?.startTime && 执行日期:{record?.startTime}~{record?.endTime ? record?.endTime : '长期执行'}} {record?.sendTime && 执行时间:{record?.sendTime}} {record?.repeatArray && 执行天数:{record?.repeatArray.join('、')}} } }, { title: '群名称', dataIndex: 'groupObjectName', key: 'groupObjectName', width: 120, ellipsis: true, fixed: 'left' }, { title: '是否开启已有旧群聊补缺', dataIndex: 'isRepair', key: 'isRepair', width: 150, ellipsis: true, render(value, record, index) { return value ? 近{record.repairTimes}天 : }, }, { title: '进群对象', dataIndex: 'externalUserFilter', key: 'externalUserFilter', width: 90, align: 'center', render(value) { return value ?
指定
({ label: item.platformName, value: item.platformKey }))} configName={value?.configName} data={value?.configContent} />} >
: '全部' }, }, { title: '群递增起始编号', dataIndex: 'groupIndex', key: 'groupIndex', width: 60, align: 'center' }, { title: '群固定人数', dataIndex: 'groupUserCount', key: 'groupUserCount', width: 50, align: 'center' }, { title: '邀请客户进群完毕后客服号是否退群', dataIndex: 'autoOutGroup', key: 'autoOutGroup', width: 85, align: 'center', render(value) { return value ? : }, }, { title: '是否排除已在群的客户', dataIndex: 'excludeInGroup', key: 'excludeInGroup', width: 60, align: 'center', render(value) { return value ? : }, }, { title: '拉群完成后自动删除拉群标签', dataIndex: 'excludeInGroup', key: 'excludeInGroup', width: 70, align: 'center', render(value) { return value ? : }, }, { title: '群聊关联公众号', dataIndex: 'weChatAppid', key: 'weChatAppid', width: 100, align: 'center', render(value) { return value || '--' }, }, { title: '拉群完成后群聊备注', dataIndex: 'remark', key: 'remark', width: 140, render(value) { return value || '--' }, }, { title: '拉群完成后群聊智能标签', dataIndex: 'tagDTO', key: 'tagDTO', width: 200, render(value) { return value && Object.keys(value)?.length > 0 ? {Object.keys(value).map(key => { if (key === 'business' && value[key]) { return `业务(来源渠道):${businessPlanData.find(i => i.value === value.business)?.label || '<空>'}` } else if (key === 'bookCity' && value[key]) { return `书城(来源渠道):${bookPlatForm.find(i => i.id === value.bookCity)?.platformName || '<空>'}` } else if (key === 'product' && value[key]) { return `产品(来源渠道):${bookList.find(i => i.id === value.product)?.bookName || '<空>'}` } return '' }).join('、')} : '--' }, }, { title: '建群成功发送内容', dataIndex: 'groupSendMsg', key: 'groupSendMsg', width: 140, render(value) { return value ? value : '--' }, }, ] }