Bläddra i källkod

Merge branch 'develop' of http://git.zanxiangnet.com/wjx/ad-manage

wjx 3 veckor sedan
förälder
incheckning
c4f03dc09f

+ 2 - 2
src/pages/launchSystemV3/material/cloudNew/selectCloudComponent.tsx

@@ -13,7 +13,7 @@ import SelectGroupCloudNew from "./selectGroupCloudNew"
  * @param param0 
  * @returns 
  */
-const SelectCloudComponent: React.FC<CLOUDNEW.SelectCloudNewProps> = ({ visible, defaultParams, num, isGroup, onChange, onClose, accountCreateLogs, putInType }) => {
+const SelectCloudComponent: React.FC<CLOUDNEW.SelectCloudNewProps> = ({ visible, defaultParams, num, isGroup, onChange, onClose, accountCreateLogs, putInType, title }) => {
 
     /************************************/
     const [checkedFolderList, setCheckedFolderList] = useState<any[]>([])
@@ -30,7 +30,7 @@ const SelectCloudComponent: React.FC<CLOUDNEW.SelectCloudNewProps> = ({ visible,
     }
 
     return <Modal
-        title={<strong>素材库</strong>}
+        title={<strong>{title || '素材库'}</strong>}
         open={visible}
         onCancel={onClose}
         width={1400}

+ 4 - 1
src/pages/launchSystemV3/material/cloudNew/selectComponentsUnit.tsx

@@ -25,7 +25,7 @@ interface Props extends CLOUDNEW.SelectGroupCloudNewProps {
  * @param param0 
  * @returns 
  */
-const SelectComponentsUnit: React.FC<Props> = ({ num: count, defaultParams, checkedFolderList, setCheckedFolderList, accountCreateLogs, active, isGroup, componentCount }) => {
+const SelectComponentsUnit: React.FC<Props> = ({ num: count, defaultParams, checkedFolderList, setCheckedFolderList, accountCreateLogs, active, isGroup, componentCount, putInType }) => {
 
     /*****************************************/
     const num = (isGroup ? componentCount : count) || 1
@@ -171,11 +171,14 @@ const SelectComponentsUnit: React.FC<Props> = ({ num: count, defaultParams, chec
                 {/* 搜索 */}
                 <SelectComponentsUnitSearch
                     type={defaultParams.materialType}
+                    defaultParams={defaultParams}
+                    accountId={unitAccountId}
                     componentSubType={componentSubType}
                     onSearch={(value) => {
                         refScllor.current?.scrollTo(0, 0)
                         setSearchParams(value)
                     }}
+                    putInType={putInType}
                 />
                 <Card
                     style={{ height: '100%', flex: '1 0', overflow: 'hidden' }}

+ 84 - 19
src/pages/launchSystemV3/material/cloudNew/selectComponentsUnitSearch.tsx

@@ -1,21 +1,56 @@
 import { Button, Card, Col, DatePicker, Form, Input, Row, Select, Space } from "antd"
-import React from "react"
-import { SearchOutlined } from "@ant-design/icons";
+import React, { useState } from "react"
+import { PlusCircleOutlined, SearchOutlined } from "@ant-design/icons";
 import moment from "moment";
 import { COMMON_POTENTIAL_STATUS_ENUM, COMPONENT_GENERATION_TYPE_ENUM, DEFAULT_COMPONENT_SUB_IMAGE_TYPE, DEFAULT_COMPONENT_SUB_VIDEO_TYPE } from "../../tencenTasset/manageComponent/const";
 import { DefaultOptionType } from "antd/lib/select";
+import SelectCloudComponent from "./selectCloudComponent";
 
 interface Props {
     type: 'image' | 'video'
+    defaultParams: CLOUDNEW.DefaultParams
+    accountId: number,
     componentSubType?: string[]
     onSearch?: (value: Partial<CLOUDNEW.GetMaterialListProps>) => void
+    putInType?: 'NOVEL' | 'GAME'
 }
 
 // 选择素材搜索
-const SelectComponentsUnitSearch: React.FC<Props> = ({ type, onSearch, componentSubType }) => {
+const SelectComponentsUnitSearch: React.FC<Props> = ({ type, defaultParams, accountId, onSearch, componentSubType, putInType }) => {
 
     /**********************************/
     const [form] = Form.useForm();
+    // const idList = Form.useWatch('idList', form)
+    const [selectCloudData, setSelectCloudData] = useState<{
+        defaultParams: {
+            sizeQueries?: {
+                width: number,
+                height: number,
+                relation: string
+            }[],
+            materialType: 'image' | 'video'
+            fileSize: number
+        }
+        num: number
+    }>()
+    const [materialConfig, setMaterialConfig] = useState<{
+        adcreativeTemplateId?: number,
+        type: string,
+        cloudSize: { relation: string, width: number, height: number }[],
+        list: any[],
+        index: number,
+        max: number,
+        sliderImgContent: any,
+        isGroup?: boolean
+    }>({
+        type: '',//类型
+        cloudSize: [],//素材搜索条件
+        list: [],//素材
+        index: 0, // 素材组下标
+        max: 1,//素材数量
+        sliderImgContent: undefined
+    })//图片素材配置
+    const [selectVideoVisible, setSelectVideoVisible] = useState(false)
     /**********************************/
 
     const handleOk = (values: any) => {
@@ -54,7 +89,30 @@ const SelectComponentsUnitSearch: React.FC<Props> = ({ type, onSearch, component
         >
             <Row gutter={[0, 6]}>
                 <Col><Form.Item name={'idList'}>
-                    <Input.TextArea rows={1} style={{ width: 190 }} allowClear placeholder="素材ID(多个空格or换行隔开)" />
+                    <Input
+                        style={{ width: 220 }}
+                        allowClear
+                        placeholder="素材ID(多个空格or换行隔开)"
+                        addonAfter={<PlusCircleOutlined
+                            style={{ cursor: 'pointer' }}
+                            onClick={() => {
+                                setSelectCloudData({
+                                    num: 100,
+                                    defaultParams: defaultParams as any
+                                })
+                                setMaterialConfig({
+                                    ...materialConfig,
+                                    type: type,
+                                    max: 100,
+                                    index: 1,
+                                    isGroup: false
+                                })
+                                setTimeout(() => {
+                                    setSelectVideoVisible(true)
+                                }, 100)
+                            }}
+                        />}
+                    />
                 </Form.Item></Col>
                 <Col><Form.Item name={'componentIdSting'}>
                     <Input.TextArea rows={1} style={{ width: 190 }} allowClear placeholder="组件ID(多个空格or换行隔开)" />
@@ -73,21 +131,6 @@ const SelectComponentsUnitSearch: React.FC<Props> = ({ type, onSearch, component
                         options={(type === 'image' ? DEFAULT_COMPONENT_SUB_IMAGE_TYPE : DEFAULT_COMPONENT_SUB_VIDEO_TYPE).filter(item => componentSubType?.includes(item.value)) as DefaultOptionType[]}
                     />
                 </Form.Item></Col>
-                {/* <Col><Form.Item name={'isDeleted'}>
-                    <Select
-                        showSearch
-                        placeholder="已删除?"
-                        filterOption={(input, option) =>
-                            ((option?.label ?? '') as any).toLowerCase().includes(input.toLowerCase())
-                        }
-                        style={{ width: 120 }}
-                        allowClear
-                        options={[
-                            { label: '已删除', value: true },
-                            { label: '未删除', value: false }
-                        ]}
-                    />
-                </Form.Item></Col> */}
                 <Col><Form.Item name={'potentialStatus'}>
                     <Select
                         showSearch
@@ -125,6 +168,28 @@ const SelectComponentsUnitSearch: React.FC<Props> = ({ type, onSearch, component
                 </Form.Item></Col>
             </Row>
         </Form>
+
+        {/* 选择素材 */}
+        {(selectVideoVisible && selectCloudData) && <SelectCloudComponent
+            {...selectCloudData}
+            accountCreateLogs={[{ accountId: accountId }]}
+            visible={selectVideoVisible}
+            isGroup={materialConfig?.isGroup}
+            onClose={() => {
+                setSelectVideoVisible(false)
+                setSelectCloudData(undefined)
+            }}
+            putInType={putInType}
+            title="选择素材查找"
+            onChange={(content: any) => {
+                if (content?.length > 0) {
+                    const idList = content?.map((item: any) => item.id)?.toString()
+                    form.setFieldsValue({ idList })
+                }
+                setSelectVideoVisible(false)
+                setSelectCloudData(undefined)
+            }}
+        />}
     </Card>
 }
 

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

@@ -159,6 +159,7 @@ declare namespace CLOUDNEW {
         putInType?: 'NOVEL' | 'GAME'
         componentCount?: number
         deliveryMode?: string
+        title?: string
     }
     interface MediaListProps {
         defaultParams: DefaultParams

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

@@ -128,7 +128,6 @@ const AddMaterial: React.FC<Props> = ({ creativeTemplateId, materialData, delive
     }
 
     useEffect(() => {
-        console.log('value--->', value)
         if (value) {
             const { dynamicMaterialDTos, mediaType } = value
             form.setFieldsValue({ ...dynamicMaterialDTos, mediaType })
@@ -180,7 +179,6 @@ const AddMaterial: React.FC<Props> = ({ creativeTemplateId, materialData, delive
 
     // 获取组件化创意素材数量
     const getComponentCount = (list: any[]): string => {
-        console.log('list', list)
         let arrayImgCount = 0, imageCount = 0, videoCount = 0
         list?.forEach((item: any) => {
             if (item?.componentSubType?.includes('IMAGE_LIST')) {

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

@@ -17,7 +17,6 @@ export interface GetAdAccountParams {
     adUnitType?: string
 }
 export async function getAdAccountListApi(data: GetAdAccountParams) {
-    // return request(api + '/adq/adAccount/accountListOfNovel', {
     return request(api + '/adq/adAccount/accountListOfType', {
         method: 'POST',
         data