|
@@ -7,7 +7,7 @@ import { getTagsList, get_adcreative_template } from "@/services/launchAdq/globa
|
|
|
import { getSysAdgroupsInfo } from "@/services/launchAdq/localAd"
|
|
|
import { getsysTargetingInfo } from "@/services/launchAdq/targeting"
|
|
|
import { CheckOutlined, CloseOutlined, SearchOutlined } from "@ant-design/icons"
|
|
|
-import { Button, Card, Col, Empty, Row, Select, Space, Spin, Tooltip, Image, message, Tabs, Popconfirm, notification } from "antd"
|
|
|
+import { Button, Card, Col, Empty, Row, Select, Space, Spin, Tooltip, Image, message, Tabs, Popconfirm, notification, Divider, Checkbox, Modal } from "antd"
|
|
|
import React, { useCallback, useEffect, useState } from "react"
|
|
|
import { useModel } from "umi"
|
|
|
import Ad from "./ad"
|
|
@@ -73,6 +73,7 @@ const CreateAd: React.FC = () => {
|
|
|
const [usesArr, setUsersArr] = useState<any>(localStorage.getItem('ADQUSERS' + userId) ? JSON.parse(localStorage.getItem('ADQUSERS' + userId) as any) : [])
|
|
|
const { init, get } = useModel('useLaunchAdq.useBdMediaPup')
|
|
|
const [cloudParams, setCloudParams] = useState<{ adcreativeTemplateId?: number }>({})
|
|
|
+ const [accSearch, setAccSearch] = useState<string>()
|
|
|
|
|
|
|
|
|
const tagsList_REGION = useAjax((params) => getTagsList(params))
|
|
@@ -662,9 +663,19 @@ const CreateAd: React.FC = () => {
|
|
|
console.log('paramsSubmit====>', params)
|
|
|
createAdBatch.run(params).then(res => {
|
|
|
if (res) {
|
|
|
- sessionStorage.setItem('CAMP', props?.campaignName)
|
|
|
- message.success('创建成功')
|
|
|
- window.location.href = '/#/launchSystemNew/launchManage/taskList'
|
|
|
+ Modal.success({
|
|
|
+ content: '任务提交成功',
|
|
|
+ bodyStyle: { fontWeight: 700 },
|
|
|
+ okText: '跳转任务列表',
|
|
|
+ closable: true,
|
|
|
+ onOk: () => {
|
|
|
+ sessionStorage.setItem('CAMP', props?.campaignName)
|
|
|
+ window.location.href = '/#/launchSystemNew/launchManage/taskList'
|
|
|
+ },
|
|
|
+ onCancel: () => {
|
|
|
+ setSubVisible(false)
|
|
|
+ }
|
|
|
+ })
|
|
|
}
|
|
|
})
|
|
|
}
|
|
@@ -858,8 +869,8 @@ const CreateAd: React.FC = () => {
|
|
|
setAccountCreateLogs([])
|
|
|
}
|
|
|
}
|
|
|
- console.log('accountCreateLogs', accountCreateLogs);
|
|
|
-
|
|
|
+
|
|
|
+
|
|
|
return <Space direction="vertical" style={{ width: '100%' }}>
|
|
|
<Card
|
|
|
title={<Space>
|
|
@@ -891,13 +902,13 @@ const CreateAd: React.FC = () => {
|
|
|
}}
|
|
|
onChange={(e, option) => { getGroupAccountList(e) }}
|
|
|
>
|
|
|
- {getGroupList.data?.map((item: any) => <Select.Option value={item.groupId} key={item.groupId}>{item.groupName}</Select.Option>)}
|
|
|
+ {getGroupList?.data?.map((item: any) => <Select.Option value={item.groupId} key={item.groupId}>{item.groupName}</Select.Option>)}
|
|
|
</Select>
|
|
|
</Selector>
|
|
|
<Selector label="媒体账户">
|
|
|
<Select
|
|
|
mode="multiple"
|
|
|
- style={{ minWidth: 200 }}
|
|
|
+ style={{ minWidth: 200, maxWidth: 500 }}
|
|
|
placeholder="请选择媒体账户"
|
|
|
maxTagCount={1}
|
|
|
allowClear
|
|
@@ -906,16 +917,42 @@ const CreateAd: React.FC = () => {
|
|
|
<span>+{accountCreateLogs?.length > 1 ? accountCreateLogs.length - 1 : 0}</span>
|
|
|
</Tooltip>}
|
|
|
dropdownMatchSelectWidth={false}
|
|
|
+ autoClearSearchValue={false}
|
|
|
filterOption={(input: any, option: any) => {
|
|
|
- return option!.children?.toString().toLowerCase().includes(input.toLowerCase())
|
|
|
+ let newInput: string[] = input ? input?.split(/[,,\n\s]+/ig) : []
|
|
|
+ return newInput?.some(val => option!.children?.toString().toLowerCase()?.includes(val))
|
|
|
}}
|
|
|
value={accountCreateLogs?.map((item: { id: number }) => item?.id)}
|
|
|
onChange={(e, option) => {
|
|
|
- console.log(option)
|
|
|
setQueryForm({ ...queryForm, adqPageList: [], pageList: [], taskMediaMaps: queryForm?.taskMediaMaps?.map((item: { sysPageId: number }) => ({ ...item, sysPageId: '', accountPageIdMap: {}, cropUserGroupMap: [] })) })
|
|
|
setAccountCreateLogs(option?.map((item: any) => ({ adAccountId: item?.children?.toString()?.split('_')[0], id: item?.value })))
|
|
|
clearData()
|
|
|
}}
|
|
|
+ searchValue={accSearch}
|
|
|
+ onSearch={(val) => {
|
|
|
+ setAccSearch(val)
|
|
|
+ }}
|
|
|
+ dropdownRender={menu => (
|
|
|
+ <>
|
|
|
+ {menu}
|
|
|
+ <Divider style={{ margin: '8px 0' }} />
|
|
|
+ <Space style={{ padding: '0 8px 4px' }}>
|
|
|
+ <Checkbox onChange={(e) => {
|
|
|
+ let data = []
|
|
|
+ if (e.target.checked) {
|
|
|
+ data = JSON.parse(JSON.stringify(getAllUserAccount?.data?.data))
|
|
|
+ if (accSearch) {
|
|
|
+ let newAccSearch = accSearch?.split(/[,,\n\s]+/ig)
|
|
|
+ data = data?.filter((item: any) => newAccSearch?.some(val => item!.accountId?.toString().toLowerCase()?.includes(val)))
|
|
|
+ }
|
|
|
+ }
|
|
|
+ setQueryForm({ ...queryForm, adqPageList: [], pageList: [], taskMediaMaps: queryForm?.taskMediaMaps?.map((item: { sysPageId: number }) => ({ ...item, sysPageId: '', accountPageIdMap: {}, cropUserGroupMap: [] })) })
|
|
|
+ setAccountCreateLogs(data?.map((item: any) => ({ adAccountId: item?.accountId, id: item?.id })))
|
|
|
+ clearData()
|
|
|
+ }}>全选</Checkbox>
|
|
|
+ </Space>
|
|
|
+ </>
|
|
|
+ )}
|
|
|
>
|
|
|
{getAllUserAccount?.data?.data?.map((item: any) => <Select.Option value={item.id} key={item.id}>{item.remark ? item.accountId + '_' + item.remark : item.accountId}</Select.Option>)}
|
|
|
</Select>
|