|
@@ -1,19 +1,28 @@
|
|
|
import { useAjax } from "@/Hook/useAjax"
|
|
|
import { getDynamicCreativeV3ListApi } from "@/services/launchAdq/adqv3"
|
|
|
-import { Button, Col, Form, Input, Row, Select, Space } from "antd"
|
|
|
-import React, { useEffect } from "react"
|
|
|
+import { Badge, Button, Col, Form, Input, Row, Select, Space } from "antd"
|
|
|
+import React, { useEffect, useState } from "react"
|
|
|
import { txDynamicConfig } from "../config"
|
|
|
import tableConfig from "./tableConfig"
|
|
|
import TableData from "@/pages/launchSystemNew/components/TableData"
|
|
|
-import { getCreativeReviewDetailApi } from "@/services/adqV3/global"
|
|
|
+import ReviewDetails from "./reviewDetails"
|
|
|
|
|
|
+/** 审核结果 */
|
|
|
+export const AD_STATUS = {
|
|
|
+ NORMAL: <Badge status="success" text="审核通过" />,
|
|
|
+ PENDING: <Badge status="default" text="审核中" />,
|
|
|
+ DENIED: <Badge status="error" text="有违规" />,
|
|
|
+ PARTIALLY_NORMAL: <Badge status="warning" text="部分审核通过" />,
|
|
|
+}
|
|
|
|
|
|
const Creative: React.FC<ADQV3.CreativeProps> = ({ queryForm, setQueryForm, userId }) => {
|
|
|
|
|
|
/*********************************/
|
|
|
const [form] = Form.useForm();
|
|
|
+ const [dynimicData, setDynamicData] = useState<any>({})
|
|
|
+ const [dynimicVisible, setDynamicVisible] = useState<boolean>(false)
|
|
|
+
|
|
|
const getDynamicCreativeV3List = useAjax((params) => getDynamicCreativeV3ListApi(params), { formatResult: true })
|
|
|
- const getCreativeReviewDetail = useAjax((params) => getCreativeReviewDetailApi(params))
|
|
|
/*********************************/
|
|
|
|
|
|
useEffect(() => {
|
|
@@ -30,71 +39,82 @@ const Creative: React.FC<ADQV3.CreativeProps> = ({ queryForm, setQueryForm, user
|
|
|
}
|
|
|
|
|
|
const reviewStatusDetails = (value: any) => {
|
|
|
-
|
|
|
+ setDynamicData(value)
|
|
|
+ setDynamicVisible(true)
|
|
|
}
|
|
|
|
|
|
- return <TableData
|
|
|
- isCard={false}
|
|
|
- columns={() => tableConfig(reviewStatusDetails)}
|
|
|
- ajax={getDynamicCreativeV3List}
|
|
|
- fixed={{ left: 2, right: 4 }}
|
|
|
- dataSource={getDynamicCreativeV3List?.data?.data?.records}
|
|
|
- loading={getDynamicCreativeV3List?.loading}
|
|
|
- scroll={{ y: 560 }}
|
|
|
- total={getDynamicCreativeV3List?.data?.data?.total}
|
|
|
- page={getDynamicCreativeV3List?.data?.data?.current}
|
|
|
- pageSize={getDynamicCreativeV3List?.data?.data?.size}
|
|
|
- myKey={'dynamicCreativeId'}
|
|
|
- gutter={[0, 10]}
|
|
|
- config={txDynamicConfig}
|
|
|
- configName="创意3.0"
|
|
|
- leftChild={<Form
|
|
|
- layout="inline"
|
|
|
- form={form}
|
|
|
- name="basignCreative"
|
|
|
- initialValues={queryForm}
|
|
|
- onFinish={onFinish}
|
|
|
- >
|
|
|
- <Row gutter={[10, 10]}>
|
|
|
- <Col><Form.Item name='accountId' style={{ marginRight: 0 }}>
|
|
|
- <Input placeholder="广告账号" style={{ width: 120 }} allowClear />
|
|
|
- </Form.Item></Col>
|
|
|
- <Col><Form.Item name='adgroupId' style={{ marginRight: 0 }}>
|
|
|
- <Input placeholder="广告ID" style={{ width: 120 }} allowClear />
|
|
|
- </Form.Item></Col>
|
|
|
- <Col><Form.Item name='creativeName' style={{ marginRight: 0 }}>
|
|
|
- <Input placeholder="创意名称" style={{ width: 150 }} allowClear />
|
|
|
- </Form.Item></Col>
|
|
|
- <Col><Form.Item name='creativeId' style={{ marginRight: 0 }}>
|
|
|
- <Input placeholder="创意ID" style={{ width: 120 }} allowClear />
|
|
|
- </Form.Item></Col>
|
|
|
- <Col><Form.Item name='isDeleted'>
|
|
|
- <Select
|
|
|
- placeholder='是否删除?'
|
|
|
- style={{ width: 100 }}
|
|
|
- showSearch
|
|
|
- filterOption={(input: any, option: any) =>
|
|
|
- (option!.children as unknown as string).toLowerCase().includes(input.toLowerCase())
|
|
|
- }
|
|
|
- >
|
|
|
- <Select.Option value={true}>是</Select.Option>
|
|
|
- <Select.Option value={false}>否</Select.Option>
|
|
|
- </Select>
|
|
|
- </Form.Item></Col>
|
|
|
- <Col><Form.Item style={{ marginRight: 0 }}>
|
|
|
- <Space>
|
|
|
- <Button type="primary" htmlType="submit">搜索</Button>
|
|
|
- <Button onClick={() => form.resetFields()}>重置</Button>
|
|
|
- </Space>
|
|
|
- </Form.Item></Col>
|
|
|
- </Row>
|
|
|
- </Form>}
|
|
|
- onChange={(props: any) => {
|
|
|
- let { pagination } = props
|
|
|
- let { current, pageSize } = pagination
|
|
|
- setQueryForm({ ...queryForm, pageNum: current, pageSize })
|
|
|
- }}
|
|
|
- />
|
|
|
+ return <>
|
|
|
+ <TableData
|
|
|
+ isCard={false}
|
|
|
+ columns={() => tableConfig(reviewStatusDetails)}
|
|
|
+ ajax={getDynamicCreativeV3List}
|
|
|
+ fixed={{ left: 2, right: 4 }}
|
|
|
+ dataSource={getDynamicCreativeV3List?.data?.data?.records}
|
|
|
+ loading={getDynamicCreativeV3List?.loading}
|
|
|
+ scroll={{ y: 560 }}
|
|
|
+ total={getDynamicCreativeV3List?.data?.data?.total}
|
|
|
+ page={getDynamicCreativeV3List?.data?.data?.current}
|
|
|
+ pageSize={getDynamicCreativeV3List?.data?.data?.size}
|
|
|
+ myKey={'dynamicCreativeId'}
|
|
|
+ gutter={[0, 10]}
|
|
|
+ config={txDynamicConfig}
|
|
|
+ configName="创意3.0"
|
|
|
+ leftChild={<Form
|
|
|
+ layout="inline"
|
|
|
+ form={form}
|
|
|
+ name="basignCreative"
|
|
|
+ initialValues={queryForm}
|
|
|
+ onFinish={onFinish}
|
|
|
+ >
|
|
|
+ <Row gutter={[10, 10]}>
|
|
|
+ <Col><Form.Item name='accountId' style={{ marginRight: 0 }}>
|
|
|
+ <Input placeholder="广告账号" style={{ width: 120 }} allowClear />
|
|
|
+ </Form.Item></Col>
|
|
|
+ <Col><Form.Item name='adgroupId' style={{ marginRight: 0 }}>
|
|
|
+ <Input placeholder="广告ID" style={{ width: 120 }} allowClear />
|
|
|
+ </Form.Item></Col>
|
|
|
+ <Col><Form.Item name='creativeName' style={{ marginRight: 0 }}>
|
|
|
+ <Input placeholder="创意名称" style={{ width: 150 }} allowClear />
|
|
|
+ </Form.Item></Col>
|
|
|
+ <Col><Form.Item name='creativeId' style={{ marginRight: 0 }}>
|
|
|
+ <Input placeholder="创意ID" style={{ width: 120 }} allowClear />
|
|
|
+ </Form.Item></Col>
|
|
|
+ <Col><Form.Item name='isDeleted'>
|
|
|
+ <Select
|
|
|
+ placeholder='是否删除?'
|
|
|
+ style={{ width: 100 }}
|
|
|
+ showSearch
|
|
|
+ filterOption={(input: any, option: any) =>
|
|
|
+ (option!.children as unknown as string).toLowerCase().includes(input.toLowerCase())
|
|
|
+ }
|
|
|
+ >
|
|
|
+ <Select.Option value={true}>是</Select.Option>
|
|
|
+ <Select.Option value={false}>否</Select.Option>
|
|
|
+ </Select>
|
|
|
+ </Form.Item></Col>
|
|
|
+ <Col><Form.Item style={{ marginRight: 0 }}>
|
|
|
+ <Space>
|
|
|
+ <Button type="primary" htmlType="submit">搜索</Button>
|
|
|
+ <Button onClick={() => form.resetFields()}>重置</Button>
|
|
|
+ </Space>
|
|
|
+ </Form.Item></Col>
|
|
|
+ </Row>
|
|
|
+ </Form>}
|
|
|
+ onChange={(props: any) => {
|
|
|
+ let { pagination } = props
|
|
|
+ let { current, pageSize } = pagination
|
|
|
+ setQueryForm({ ...queryForm, pageNum: current, pageSize })
|
|
|
+ }}
|
|
|
+ />
|
|
|
+ {dynimicVisible && <ReviewDetails
|
|
|
+ visible={dynimicVisible}
|
|
|
+ dynamic={dynimicData}
|
|
|
+ onClose={() => {
|
|
|
+ setDynamicData({})
|
|
|
+ setDynamicVisible(false)
|
|
|
+ }}
|
|
|
+ />}
|
|
|
+ </>
|
|
|
}
|
|
|
|
|
|
export default React.memo(Creative)
|