|
@@ -125,7 +125,7 @@ export const userInheritColumns = (setContent: (data: TASK_CREATE.SetContentProp
|
|
|
}
|
|
|
|
|
|
/** 群发 */
|
|
|
-export const massSendingColumns = (setContent: (data: TASK_CREATE.SetContentProps) => void, bookPlatForm: TASK_CREATE.BookPlatFormProps[]): ColumnsType<AnyObject> => {
|
|
|
+export const massSendingColumns = (setContent: (data: TASK_CREATE.SetContentProps) => void, bookPlatForm: TASK_CREATE.BookPlatFormProps[], previewContent: { groupMsgContent?: any[], welcomeMsgContent?: any[], externalUserTransferContent?: any[] }): ColumnsType<AnyObject> => {
|
|
|
return [
|
|
|
{
|
|
|
title: '账号',
|
|
@@ -135,6 +135,7 @@ export const massSendingColumns = (setContent: (data: TASK_CREATE.SetContentProp
|
|
|
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>
|
|
|
</>
|
|
|
},
|
|
@@ -216,16 +217,37 @@ export const massSendingColumns = (setContent: (data: TASK_CREATE.SetContentProp
|
|
|
key: 'linkUrl',
|
|
|
width: 250,
|
|
|
render(_, record) {
|
|
|
- return record?.linkData?.length > 0 ? <SelectBookLinkButton
|
|
|
- bookPlatForm={bookPlatForm}
|
|
|
- mpAccountId={record.corpUserList?.[0]?.mpAccountId}
|
|
|
- linkData={record.linkData}
|
|
|
- onChange={(linkStr) => setContent({
|
|
|
- msg: { linkUrl: linkStr },
|
|
|
- index: [record.corpUsergroupIndex, record.strategyIndex - 1, record.sendDataIndex - 1, record.contentIndex - 1],
|
|
|
- type: 'massSending'
|
|
|
- })}
|
|
|
- /> : '--'
|
|
|
+ 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> : '--'
|
|
|
},
|
|
|
},
|
|
|
{
|
|
@@ -234,9 +256,10 @@ export const massSendingColumns = (setContent: (data: TASK_CREATE.SetContentProp
|
|
|
key: 'miniprogramAppid',
|
|
|
width: 200,
|
|
|
render(_, record) {
|
|
|
- return record?.isMiniProgram ? <Input.TextArea
|
|
|
+ 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],
|
|
@@ -249,17 +272,44 @@ export const massSendingColumns = (setContent: (data: TASK_CREATE.SetContentProp
|
|
|
title: '小程序路径',
|
|
|
dataIndex: 'miniprogramPage',
|
|
|
key: 'miniprogramPage',
|
|
|
- width: 200,
|
|
|
+ width: 250,
|
|
|
render(_, record) {
|
|
|
- return record?.isMiniProgram ? <Input.TextArea
|
|
|
- placeholder="请输入小程序路径"
|
|
|
- allowClear
|
|
|
- onChange={e => setContent({
|
|
|
- msg: { miniprogramPage: e.target.value },
|
|
|
- index: [record.corpUsergroupIndex, record.strategyIndex - 1, record.sendDataIndex - 1, record.contentIndex - 1],
|
|
|
- type: 'massSending'
|
|
|
- })}
|
|
|
- /> : '--'
|
|
|
+ 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> : '--'
|
|
|
}
|
|
|
}
|
|
|
]
|
|
@@ -392,7 +442,7 @@ export const highMassSendingColumns = (): ColumnsType<AnyObject> => {
|
|
|
}
|
|
|
|
|
|
|
|
|
-export const welcomeColumns = (bookPlatForm: { platformName: string, id: number, platformKey: string }[], bookList: { id: number, bookName: string, platformId: number }[], setContent: (data: TASK_CREATE.SetContentProps) => void): ColumnsType<AnyObject> => {
|
|
|
+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: '账号',
|
|
@@ -402,6 +452,7 @@ export const welcomeColumns = (bookPlatForm: { platformName: string, id: number,
|
|
|
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>
|
|
|
</>
|
|
|
},
|
|
@@ -473,23 +524,44 @@ export const welcomeColumns = (bookPlatForm: { platformName: string, id: number,
|
|
|
key: 'linkUrl',
|
|
|
width: 250,
|
|
|
render(_, record) {
|
|
|
- return record?.linkData?.length > 0 ? <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) => setContent({
|
|
|
- msg: { linkUrl: linkStr },
|
|
|
- index: [record.corpUsergroupIndex, record.contentIndex - 1],
|
|
|
- type: 'welcome'
|
|
|
- })}
|
|
|
- /> : '--'
|
|
|
+ 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> : '--'
|
|
|
},
|
|
|
},
|
|
|
{
|
|
@@ -498,9 +570,10 @@ export const welcomeColumns = (bookPlatForm: { platformName: string, id: number,
|
|
|
key: 'miniprogramAppid',
|
|
|
width: 200,
|
|
|
render(_, record) {
|
|
|
- return record?.isMiniProgram ? <Input.TextArea
|
|
|
+ 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],
|
|
@@ -513,17 +586,44 @@ export const welcomeColumns = (bookPlatForm: { platformName: string, id: number,
|
|
|
title: '小程序路径',
|
|
|
dataIndex: 'miniprogramPage',
|
|
|
key: 'miniprogramPage',
|
|
|
- width: 200,
|
|
|
+ width: 250,
|
|
|
render(_, record) {
|
|
|
- return record?.isMiniProgram ? <Input.TextArea
|
|
|
- placeholder="请输入小程序路径"
|
|
|
- allowClear
|
|
|
- onChange={e => setContent({
|
|
|
- msg: { miniprogramPage: e.target.value },
|
|
|
- index: [record.corpUsergroupIndex, record.contentIndex - 1],
|
|
|
- type: 'welcome'
|
|
|
- })}
|
|
|
- /> : '--'
|
|
|
+ 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> : '--'
|
|
|
}
|
|
|
}
|
|
|
]
|