wjx 3 mēneši atpakaļ
vecāks
revīzija
9efec6f014

+ 2 - 1
src/pages/launchSystemV3/components/AdgroupTooltip/index.tsx

@@ -20,7 +20,7 @@ const AdgroupTooltip: React.FC<Props> = ({ data: adgroups, taskType }) => {
 
     /************************************/
     const {
-        marketingGoal, marketingSubGoal, marketingAssetOuterSpec, marketingCarrierType, automaticSiteEnabled, explorationStrategy, siteSet, prioritySiteSet, searchExpandTargetingSwitch, bidMode, smartBidType, bidScene, bidAmount, optimizationGoal,
+        marketingGoal, marketingSubGoal, marketingAssetOuterSpec, marketingCarrierType, automaticSiteEnabled, explorationStrategy, siteSet, prioritySiteSet, searchExpandTargetingSwitch, bidMode, smartBidType, bidScene, bidAmount, optimizationGoal, ecomPkamSwitch,
         deepConversionSpec, autoAcquisitionEnabled, autoAcquisitionBudget, dailyBudget, endDate, beginDate, timeSeries, firstDayBeginTime, configuredStatus, adgroupName, promoteApplicationId, rtaId, rtaTargetId, bidAmountMin, bidAllocationMode, bidAmountMax,
 
     } = adgroups
@@ -75,6 +75,7 @@ const AdgroupTooltip: React.FC<Props> = ({ data: adgroups, taskType }) => {
                     }
                 </>}
             </>}
+            <p>一方人群跑量加强:{ecomPkamSwitch === 'ECOM_PKAM_SWITCH_OPEN' ? '开启' : '关闭'}</p>
             <p>一键起量:{autoAcquisitionEnabled ? '开启' : '关闭'}</p>
             {autoAcquisitionEnabled && <p>起量预算:{autoAcquisitionBudget}元/天</p>}
             <p>广告日预算:{dailyBudget ? dailyBudget + '元/天' : '不限'}</p>

+ 1 - 1
src/pages/launchSystemV3/material/cloudNew/global.less

@@ -21,7 +21,7 @@
 }
 
 .SCK .ant-modal-header {
-    padding: 0 8px;
+    padding: 0 8px !important;
 
     .SCK_header {
         display: flex;

+ 11 - 3
src/pages/launchSystemV3/material/cloudNew/selectCloudNew.tsx

@@ -17,6 +17,7 @@ import PlayVideo from "./playVideo"
 import { showFieldList } from "./const"
 import SelectFolder from "./selectFolder"
 import SelectGroupCloudNew from "./selectGroupCloudNew"
+import SelectGroupUnitNew from "./selectGroupUnitNew"
 
 
 const { Text, Paragraph } = Typography;
@@ -128,7 +129,7 @@ const SelectCloudNew: React.FC<CLOUDNEW.SelectCloudNewProps> = ({ visible, defau
 
     return <Modal
         title={<div className={'SCK_header'}>
-            {[{ label: '素材库', value: '1' }, { label: '账户组媒体素材', value: '2' }].map(item => <div
+            {[{ label: '素材库', value: '1' }, { label: '账户组媒体素材', value: '2' }, { label: '业务单元素材', value: '3' }].map(item => <div
                 className={item.value === SCKType ? 'selected' : ''}
                 key={item.value}
                 onClick={() => {
@@ -365,7 +366,15 @@ const SelectCloudNew: React.FC<CLOUDNEW.SelectCloudNewProps> = ({ visible, defau
                     </div>
                 </div>
             </Card>
-        </div> : <SelectGroupCloudNew
+        </div> : SCKType === '2' ? <SelectGroupCloudNew
+            num={num}
+            defaultParams={defaultParams}
+            checkedFolderList={checkedFolderList}
+            setCheckedFolderList={setCheckedFolderList}
+            accountCreateLogs={accountCreateLogs}
+            putInType={putInType}
+            active={active}
+        /> : <SelectGroupUnitNew
             num={num}
             defaultParams={defaultParams}
             checkedFolderList={checkedFolderList}
@@ -373,7 +382,6 @@ const SelectCloudNew: React.FC<CLOUDNEW.SelectCloudNewProps> = ({ visible, defau
             accountCreateLogs={accountCreateLogs}
             putInType={putInType}
             active={active}
-            setActive={setActive}
         />}
 
 

+ 1 - 1
src/pages/launchSystemV3/material/cloudNew/selectGroupCloudNew.tsx

@@ -22,7 +22,7 @@ const { Text, Paragraph } = Typography;
  * @param param0 
  * @returns 
  */
-const SelectGroupCloudNew: React.FC<CLOUDNEW.SelectGroupCloudNewProps> = ({ num, defaultParams, checkedFolderList, setCheckedFolderList, accountCreateLogs, putInType, active, setActive }) => {
+const SelectGroupCloudNew: React.FC<CLOUDNEW.SelectGroupCloudNewProps> = ({ num, defaultParams, checkedFolderList, setCheckedFolderList, accountCreateLogs, putInType, active }) => {
 
     /*****************************************/
     const [rowNum, setRowNum] = useState<number>(0)

+ 348 - 0
src/pages/launchSystemV3/material/cloudNew/selectGroupUnitNew.tsx

@@ -0,0 +1,348 @@
+import React, { useEffect, useState } from "react"
+import style from './index.less'
+import { Button, Card, Checkbox, Divider, Empty, Form, message, Pagination, Popover, Radio, Result, Select, Space, Spin, Typography, Image } from "antd"
+import { useAjax } from "@/Hook/useAjax"
+import { getPageRemoteImageDataListApi } from "@/services/adqV3/cloudNew"
+import { formatBytes, formatSecondsToTime, groupBy } from "@/utils/utils"
+import SelectGroupSearch from "./selectGroupSearch"
+import './global.less'
+import '../../tencentAdPutIn/index.less'
+import { showField1List } from "./const"
+import { EyeOutlined, SortAscendingOutlined } from "@ant-design/icons"
+import PlayVideo from "./playVideo"
+import Lazyimg from "react-lazyimg-component"
+import { useLocalStorageState } from "ahooks"
+import SyncCloudSc from "./syncCloudSc"
+import { checkAccountUnitApi, getUserAccountListApi } from "@/services/launchAdq/adAuthorize"
+
+const { Text, Paragraph } = Typography;
+
+/**
+ * 选择业务单元素材
+ * @param param0 
+ * @returns 
+ */
+const SelectGroupUnitNew: React.FC<CLOUDNEW.SelectGroupCloudNewProps> = ({ num, defaultParams, checkedFolderList, setCheckedFolderList, accountCreateLogs, putInType, active }) => {
+
+    /*****************************************/
+    const [rowNum, setRowNum] = useState<number>(0)
+
+    const [checkFolderAll, setCheckFolderAll] = useState<boolean>(false);
+    const [indeterminateFolder, setIndeterminateFolder] = useState<boolean>(false);
+
+    const [queryParams, setQueryParams] = useState<Omit<CLOUDNEW.GetPageRemoteImageDataListProps, 'materialType'>>({ pageNum: 1, pageSize: 20 })
+    const [searchParams, setSearchParams] = useState<Partial<Omit<CLOUDNEW.GetPageRemoteImageDataListProps, 'materialType'>>>({})
+    const [unitAccountId, setUnitAccountId] = useState<number>()
+    const [previewData, setPreviewData] = useState<{ visible: boolean, url?: string }>({ visible: false })
+    const [sortData, setSortData] = useLocalStorageState<{ sortField: string | undefined, sortType: boolean }>('sort-data-unit', { sortField: undefined, sortType: false });
+    const [showField, setShowField] = useLocalStorageState<string[]>('show-field-unit', ['material.create_time', 'material_data_day.cost', 'material_data_day.ctr', 'material_data_day.conversions_rate', 'material_data_day.dynamic_creative_count']);
+
+    const getPageRemoteImageDataList = useAjax((params) => getPageRemoteImageDataListApi(params))
+    const checkAccountUnit = useAjax((params) => checkAccountUnitApi(params))
+    /*****************************************/
+
+    // 根据内容宽度计算列数
+    useEffect(() => {
+        let rowNum = Math.floor(1350 / 220)
+        setRowNum(rowNum || 1)
+    }, [])
+
+    // 处理全选按钮状态
+    useEffect(() => {
+        let data: any[] = getPageRemoteImageDataList?.data?.records || []
+        let dataIds = data.map(item => item.image_id || item.video_id)
+        let selectIds = checkedFolderList.map(item => item.id)
+        if (selectIds.length === 0 || dataIds.length === 0) {
+            setCheckFolderAll(false)
+            setIndeterminateFolder(false);
+        } else if (dataIds.every((element) => selectIds.includes(element))) {
+            setCheckFolderAll(true)
+            setIndeterminateFolder(false);
+        } else if (dataIds.some((element) => selectIds.includes(element))) {
+            setCheckFolderAll(false)
+            setIndeterminateFolder(true);
+        } else {
+            setCheckFolderAll(false)
+            setIndeterminateFolder(false);
+        }
+    }, [checkedFolderList, getPageRemoteImageDataList?.data?.records])
+
+    useEffect(() => {
+        if (accountCreateLogs?.length) {
+            checkAccountUnit.run(accountCreateLogs.map(item => item.accountId)).then(res => {
+                setUnitAccountId(res?.adUnitAccountId)
+            })
+        }
+    }, [accountCreateLogs])
+
+    useEffect(() => {
+        if (unitAccountId) {
+            let params = { ...searchParams, ...defaultParams, ...queryParams, ownerAccountId: unitAccountId }
+            if (sortData?.sortField) {
+                params = { ...params, ...sortData }
+            }
+            getPageRemoteImageDataList.run(params)
+        }
+    }, [queryParams, defaultParams, searchParams, sortData, showField, unitAccountId])
+
+    // 选择
+    const onCheckboxChange = (checked: boolean, item: any) => {
+        let newCheckedFolderList: any[] = JSON.parse(JSON.stringify(checkedFolderList))
+        if (active || active === 0) {
+            if (checked) { // 选中
+                newCheckedFolderList[active] = { ...item, id: item.image_id || item.video_id, material_type: defaultParams.materialType, oss_url: item.preview_url, materialType: 1, isUnit: true }
+            } else { // 取消
+                message.warning('请选择其他图片替换')
+                return
+            }
+        } else {
+            if (checked) { // 选中
+                newCheckedFolderList.push({ ...item, id: item.image_id || item.video_id, material_type: defaultParams.materialType, oss_url: item.preview_url, materialType: 1, isUnit: true })
+            } else { // 取消
+                let id = item.image_id || item.video_id
+                newCheckedFolderList = newCheckedFolderList.filter(i => i.id !== id)
+            }
+        }
+        setCheckedFolderList(newCheckedFolderList)
+    };
+
+    return <Spin spinning={checkAccountUnit.loading} wrapperClassName={'select_group_spin'}>
+        <div className={style.select_cloudNew_layout}>
+            {unitAccountId ? <>
+                {/* 搜索 */}
+                <SelectGroupSearch
+                    type={defaultParams.materialType}
+                    onSearch={(value) => { setSearchParams(value) }}
+                />
+                <Card
+                    style={{ height: '100%', flex: '1 0', overflow: 'hidden' }}
+                    bodyStyle={{ padding: 0, overflow: 'auto hidden', height: '100%' }}
+                    className="cardResetCss buttonResetCss"
+                    bordered
+                >
+                    <div className={style.cloudNew}>
+                        <div className={style.material} style={{ height: '100%' }}>
+                            <div className={style.operates}>
+                                <div className={style.left_bts}>
+                                    <Checkbox
+                                        onChange={(e) => {
+                                            let newCheckedFolderList: any[] = JSON.parse(JSON.stringify(checkedFolderList))
+                                            const data: any[] = getPageRemoteImageDataList?.data?.records
+
+                                            if (e.target.checked) { // 全选
+                                                const selectIds = newCheckedFolderList.map(item => item.id)
+                                                const remainData = data.filter(item => {
+                                                    const id = item.image_id || item.video_id
+                                                    return !selectIds.includes(id)
+                                                })
+                                                const remainDataLength = remainData.length
+                                                const remainNum = num - newCheckedFolderList.length
+                                                if (remainNum > remainDataLength) {
+                                                    newCheckedFolderList.push(...remainData.map(i => ({ ...i, material_type: defaultParams.materialType, id: i.image_id || i.video_id, oss_url: i.preview_url, materialType: 1, isUnit: true })))
+                                                } else {
+                                                    newCheckedFolderList.push(...remainData.splice(0, remainNum).map(i => ({ ...i, material_type: defaultParams.materialType, id: i.image_id || i.video_id, oss_url: i.preview_url, materialType: 1, isUnit: true })))
+                                                }
+                                                newCheckedFolderList = Array.from(new Set(newCheckedFolderList.map(item => JSON.stringify(item)))).map(item => JSON.parse(item));
+                                            } else { // 取消全选
+                                                const dataIds = data.map(item => item.image_id || item.video_id)
+                                                newCheckedFolderList = newCheckedFolderList.filter(i => !dataIds.includes(i.id))
+                                            }
+                                            setCheckedFolderList(newCheckedFolderList)
+                                        }}
+                                        disabled={checkedFolderList?.length >= num || !!active || active === 0}
+                                        indeterminate={indeterminateFolder}
+                                        checked={checkFolderAll}
+                                    >全选</Checkbox>
+                                    <span>已选 <span style={{ color: '#1890FF' }}>{checkedFolderList?.length || 0}</span>/{num} 个素材</span>
+                                    {checkedFolderList.length > 0 && <a style={{ color: 'red' }} onClick={() => setCheckedFolderList([])}>清除所有</a>}
+                                    {sortData?.sortField && <Text>「排序-{showField1List.find(item => item.value === sortData.sortField)?.label}-{sortData.sortType ? '正序' : '倒序'}」</Text>}
+                                    {/* 同步素材 */}
+                                    <SyncCloudSc
+                                        accountId={unitAccountId}
+                                    />
+                                </div>
+                                <div className={style.left_bts}>
+                                    <Popover
+                                        content={<div style={{ width: 320 }}>
+                                            <Form
+                                                labelCol={{ span: 5 }}
+                                                labelAlign="left"
+                                                colon={false}
+                                            >
+                                                <Form.Item label={<strong>展示指标</strong>}>
+                                                    <Select
+                                                        placeholder="选择展示指标"
+                                                        showSearch
+                                                        filterOption={(input, option) =>
+                                                            (option?.label as any)?.toLowerCase().indexOf(input.toLowerCase()) >= 0
+                                                        }
+                                                        mode="multiple"
+                                                        options={showField1List}
+                                                        value={showField}
+                                                        onChange={(value) => {
+                                                            if (value.length > 6) {
+                                                                message.warn('最多只能选择6个指标')
+                                                                return
+                                                            }
+                                                            if (value.length < 1) {
+                                                                message.warn('最少选择1个指标')
+                                                                return
+                                                            }
+                                                            setSortData({ ...sortData, sortField: undefined })
+                                                            setShowField(value as any)
+                                                        }}
+                                                    />
+                                                </Form.Item>
+                                                <Form.Item label={<strong>排序</strong>}>
+                                                    <Space>
+                                                        <Select
+                                                            style={{ width: 125 }}
+                                                            placeholder="选择排序指标"
+                                                            showSearch
+                                                            filterOption={(input, option) =>
+                                                                (option?.label as any)?.toLowerCase().indexOf(input.toLowerCase()) >= 0
+                                                            }
+                                                            options={showField1List.filter(item => showField.includes(item.value) && item.value !== 'description')}
+                                                            value={sortData.sortField}
+                                                            allowClear
+                                                            onChange={(value) => {
+                                                                setSortData({ ...sortData, sortField: value as any })
+                                                            }}
+                                                        />
+                                                        <Radio.Group value={sortData.sortType} onChange={(e) => setSortData({ ...sortData, sortType: e.target.value })} buttonStyle="solid">
+                                                            <Radio.Button value={true}>正序</Radio.Button>
+                                                            <Radio.Button value={false}>倒序</Radio.Button>
+                                                        </Radio.Group>
+                                                    </Space>
+                                                </Form.Item>
+                                            </Form>
+                                        </div>}
+                                        trigger={['click']}
+                                        title={<strong>自定义展示指标与排序</strong>}
+                                        placement="bottomRight"
+                                    >
+                                        <Button icon={<SortAscendingOutlined />}>自定义展示指标与排序</Button>
+                                    </Popover>
+                                </div>
+                            </div>
+                            <div className={`${style.content} content_global`}>
+                                <Spin spinning={getPageRemoteImageDataList.loading}>
+                                    <div className={`${style.content_scroll} scroll`}>
+                                        {getPageRemoteImageDataList?.data?.records?.length > 0 ? <Checkbox.Group value={checkedFolderList?.filter((_, index) => (active || active === 0) ? index === active : true)?.map(item => item.id)} style={{ width: '100%' }}>
+                                            <div className={style.content_scroll_div}>
+                                                {getPageRemoteImageDataList?.data?.records.map((item: any) => {
+                                                    let id = defaultParams.materialType === 'image' ? item.image_id : item.video_id
+                                                    const isSelect = checkedFolderList?.filter((_, index) => (active || active === 0) ? index === active : true)?.map(item => item.id).includes(id)
+                                                    const disabled = (active || active === 0) ? false : (checkedFolderList.length >= num && !isSelect)
+                                                    return <div key={id} className={style.content_row} style={{ width: rowNum ? (1 / rowNum * 100) + '%' : 220 }}>
+                                                        <Card
+                                                            hoverable
+                                                            bodyStyle={{ padding: 0 }}
+                                                            style={{ cursor: disabled ? 'not-allowed' : 'pointer' }}
+                                                            className={`${style.content_col}`}
+                                                            cover={<div style={{ height: 120, padding: 0 }} className={style.content_cover}>
+                                                                <div className={style.checkbox}><Checkbox disabled={disabled} value={id} onChange={(e) => onCheckboxChange(e.target.checked, item)} /></div>
+                                                                {defaultParams.materialType === 'video' ? <div className={style.playr}>
+                                                                    <PlayVideo videoUrl={item.preview_url}>{(onPlay) => <img onClick={(e) => {
+                                                                        e.stopPropagation(); e.preventDefault()
+                                                                        onPlay()
+                                                                    }} src={require('../../../../../public/image/play.png')} alt="" />}</PlayVideo>
+                                                                </div> : <div className={style.imgPreview} onClick={(e) => {
+                                                                    e.stopPropagation()
+                                                                    setPreviewData({ visible: true, url: item.preview_url })
+                                                                }}>
+                                                                    <Space><EyeOutlined /><span>预览</span></Space>
+                                                                </div>}
+                                                                <div className={style.file_info}>
+                                                                    <div>{item.width}*{item.height}</div>
+                                                                    {defaultParams.materialType === 'video' && item.image_duration_millisecond && <div>{formatSecondsToTime(Math.floor(item.image_duration_millisecond / 1000))}</div>}
+                                                                </div>
+                                                                <Lazyimg
+                                                                    animateType="transition"
+                                                                    src={defaultParams.materialType === 'image' ? item.preview_url : item?.key_frame_image_url}
+                                                                    className={`${style.coverImg} lazy`}
+                                                                    animateClassName={['transition-enter', 'transition-enter-active']}
+                                                                />
+                                                            </div>}
+                                                            onClick={() => !disabled && onCheckboxChange(!isSelect, item)}
+                                                        >
+                                                            <div className={style.body}>
+                                                                <Text ellipsis strong style={{ flex: '1 0' }}>{item?.material_name}</Text>
+                                                                <Text style={{ fontSize: 12 }}>{formatBytes(item?.file_size)}</Text>
+                                                            </div>
+                                                            <Divider style={{ margin: '0 0 4px 0' }} />
+                                                            <div style={{ padding: '0 10px 6px' }}>
+                                                                {showField.map(field => {
+                                                                    switch (field) {
+                                                                        case 'material.created_time':
+                                                                            return <Paragraph key={field} style={{ fontSize: 12, marginBottom: 1 }}>创建时间:{item?.created_time}</Paragraph>
+                                                                        case 'material_data_day.cost':
+                                                                            return <Paragraph key={field} style={{ fontSize: 12, marginBottom: 1 }}>消耗:{(item?.cost === null || item?.cost === undefined) ? '--' : item?.cost}</Paragraph>
+                                                                        case 'material_data_day.order_pv':
+                                                                            return <Paragraph key={field} style={{ fontSize: 12, marginBottom: 1 }}>下单次数:{(item?.order_pv === null || item?.order_pv === undefined) ? '--' : item?.order_pv}</Paragraph>
+                                                                        case 'material_data_day.order_cost':
+                                                                            return <Paragraph key={field} style={{ fontSize: 12, marginBottom: 1 }}>下单成本:{(item?.order_cost === null || item?.order_cost === undefined) ? '--' : item?.order_cost}</Paragraph>
+                                                                        case 'material_data_day.ctr':
+                                                                            return <Paragraph key={field} style={{ fontSize: 12, marginBottom: 1 }}>点击率:{(item?.ctr === null || item?.ctr === undefined) ? '--' : (item?.ctr * 100).toFixed(2) + '%'}</Paragraph>
+                                                                        case 'material_data_day.conversions_rate':
+                                                                            return <Paragraph key={field} style={{ fontSize: 12, marginBottom: 1 }}>目标转化率:{(item?.conversions_rate === null || item?.conversions_rate === undefined) ? '--' : (item?.conversions_rate * 100).toFixed(2) + '%'}</Paragraph>
+                                                                        case 'material_data_day.adgroup_count':
+                                                                            return <Paragraph key={field} style={{ fontSize: 12, marginBottom: 1 }}>广告关联数:{(item?.adgroup_count === null || item?.adgroup_count === undefined) ? '--' : item?.adgroup_count}</Paragraph>
+                                                                        case 'material_data_day.dynamic_creative_count':
+                                                                            return <Paragraph key={field} style={{ fontSize: 12, marginBottom: 1 }}>创意关联数:{(item?.dynamic_creative_count === null || item?.dynamic_creative_count === undefined) ? '--' : item?.dynamic_creative_count}</Paragraph>
+                                                                        default:
+                                                                            return null
+                                                                    }
+                                                                })}
+                                                                {showField.includes('description') && <Paragraph style={{ fontSize: 12, marginBottom: 1 }} ellipsis={{ tooltip: true }}>备注:{item.description || '--'}</Paragraph>}
+                                                            </div>
+                                                        </Card>
+                                                    </div>
+                                                })}
+                                            </div>
+                                        </Checkbox.Group> : <div style={{ height: '100%', width: '100%', alignContent: 'center' }}><Empty image={Empty.PRESENTED_IMAGE_SIMPLE} /></div>}
+                                    </div>
+                                </Spin>
+                            </div>
+                            <div className={style.fotter}>
+                                <Pagination
+                                    size="small"
+                                    total={getPageRemoteImageDataList?.data?.total || 0}
+                                    showSizeChanger
+                                    showQuickJumper
+                                    pageSize={getPageRemoteImageDataList?.data?.size || 20}
+                                    current={getPageRemoteImageDataList?.data?.current || 1}
+                                    onChange={(page: number, pageSize: number) => {
+                                        setQueryParams({ ...queryParams, pageNum: page, pageSize })
+                                    }}
+                                    pageSizeOptions={[10, 15, 20, 50, 100]}
+                                />
+                            </div>
+                        </div>
+                    </div>
+                </Card>
+            </> : checkAccountUnit?.data ? <div style={{ display: 'flex', justifyContent: 'center', alignItems: 'center', height: '100%' }}>
+                <Result
+                    title="警告"
+                    status="500"
+                    subTitle="选择的账户不在一个业务单元中或者没有加入业务单元"
+                />
+            </div> : undefined}
+        </div>
+
+        {/* 预览 */}
+        {previewData.visible && <Image
+            width={200}
+            style={{ display: 'none' }}
+            preview={{
+                visible: previewData.visible,
+                src: previewData.url,
+                onVisibleChange: value => {
+                    setPreviewData({ visible: false })
+                },
+            }}
+        />}
+    </Spin>
+}
+
+export default React.memo(SelectGroupUnitNew)

+ 0 - 1
src/pages/launchSystemV3/material/typings.d.ts

@@ -161,7 +161,6 @@ declare namespace CLOUDNEW {
         checkedFolderList: any[]
         setCheckedFolderList: React.Dispatch<React.SetStateAction<any[]>>
         active: number | undefined
-        setActive: React.Dispatch<React.SetStateAction<number | undefined>>
         accountCreateLogs?: PULLIN.AccountCreateLogsProps[]
         putInType?: 'NOVEL' | 'GAME'
     }

+ 16 - 1
src/pages/launchSystemV3/tencentAdPutIn/create/Ad/adgroupsPrice.tsx

@@ -193,7 +193,22 @@ const AdgroupsPrice: React.FC = () => {
                         </Space>
                     </Form.Item>}
                 </> : null}
-
+            {optimizationGoal === 'OPTIMIZATIONGOAL_24H_FIRSTPAY' && <Form.Item
+                style={{ marginBottom: 10 }}
+                label={<Space>
+                    <strong>一方数据跑量加强</strong>
+                    <Tooltip title={<div>
+                        <p>基于您规范回传的一方数据,系统将其作为补充样本针对性优化OCPX模型,并助力提升广告投放拿量能力</p>
+                    </div>}>
+                        <QuestionCircleFilled />
+                    </Tooltip>
+                </Space>}
+                name='ecomPkamSwitch'
+                valuePropName="checked"
+                help="注意账号需要开通权限"
+            >
+                <Switch checkedChildren="开启" unCheckedChildren="关闭" />
+            </Form.Item>}
             {((bidMode === 'BID_MODE_OCPM' || bidMode === 'BID_MODE_OCPC') && (putInType === 'GAME' ? bidScene !== 'BID_SCENE_NORMAL_MAX' : smartBidType !== 'SMART_BID_TYPE_SYSTEMATIC')) && <>
                 <Form.Item
                     style={{ marginBottom: 10 }}

+ 2 - 1
src/pages/launchSystemV3/tencentAdPutIn/create/Ad/index.tsx

@@ -23,7 +23,7 @@ const Ad: React.FC = () => {
     const { adgroups } = addelivery
     const {
         marketingGoal, marketingSubGoal, marketingAssetOuterSpec, marketingCarrierType, automaticSiteEnabled, explorationStrategy, siteSet, prioritySiteSet, searchExpandTargetingSwitch, bidMode, smartBidType, bidScene, bidAmount, optimizationGoal, isConversion, depthConversionEnabled,
-        deepConversionSpec, autoAcquisitionEnabled, autoAcquisitionBudget, dailyBudget, endDate, beginDate, timeSeries, firstDayBeginTime, configuredStatus, adgroupName, sceneSpec, autoDerivedCreativeEnabled, sysWechatAppId, wxGameAppId, promoteApplicationId, rtaId, rtaTargetId, bidAllocationMode,
+        deepConversionSpec, ecomPkamSwitch, autoAcquisitionEnabled, autoAcquisitionBudget, dailyBudget, endDate, beginDate, timeSeries, firstDayBeginTime, configuredStatus, adgroupName, sceneSpec, autoDerivedCreativeEnabled, sysWechatAppId, wxGameAppId, promoteApplicationId, rtaId, rtaTargetId, bidAllocationMode,
         bidAmountMin, bidAmountMax
     } = adgroups
     const [newVisible, setNewVisible] = useState<boolean>(false)
@@ -93,6 +93,7 @@ const Ad: React.FC = () => {
                                 }
                             </>}
                         </>}
+                        <p>一方人群跑量加强:{ecomPkamSwitch === 'ECOM_PKAM_SWITCH_OPEN' ? '开启' : '关闭'}</p>
                         <p>一键起量:{autoAcquisitionEnabled ? '开启' : '关闭'}</p>
                         {autoAcquisitionEnabled && <p>起量预算:{autoAcquisitionBudget}元/天</p>}
                         <p>广告日预算:{dailyBudget ? dailyBudget + '元/天' : '不限'}</p>

+ 10 - 0
src/pages/launchSystemV3/tencentAdPutIn/create/Ad/newCreateAd.tsx

@@ -51,6 +51,7 @@ const NewCreateAd: React.FC<Props> = ({ accountIdList, value, visible, onChange,
             timeSeriesType,          // 选择时段类型
             timeSeries,              // 时段
             isSetfirstDayBeginTime,  // 首日开始时间是否开启
+            ecomPkamSwitch,
             ...surplusValues
         } = values
         console.log(values)
@@ -66,6 +67,10 @@ const NewCreateAd: React.FC<Props> = ({ accountIdList, value, visible, onChange,
             }
         }
 
+        if (ecomPkamSwitch) {
+            adgroupsValues.ecomPkamSwitch = 'ECOM_PKAM_SWITCH_OPEN'
+        }
+
         // 投放时段处理
         if (timeSeriesType === '0') {
             adgroupsValues.timeSeries = Array(336).fill(1).join('');
@@ -92,6 +97,7 @@ const NewCreateAd: React.FC<Props> = ({ accountIdList, value, visible, onChange,
                 sceneSpec,
                 marketingAssetOuterSpec,
                 autoDerivedCreativeEnabled,
+                ecomPkamSwitch,
                 ...surplusValues
             } = JSON.parse(JSON.stringify(value))
             let adgroupsValues: any = {
@@ -101,6 +107,10 @@ const NewCreateAd: React.FC<Props> = ({ accountIdList, value, visible, onChange,
                 autoDerivedCreativeEnabled: autoDerivedCreativeEnabled ? true : false
             }
 
+            if (ecomPkamSwitch === 'ECOM_PKAM_SWITCH_OPEN') {
+                adgroupsValues.ecomPkamSwitch = true
+            }
+
             // 首日开始时间
             if (firstDayBeginTime) {
                 adgroupsValues.firstDayBeginTime = firstDayBeginTime

+ 17 - 17
src/pages/launchSystemV3/tencentAdPutIn/create/Material/addMaterial.tsx

@@ -624,9 +624,9 @@ const AddMaterial: React.FC<Props> = ({ creativeTemplateId, materialData, delive
             visible={selectVideoVisible}
             isGroup={materialConfig?.isGroup}
             sliderImgContent={materialConfig.index === 99999 ? undefined :
-                materialConfig.type === 'element_story' ? (dynamicGroup[materialConfig.index] && Object.keys(dynamicGroup[materialConfig.index])?.includes('element_story')) ? dynamicGroup[materialConfig.index]['element_story']?.map((item: any) => ({ oss_url: item.url, id: item.id, materialType: item?.materialType, material_type: selectCloudData.defaultParams.materialType, owner_account_id: item?.accountId })) : undefined :
-                    materialConfig.type === 'image_list' ? (dynamicGroup[materialConfig.index] && Object.keys(dynamicGroup[materialConfig.index])?.includes('image_list')) ? dynamicGroup[materialConfig.index]['image_list']?.map((item: any) => ({ oss_url: item.url, id: item.id, materialType: item?.materialType, material_type: selectCloudData.defaultParams.materialType, owner_account_id: item?.accountId })) : undefined :
-                        (dynamicGroup[materialConfig.index] && Object.keys(dynamicGroup[materialConfig.index])?.includes(materialConfig.type)) ? [{ oss_url: dynamicGroup[materialConfig.index][materialConfig.type]['url'], id: dynamicGroup[materialConfig.index][materialConfig.type]['id'], material_type: selectCloudData.defaultParams.materialType, materialType: dynamicGroup[materialConfig.index][materialConfig.type]?.['materialType'], key_frame_image_url: dynamicGroup[materialConfig.index][materialConfig.type]?.['keyFrameImageUrl'], owner_account_id: dynamicGroup[materialConfig.index][materialConfig.type]?.['accountId'] }] : undefined
+                materialConfig.type === 'element_story' ? (dynamicGroup[materialConfig.index] && Object.keys(dynamicGroup[materialConfig.index])?.includes('element_story')) ? dynamicGroup[materialConfig.index]['element_story']?.map((item: any) => ({ oss_url: item.url, id: item.id, materialType: item?.materialType, material_type: selectCloudData.defaultParams.materialType, owner_account_id: item?.accountId, isUnit: item?.isUnit })) : undefined :
+                    materialConfig.type === 'image_list' ? (dynamicGroup[materialConfig.index] && Object.keys(dynamicGroup[materialConfig.index])?.includes('image_list')) ? dynamicGroup[materialConfig.index]['image_list']?.map((item: any) => ({ oss_url: item.url, id: item.id, materialType: item?.materialType, material_type: selectCloudData.defaultParams.materialType, owner_account_id: item?.accountId, isUnit: item?.isUnit })) : undefined :
+                        (dynamicGroup[materialConfig.index] && Object.keys(dynamicGroup[materialConfig.index])?.includes(materialConfig.type)) ? [{ oss_url: dynamicGroup[materialConfig.index][materialConfig.type]['url'], id: dynamicGroup[materialConfig.index][materialConfig.type]['id'], material_type: selectCloudData.defaultParams.materialType, materialType: dynamicGroup[materialConfig.index][materialConfig.type]?.['materialType'], key_frame_image_url: dynamicGroup[materialConfig.index][materialConfig.type]?.['keyFrameImageUrl'], owner_account_id: dynamicGroup[materialConfig.index][materialConfig.type]?.['accountId'], isUnit: dynamicGroup[materialConfig.index][materialConfig.type]?.['isUnit'] }] : undefined
             }
             onClose={() => {
                 setSelectVideoVisible(false)
@@ -642,9 +642,9 @@ const AddMaterial: React.FC<Props> = ({ creativeTemplateId, materialData, delive
                             } else {
                                 const aContent = content.map((m: any) => {
                                     if (selectCloudData?.defaultParams?.materialType === 'video' && m?.materialType === 1) {
-                                        return { id: m?.id, url: m?.oss_url, materialType: m?.materialType || 0, keyFrameImageUrl: m?.key_frame_image_url, accountId: m?.owner_account_id }
+                                        return { id: m?.id, url: m?.oss_url, materialType: m?.materialType || 0, isUnit: m?.isUnit || false, keyFrameImageUrl: m?.key_frame_image_url, accountId: m?.owner_account_id }
                                     }
-                                    return { id: m?.id, url: m?.oss_url, materialType: m?.materialType || 0, accountId: m?.owner_account_id }
+                                    return { id: m?.id, url: m?.oss_url, materialType: m?.materialType || 0, isUnit: m?.isUnit || false, accountId: m?.owner_account_id }
                                 })
                                 let newDynamicGroup = dynamicGroup?.map((item: any) => {
                                     let oldList = item?.list || []
@@ -671,17 +671,17 @@ const AddMaterial: React.FC<Props> = ({ creativeTemplateId, materialData, delive
                                     if (materialConfig.isGroup) {
                                         oldList = oldList.concat([content.map((m: any) => {
                                             if (selectCloudData?.defaultParams?.materialType === 'video' && m?.materialType === 1) {
-                                                return { id: m?.id, url: m?.oss_url, materialType: m?.materialType || 0, keyFrameImageUrl: m?.key_frame_image_url, accountId: m?.owner_account_id }
+                                                return { id: m?.id, url: m?.oss_url, materialType: m?.materialType || 0, isUnit: m?.isUnit || false, keyFrameImageUrl: m?.key_frame_image_url, accountId: m?.owner_account_id }
                                             }
-                                            return { id: m?.id, url: m?.oss_url, materialType: m?.materialType || 0, accountId: m?.owner_account_id }
+                                            return { id: m?.id, url: m?.oss_url, materialType: m?.materialType || 0, isUnit: m?.isUnit || false, accountId: m?.owner_account_id }
                                         })])
                                         return { list: oldList }
                                     } else {
                                         oldList = oldList.concat(content.map((m: any) => {
                                             if (selectCloudData?.defaultParams?.materialType === 'video' && m?.materialType === 1) {
-                                                return { id: m?.id, url: m?.oss_url, materialType: m?.materialType || 0, keyFrameImageUrl: m?.key_frame_image_url, accountId: m?.owner_account_id }
+                                                return { id: m?.id, url: m?.oss_url, materialType: m?.materialType || 0, isUnit: m?.isUnit || false, keyFrameImageUrl: m?.key_frame_image_url, accountId: m?.owner_account_id }
                                             }
-                                            return { id: m?.id, url: m?.oss_url, materialType: m?.materialType || 0, accountId: m?.owner_account_id }
+                                            return { id: m?.id, url: m?.oss_url, materialType: m?.materialType || 0, isUnit: m?.isUnit || false, accountId: m?.owner_account_id }
                                         }))
                                         return { list: oldList }
                                     }
@@ -693,7 +693,7 @@ const AddMaterial: React.FC<Props> = ({ creativeTemplateId, materialData, delive
                     } else { // 自定义创意
                         if (materialConfig.index === 99999) {
                             if (materialConfig.type === 'image_list' || materialConfig.type === 'element_story') {
-                                let urls = content?.map((item: any) => ({ id: item?.id, url: item?.oss_url, materialType: item?.materialType || 0, accountId: item?.owner_account_id }))
+                                let urls = content?.map((item: any) => ({ id: item?.id, url: item?.oss_url, materialType: item?.materialType || 0, isUnit: item?.isUnit || false, accountId: item?.owner_account_id }))
                                 let max = materialConfig.max
                                 let materialsNew = dynamicGroup.map((item: any) => {
                                     let newItem = item || {}
@@ -741,9 +741,9 @@ const AddMaterial: React.FC<Props> = ({ creativeTemplateId, materialData, delive
                             } else {
                                 let newMaterials = content?.map((item: any) => {
                                     if (["short_video1", 'video_id'].includes(materialConfig.type) && mLength === 2) {
-                                        return { [materialConfig.type]: { url: item?.oss_url, keyFrameImageUrl: item.key_frame_image_url, id: item?.id, materialType: item?.materialType || 0, accountId: item?.owner_account_id }, cover_id: { url: item?.materialType === 1 ? item?.key_frame_image_url : getVideoImgUrl(item?.oss_url), id: null, materialType: item?.materialType || 0, accountId: item?.owner_account_id } }
+                                        return { [materialConfig.type]: { url: item?.oss_url, keyFrameImageUrl: item.key_frame_image_url, id: item?.id, materialType: item?.materialType || 0, isUnit: item?.isUnit || false, accountId: item?.owner_account_id }, cover_id: { url: item?.materialType === 1 ? item?.key_frame_image_url : getVideoImgUrl(item?.oss_url), id: null, materialType: item?.materialType || 0, isUnit: item?.isUnit || false, accountId: item?.owner_account_id } }
                                     }
-                                    return { [materialConfig.type]: { url: item?.oss_url, id: item?.id, materialType: item?.materialType || 0, accountId: item?.owner_account_id } }
+                                    return { [materialConfig.type]: { url: item?.oss_url, id: item?.id, materialType: item?.materialType || 0, isUnit: item?.isUnit || false, accountId: item?.owner_account_id } }
                                 })
                                 if (newMaterials.length > 0) {
                                     if (dynamicGroup?.every((item: any) => !item)) { // 没设置过
@@ -774,14 +774,14 @@ const AddMaterial: React.FC<Props> = ({ creativeTemplateId, materialData, delive
                                 if (materialConfig.index === index) {
                                     if (materialConfig.type === 'image_list' || materialConfig.type === 'element_story') {
                                         if (item) {
-                                            item[materialConfig.type] = content?.map((item: any) => ({ id: item?.id, url: item?.oss_url, materialType: item?.materialType || 0, accountId: item?.owner_account_id }))
+                                            item[materialConfig.type] = content?.map((item: any) => ({ id: item?.id, url: item?.oss_url, materialType: item?.materialType || 0, isUnit: item?.isUnit || false, accountId: item?.owner_account_id }))
                                             return { ...item }
                                         } else {
-                                            return { [materialConfig.type]: content?.map((item: any) => ({ id: item?.id, url: item?.oss_url, materialType: item?.materialType || 0, accountId: item?.owner_account_id })) }
+                                            return { [materialConfig.type]: content?.map((item: any) => ({ id: item?.id, url: item?.oss_url, materialType: item?.materialType || 0, isUnit: item?.isUnit || false, accountId: item?.owner_account_id })) }
                                         }
                                     } else {
                                         if (item) {
-                                            let d: any = { id: content[0]?.id, url: content[0]?.oss_url, materialType: content[0]?.materialType || 0, accountId: content[0]?.owner_account_id }
+                                            let d: any = { id: content[0]?.id, url: content[0]?.oss_url, materialType: content[0]?.materialType || 0, isUnit: content[0]?.isUnit || false, accountId: content[0]?.owner_account_id }
                                             if (["short_video1", 'video_id'].includes(materialConfig.type) && content[0]?.materialType === 1) {
                                                 d.keyFrameImageUrl = content[0]?.key_frame_image_url
                                             }
@@ -789,9 +789,9 @@ const AddMaterial: React.FC<Props> = ({ creativeTemplateId, materialData, delive
                                             return { ...item }
                                         } else {
                                             if (["short_video1", 'video_id'].includes(materialConfig.type) && mLength === 2) {
-                                                return { [materialConfig.type]: { id: content[0]?.id, url: content[0]?.oss_url, keyFrameImageUrl: content[0]?.key_frame_image_url, materialType: content[0]?.materialType || 0, accountId: content[0]?.owner_account_id }, cover_id: { id: null, url: content[0]?.materialType === 1 ? content[0]?.key_frame_image_url : getVideoImgUrl(content[0]?.oss_url), materialType: content[0]?.materialType || 0, accountId: content[0]?.owner_account_id } }
+                                                return { [materialConfig.type]: { id: content[0]?.id, url: content[0]?.oss_url, keyFrameImageUrl: content[0]?.key_frame_image_url, materialType: content[0]?.materialType || 0, isUnit: content[0]?.isUnit || false, accountId: content[0]?.owner_account_id }, cover_id: { id: null, url: content[0]?.materialType === 1 ? content[0]?.key_frame_image_url : getVideoImgUrl(content[0]?.oss_url), materialType: content[0]?.materialType || 0, isUnit: content[0]?.isUnit || false, accountId: content[0]?.owner_account_id } }
                                             }
-                                            return { [materialConfig.type]: { id: content[0]?.id, url: content[0]?.oss_url, materialType: content[0]?.materialType || 0, accountId: content[0]?.owner_account_id } }
+                                            return { [materialConfig.type]: { id: content[0]?.id, url: content[0]?.oss_url, materialType: content[0]?.materialType || 0, isUnit: content[0]?.isUnit || false, accountId: content[0]?.owner_account_id } }
                                         }
                                     }
                                 }

+ 80 - 35
src/pages/launchSystemV3/tencentAdPutIn/create/SelectAccount/index.tsx

@@ -6,7 +6,7 @@ import { CloseCircleFilled } from "@ant-design/icons";
 import { getGroupListApi } from "@/services/launchAdq/subgroup";
 import { useAjax } from "@/Hook/useAjax";
 import { getAccountAssetsGroupListAllApi } from "@/services/adqV3/global";
-import { getUserAccountListApi } from "@/services/launchAdq/adAuthorize";
+import { checkAccountUnitApi, getUserAccountListApi } from "@/services/launchAdq/adAuthorize";
 import { arraysHaveSameValues, groupBy } from "@/utils/utils";
 import { DELIVERY_MODE_ENUM } from "../../const";
 import '../../index.less'
@@ -33,13 +33,14 @@ const SelectAccount: React.FC<Props> = ({ putInType, accountCreateLogs, setAccou
     const [form] = Form.useForm()
     const [visible, setVisible] = useState<boolean>(false)
     const [selectedRows, setSelectedRows] = useState<any[]>([])
-    const [tipsVisible, setTipsVisible] = useState<boolean>(false)
+    const [tips, setTips] = useState<number>()
     const [loading, setLoading] = useState<boolean>(false)
     const [queryForm, setQueryForm] = useState<{ accountIdList?: number[], adUnitTypeList?: string[], groupId?: number, remark?: string, sysGroupId?: number, pageNum: number, pageSize: number }>({ pageNum: 1, pageSize: 50 })
 
     const getGroupList = useAjax(() => getGroupListApi())
     const getAccountAssetsGroupListAll = useAjax((params) => getAccountAssetsGroupListAllApi(params))
     const getUserAccountList = useAjax((params) => getUserAccountListApi(params))
+    const checkAccountUnit = useAjax((params) => checkAccountUnitApi(params))
     /***********************************/
 
     const onFinish = (data: any) => {
@@ -128,7 +129,7 @@ const SelectAccount: React.FC<Props> = ({ putInType, accountCreateLogs, setAccou
         onChange?.(selectedRows, isClear)
         setSelectedRows([])
         setVisible(false)
-        setTipsVisible(false)
+        setTips(undefined)
     }
 
     const handleCancel = () => {
@@ -328,6 +329,16 @@ const SelectAccount: React.FC<Props> = ({ putInType, accountCreateLogs, setAccou
                                     return <span style={{ fontSize: 12 }}>{value}</span>
                                 }
                             },
+                            {
+                                title: '业务单元ID',
+                                dataIndex: 'adUnitAccountId',
+                                key: 'adUnitAccountId',
+                                width: 90,
+                                align: 'center',
+                                render(value) {
+                                    return <span style={{ fontSize: 12 }}>{value || '--'}</span>
+                                }
+                            },
                             {
                                 title: '备注',
                                 dataIndex: 'remark',
@@ -380,27 +391,39 @@ const SelectAccount: React.FC<Props> = ({ putInType, accountCreateLogs, setAccou
                     <Button
                         className={style.resetCss}
                         type="primary"
-                        loading={loading}
+                        loading={loading || checkAccountUnit.loading}
                         style={{ marginLeft: 8 }}
-                        onClick={() => {
+                        onClick={async () => {
                             if (accountCreateLogs?.length && arraysHaveSameValues(accountCreateLogs.map(item => item.accountId), selectedRows.map(item => item.accountId))) {
                                 handleCancel()
                                 return
                             }
                             let authMainAccountId: any
+                            // 业务单元素材id
+                            let unitAccountId: any
                             let isY = false
-                            // 1.判断是否有账户组素材 有的话 获取账户组ID
+                            // 1.判断是否有账户组素材 有的话 获取账户组ID // 判断是否是一组业务单元 checkAccountUnitApi
                             if (dynamicGroup && dynamicGroup?.length > 0) {
                                 if (deliveryMode && mType) {
                                     if (dynamicGroup.some((item: any) => {
                                         if (deliveryMode === 'DELIVERY_MODE_CUSTOMIZE') {
                                             if (['short_video', 'video'].includes(mType) && (item?.video_id?.materialType || item?.short_video1?.materialType) === 1) {
-                                                authMainAccountId = item?.video_id?.accountId || item?.short_video1?.accountId
-                                                return true
+                                                if (item?.video_id?.isUnit || item?.short_video1?.isUnit) {
+                                                    unitAccountId = item?.video_id?.accountId || item?.short_video1?.accountId
+                                                    return false
+                                                } else {
+                                                    authMainAccountId = item?.video_id?.accountId || item?.short_video1?.accountId
+                                                    return true
+                                                }
                                             } else if (['image_list'].includes(mType) && item?.image_list?.some((list: any) => {
                                                 if (list?.materialType === 1) {
-                                                    authMainAccountId = list?.accountId
-                                                    return true
+                                                    if (item?.isUnit) {
+                                                        unitAccountId = list?.accountId
+                                                        return false
+                                                    } else {
+                                                        authMainAccountId = list?.accountId
+                                                        return true
+                                                    }
                                                 } else {
                                                     return false
                                                 }
@@ -408,16 +431,26 @@ const SelectAccount: React.FC<Props> = ({ putInType, accountCreateLogs, setAccou
                                                 return true
                                             } else if (['element_story'].includes(mType) && item?.element_story?.some((list: any) => {
                                                 if (list?.materialType === 1) {
-                                                    authMainAccountId = list?.accountId
-                                                    return true
+                                                    if (item?.isUnit) {
+                                                        unitAccountId = list?.accountId
+                                                        return false
+                                                    } else {
+                                                        authMainAccountId = list?.accountId
+                                                        return true
+                                                    }
                                                 } else {
                                                     return false
                                                 }
                                             })) {
                                                 return true
                                             } else if (['image'].includes(mType) && item?.image_id?.materialType === 1) {
-                                                authMainAccountId = item?.image_id?.accountId
-                                                return true
+                                                if (item?.image_id?.isUnit) {
+                                                    unitAccountId = item?.image_id?.accountId
+                                                    return false
+                                                } else {
+                                                    authMainAccountId = item?.image_id?.accountId
+                                                    return true
+                                                }
                                             } else {
                                                 return false
                                             }
@@ -425,16 +458,26 @@ const SelectAccount: React.FC<Props> = ({ putInType, accountCreateLogs, setAccou
                                             if (item?.list?.some((list: any) => {
                                                 if (Array.isArray(list) && list.some((l: any) => {
                                                     if (l.materialType === 1) {
-                                                        authMainAccountId = l?.accountId
-                                                        return true
+                                                        if (l?.isUnit) {
+                                                            unitAccountId = l?.accountId
+                                                            return false
+                                                        } else {
+                                                            authMainAccountId = l?.accountId
+                                                            return true
+                                                        }
                                                     } else {
                                                         return false
                                                     }
                                                 })) {
                                                     return true
                                                 } else if (list.materialType === 1) {
-                                                    authMainAccountId = list?.accountId
-                                                    return true
+                                                    if (list?.isUnit) {
+                                                        unitAccountId = list?.accountId
+                                                        return false
+                                                    } else {
+                                                        authMainAccountId = list?.accountId
+                                                        return true
+                                                    }
                                                 } else {
                                                     return false
                                                 }
@@ -452,37 +495,39 @@ const SelectAccount: React.FC<Props> = ({ putInType, accountCreateLogs, setAccou
                                 }
                             }
                             if (isY && authMainAccountId) {
-                                // 2.有的话判断 判断账户是否为一组
-                                getauthMainAccountData(selectedRows).then(authMainData => {
-                                    console.log('authMainData---->', authMainData)
-                                    if (authMainData.isSelectRemote && authMainData.authMainAccountId === authMainAccountId) {
-                                        handleOk(false)
-                                    } else {
-                                        setTipsVisible(true)
-                                    }
-                                })
-
-                                // 3.是的话 判断是以前那组吗
-                            } else {
-                                handleOk(false)
+                                const authMainData = await getauthMainAccountData(selectedRows)
+                                if (!(authMainData.isSelectRemote && authMainData.authMainAccountId === authMainAccountId)) {
+                                    setTips(1)
+                                    return
+                                }
+                            }
+                            if (unitAccountId) {
+                                const unitData = await checkAccountUnit.run(selectedRows.map(item => item.accountId))
+                                // 业务单元匹配不上
+                                if (!unitData?.result || unitData?.adUnitAccountId !== unitAccountId) {
+                                    setTips(2)
+                                    return
+                                }
                             }
+                            handleOk(false)
+                            return
                         }}
                     >确定</Button>
                 </div>
             </div>}
         </div>
         {visible && <div className={style.selectAccount_mask}></div>}
-        {tipsVisible && <Modal
+        {tips && <Modal
             title={<strong>提示</strong>}
-            open={tipsVisible}
+            open={!!tips}
             onCancel={() => {
-                setTipsVisible(false)
+                setTips(undefined)
             }}
             onOk={() => handleOk(true)}
             className="modalResetCss"
             okText="清空"
             cancelText="留下来修改账户"
-        >选择的素材有账户组素材,但是与当前账户不匹配,是否使用当前账号清空素材?</Modal>}
+        >{tips === 1 ? `选择的素材有账户组素材,但是与当前账户不匹配,是否使用当前账号清空素材?` : `选择的素材有业务单元素材,但是与当前账户不匹配,是否使用当前账号清空素材?`}</Modal>}
     </div>
 }
 

+ 1 - 0
src/pages/launchSystemV3/tencentAdPutIn/create/index.tsx

@@ -917,6 +917,7 @@ const Create: React.FC = () => {
     const clearData = () => {
         setTableData({})
     }
+    console.log('process.env.NODE_ENV-->', process.env)
 
     return <Space direction="vertical" style={{ width: '100%' }}>
         <Spin spinning={createAdgroupTask.loading || getSelectTaskDetail.loading || getCreativeDetails.loading}>

+ 12 - 0
src/services/launchAdq/adAuthorize.ts

@@ -80,4 +80,16 @@ export async function putAdAccountApi(adAccountId: any,remark: any) {
     return request(api + `/adq/adAccount/modifyRemark/${adAccountId}/${encodeURIComponent(remark)}`, {
         method: 'PUT',
     });
+}
+
+/**
+ * 账号检查是否是同一个业务单元内账号
+ * @param data 
+ * @returns 
+ */
+export async function checkAccountUnitApi(data: number[]) {
+    return request(api + `/adq/admin/adAccount/checkAccountUnit`, {
+        method: 'POST',
+        data
+    });
 }