Просмотр исходного кода

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

wjx 2 лет назад
Родитель
Сommit
c7c3e7202d

+ 2 - 128
src/pages/launchSystemNew/components/pageModal/index.tsx

@@ -1,131 +1,4 @@
-// import Tables from "@/components/Tables"
-// import { useAjax } from "@/Hook/useAjax"
-// import { getAdqLandingPageList, putAdqLandingPage } from "@/services/launchAdq/adq"
-// import { CreateAdProps } from "@/services/launchAdq/createAd"
-// import { CheckOutlined, SyncOutlined } from "@ant-design/icons"
-// import { Button, Col, Modal, Row, Space } from "antd"
-// import React, { useEffect, useState } from "react"
-// import style from '../goodsModal/index.less'
-// import columns from "./tableConfig"
 
-
-// /**
-//  * 获取adq落地页
-//  * @returns 
-//  */
-// interface Props {
-//     visible?: boolean,
-//     onClose?: () => void,
-//     onChange?: (data: any) => void,
-//     data: any,
-// }
-// const PageModal: React.FC<Props> = (props) => {
-
-//     /*************************/
-//     const { visible, onClose, data: data1, onChange } = props
-//     const [selectAdz, setSelectAdz] = useState<number>(data1[0].accountId)   // 选择广告主
-//     const [data, setData] = useState<any>(null)
-//     const [queryForm, setQueryForm] = useState<{ accountId?: number, pageSize: number, pageNum: number }>({ pageNum: 1, pageSize: 20 })
-
-//     const putAdq = useAjax((params) => putAdqLandingPage(params))
-//     const listAjax = useAjax((params) => getAdqLandingPageList(params))
-//     /*************************/
-
-//     useEffect(() => {
-//         if (data1?.length > 0) {
-//             setQueryForm({ ...queryForm, accountId: data1.find((item: { accountId: number })=>item.accountId === selectAdz).accountId })
-//         }
-//     }, [selectAdz])
-
-//     useEffect(() => {
-//         if (queryForm?.accountId) {
-//             getList()
-//         }
-//     }, [queryForm])
-
-//     // 获取落地页列表
-//     const getList = () => {
-//         listAjax.run(queryForm)
-//     }
-
-//     const handleOk = () => {
-//         console.log('data---->', data);
-
-//         onChange && onChange(data)
-//     }
-
-//     /** 设置选中广告主 */
-//     const handleSelectAdz = ( item: any) => {
-//         if (item.accountId === selectAdz) {
-//             return
-//         }
-//         setSelectAdz(item.accountId)
-//     }
-
-//     /** 表格选折 */
-//     const onChangeTable = (selectedRowKeys: React.Key[], selectedRows: any) => {
-//         // setData([...data,selectedRows[0]])
-//     }
-
-//     /** 同步落地页 */
-//     const synPageList = () => {
-//         let ajaxs = data?.map((item: { id: number }) => putAdq.run(item.id))
-//         Promise.all(ajaxs).then(res => {
-//             listAjax.refresh()
-//         })
-//     }
-//     console.log(data,data1)
-//     return <Modal
-//         title={<Space>
-//             <span>ADQ落地页</span>
-//             <Button size="small" onClick={() => { synPageList() }} type="link" loading={putAdq?.loading}>同步落地页</Button>
-//         </Space>}
-//         visible={visible}
-//         onCancel={() => { onClose && onClose() }}
-//         onOk={handleOk}
-//         width={1200}
-//         className={style.SelectPackage}
-//         bodyStyle={{ padding: '0 10px 0 10px' }}
-//     >
-
-//         <div className={style.content}>
-//             <div className={style.left} style={{width:180}}>
-//                 <h4 className={style.title}>媒体账户</h4>
-//                 {data1?.map((item: { accountId: number,remark:string, id: number }, index: number) => (
-//                     <Row key={index} onClick={() => { handleSelectAdz(item) }} className={`${style.accItem} ${selectAdz === item.accountId && style.select} `} >
-//                         {/* {item?.accountId} */}
-//                         <Col span={21} style={{whiteSpace:'nowrap',width:'100%',overflow:'hidden',textOverflow:'ellipsis'}}>{item.remark ? item.accountId + '—' + item.remark : item.accountId}</Col>
-//                         <Col span={3}>{data?.accountId === item.accountId && <CheckOutlined style={{ color: '#1890ff' }} />}</Col>
-//                     </Row>))}
-//             </div>
-//             <div className={style.right}>
-//                 <Space style={{ marginBottom: 10 }} align="end">
-//                     <Button icon={<SyncOutlined />} type='link' loading={listAjax?.loading} onClick={() => { listAjax?.refresh() }}></Button>
-//                 </Space>
-//                 <Tables
-//                     columns={columns()}
-//                     dataSource={listAjax?.data?.records?.map((item: any) => ({ ...item, id: item.pageId }))}
-//                     size="small"
-//                     loading={listAjax?.loading}
-//                     scroll={{ y: 300 }}
-//                     bordered
-//                     defaultPageSize={100}
-//                     pageChange={(page: number, pageSize?: number) => {
-//                         setQueryForm({ ...queryForm, pageNum: page, pageSize: pageSize as number || 20 })
-//                     }}
-//                     rowSelection={{
-//                         type: 'radio',
-//                         selectedRowKeys: data1[selectAdz - 1]?.pageList?.map((item: any) => item?.id?.toString()),
-//                         onChange: onChangeTable
-//                     }}
-//                 />
-//             </div>
-//         </div>
-
-//     </Modal>
-// }
-
-// export default React.memo(PageModal)
 import Tables from "@/components/Tables"
 import { useAjax } from "@/Hook/useAjax"
 import { getAdqLandingPageList, putAdqLandingPage } from "@/services/launchAdq/adq"
@@ -242,7 +115,8 @@ const PageModal: React.FC<Props> = (props) => {
                     loading={listAjax?.loading}
                     scroll={{ y: 300 }}
                     bordered
-                    defaultPageSize={100}
+                    total={listAjax?.data?.total}
+                    defaultPageSize={20}
                     pageChange={(page: number, pageSize?: number) => {
                         setQueryForm({ ...queryForm, pageNum: page, pageSize: pageSize as number || 20 })
                     }}

+ 3 - 2
src/pages/launchSystemNew/launchManage/createAd/targeting/index.tsx

@@ -54,8 +54,9 @@ function TargetIng(props: Props) {
     return <Col className={style.conRightBorder}>
         <div className={style.top}>
             定向
-            {(queryForm.sysAdgroup?.bidMode === 'BID_MODE_CPM' || queryForm.sysAdgroup?.bidMode === 'BID_MODE_CPC') && <>{
-                accountCreateLogs?.length > 0 && queryForm?.sysTargetingId ? <Button type="link" style={{ fontSize: 12, padding: 0 }} onClick={() => setCpVisible(true)}>选择定向包</Button> : <Tooltip title={accountCreateLogs?.length > 0 ? `请先添加定向` : `请先选择媒体账户`}>
+            {/* (queryForm.sysAdgroup?.bidMode === 'BID_MODE_CPM' || queryForm.sysAdgroup?.bidMode === 'BID_MODE_CPC') &&  */}
+            {<>{
+                accountCreateLogs?.length > 0 && queryForm?.sysTargeting ? <Button type="link" style={{ fontSize: 12, padding: 0 }} onClick={() => setCpVisible(true)}>选择定向包</Button> : <Tooltip title={accountCreateLogs?.length > 0 ? `请先添加定向` : `请先选择媒体账户`}>
                     <Button type="link" style={{ fontSize: 12, padding: 0 }}>选择定向包</Button>
                 </Tooltip>
             }</>}