wjx hace 5 meses
padre
commit
15c1d8c145

+ 16 - 1
src/components/QueryForm/index.tsx

@@ -17,6 +17,8 @@ interface Props {
     isCpaBid?: boolean
     /** 是否开启 广告名称 搜索 */
     isPromotionName?: boolean
+    /** 是否开启 创意名称 搜索 */
+    isCreativeName?: boolean
     /** 是否开启 广告ID 搜索 */
     isPromotionId?: boolean
     /** 是否开启 创意ID 搜索 */
@@ -43,6 +45,8 @@ interface Props {
     day2?: RangePickerProps
     /** 是否开启 日期 搜索 */
     day3?: RangePickerProps
+    /** 是否开启 日期 搜索 */
+    day4?: RangePickerProps
 }
 /**
  * 游戏数据系统 请求参数
@@ -53,7 +57,7 @@ const QueryForm: React.FC<Props> = (props) => {
     /**************************/
     const { initialState } = useModel('@@initialState');
     const {
-        onChange, initialValues, isAccountId, isPromotionName, isPromotionId, isDynamicCreativeId, isCpaBid, isPutUserIdList, isPricing, isTTPricing, isStatus, isTTStatus, isDeleted, isRetainedType, day1, day2, day3
+        onChange, initialValues, isAccountId, isPromotionName, isCreativeName, isPromotionId, isDynamicCreativeId, isCpaBid, isPutUserIdList, isPricing, isTTPricing, isStatus, isTTStatus, isDeleted, isRetainedType, day1, day2, day3, day4
     } = props
     const [form] = Form.useForm()
     const [putUserList, setPutUserList] = useState<{ label: string, value: string }[]>([])
@@ -91,6 +95,11 @@ const QueryForm: React.FC<Props> = (props) => {
             {isPromotionName && <Col><Form.Item name='promotionName'>
                 <Input placeholder="广告名称" style={{ width: 150 }} />
             </Form.Item></Col>}
+            
+            {/* 创意名称 */}
+            {isCreativeName && <Col><Form.Item name='creativeName'>
+                <Input placeholder="创意名称" style={{ width: 150 }} />
+            </Form.Item></Col>}
 
             {/* 广告ID */}
             {isPromotionId && <Col><Form.Item name='promotionId'>
@@ -232,6 +241,12 @@ const QueryForm: React.FC<Props> = (props) => {
                 <DatePicker.RangePicker style={{ width: 250 }} {...day3} />
             </Form.Item></Col>}
 
+            {/* 日期选择框 */}
+            {day4 && <Col><Form.Item name='day4'>
+                {/* @ts-ignore */}
+                <DatePicker.RangePicker style={{ width: 250 }} {...day4} />
+            </Form.Item></Col>}
+
             <Col>
                 <Space>
                     <Button type="primary" htmlType="submit">搜索</Button>

+ 11 - 1
src/pages/iaaData/game/tencent/dynamic/index.tsx

@@ -104,6 +104,7 @@ const Dynamic: React.FC = () => {
                 initialValues={{ day3: [moment(), moment()] }}
                 isAccountId
                 isPromotionName
+                isCreativeName
                 isDynamicCreativeId
                 isPutUserIdList
                 isCpaBid
@@ -114,9 +115,10 @@ const Dynamic: React.FC = () => {
                 day1={{ placeholder: ['广告创建日期开始', '广告创建日期结束'] }}
                 day2={{ placeholder: ['投放日期开始', '投放日期结束'] }}
                 day3={{ placeholder: ['消耗日期开始', '消耗日期结束'] }}
+                day4={{ placeholder: ['创意创建时间开始', '创意创建时间结束'] }}
                 onChange={(data: any) => {
                     console.log(data)
-                    const { day1, day2, day3, ...params } = data
+                    const { day1, day2, day3, day4, ...params } = data
                     let newQueryForm = JSON.parse(JSON.stringify(queryForm))
                     newQueryForm.pageNum = 1
                     if (day1 && day1?.length === 2) {
@@ -142,6 +144,14 @@ const Dynamic: React.FC = () => {
                         delete newQueryForm['costDayBegin']
                         delete newQueryForm['costDayEnd']
                     }
+
+                    if (day4 && day4?.length === 2) {
+                        newQueryForm['creativeCreateBegin'] = moment(day4[0]).format('YYYY-MM-DD')
+                        newQueryForm['creativeCreateEnd'] = moment(day4[1]).format('YYYY-MM-DD')
+                    } else {
+                        delete newQueryForm['creativeCreateBegin']
+                        delete newQueryForm['creativeCreateEnd']
+                    }
                     setQueryForm({ ...newQueryForm, ...params })
                 }}
             />}