123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742 |
- import { Input, Typography } from "antd";
- import { AnyObject } from "antd/es/_util/type"
- import { ColumnsType } from "antd/es/table"
- import { businessPlanData, TIME_TYPE, welcomeContentData } from "./const";
- import FilterUser from "@/pages/weComTask/components/filterUser";
- import ShowContentTable from "./components/massSending/showContentTable";
- import WelcomeShowTable from "./components/welcome/welcomeShowTable";
- import FriendsShowTable from "./components/friends/friendsShowTable";
- import SelectBookLinkButton from "../../bookLink/SelectBookLinkButton";
- const { Title, Text, Paragraph } = Typography;
- export const userInheritColumns = (setContent: (data: TASK_CREATE.SetContentProps) => void): ColumnsType<AnyObject> => {
- return [
- {
- title: '账号',
- dataIndex: 'corpUserGroupName',
- key: 'corpUserGroupName',
- width: 150,
- render(value, record) {
- return <>
- <Title level={5} style={{ margin: 0 }}>{value}({record?.corpUserList?.[0]?.corpName})</Title>
- <Paragraph style={{ margin: 0 }}>客服号:{record?.corpUserList?.map(i => i.name).join('、')}</Paragraph>
- </>
- },
- onCell: (record) => {
- return { rowSpan: record.userRowSpan }
- }
- },
- {
- title: '继承信息',
- dataIndex: 'taskName',
- key: 'taskName',
- width: 130,
- render(value, record) {
- return <>
- <Title level={5} style={{ margin: 0 }}>标题:{value}</Title>
- {record?.bizType && <Paragraph style={{ margin: 0 }}>业务类型:{record?.bizType || '<空>'}</Paragraph>}
- {record?.platform && <Paragraph style={{ margin: 0 }}>书城:{record?.platform || '<空>'}</Paragraph>}
- {record?.templateProductId && <Paragraph style={{ margin: 0 }}>适用产品:{record?.templateProductId || '<空>'}</Paragraph>}
- </>
- },
- onCell: (record) => {
- return { rowSpan: record.userRowSpan }
- }
- },
- {
- title: '策略信息',
- dataIndex: 'strategyData',
- key: 'strategyData',
- width: 200,
- render(value, record) {
- return <>
- <Title level={5} style={{ margin: 0 }}>策略{record.strategyIndex}</Title>
- <Paragraph style={{ margin: 0 }}>名称:{value?.strategyName || '<空>'}</Paragraph>
- <Paragraph style={{ margin: 0 }}>执行类型:{TIME_TYPE[value?.timeRepeatType]}</Paragraph>
- {value?.sendDay && <Paragraph style={{ margin: 0 }}>执行时间:{value?.sendDay}</Paragraph>}
- {value?.startTime && <Paragraph style={{ margin: 0 }}>执行日期:{value?.startTime}~{value?.endTime ? value?.endTime : '长期执行'}</Paragraph>}
- {value?.sendTime && <Paragraph style={{ margin: 0 }}>执行时间:{value?.sendTime}</Paragraph>}
- {value?.repeatArray && <Paragraph style={{ margin: 0 }}>执行天数:{value?.repeatArray.join('、')}</Paragraph>}
- </>
- },
- onCell: (record) => {
- return { rowSpan: record.strategyRowSpan }
- }
- },
- {
- title: '继承对象',
- dataIndex: 'inheritData',
- key: 'inheritData',
- width: 200,
- render(value, record) {
- return <>
- <Title level={5} style={{ margin: 0 }}>转移对象{record.inheritIndex}</Title>
- <Paragraph style={{ margin: 0 }}>类型:{value?.transferType === 'all' ? '全部' : '指定'}</Paragraph>
- {value?.transferType === 'specify' && <FilterUser isSHow value={value?.transferUserDto} configType='USER_GROUP' />}
- </>
- },
- },
- {
- title: '继承后文本内容',
- dataIndex: 'transferSuccessMsg',
- key: 'transferSuccessMsg',
- width: 200,
- render(_, record) {
- return <Text>{record?.inheritData?.transferSuccessMsg || '<空>'}</Text>
- },
- },
- {
- title: '接替客户企微号',
- dataIndex: 'externalUser',
- key: 'externalUserCorpUserName',
- width: 100,
- render(_, record) {
- return <Input.TextArea
- placeholder="请输入接替客户企微号"
- allowClear
- onChange={e => setContent({
- msg: { corpUserName: e.target.value },
- index: [record.corpUsergroupIndex, record.strategyIndex - 1, record.inheritIndex - 1],
- type: 'userInherit'
- })}
- />
- },
- },
- {
- title: '接替客户企微号ID',
- dataIndex: 'externalUser',
- key: 'externalUserCorpUserId',
- width: 100,
- render(_, record) {
- return <Input.TextArea
- placeholder="请输入接替客户企微号ID"
- allowClear
- onChange={e => setContent({
- msg: { corpUserId: e.target.value },
- index: [record.corpUsergroupIndex, record.strategyIndex - 1, record.inheritIndex - 1],
- type: 'userInherit'
- })}
- />
- },
- }
- ]
- }
- /** 群发 */
- export const massSendingColumns = (setContent: (data: TASK_CREATE.SetContentProps) => void, bookPlatForm: TASK_CREATE.BookPlatFormProps[], previewContent: { groupMsgContent?: any[], welcomeMsgContent?: any[], externalUserTransferContent?: any[] }): ColumnsType<AnyObject> => {
- return [
- {
- title: '账号',
- dataIndex: 'corpUserGroupName',
- key: 'corpUserGroupName',
- width: 150,
- render(value, record) {
- return <>
- <Title level={5} style={{ margin: 0 }}>{value}</Title>
- <Paragraph style={{ margin: 0 }}>公众号ID:{record?.corpUserList?.[0]?.mpAccountId || '--'}</Paragraph>
- <Paragraph style={{ margin: 0 }}>客服号:{record?.corpUserList?.map(i => i.name).join('、')}</Paragraph>
- </>
- },
- onCell: (record) => {
- return { rowSpan: record.userRowSpan }
- }
- },
- {
- title: '群发信息',
- dataIndex: 'groupSendName',
- key: 'groupSendName',
- width: 130,
- render(value, record) {
- return <>
- <Title level={5} style={{ margin: 0 }}>标题:{value}</Title>
- {record?.bizType && <Paragraph style={{ margin: 0 }}>业务类型:{record?.bizType || '<空>'}</Paragraph>}
- {record?.platform && <Paragraph style={{ margin: 0 }}>书城:{record?.platform || '<空>'}</Paragraph>}
- {record?.templateProductId && <Paragraph style={{ margin: 0 }}>适用产品:{record?.templateProductId || '<空>'}</Paragraph>}
- </>
- },
- onCell: (record) => {
- return { rowSpan: record.userRowSpan }
- }
- },
- {
- title: '策略信息',
- dataIndex: 'strategyData',
- key: 'strategyData',
- width: 200,
- render(value, record) {
- return <>
- <Title level={5} style={{ margin: 0 }}>策略{record.strategyIndex}</Title>
- <Paragraph style={{ margin: 0 }}>名称:{value?.strategyName || '<空>'}</Paragraph>
- <Paragraph style={{ margin: 0 }}>执行类型:{TIME_TYPE[value?.timeRepeatType]}</Paragraph>
- {value?.sendDay && <Paragraph style={{ margin: 0 }}>执行时间:{value?.sendDay}</Paragraph>}
- {value?.startTime && <Paragraph style={{ margin: 0 }}>执行日期:{value?.startTime}~{value?.endTime ? value?.endTime : '长期执行'}</Paragraph>}
- {value?.sendTime && <Paragraph style={{ margin: 0 }}>执行时间:{value?.sendTime}</Paragraph>}
- {value?.repeatArray && <Paragraph style={{ margin: 0 }}>执行天数:{value?.repeatArray.join('、')}</Paragraph>}
- </>
- },
- onCell: (record) => {
- return { rowSpan: record.strategyRowSpan }
- }
- },
- {
- title: '发送对象',
- dataIndex: 'sendData',
- key: 'sendData',
- width: 200,
- render(value, record) {
- return <>
- <Title level={5} style={{ margin: 0 }}>发送对象{record.sendDataIndex}</Title>
- <Paragraph style={{ margin: 0 }}>内容发送模式:{welcomeContentData?.find(i => i.value === record?.sendMode)?.label}</Paragraph>
- <Paragraph style={{ margin: 0 }}>类型:{value?.externalUserType === 'all' ? '全部' : '指定'}</Paragraph>
- {value?.externalUserType === 'specify' && <FilterUser isSHow value={value?.externalUserFilter} configType='USER_GROUP' />}
- </>
- },
- onCell: (record) => {
- return { rowSpan: record.sendDataRowSpan }
- }
- },
- {
- title: '发送内容',
- dataIndex: 'content',
- key: 'content',
- width: 200,
- render(_, record) {
- return <>
- <ShowContentTable
- data={record?.content}
- name={<><span>内容{record.contentIndex}:</span><span dangerouslySetInnerHTML={{ __html: record.contentReactNode?.map((item) => item).join('、') }}></span></>}
- />
- </>
- },
- },
- {
- title: '图文链接',
- dataIndex: 'linkUrl',
- key: 'linkUrl',
- width: 250,
- render(_, record) {
- return record?.linkData?.length > 0 ? <div style={{ display: 'flex', gap: 4, alignItems: 'flex-end' }}>
- <Input.TextArea
- placeholder="请输入链接"
- allowClear
- value={previewContent?.groupMsgContent?.[record.corpUsergroupIndex]?.[record.strategyIndex - 1]?.[record.sendDataIndex - 1]?.[record.contentIndex - 1]?.linkUrl}
- onChange={e => {
- setContent({
- msg: { linkUrl: e.target.value },
- index: [record.corpUsergroupIndex, record.strategyIndex - 1, record.sendDataIndex - 1, record.contentIndex - 1],
- type: 'massSending'
- })
- }}
- />
- <SelectBookLinkButton
- bookPlatForm={bookPlatForm}
- mpAccountId={record.corpUserList?.[0]?.mpAccountId}
- linkData={record.linkData}
- onChange={(linkStr, miniprogramAppid, miniprogramPage) => {
- const msg: { [x: string]: string } = { linkUrl: linkStr }
- if (miniprogramAppid && miniprogramPage && record?.miniProgramData?.length > 0 && !previewContent?.groupMsgContent?.[record.corpUsergroupIndex]?.[record.strategyIndex - 1]?.[record.sendDataIndex - 1]?.[record.contentIndex - 1]?.miniprogramAppid && !previewContent?.groupMsgContent?.[record.corpUsergroupIndex]?.[record.strategyIndex - 1]?.[record.sendDataIndex - 1]?.[record.contentIndex - 1]?.miniprogramPage) {
- msg.miniprogramAppid = miniprogramAppid
- msg.miniprogramPage = miniprogramPage
- }
- setContent({
- msg,
- index: [record.corpUsergroupIndex, record.strategyIndex - 1, record.sendDataIndex - 1, record.contentIndex - 1],
- type: 'massSending'
- })
- }}
- />
- </div> : '--'
- },
- },
- {
- title: '小程序APPID',
- dataIndex: 'miniprogramAppid',
- key: 'miniprogramAppid',
- width: 200,
- render(_, record) {
- return record?.miniProgramData?.length > 0 ? <Input.TextArea
- placeholder="请输入小程序APPID"
- allowClear
- value={previewContent?.groupMsgContent?.[record.corpUsergroupIndex]?.[record.strategyIndex - 1]?.[record.sendDataIndex - 1]?.[record.contentIndex - 1]?.miniprogramAppid}
- onChange={e => setContent({
- msg: { miniprogramAppid: e.target.value },
- index: [record.corpUsergroupIndex, record.strategyIndex - 1, record.sendDataIndex - 1, record.contentIndex - 1],
- type: 'massSending'
- })}
- /> : '--'
- },
- },
- {
- title: '小程序路径',
- dataIndex: 'miniprogramPage',
- key: 'miniprogramPage',
- width: 250,
- render(_, record) {
- return record?.miniProgramData?.length > 0 ? <div style={{ display: 'flex', gap: 4, alignItems: 'flex-end' }}>
- <Input.TextArea
- placeholder="请输入小程序路径"
- allowClear
- value={previewContent?.groupMsgContent?.[record.corpUsergroupIndex]?.[record.strategyIndex - 1]?.[record.sendDataIndex - 1]?.[record.contentIndex - 1]?.miniprogramPage}
- onChange={e => setContent({
- msg: { miniprogramPage: e.target.value },
- index: [record.corpUsergroupIndex, record.strategyIndex - 1, record.sendDataIndex - 1, record.contentIndex - 1],
- type: 'massSending'
- })}
- />
- <SelectBookLinkButton
- bookPlatForm={bookPlatForm}
- mpAccountId={record.corpUserList?.[0]?.mpAccountId}
- linkData={[{
- msgType: "TASK_CONTENT_LINK",
- link: {
- title: record.miniProgramData?.[0]?.miniprogram?.title,
- picUrl: record.miniProgramData?.[0]?.miniprogram?.picUrl,
- desc: ''
- }
- }]}
- onChange={(_, miniprogramAppid, miniprogramPage) => {
- const msg: { [x: string]: string } = {}
- if (miniprogramAppid && miniprogramPage) {
- msg.miniprogramAppid = miniprogramAppid
- msg.miniprogramPage = miniprogramPage
- setContent({
- msg,
- index: [record.corpUsergroupIndex, record.strategyIndex - 1, record.sendDataIndex - 1, record.contentIndex - 1],
- type: 'massSending'
- })
- }
- }}
- />
- </div> : '--'
- }
- }
- ]
- }
- export const highMassSendingColumns = (): ColumnsType<AnyObject> => {
- return [
- {
- title: '账号',
- dataIndex: 'corpUserName',
- key: 'corpUserName',
- width: 150,
- render(value, record) {
- return <Text>{value}({record.corpUserId})</Text>
- },
- onCell: (record) => {
- return { rowSpan: record.userRowSpan }
- }
- },
- {
- title: '群发信息',
- dataIndex: 'groupSendName',
- key: 'groupSendName',
- width: 130,
- render(value, record) {
- return <>
- <Title level={5} style={{ margin: 0 }}>标题:{value}</Title>
- {record?.bizType && <Paragraph style={{ margin: 0 }}>业务类型:{record?.bizType || '<空>'}</Paragraph>}
- {record?.platform && <Paragraph style={{ margin: 0 }}>书城:{record?.platform || '<空>'}</Paragraph>}
- {record?.templateProductId && <Paragraph style={{ margin: 0 }}>适用产品:{record?.templateProductId || '<空>'}</Paragraph>}
- </>
- },
- onCell: (record) => {
- return { rowSpan: record.userRowSpan }
- }
- },
- {
- title: '策略信息',
- dataIndex: 'strategyData',
- key: 'strategyData',
- width: 200,
- render(value, record) {
- return <>
- <Title level={5} style={{ margin: 0 }}>策略{record.strategyIndex}</Title>
- <Paragraph style={{ margin: 0 }}>名称:{value?.strategyName || '<空>'}</Paragraph>
- <Paragraph style={{ margin: 0 }}>执行类型:{TIME_TYPE[value?.timeRepeatType]}</Paragraph>
- {value?.sendDay && <Paragraph style={{ margin: 0 }}>执行时间:{value?.sendDay}</Paragraph>}
- {value?.startTime && <Paragraph style={{ margin: 0 }}>执行日期:{value?.startTime}~{value?.endTime ? value?.endTime : '长期执行'}</Paragraph>}
- {value?.sendTime && <Paragraph style={{ margin: 0 }}>执行时间:{value?.sendTime}</Paragraph>}
- {value?.repeatArray && <Paragraph style={{ margin: 0 }}>执行天数:{value?.repeatArray.join('、')}</Paragraph>}
- </>
- },
- onCell: (record) => {
- return { rowSpan: record.strategyRowSpan }
- }
- },
- {
- title: '发送对象',
- dataIndex: 'sendData',
- key: 'sendData',
- width: 200,
- render(value, record) {
- return <>
- <Title level={5} style={{ margin: 0 }}>发送对象{record.sendDataIndex}</Title>
- <Paragraph style={{ margin: 0 }}>内容发送模式:{welcomeContentData?.find(i => i.value === record?.sendMode)?.label}</Paragraph>
- <Paragraph style={{ margin: 0 }}>类型:{value?.externalUserType === 'all' ? '全部' : '指定'}</Paragraph>
- {value?.externalUserType === 'specify' && <FilterUser isSHow value={value?.externalUserFilter} configType='GROUP_GROUP' />}
- </>
- },
- onCell: (record) => {
- return { rowSpan: record.sendDataRowSpan }
- }
- },
- {
- title: '群发外部联系人',
- dataIndex: 'externalUser',
- key: 'externalUser',
- width: 200,
- render(value) {
- return <>
- <Title ellipsis level={5} style={{ margin: 0 }}>消息发送号外部联系人</Title>
- <Paragraph ellipsis={{ tooltip: true }} style={{ margin: 0 }}>{value?.externalUserId}({value?.name})</Paragraph>
- <Title ellipsis level={5} style={{ margin: 0 }}>群聊所在主体</Title>
- <Paragraph ellipsis={{ tooltip: true }} style={{ margin: 0 }}>{value?.corpId}({value?.corpName})</Paragraph>
- </>
- },
- },
- {
- title: '发送内容',
- dataIndex: 'content',
- key: 'content',
- width: 200,
- render(_, record) {
- return <WelcomeShowTable
- name={<><span>内容{record.contentIndex}:</span><span dangerouslySetInnerHTML={{ __html: record.contentReactNode?.map((item) => item).join('、') }}></span></>}
- data={record?.content}
- />
- },
- },
- {
- title: '图文链接',
- dataIndex: 'linkUrl',
- key: 'linkUrl',
- width: 200,
- render(_, record) {
- return <Paragraph style={{ margin: 0, color: '#000', fontWeight: !!record?.groupMsgContent?.linkUrl ? 'bold' : 'normal' }}>{record?.groupMsgContent?.linkUrl || '--'}</Paragraph>
- },
- },
- {
- title: '小程序APPID',
- dataIndex: 'miniprogramAppid',
- key: 'miniprogramAppid',
- width: 200,
- render(_, record) {
- return <Paragraph style={{ margin: 0, color: '#000', fontWeight: !!record?.groupMsgContent?.miniprogramAppid ? 'bold' : 'normal' }}>{record?.groupMsgContent?.miniprogramAppid || '--'}</Paragraph>
- },
- },
- {
- title: '小程序路径',
- dataIndex: 'miniprogramPage',
- key: 'miniprogramPage',
- width: 200,
- render(_, record) {
- return <Paragraph style={{ margin: 0, color: '#000', fontWeight: !!record?.groupMsgContent?.miniprogramPage ? 'bold' : 'normal' }}>{record?.groupMsgContent?.miniprogramPage || '--'}</Paragraph>
- },
- }
- ]
- }
- export const welcomeColumns = (bookPlatForm: { platformName: string, id: number, platformKey: string }[], bookList: { id: number, bookName: string, platformId: number }[], setContent: (data: TASK_CREATE.SetContentProps) => void, previewContent: { groupMsgContent?: any[], welcomeMsgContent?: any[], externalUserTransferContent?: any[] }): ColumnsType<AnyObject> => {
- return [
- {
- title: '账号',
- dataIndex: 'corpUserGroupName',
- key: 'corpUserGroupName',
- width: 150,
- render(value, record) {
- return <>
- <Title level={5} style={{ margin: 0 }}>{value}({record?.corpUserList?.[0]?.corpName})</Title>
- <Paragraph style={{ margin: 0 }}>公众号ID:{record?.corpUserList?.[0]?.mpAccountId || '--'}</Paragraph>
- <Paragraph style={{ margin: 0 }}>客服号:{record?.corpUserList?.map(i => i.name).join('、')}</Paragraph>
- </>
- },
- onCell: (record) => {
- return { rowSpan: record.rowSpan }
- }
- },
- {
- title: '欢迎语信息',
- dataIndex: 'welcomeName',
- key: 'welcomeName',
- width: 130,
- render(value, record) {
- return <>
- <Title level={5} style={{ margin: 0 }}>标题:{value}</Title>
- {record?.bizType && <Paragraph style={{ margin: 0 }}>业务类型:{record?.bizType || '<空>'}</Paragraph>}
- {record?.platform && <Paragraph style={{ margin: 0 }}>书城:{record?.platform || '<空>'}</Paragraph>}
- {record?.templateProductId && <Paragraph style={{ margin: 0 }}>适用产品:{record?.templateProductId || '<空>'}</Paragraph>}
- </>
- },
- onCell: (record) => {
- return { rowSpan: record.rowSpan }
- }
- },
- {
- title: '智能标签',
- dataIndex: 'welcomeMsgTagDTO',
- key: 'welcomeMsgTagDTO',
- width: 200,
- render(value) {
- return <>
- {value?.business && <Paragraph style={{ margin: 0 }}>业务(来源渠道):{businessPlanData.find(i => i.value === value.business)?.label || '<空>'}</Paragraph>}
- {value?.bookCity && <Paragraph style={{ margin: 0 }}>书城(来源渠道):{bookPlatForm.find(i => i.id === value.bookCity)?.platformName || '<空>'}</Paragraph>}
- {value?.product && <Paragraph style={{ margin: 0 }}>产品(来源渠道):{bookList.find(i => i.id === value.product)?.bookName || '<空>'}</Paragraph>}
- </>
- },
- onCell: (record) => {
- return { rowSpan: record.rowSpan }
- }
- },
- {
- title: '内容组发送模式',
- dataIndex: 'sendMode',
- key: 'sendMode',
- width: 100,
- align: 'center',
- render(value) {
- return <Paragraph style={{ margin: 0 }}>{welcomeContentData?.find(i => i.value === value)?.label}</Paragraph>
- },
- onCell: (record) => {
- return { rowSpan: record.rowSpan }
- }
- },
- {
- title: '欢迎语发送内容',
- dataIndex: 'sendData',
- key: 'sendData',
- width: 200,
- render(value, record) {
- return <WelcomeShowTable
- name={<><span>内容{record.contentIndex}:</span><span dangerouslySetInnerHTML={{ __html: record.contentReactNode?.map((item) => item).join('、') }}></span></>}
- data={value}
- />
- },
- },
- {
- title: '图文链接',
- dataIndex: 'linkUrl',
- key: 'linkUrl',
- width: 250,
- render(_, record) {
- return record?.linkData?.length > 0 ? <div style={{ display: 'flex', gap: 4, alignItems: 'flex-end' }}>
- <Input.TextArea
- placeholder="请输入链接"
- allowClear
- value={previewContent?.welcomeMsgContent?.[record.corpUsergroupIndex]?.[record.contentIndex - 1]?.linkUrl}
- onChange={e => {
- setContent({
- msg: { linkUrl: e.target.value },
- index: [record.corpUsergroupIndex, record.contentIndex - 1],
- type: 'welcome'
- })
- }}
- />
- <SelectBookLinkButton
- bookPlatForm={bookPlatForm}
- mpAccountId={record.corpUserList?.[0]?.mpAccountId}
- linkData={record.linkData.map(item => ({
- msgType: "TASK_CONTENT_LINK",
- link: {
- title: item.linkTitle,
- picUrl: item.linkPicurl,
- desc: item.linkDesc
- }
- }))}
- onChange={(linkStr, miniprogramAppid, miniprogramPage) => {
- const msg: { [x: string]: string } = { linkUrl: linkStr }
- if (miniprogramAppid && miniprogramPage && record?.miniProgramData?.length > 0 && !previewContent?.welcomeMsgContent?.[record.corpUsergroupIndex]?.[record.contentIndex - 1]?.miniprogramAppid && !previewContent?.welcomeMsgContent?.[record.corpUsergroupIndex]?.[record.contentIndex - 1]?.miniprogramPage) {
- msg.miniprogramAppid = miniprogramAppid
- msg.miniprogramPage = miniprogramPage
- }
- setContent({
- msg,
- index: [record.corpUsergroupIndex, record.contentIndex - 1],
- type: 'welcome'
- })
- }}
- />
- </div> : '--'
- },
- },
- {
- title: '小程序APPID',
- dataIndex: 'miniprogramAppid',
- key: 'miniprogramAppid',
- width: 200,
- render(_, record) {
- return record?.miniProgramData?.length > 0 ? <Input.TextArea
- placeholder="请输入小程序APPID"
- allowClear
- value={previewContent?.welcomeMsgContent?.[record.corpUsergroupIndex]?.[record.contentIndex - 1]?.miniprogramAppid}
- onChange={e => setContent({
- msg: { miniprogramAppid: e.target.value },
- index: [record.corpUsergroupIndex, record.contentIndex - 1],
- type: 'welcome'
- })}
- /> : '--'
- },
- },
- {
- title: '小程序路径',
- dataIndex: 'miniprogramPage',
- key: 'miniprogramPage',
- width: 250,
- render(_, record) {
- return record?.miniProgramData?.length > 0 ? <div style={{ display: 'flex', gap: 4, alignItems: 'flex-end' }}>
- <Input.TextArea
- placeholder="请输入小程序路径"
- allowClear
- value={previewContent?.welcomeMsgContent?.[record.corpUsergroupIndex]?.[record.contentIndex - 1]?.miniprogramPage}
- onChange={e => setContent({
- msg: { miniprogramPage: e.target.value },
- index: [record.corpUsergroupIndex, record.contentIndex - 1],
- type: 'welcome'
- })}
- />
- <SelectBookLinkButton
- bookPlatForm={bookPlatForm}
- mpAccountId={record.corpUserList?.[0]?.mpAccountId}
- linkData={[{
- msgType: "TASK_CONTENT_LINK",
- link: {
- title: record.miniProgramData?.[0]?.miniprogramTitle,
- picUrl: record.miniProgramData?.[0]?.miniprogramPicurl,
- desc: ''
- }
- }]}
- onChange={(_, miniprogramAppid, miniprogramPage) => {
- const msg: { [x: string]: string } = {}
- if (miniprogramAppid && miniprogramPage) {
- msg.miniprogramAppid = miniprogramAppid
- msg.miniprogramPage = miniprogramPage
- setContent({
- msg,
- index: [record.corpUsergroupIndex, record.contentIndex - 1],
- type: 'welcome'
- })
- }
- }}
- />
- </div> : '--'
- }
- }
- ]
- }
- export const friendsColumns = (): ColumnsType<AnyObject> => {
- return [
- {
- title: '账号',
- dataIndex: 'corpUserName',
- key: 'corpUserName',
- width: 150,
- render(value, record) {
- return <Text>{value}({record.corpUserId})</Text>
- },
- onCell: (record) => {
- return { rowSpan: record.userRowSpan }
- }
- },
- {
- title: '朋友圈信息',
- dataIndex: 'momentSendName',
- key: 'momentSendName',
- width: 130,
- render(value, record) {
- return <>
- <Title level={5} style={{ margin: 0 }}>标题:{value}</Title>
- {record?.bizType && <Paragraph style={{ margin: 0 }}>业务类型:{record?.bizType || '<空>'}</Paragraph>}
- {record?.platform && <Paragraph style={{ margin: 0 }}>书城:{record?.platform || '<空>'}</Paragraph>}
- {record?.templateProductId && <Paragraph style={{ margin: 0 }}>适用产品:{record?.templateProductId || '<空>'}</Paragraph>}
- </>
- },
- onCell: (record) => {
- return { rowSpan: record.userRowSpan }
- }
- },
- {
- title: '策略信息',
- dataIndex: 'strategyData',
- key: 'strategyData',
- width: 200,
- render(value, record) {
- return <>
- <Title level={5} style={{ margin: 0 }}>策略{record.strategyIndex + 1}</Title>
- <Paragraph style={{ margin: 0 }}>名称:{value?.strategyName || '<空>'}</Paragraph>
- <Paragraph style={{ margin: 0 }}>执行类型:{TIME_TYPE[value?.timeRepeatType]}</Paragraph>
- {value?.sendDay && <Paragraph style={{ margin: 0 }}>执行时间:{value?.sendDay}</Paragraph>}
- {value?.startTime && <Paragraph style={{ margin: 0 }}>执行日期:{value?.startTime}~{value?.endTime ? value?.endTime : '长期执行'}</Paragraph>}
- {value?.sendTime && <Paragraph style={{ margin: 0 }}>执行时间:{value?.sendTime}</Paragraph>}
- {value?.repeatArray && <Paragraph style={{ margin: 0 }}>执行天数:{value?.repeatArray.join('、')}</Paragraph>}
- </>
- },
- onCell: (record) => {
- return { rowSpan: record.strategyRowSpan }
- }
- },
- {
- title: '发送对象',
- dataIndex: 'sendData',
- key: 'sendData',
- width: 200,
- render(value, record) {
- return <>
- <Title level={5} style={{ margin: 0 }}>发送对象{record.sendDataIndex}</Title>
- <Paragraph style={{ margin: 0 }}>内容发送模式:{welcomeContentData?.find(i => i.value === record?.sendMode)?.label}</Paragraph>
- <Paragraph style={{ margin: 0 }} ellipsis={{ rows: 3, tooltip: true }}>企微标签:{value?.length > 0 ? value?.map(i => i.title).join('、') : '全部'}</Paragraph>
- </>
- },
- onCell: (record) => {
- return { rowSpan: record.strategyRowSpan }
- }
- },
- {
- title: '发送内容',
- dataIndex: 'content',
- key: 'content',
- width: 200,
- render(_, record) {
- return <>
- <FriendsShowTable
- data={record?.content}
- name={<><span>内容{record.contentIndex + 1}:</span><span dangerouslySetInnerHTML={{ __html: record.contentReactNode?.map((item) => item).join('、') }}></span></>}
- />
- </>
- },
- },
- {
- title: '图文链接',
- dataIndex: 'linkUrl',
- key: 'linkUrl',
- width: 200,
- render(_, record) {
- return <Paragraph style={{ margin: 0, color: '#000', fontWeight: !!record?.friendsContent?.linkUrl ? 'bold' : 'normal' }}>{record?.friendsContent?.linkUrl || '--'}</Paragraph>
- },
- },
- {
- title: '小程序APPID',
- dataIndex: 'miniprogramAppid',
- key: 'miniprogramAppid',
- width: 200,
- render(_, record) {
- return <Paragraph style={{ margin: 0, color: '#000', fontWeight: !!record?.friendsContent?.miniprogramAppid ? 'bold' : 'normal' }}>{record?.friendsContent?.miniprogramAppid || '--'}</Paragraph>
- },
- },
- {
- title: '小程序路径',
- dataIndex: 'miniprogramPage',
- key: 'miniprogramPage',
- width: 200,
- render(_, record) {
- return <Paragraph style={{ margin: 0, color: '#000', fontWeight: !!record?.friendsContent?.miniprogramPage ? 'bold' : 'normal' }}>{record?.friendsContent?.miniprogramPage || '--'}</Paragraph>
- },
- }
- ]
- }
|