|
@@ -1,18 +1,19 @@
|
|
|
import { useAjax } from "@/Hook/useAjax"
|
|
|
import { delBatchCreativeApi, getDynamicCreativeV3ListApi, syncBatchCreativeApi, updateBatchDynamicCreativesInfoApi } from "@/services/launchAdq/adqv3"
|
|
|
-import { Badge, Button, Col, DatePicker, Form, Input, Modal, Popconfirm, Row, Select, Space, Table, message } from "antd"
|
|
|
+import { Badge, Button, Checkbox, Col, DatePicker, Form, Input, Modal, Popconfirm, Row, Select, Space, Table, Tooltip, message } from "antd"
|
|
|
import React, { useEffect, useState } from "react"
|
|
|
import { txDynamicConfig } from "../config"
|
|
|
import tableConfig from "./tableConfig"
|
|
|
import TableData from "@/pages/launchSystemNew/components/TableData"
|
|
|
import ReviewDetails from "./reviewDetails"
|
|
|
-import { DeleteOutlined, PauseCircleOutlined, PlayCircleOutlined } from "@ant-design/icons"
|
|
|
+import { DeleteOutlined, PauseCircleOutlined, PlayCircleOutlined, QuestionCircleOutlined } from "@ant-design/icons"
|
|
|
import '../../tencentAdPutIn/index.less'
|
|
|
import HandleLog from "./handleLog"
|
|
|
import moment from "moment"
|
|
|
import RetriaModal from "./retriaModal"
|
|
|
import ReplacePage from "./replacePage"
|
|
|
import ReplaceGfPage from "./replaceGfPage"
|
|
|
+import { useLocalStorageState } from "ahooks"
|
|
|
|
|
|
/** 审核结果 */
|
|
|
export const AD_STATUS = {
|
|
@@ -22,9 +23,12 @@ export const AD_STATUS = {
|
|
|
PARTIALLY_NORMAL: <Badge status="warning" text="部分审核通过" />,
|
|
|
}
|
|
|
|
|
|
+let isFist = true
|
|
|
+
|
|
|
const Creative: React.FC<ADQV3.CreativeProps> = ({ queryForm, setQueryForm, userId }) => {
|
|
|
|
|
|
/*********************************/
|
|
|
+ const [searchParams, setSearchParams] = useLocalStorageState<{ isSaveSearchParams: boolean, queryForm?: any }>('SAVE_CREATIVE_SEARCH_FORM', { isSaveSearchParams: false });
|
|
|
const [form] = Form.useForm();
|
|
|
const [dynimicData, setDynamicData] = useState<any>({})
|
|
|
const [dynimicVisible, setDynamicVisible] = useState<boolean>(false)
|
|
@@ -43,11 +47,23 @@ const Creative: React.FC<ADQV3.CreativeProps> = ({ queryForm, setQueryForm, user
|
|
|
/*********************************/
|
|
|
|
|
|
useEffect(() => {
|
|
|
- form.setFieldsValue({ adgroupId: queryForm.adgroupId })
|
|
|
- }, [queryForm.adgroupId])
|
|
|
+ if (queryForm?.adgroupId) {
|
|
|
+ form.setFieldsValue({ adgroupId: queryForm.adgroupId })
|
|
|
+ } else if (searchParams?.isSaveSearchParams && searchParams?.queryForm) {
|
|
|
+ const { beginDate, endDate, ...params } = searchParams.queryForm
|
|
|
+ if (beginDate && endDate) {
|
|
|
+ params.date = [moment(beginDate), moment(endDate)]
|
|
|
+ }
|
|
|
+ form.setFieldsValue(params)
|
|
|
+ }
|
|
|
+
|
|
|
+ }, [queryForm?.adgroupId])
|
|
|
+
|
|
|
+ // queryForm = queryForm.adgroupId ? queryForm : (searchParams?.isSaveSearchParams && searchParams?.queryForm && Object.keys(searchParams?.queryForm).length > 0) ? searchParams?.queryForm : queryForm
|
|
|
|
|
|
useEffect(() => {
|
|
|
- let params: any = { ...queryForm, userId }
|
|
|
+ const params: any = isFist && (searchParams?.isSaveSearchParams && searchParams?.queryForm && Object.keys(searchParams?.queryForm).length > 0) ? { ...searchParams.queryForm, userId } : { ...queryForm, userId }
|
|
|
+ isFist = false
|
|
|
if (params?.accountId) {
|
|
|
params.accountId = params.accountId?.split(/[,,\s\n]+/)
|
|
|
}
|
|
@@ -68,6 +84,9 @@ const Creative: React.FC<ADQV3.CreativeProps> = ({ queryForm, setQueryForm, user
|
|
|
delete newQueryForm?.beginDate
|
|
|
delete newQueryForm?.endDate
|
|
|
}
|
|
|
+ if (searchParams?.isSaveSearchParams) {
|
|
|
+ setSearchParams({ isSaveSearchParams: true, queryForm: newQueryForm })
|
|
|
+ }
|
|
|
setQueryForm(newQueryForm)
|
|
|
}
|
|
|
|
|
@@ -77,7 +96,7 @@ const Creative: React.FC<ADQV3.CreativeProps> = ({ queryForm, setQueryForm, user
|
|
|
}
|
|
|
|
|
|
const dynamicHandle = (type: '删除' | '启动' | '暂停', data?: any) => {
|
|
|
- let accountAdgroupMaps = data ? [data.accountId + ',' + data.dynamicCreativeId] : [...new Set(selectedRows?.map(item => item.accountId + ',' + item.dynamicCreativeId))]
|
|
|
+ const accountAdgroupMaps = data ? [data.accountId + ',' + data.dynamicCreativeId] : [...new Set(selectedRows?.map(item => item.accountId + ',' + item.dynamicCreativeId))]
|
|
|
let hide: any
|
|
|
if (data) {
|
|
|
hide = message.loading(`正在设置...`, 0, () => {
|
|
@@ -219,7 +238,20 @@ const Creative: React.FC<ADQV3.CreativeProps> = ({ queryForm, setQueryForm, user
|
|
|
</Form.Item></Col>
|
|
|
<Col><Form.Item style={{ marginRight: 0 }}>
|
|
|
<Space>
|
|
|
- <Button type="primary" htmlType="submit">搜索</Button>
|
|
|
+ <Button type="primary" htmlType="submit">
|
|
|
+ <Space>
|
|
|
+ <span>搜索</span>
|
|
|
+ <Checkbox
|
|
|
+ checked={searchParams?.isSaveSearchParams}
|
|
|
+ onChange={(e) => {
|
|
|
+ setSearchParams({ isSaveSearchParams: e.target.checked })
|
|
|
+ }}
|
|
|
+ />
|
|
|
+ <Tooltip title="勾选搜索长保存搜索条件">
|
|
|
+ <QuestionCircleOutlined />
|
|
|
+ </Tooltip>
|
|
|
+ </Space>
|
|
|
+ </Button>
|
|
|
<Button onClick={() => {
|
|
|
setQueryForm({ pageNum: 1, pageSize: queryForm.pageSize, userId })
|
|
|
form.resetFields()
|
|
@@ -359,8 +391,8 @@ const Creative: React.FC<ADQV3.CreativeProps> = ({ queryForm, setQueryForm, user
|
|
|
}
|
|
|
}}
|
|
|
onChange={(props: any) => {
|
|
|
- let { pagination } = props
|
|
|
- let { current, pageSize } = pagination
|
|
|
+ const { pagination } = props
|
|
|
+ const { current, pageSize } = pagination
|
|
|
setQueryForm({ ...queryForm, pageNum: current, pageSize })
|
|
|
}}
|
|
|
/>
|