import { App, Badge, Button, Card, Empty, Form, Input, InputNumber, Modal, Popover, Radio, Select, Space, Table, Typography } from 'antd'; import React, { useEffect, useState } from 'react'; import { PlusOutlined, QuestionCircleFilled } from '@ant-design/icons'; import FilterUser from '@/pages/weComTask/components/filterUser'; import MindTags from '@/pages/weComTask/components/mindTags'; import { getBindMpListApi } from '@/pages/weComTask/API/corpUserAssign'; import { useAjax } from '@/Hook/useAjax'; import FilterUserTooltip from '@/pages/weComTask/components/filterUser/filterUserTooltip'; import { businessPlanData } from '@/pages/weComTask/page/businessPlan/create/const'; import { ColumnsType } from 'antd/es/table'; const { Text, Paragraph } = Typography; /** * 进群对象新建组件 * @param param0 * @returns */ const AddGroupObject: React.FC = ({ value = [], onChange, onCopy, bookPlatForm, index, strategyList, bookList }) => { /******************************************/ const { message } = App.useApp(); const [visible, setVisible] = useState(false) const [initialValues, setInitialValues] = useState(undefined) const [copyData, setCopyData] = useState<{ visible?: boolean, data?: any }>() const [copyIndex, setCopyIndex] = useState() /******************************************/ return <> {value?.length > 0 ? { onChange?.(value.filter((_, index) => index + 1 !== id)) }} handleEdit={(record) => { setInitialValues(record) setVisible(true) }} handleCopy={(record) => { const newValue = { ...record, id: Date.now(), groupObjectName: `copy策略${index + 1}_` + record.groupObjectName } setCopyData({ visible: true, data: newValue }) }} /> : } {visible && { const newValue = JSON.parse(JSON.stringify(value)) if (initialValues?.id) { newValue[initialValues.id - 1] = values } else { newValue.push(values) } onChange?.(newValue) setVisible(false) setInitialValues(undefined) }} onClose={() => { setVisible(false) setInitialValues(undefined) }} />} {copyData?.visible && 复制至} open={copyData?.visible} onCancel={() => setCopyData(undefined)} onOk={() => { if (copyIndex) { onCopy?.(copyData.data, copyIndex) setCopyData(undefined) setCopyIndex(undefined) setVisible(false) } else { message.error('清选择复制到哪') } }} > 是否开启已有旧群聊补缺} tooltip={{ title: '优先将客户补充进已有旧群聊的空缺位置,待旧群满员后再创建新群容纳剩余客户。', placement: 'top' }} rules={[{ required: true, message: '请选择是否开启群补人!' }]} > {isRepair && 补缺群聊范围} rules={[{ required: true, message: '请选择补缺群聊范围!' }]} tooltip={{ title: '可补缺的群聊范围:在本建群策略内创建的群聊', placement: 'top' }} > (option?.label as any)?.toLowerCase().indexOf(input.toLowerCase()) >= 0 } options={getBindMpList?.data?.data?.map(item => ({ label: item.name, value: item.name + '_' + item.id }))} /> 拉群完成后群聊备注} > 拉群完成后群聊智能标签} style={{ background: '#fff', marginBottom: 10 }} styles={{ body: { padding: '6px 0 6px 16px' } }}> 建群成功发送内容} rules={[{ required: true, message: '请输入建群成功发送内容!' }]} > }) export default React.memo(AddGroupObject);