123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596 |
- import { useAjax } from "@/Hook/useAjax"
- import { dynamicCreativeLogApi } from "@/services/launchAdq/adqv3"
- import { Button, Col, Form, Input, Modal, Row, Space, Table } from "antd"
- import React, { useEffect, useState } from "react"
- import { columnsLog } from "./tableConfig"
- interface Props {
- userId: number
- visible?: boolean,
- onClose?: () => void,
- }
- /**
- * 创意操作记录
- * @param param0
- * @returns
- */
- const HandleLog: React.FC<Props> = ({ visible, onClose, userId }) => {
- /*********************************/
- const [form] = Form.useForm();
- const [queryParams, setQueryParams] = useState<ADQV3.DynamicCreativeLogProps>({ pageNum: 1, pageSize: 20 })
- const dynamicCreativeLog = useAjax((params) => dynamicCreativeLogApi(params))
- /*********************************/
- useEffect(() => {
- dynamicCreativeLog.run({ ...queryParams, userId })
- }, [queryParams])
- const onFinish = (values: any) => {
- console.log(values)
- setQueryParams({ ...queryParams, ...values })
- }
- return <Modal
- title={<strong>创意操作记录</strong>}
- className="modalResetCss"
- visible={visible}
- onCancel={onClose}
- footer={null}
- width={1100}
- >
- <Space style={{ width: '100%' }} direction="vertical">
- <Form
- layout="inline"
- form={form}
- name="handleLog"
- onFinish={onFinish}
- style={{ marginBottom: 6 }}
- >
- <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 style={{ marginRight: 0 }}>
- <Space>
- <Button type="primary" htmlType="submit">搜索</Button>
- <Button onClick={() => {
- form.resetFields()
- }}>重置</Button>
- </Space>
- </Form.Item></Col>
- </Row>
- </Form>
- <Table
- columns={columnsLog()}
- dataSource={dynamicCreativeLog?.data?.records}
- size="small"
- loading={dynamicCreativeLog?.loading}
- scroll={{ y: 500 }}
- rowKey={'id'}
- pagination={{
- defaultPageSize: 100,
- current: dynamicCreativeLog.data?.current || 1,
- pageSize: dynamicCreativeLog.data?.size || 10,
- total: dynamicCreativeLog.data?.total || 0
- }}
- onChange={(pagination) => {
- const { current, pageSize } = pagination
- setQueryParams({ ...queryParams, pageNum: current || 1, pageSize: pageSize || 10 })
- }}
- />
- </Space>
- </Modal>
- }
- export default React.memo(HandleLog)
|