wjx 2 роки тому
батько
коміт
81a1c13e82

+ 75 - 0
src/components/Tables/EditableCell.tsx

@@ -0,0 +1,75 @@
+import { Form, FormInstance, Input, InputRef } from "antd";
+import React, { useContext, useEffect, useRef, useState } from "react";
+import './index.less'
+
+export const EditableContext = React.createContext<FormInstance<any> | null>(null);
+
+interface Item {
+    key: string;
+    name: string;
+    age: string;
+    address: string;
+}
+interface EditableCellProps {
+    title: React.ReactNode;
+    editable: boolean;
+    children: React.ReactNode;
+    dataIndex: keyof Item;
+    record: Item;
+    handleSave: (record: Item) => void;
+}
+const EditableCell: React.FC<EditableCellProps> = ({
+    title,
+    editable,
+    children,
+    dataIndex,
+    record,
+    handleSave,
+    ...restProps
+}) => {
+    const [editing, setEditing] = useState(false);
+    const inputRef = useRef<InputRef>(null);
+    const form = useContext(EditableContext)!;
+
+    useEffect(() => {
+        if (editing) {
+            inputRef.current!.focus();
+        }
+    }, [editing]);
+
+    const toggleEdit = () => {
+        setEditing(!editing);
+        form.setFieldsValue({ [dataIndex]: record[dataIndex] });
+    };
+
+    const save = async () => {
+        try {
+            const values = await form.validateFields();
+            if (values?.adgroupName !== (record as any)?.adgroupName) {
+                handleSave({ ...record, ...values });
+            }
+            toggleEdit();
+        } catch (errInfo) {
+            console.log('Save failed:', errInfo);
+        }
+    };
+
+    let childNode = children;
+
+    if (editable) {
+        childNode = editing ? (<Form.Item
+            style={{ margin: 0 }}
+            name={dataIndex}
+            rules={[{ required: true, message: `${title} is required.` }]}
+        >
+            <Input ref={inputRef} onPressEnter={save} onBlur={save} />
+        </Form.Item>) : (<div className="editable-cell-value-wrap ellipsisText" onClick={toggleEdit}>
+            {children}
+        </div>);
+    }
+
+    return <td {...restProps}>{childNode}</td>;
+};
+
+
+export default React.memo(EditableCell)

+ 20 - 0
src/components/Tables/EditableRow.tsx

@@ -0,0 +1,20 @@
+import { Form } from "antd";
+import React from "react";
+import './index.less'
+import { EditableContext } from "./EditableCell";
+
+interface EditableRowProps {
+    index: number;
+}
+const EditableRow: React.FC<EditableRowProps> = ({ index, ...props }) => {
+    const [form] = Form.useForm();
+    return (
+        <Form form={form} component={false}>
+            <EditableContext.Provider value={form}>
+                <tr {...props} />
+            </EditableContext.Provider>
+        </Form>
+    );
+};
+
+export default React.memo(EditableRow)

+ 47 - 88
src/components/Tables/index.less

@@ -1,95 +1,54 @@
-.unfollow{
+.unfollow {
     background-color: #fafafa;
 }
 
-.ant-table-row.expanded>.ant-table-cell{
+.ant-table-row.expanded>.ant-table-cell {
     padding: 5px 16px !important;
 }
-.ant-table-row.error{
+
+.ant-table-row.error {
     background-color: #ffe9e9;
 }
-// .react-resizable {
-//     position: relative;
-//   }
-//   .react-resizable-handle {
-//     position: absolute;
-//     width: 20px;
-//     height: 20px;
-//     background-repeat: no-repeat;
-//     background-origin: content-box;
-//     box-sizing: border-box;
-//     background-image: url('data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCA2IDYiIHN0eWxlPSJiYWNrZ3JvdW5kLWNvbG9yOiNmZmZmZmYwMCIgeD0iMHB4IiB5PSIwcHgiIHdpZHRoPSI2cHgiIGhlaWdodD0iNnB4Ij48ZyBvcGFjaXR5PSIwLjMwMiI+PHBhdGggZD0iTSA2IDYgTCAwIDYgTCAwIDQuMiBMIDQgNC4yIEwgNC4yIDQuMiBMIDQuMiAwIEwgNiAwIEwgNiA2IEwgNiA2IFoiIGZpbGw9IiMwMDAwMDAiLz48L2c+PC9zdmc+');
-//     background-position: bottom right;
-//     padding: 0 3px 3px 0;
-//   }
-//   .react-resizable-handle-sw {
-//     bottom: 0;
-//     left: 0;
-//     cursor: sw-resize;
-//     transform: rotate(90deg);
-//   }
-//   .react-resizable-handle-se {
-//     bottom: 0;
-//     right: 0;
-//     cursor: se-resize;
-//   }
-//   .react-resizable-handle-nw {
-//     top: 0;
-//     left: 0;
-//     cursor: nw-resize;
-//     transform: rotate(180deg);
-//   }
-//   .react-resizable-handle-ne {
-//     top: 0;
-//     right: 0;
-//     cursor: ne-resize;
-//     transform: rotate(270deg);
-//   }
-//   .react-resizable-handle-w,
-//   .react-resizable-handle-e {
-//     top: 50%;
-//     margin-top: -10px;
-//     cursor: ew-resize;
-//   }
-//   .react-resizable-handle-w {
-//     left: 0;
-//     transform: rotate(135deg);
-//   }
-//   .react-resizable-handle-e {
-//     right: 0;
-//     transform: rotate(315deg);
-//   }
-//   .react-resizable-handle-n,
-//   .react-resizable-handle-s {
-//     left: 50%;
-//     margin-left: -10px;
-//     cursor: ns-resize;
-//   }
-//   .react-resizable-handle-n {
-//     top: 0;
-//     transform: rotate(225deg);
-//   }
-//   .react-resizable-handle-s {
-//     bottom: 0;
-//     transform: rotate(45deg);
-//   }
-  .ellipsisText{
-      overflow: hidden;
-      text-overflow: ellipsis;
-      white-space: nowrap;
-      display: block;
-  }
-  .components-table-resizable-column .react-resizable{
-      position: relative;
-      background-clip: padding-box;
-  }
-  .components-table-resizable-column .react-resizable-handle{
-      position:absolute;
-      width: 10px;
-      height: 100%;
-      bottom: 0;
-      right: -9px;
-      cursor:col-resize;
-      z-index: 1;
-      border-left: white 1px solid;
-  }
+
+.editable-cell {
+    position: relative;
+}
+
+.editable-cell-value-wrap {
+    padding: 5px;
+    cursor: pointer;
+    box-sizing: border-box;
+}
+
+.editable-cell-value-wrap:hover {
+    padding: 5px;
+    box-shadow: 0 0 0 1px #d9d9d9;
+    border-radius: 4px;
+}
+
+[data-theme='dark'] .editable-cell-value-wrap:hover {
+    box-shadow: 0 0 0 1px #d9d9d9;
+}
+
+.ellipsisText {
+    overflow: hidden;
+    text-overflow: ellipsis;
+    white-space: nowrap;
+    display: block;
+}
+
+.components-table-resizable-column .react-resizable {
+    position: relative;
+    background-clip: padding-box;
+}
+
+.components-table-resizable-column .react-resizable-handle {
+    position: absolute;
+    width: 10px;
+    height: 100%;
+    bottom: 0;
+    right: -9px;
+    cursor: col-resize;
+    z-index: 1;
+    border-left: white 1px solid;
+}

+ 46 - 33
src/components/Tables/index.tsx

@@ -1,18 +1,26 @@
-import React, { ReactNode ,useEffect, useRef, useState} from 'react'
+import React, { ReactNode, useEffect, useRef, useState } from 'react'
 import { Table, Tag, message } from 'antd';
 import { Excle } from '@/utils/Excle'
 import style from './index.less'
 import './index.less'
 import { Resizable } from 'react-resizable'
 import { SortOrder } from 'antd/lib/table/interface';
+import EditableRow from './EditableRow';
+import EditableCell from './EditableCell';
 
+export interface DataType {
+    key: React.Key;
+    name: string;
+    age: string;
+    address: string;
+}
 
 const ResizableHeader = (props: { [x: string]: any; onResize: any; width: any }) => {
     const { onResize, width, ...restProps } = props;
     if (!width) {
         return <th {...restProps} />
     }
-    return <Resizable width={width} height={0} onResize={onResize} draggableOpts={{enableUserSelectHack:false}}>
+    return <Resizable width={width} height={0} onResize={onResize} draggableOpts={{ enableUserSelectHack: false }}>
         <th {...restProps} />
     </Resizable>
 }
@@ -52,15 +60,16 @@ interface Props {
     showHeader?: 1,
     hideOnSinglePage?: boolean,
     className?: string,
-    handelResize?:(columns:any)=>void//当表头被拖动改变宽度时回调设置对应的本地保存
+    handelResize?: (columns: any) => void//当表头被拖动改变宽度时回调设置对应的本地保存
     sortDirections?: SortOrder[],
     isShowTotal?: boolean,  // 是否展示总计
-    myKey?:any,//自定义要用哪个值做key
+    myKey?: any,//自定义要用哪个值做key
+    handleSave?: (row: DataType) => void
 }
 
 function Tables(props: Props) {
     // //导出数据
-    let { columns, dataSource, excle, total,handelResize, rowSelection, onRow, isShowTotal = true, hideOnSinglePage, rowClassName, className, expandedRowRender, scroll, summary, showHeader, bordered, size = 'small', onChange, sortDirections, pagination,myKey, ...prop } = props
+    let { columns, dataSource, excle, total, handelResize, rowSelection, onRow, isShowTotal = true, hideOnSinglePage, handleSave, rowClassName, className, expandedRowRender, scroll, summary, showHeader, bordered, size = 'small', onChange, sortDirections, pagination, myKey, ...prop } = props
     let handleExcle = () => {
         if (dataSource.length < 1) {
             message.error('请先搜索再导出');
@@ -77,32 +86,47 @@ function Tables(props: Props) {
     }
     let ww = document.body.clientWidth < 415
     // 拖动宽逻辑
-    const [cols,setCols] = useState<any>(columns)
+    const [cols, setCols] = useState<any>(columns)
     const colsRef = useRef<any[]>([])
-    const components={
-        header:{
-            cell:ResizableHeader
+    const components = {
+        header: {
+            cell: ResizableHeader
+        },
+        body: {
+            row: EditableRow,
+            cell: EditableCell
         }
     }
-    useEffect(()=>{
+
+    useEffect(() => {
         setCols(columns)
-    },[columns])
-    const handleResize=(index:any)=>(e:any,{size}:any)=>{
-        const nextColumns=[...cols]
-        nextColumns[index]={
+    }, [columns])
+
+    const handleResize = (index: any) => (e: any, { size }: any) => {
+        const nextColumns = [...cols]
+        nextColumns[index] = {
             ...nextColumns[index],
-            width:size.width
+            width: size.width
         }
         setCols(nextColumns)
         handelResize && handelResize(nextColumns)
     }
-    colsRef.current = (cols||[]).map((col:any,index:any)=>({
+
+    colsRef.current = (cols || []).map((col: any, index: any) => ({
         ...col,
-        onHeaderCell:(column:any)=>({
-            width:column.width,
-            onResize:handleResize(index)
-        })
+        onHeaderCell: (column: any) => ({
+            width: column.width,
+            onResize: handleResize(index)
+        }),
+        onCell: (record: DataType) => ({
+            record,
+            editable: col.editable,
+            dataIndex: col.dataIndex,
+            title: col.title,
+            handleSave: (row: DataType) => { handleSave?.(row) },
+        }),
     }))
+
     return <div className='components-table-resizable-column'>
         {
             excle && <Tag color='#f50' style={{ margin: '10px 0', float: 'right' }} onClick={handleExcle}><a>导出数据</a></Tag>
@@ -120,7 +144,7 @@ function Tables(props: Props) {
             scroll={scroll ? { ...scroll, scrollToFirstRowOnChange: true } : undefined}
             size={size}
             rowKey={(a: any) => {
-                if(myKey){
+                if (myKey) {
                     return JSON.stringify(a[myKey])
                 }
                 return (JSON.stringify(a?.id) || JSON.stringify(a?.key))
@@ -131,16 +155,6 @@ function Tables(props: Props) {
                     onClick: onRow?.onClick && onRow?.onClick.bind('', record) || undefined,
                 }
             }}
-            // rowClassName={(record: any) => {
-            //     if (rowClassName && record[rowClassName as string] === 2) {
-            //         return style.unfollow
-            //     }
-            //     if (rowClassName && !record[rowClassName as string]) {
-            //         return style.unfollow
-            //     }
-            // }
-            // }
-            // rowClassName={rowClassName}
             summary={summary}
             className={className}
             expandable={expandedRowRender ? {
@@ -178,8 +192,7 @@ function Tables(props: Props) {
                         return style.unfollow
                     }
                 } : rowClassName
-            }
-            }
+            }}
         />
     </div>
 }

+ 131 - 121
src/pages/launchSystemNew/adq/ad/index.tsx

@@ -5,10 +5,11 @@ import { Col, Row, Input, Select, message, Space, Button, Popconfirm, Switch, no
 import React, { useEffect, useCallback, useState } from 'react'
 import TableData from '../../components/TableData'
 import tableConfig from './tableConfig'
-import { putAdqAdgroupsSync, getAdqAdgroupsList, delListAdqAdgroupsApi, newEditAdqAdgroupsDataApi } from '@/services/launchAdq/adq'
+import { putAdqAdgroupsSync, getAdqAdgroupsList, delListAdqAdgroupsApi, newEditAdqAdgroupsDataApi, editAdqAdgroupsDataApi } from '@/services/launchAdq/adq'
 import { CopyOutlined, DeleteOutlined, FieldTimeOutlined, PauseCircleOutlined, PlayCircleOutlined, TransactionOutlined } from '@ant-design/icons'
 import UpdateAd from './updateAd'
 import Copy from './copy'
+import { DataType } from '@/components/Tables'
 
 type Props = {
     accountId: string,
@@ -42,7 +43,7 @@ const Ad: React.FC<Props> = (props) => {
     const [update, setUpdate] = useState<{ visible: boolean, title: string }>({ visible: false, title: '' })
     const [model, setModel] = useState(true)
     const [copyData, setCopyData] = useState<{ visible: boolean }>({ visible: false })
-    const [queryFrom,set_queryFrom]=useState<{
+    const [queryFrom, set_queryFrom] = useState<{
         pageNum: number;
         pageSize: number;
         accountIdList?: any[];
@@ -51,25 +52,26 @@ const Ad: React.FC<Props> = (props) => {
         promotedObjectType?: string;
         isDeleted?: boolean
         campaignIdList?: any[]
-        statusList?:any[],
-        memoList?:any[]
-        remarkList?:any[]
-    }>({pageNum:1,pageSize:20})
+        statusList?: any[],
+        memoList?: any[]
+        remarkList?: any[]
+    }>({ pageNum: 1, pageSize: 20 })
     const listAjax = useAjax((params) => getAdqAdgroupsList(params), { formatResult: true })
     const syncAjax = useAjax((adAccountId) => putAdqAdgroupsSync(adAccountId))
     const delListAdqAdgroups = useAjax((params) => delListAdqAdgroupsApi(params))
     const editAdqAdgroupsData = useAjax((params) => newEditAdqAdgroupsDataApi(params))
+    const editAdqAdgroups = useAjax((params) => editAdqAdgroupsDataApi(params))
     /************************/
 
     useEffect(() => {
-        let {accountId,campaignId,adgroupId,...obj} = queryParmas
+        let { accountId, campaignId, adgroupId, ...obj } = queryParmas
         let new_queryParmas = {
             ...obj,
-            accountIdList:accountId?[accountId]:[],
-            campaignIdList:campaignId?[campaignId]:[],
-            adgroupIdList:adgroupId?[adgroupId]:[]
+            accountIdList: accountId ? [accountId] : [],
+            campaignIdList: campaignId ? [campaignId] : [],
+            adgroupIdList: adgroupId ? [adgroupId] : []
         }
-        getList({ pageNum: 1, pageSize: 20, ...new_queryParmas,accountIdList:accountId?[accountId]:[] })
+        getList({ pageNum: 1, pageSize: 20, ...new_queryParmas, accountIdList: accountId ? [accountId] : [] })
     }, [accountId, userId, queryParmas])
 
     // 获取列表
@@ -82,9 +84,9 @@ const Ad: React.FC<Props> = (props) => {
         promotedObjectType?: string;
         isDeleted?: boolean
         campaignIdList?: any[]
-        statusList?:any[],
-        memoList?:any[]
-        remarkList?:any[]
+        statusList?: any[],
+        memoList?: any[]
+        remarkList?: any[]
     }) => {
         if (!params.adgroupName || params.adgroupName !== listAjax?.params[0]?.adgroupName) {
             !params.adgroupName && delete params.adgroupName
@@ -160,6 +162,13 @@ const Ad: React.FC<Props> = (props) => {
         setCopyData({ visible: true })
     }
 
+    const handleSave = (row: any) => {
+        editAdqAdgroups.run({ adgroupIds: [row.adgroupId], adgroupName: row.adgroupName }).then(res => {
+            message.success('修改广告名称成功')
+            listAjax.refresh()
+        })
+    }
+
     return <div>
         {/* 修改广告 */}
         {update.visible && <UpdateAd
@@ -186,6 +195,7 @@ const Ad: React.FC<Props> = (props) => {
             page={listAjax?.data?.data?.current}
             pageSize={listAjax?.data?.data?.size}
             myKey={'adgroupId'}
+            handleSave={handleSave}
             leftChild={<Space direction='vertical'>
                 <Row gutter={[10, 10]} align='middle'>
                     <Col>
@@ -195,37 +205,37 @@ const Ad: React.FC<Props> = (props) => {
                             style={{ width: 150 }}
                             onBlur={(e) => {
                                 let value = e.target.value
-                                let arr:any = []
-                                if(value){
-                                    value = value.replace(/[,,\s]/g,',')
-                                    arr = value.split(',').filter(a=>a)
+                                let arr: any = []
+                                if (value) {
+                                    value = value.replace(/[,,\s]/g, ',')
+                                    arr = value.split(',').filter(a => a)
                                 }
-                                set_queryFrom({...queryFrom,accountIdList: arr})
-                                getList({ ...queryFrom,pageNum: 1,  accountIdList: arr })
+                                set_queryFrom({ ...queryFrom, accountIdList: arr })
+                                getList({ ...queryFrom, pageNum: 1, accountIdList: arr })
                             }}
                             onKeyDownCapture={(e: any) => {
                                 let key = e.key
                                 if (key === 'Enter') {
                                     let value = e.target.value
-                                    let arr:any = []
-                                    if(value){
-                                        value = value.replace(/[,,\s]/g,',')
-                                        arr = value.split(',').filter((a: any)=>a)
+                                    let arr: any = []
+                                    if (value) {
+                                        value = value.replace(/[,,\s]/g, ',')
+                                        arr = value.split(',').filter((a: any) => a)
                                     }
-                                    set_queryFrom({...queryFrom,accountIdList: arr})
-                                    getList({...queryFrom, pageNum: 1, accountIdList: arr })
+                                    set_queryFrom({ ...queryFrom, accountIdList: arr })
+                                    getList({ ...queryFrom, pageNum: 1, accountIdList: arr })
                                 }
                             }}
                             onChange={(e) => {
                                 let value = e.target.value
                                 if (!value) {
-                                    let arr:any = []
-                                    if(value){
-                                        value = value.replace(/[,,\s]/g,',')
-                                        arr = value.split(',').filter((a: any)=>a)
+                                    let arr: any = []
+                                    if (value) {
+                                        value = value.replace(/[,,\s]/g, ',')
+                                        arr = value.split(',').filter((a: any) => a)
                                     }
-                                    set_queryFrom({...queryFrom,accountIdList: arr})
-                                    getList({...queryFrom, pageNum: 1,  accountIdList: arr })
+                                    set_queryFrom({ ...queryFrom, accountIdList: arr })
+                                    getList({ ...queryFrom, pageNum: 1, accountIdList: arr })
                                 }
                             }}
                         />
@@ -237,22 +247,22 @@ const Ad: React.FC<Props> = (props) => {
                             style={{ width: 150 }}
                             onBlur={(e) => {
                                 let value = e.target.value
-                                set_queryFrom({...queryFrom,adgroupName: value })
-                                getList({ ...queryFrom,pageNum: 1, adgroupName: value })
+                                set_queryFrom({ ...queryFrom, adgroupName: value })
+                                getList({ ...queryFrom, pageNum: 1, adgroupName: value })
                             }}
                             onKeyDownCapture={(e: any) => {
                                 let key = e.key
                                 if (key === 'Enter') {
                                     let value = e.target.value
-                                    set_queryFrom({...queryFrom,adgroupName: value })
-                                    getList({ ...queryFrom,pageNum: 1,  adgroupName: value })
+                                    set_queryFrom({ ...queryFrom, adgroupName: value })
+                                    getList({ ...queryFrom, pageNum: 1, adgroupName: value })
                                 }
                             }}
                             onChange={(e) => {
                                 let value = e.target.value
                                 if (!value) {
-                                    set_queryFrom({...queryFrom,adgroupName: value })
-                                    getList({...queryFrom, pageNum: 1,  adgroupName: value })
+                                    set_queryFrom({ ...queryFrom, adgroupName: value })
+                                    getList({ ...queryFrom, pageNum: 1, adgroupName: value })
                                 }
                             }}
                         />
@@ -264,37 +274,37 @@ const Ad: React.FC<Props> = (props) => {
                             style={{ width: 150 }}
                             onBlur={(e) => {
                                 let value = e.target.value
-                                let arr:any = []
-                                if(value){
-                                    value = value.replace(/[,,\s]/g,',')
-                                    arr = value.split(',').filter((a: any)=>a)
+                                let arr: any = []
+                                if (value) {
+                                    value = value.replace(/[,,\s]/g, ',')
+                                    arr = value.split(',').filter((a: any) => a)
                                 }
-                                set_queryFrom({...queryFrom,adgroupIdList: arr  })
-                                getList({...queryFrom, pageNum: 1,  adgroupIdList: arr })
+                                set_queryFrom({ ...queryFrom, adgroupIdList: arr })
+                                getList({ ...queryFrom, pageNum: 1, adgroupIdList: arr })
                             }}
                             onKeyDownCapture={(e: any) => {
                                 let key = e.key
                                 if (key === 'Enter') {
                                     let value = e.target.value
-                                    let arr:any = []
-                                    if(value){
-                                        value = value.replace(/[,,\s]/g,',')
-                                        arr = value.split(',').filter((a: any)=>a)
+                                    let arr: any = []
+                                    if (value) {
+                                        value = value.replace(/[,,\s]/g, ',')
+                                        arr = value.split(',').filter((a: any) => a)
                                     }
-                                    set_queryFrom({...queryFrom,adgroupIdList: arr  })
-                                    getList({...queryFrom, pageNum: 1,  adgroupIdList: arr })
+                                    set_queryFrom({ ...queryFrom, adgroupIdList: arr })
+                                    getList({ ...queryFrom, pageNum: 1, adgroupIdList: arr })
                                 }
                             }}
                             onChange={(e) => {
                                 let value = e.target.value
                                 if (!value) {
-                                    let arr:any = []
-                                    if(value){
-                                        value = value.replace(/[,,\s]/g,',')
-                                        arr = value.split(',').filter((a: any)=>a)
+                                    let arr: any = []
+                                    if (value) {
+                                        value = value.replace(/[,,\s]/g, ',')
+                                        arr = value.split(',').filter((a: any) => a)
                                     }
-                                    set_queryFrom({...queryFrom,adgroupIdList: arr  })
-                                    getList({...queryFrom, pageNum: 1,  adgroupIdList: arr })
+                                    set_queryFrom({ ...queryFrom, adgroupIdList: arr })
+                                    getList({ ...queryFrom, pageNum: 1, adgroupIdList: arr })
                                 }
                             }}
                         />
@@ -306,37 +316,37 @@ const Ad: React.FC<Props> = (props) => {
                             style={{ width: 150 }}
                             onBlur={(e) => {
                                 let value = e.target.value
-                                let arr:any = []
-                                if(value){
-                                    value = value.replace(/[,,\s]/g,',')
-                                    arr = value.split(',').filter((a: any)=>a)
+                                let arr: any = []
+                                if (value) {
+                                    value = value.replace(/[,,\s]/g, ',')
+                                    arr = value.split(',').filter((a: any) => a)
                                 }
-                                set_queryFrom({...queryFrom,campaignIdList: arr  })
-                                getList({ ...queryFrom,pageNum: 1,  campaignIdList: arr })
+                                set_queryFrom({ ...queryFrom, campaignIdList: arr })
+                                getList({ ...queryFrom, pageNum: 1, campaignIdList: arr })
                             }}
                             onKeyDownCapture={(e: any) => {
                                 let key = e.key
                                 if (key === 'Enter') {
                                     let value = e.target.value
-                                    let arr:any = []
-                                    if(value){
-                                        value = value.replace(/[,,\s]/g,',')
-                                        arr = value.split(',').filter((a: any)=>a)
+                                    let arr: any = []
+                                    if (value) {
+                                        value = value.replace(/[,,\s]/g, ',')
+                                        arr = value.split(',').filter((a: any) => a)
                                     }
-                                    set_queryFrom({...queryFrom,campaignIdList: arr  })
-                                    getList({ ...queryFrom,pageNum: 1,  campaignIdList: arr })
+                                    set_queryFrom({ ...queryFrom, campaignIdList: arr })
+                                    getList({ ...queryFrom, pageNum: 1, campaignIdList: arr })
                                 }
                             }}
                             onChange={(e) => {
                                 let value = e.target.value
                                 if (!value) {
-                                    let arr:any = []
-                                    if(value){
-                                        value = value.replace(/[,,\s]/g,',')
-                                        arr = value.split(',').filter((a: any)=>a)
+                                    let arr: any = []
+                                    if (value) {
+                                        value = value.replace(/[,,\s]/g, ',')
+                                        arr = value.split(',').filter((a: any) => a)
                                     }
-                                    set_queryFrom({...queryFrom,campaignIdList: arr  })
-                                    getList({ ...queryFrom,pageNum: 1,  campaignIdList: arr })
+                                    set_queryFrom({ ...queryFrom, campaignIdList: arr })
+                                    getList({ ...queryFrom, pageNum: 1, campaignIdList: arr })
                                 }
                             }}
                         />
@@ -351,8 +361,8 @@ const Ad: React.FC<Props> = (props) => {
                             }
                             allowClear
                             onChange={(value: any) => {
-                                set_queryFrom({...queryFrom,promotedObjectType: value  })
-                                getList({ ...queryFrom,pageNum: 1,  promotedObjectType: value })
+                                set_queryFrom({ ...queryFrom, promotedObjectType: value })
+                                getList({ ...queryFrom, pageNum: 1, promotedObjectType: value })
                             }}
                         >
                             {Object.keys(PromotedObjectType).map(key => {
@@ -370,8 +380,8 @@ const Ad: React.FC<Props> = (props) => {
                             }
                             allowClear
                             onChange={(value: any) => {
-                                set_queryFrom({...queryFrom,isDeleted: value  })
-                                getList({ ...queryFrom,pageNum: 1,  isDeleted: value })
+                                set_queryFrom({ ...queryFrom, isDeleted: value })
+                                getList({ ...queryFrom, pageNum: 1, isDeleted: value })
                             }}
                         >
                             <Select.Option value={true}>已删除</Select.Option>
@@ -389,13 +399,13 @@ const Ad: React.FC<Props> = (props) => {
                             }
                             allowClear
                             onChange={(value: any) => {
-                                set_queryFrom({...queryFrom,statusList: value  })
-                                getList({...queryFrom, pageNum: 1,  statusList: value })
+                                set_queryFrom({ ...queryFrom, statusList: value })
+                                getList({ ...queryFrom, pageNum: 1, statusList: value })
                             }}
                         >
                             {
-                                Object.keys(AdStatusEnum).map(key=>{
-                                    return  <Select.Option value={key} key={key}>{AdStatusEnum[key]}</Select.Option>
+                                Object.keys(AdStatusEnum).map(key => {
+                                    return <Select.Option value={key} key={key}>{AdStatusEnum[key]}</Select.Option>
                                 })
                             }
                         </Select>
@@ -407,37 +417,37 @@ const Ad: React.FC<Props> = (props) => {
                             style={{ width: 150 }}
                             onBlur={(e) => {
                                 let value = e.target.value
-                                let arr:any = []
-                                if(value){
-                                    value = value.replace(/[,,\s]/g,',')
-                                    arr = value.split(',').filter(a=>a)
+                                let arr: any = []
+                                if (value) {
+                                    value = value.replace(/[,,\s]/g, ',')
+                                    arr = value.split(',').filter(a => a)
                                 }
-                                set_queryFrom({...queryFrom,memoList: arr  })
-                                getList({...queryFrom, pageNum: 1,  memoList: arr })
+                                set_queryFrom({ ...queryFrom, memoList: arr })
+                                getList({ ...queryFrom, pageNum: 1, memoList: arr })
                             }}
                             onKeyDownCapture={(e: any) => {
                                 let key = e.key
                                 if (key === 'Enter') {
                                     let value = e.target.value
-                                    let arr:any = []
-                                    if(value){
-                                        value = value.replace(/[,,\s]/g,',')
-                                        arr = value.split(',').filter((a: any)=>a)
+                                    let arr: any = []
+                                    if (value) {
+                                        value = value.replace(/[,,\s]/g, ',')
+                                        arr = value.split(',').filter((a: any) => a)
                                     }
-                                    set_queryFrom({...queryFrom,memoList: arr  })
-                                    getList({...queryFrom, pageNum: 1,  memoList: arr })
+                                    set_queryFrom({ ...queryFrom, memoList: arr })
+                                    getList({ ...queryFrom, pageNum: 1, memoList: arr })
                                 }
                             }}
                             onChange={(e) => {
                                 let value = e.target.value
                                 if (!value) {
-                                    let arr:any = []
-                                    if(value){
-                                        value = value.replace(/[,,\s]/g,',')
-                                        arr = value.split(',').filter((a: any)=>a)
+                                    let arr: any = []
+                                    if (value) {
+                                        value = value.replace(/[,,\s]/g, ',')
+                                        arr = value.split(',').filter((a: any) => a)
                                     }
-                                    set_queryFrom({...queryFrom,memoList: arr  })
-                                    getList({...queryFrom, pageNum: 1, memoList: arr })
+                                    set_queryFrom({ ...queryFrom, memoList: arr })
+                                    getList({ ...queryFrom, pageNum: 1, memoList: arr })
                                 }
                             }}
                         />
@@ -449,37 +459,37 @@ const Ad: React.FC<Props> = (props) => {
                             style={{ width: 150 }}
                             onBlur={(e) => {
                                 let value = e.target.value
-                                let arr:any = []
-                                if(value){
-                                    value = value.replace(/[,,\s]/g,',')
-                                    arr = value.split(',').filter(a=>a)
+                                let arr: any = []
+                                if (value) {
+                                    value = value.replace(/[,,\s]/g, ',')
+                                    arr = value.split(',').filter(a => a)
                                 }
-                                set_queryFrom({...queryFrom,remarkList: arr  })
-                                getList({...queryFrom, pageNum: 1,  remarkList: arr })
+                                set_queryFrom({ ...queryFrom, remarkList: arr })
+                                getList({ ...queryFrom, pageNum: 1, remarkList: arr })
                             }}
                             onKeyDownCapture={(e: any) => {
                                 let key = e.key
                                 if (key === 'Enter') {
                                     let value = e.target.value
-                                    let arr:any = []
-                                    if(value){
-                                        value = value.replace(/[,,\s]/g,',')
-                                        arr = value.split(',').filter((a: any)=>a)
+                                    let arr: any = []
+                                    if (value) {
+                                        value = value.replace(/[,,\s]/g, ',')
+                                        arr = value.split(',').filter((a: any) => a)
                                     }
-                                    set_queryFrom({...queryFrom,remarkList: arr  })
-                                    getList({...queryFrom, pageNum: 1,  remarkList: arr })
+                                    set_queryFrom({ ...queryFrom, remarkList: arr })
+                                    getList({ ...queryFrom, pageNum: 1, remarkList: arr })
                                 }
                             }}
                             onChange={(e) => {
                                 let value = e.target.value
                                 if (!value) {
-                                    let arr:any = []
-                                    if(value){
-                                        value = value.replace(/[,,\s]/g,',')
-                                        arr = value.split(',').filter((a: any)=>a)
+                                    let arr: any = []
+                                    if (value) {
+                                        value = value.replace(/[,,\s]/g, ',')
+                                        arr = value.split(',').filter((a: any) => a)
                                     }
-                                    set_queryFrom({...queryFrom,remarkList: arr  })
-                                    getList({...queryFrom, pageNum: 1,  remarkList: arr })
+                                    set_queryFrom({ ...queryFrom, remarkList: arr })
+                                    getList({ ...queryFrom, pageNum: 1, remarkList: arr })
                                 }
                             }}
                         />
@@ -490,7 +500,7 @@ const Ad: React.FC<Props> = (props) => {
                         <Switch checkedChildren="普通模式" unCheckedChildren="深度优化" checked={model} onChange={(checked) => { setModel(checked); setSelectedRows([]) }} style={model ? {} : { background: '#67c23a' }} />
                     </Col>
                     {model ? <>
-                        <Col><Button type='primary' style={{ background: '#1890ff' }} icon={<FieldTimeOutlined />} disabled={selectedRows.length === 0} onClick={editScheduling}>修改排期出价</Button></Col>
+                        <Col><Button type='primary' style={{ background: '#1890ff' }} icon={<FieldTimeOutlined />} disabled={selectedRows.length === 0} onClick={editScheduling}>修改排期出价名称</Button></Col>
                         <Col><Button type='primary' style={{ background: '#1890ff' }} icon={<CopyOutlined />} disabled={selectedRows.length === 0} onClick={copyHandle}>批量复制</Button></Col>
                         <Col><Button type='primary' style={{ background: '#67c23a', borderColor: '#67c23a' }} loading={editAdqAdgroupsData.loading} icon={<PlayCircleOutlined />} disabled={selectedRows.length === 0} onClick={() => adStatus('play')}>启动广告</Button></Col>
                         <Col><Button type='primary' style={{ background: '#e6a23c', borderColor: '#e6a23c' }} loading={editAdqAdgroupsData.loading} icon={<PauseCircleOutlined />} disabled={selectedRows.length === 0} onClick={() => adStatus('suspend')}>暂停广告</Button></Col>
@@ -527,8 +537,8 @@ const Ad: React.FC<Props> = (props) => {
             onChange={(props: any) => {
                 let { sortData, pagination } = props
                 let { current, pageSize } = pagination
-                set_queryFrom({...queryFrom,pageNum:current,pageSize})
-                getList({...queryFrom, pageNum: current, pageSize })
+                set_queryFrom({ ...queryFrom, pageNum: current, pageSize })
+                getList({ ...queryFrom, pageNum: current, pageSize })
             }}
         />
     </div>

+ 1 - 3
src/pages/launchSystemNew/adq/ad/tableConfig.tsx

@@ -96,9 +96,7 @@ function tableConfig(
             key: 'adgroupName',
             width: 280,
             ellipsis: true,
-            render: (a: string) => {
-                return <a style={{ wordBreak: 'break-all' }} onClick={() => { copy(a) }}>{a}</a>
-            }
+            editable: true
         },
         {
             title: '推广目标类型',

+ 12 - 2
src/pages/launchSystemNew/adq/ad/updateAd.tsx

@@ -48,6 +48,7 @@ const UpdateAd: React.FC<Props> = ({ title = '修改广告', visible, onChange,
             let adgroupsUpdateDatetimeDTO = {}  // 排期
             let adgroupsUpdateBidAmountDTO = {} // 出价
             let deepConversionSpec = {} // ROI
+            let data = {}
             if (timeSeriesType === 'allDayLong') {
                 newValues.timeSeries = getTimeSeriesList()
             }
@@ -88,11 +89,14 @@ const UpdateAd: React.FC<Props> = ({ title = '修改广告', visible, onChange,
                             adgroupsUpdateBidAmountDTO['bidStrategy'] = newValues.bidStrategy
                             adgroupsUpdateBidAmountDTO['bidAmount'] = newValues.bidAmount * 100
                             break
+                        case 'adgroupName':
+                            data['adgroupName'] = newValues.adgroupName
+                            break
                     }
                 })
             }
-            // console.log('params--->', adgroupsUpdateDatetimeDTO);
-            editAdqAdgroupsData.run({ adgroupIds: selectedRows.map((item: { adgroupId: number }) => item.adgroupId), adgroupsUpdateDatetimeDTO, adgroupsUpdateBidAmountDTO, deepConversionSpec }).then(res => {
+            
+            editAdqAdgroupsData.run({ adgroupIds: selectedRows.map((item: { adgroupId: number }) => item.adgroupId), adgroupsUpdateDatetimeDTO, adgroupsUpdateBidAmountDTO, deepConversionSpec, ...data }).then(res => {
                 if (res) {
                     message.success(`修改操作完成.结果请在操作记录查询!`)//成功: ${res.success},失败: ${res.fail}
                     if (res?.fail) {
@@ -154,6 +158,7 @@ const UpdateAd: React.FC<Props> = ({ title = '修改广告', visible, onChange,
                                 </Tooltip>}
                             </Space>
                         </Checkbox>
+                        <Checkbox value="adgroupName">广告名称</Checkbox>
                     </Checkbox.Group>
                 </Form.Item>
                 {field?.includes('dateType') && <>
@@ -218,6 +223,11 @@ const UpdateAd: React.FC<Props> = ({ title = '修改广告', visible, onChange,
                         <Input placeholder={`输入价格 元`} style={{ width: 300 }} />
                     </Form.Item>
                 </>}
+                {field?.includes('adgroupName') && <>
+                    <Form.Item label={<strong>广告名称</strong>} name='adgroupName' rules={[{ required: true, message: '请输入广告名称' }]}>
+                        <Input placeholder={`请输入广告名称`} style={{ width: 300 }} />
+                    </Form.Item>
+                </>}
             </> : <>
                 <Form.Item label={<strong>深度优化方式</strong>} name='optimizationMode' rules={[{ required: true, message: '请选择深度优化方式' }]}>
                     <Radio.Group disabled>

+ 21 - 0
src/pages/launchSystemNew/adq/ad/updateAdName.tsx

@@ -0,0 +1,21 @@
+import React from "react"
+
+
+
+
+interface Props {
+
+}
+const updateAdName: React.FC<Props> = (props) => {
+
+    /*******************************/
+    const {} = props
+    /*******************************/
+
+    return <div>
+
+    </div>
+}
+
+
+export default React.memo(updateAdName)

+ 56 - 21
src/pages/launchSystemNew/adq/adAccount/index.tsx

@@ -1,6 +1,6 @@
 
 import { useAjax } from '@/Hook/useAjax'
-import {  Row,  message } from 'antd'
+import { Row, message, Input } from 'antd'
 import React, { useEffect, useState, useCallback } from 'react'
 import TableData from '../../components/TableData'
 import tableConfig from './tableConfig'
@@ -28,28 +28,26 @@ type Props = {
         }
     }) => void
 }
-function AdAccount(props:Props) {
-    let { accountId, adAccountId, userId,tableIdClick } = props
-    let [selectedRowKeys,setSelectedRowKeys]=useState<any[]>([])
+function AdAccount(props: Props) {
+    let { adAccountId, userId } = props
+    let [selectedRowKeys, setSelectedRowKeys] = useState<any[]>([])
+    const [queryForm, setQueryForm] = useState<{
+        pageNum: number;
+        pageSize: number;
+        accountIds?: string;
+        adcreativeName?: string;
+    }>({pageNum: 1, pageSize: 20})
     // api方法
     const listAjax = useAjax((params) => getAdqAdAccountList(params), { formatResult: true })
     const syncAjax = useAjax((params) => putAdqAdAccountSyncByIds(params))
     console.log('创意=====》')
     useEffect(() => {
-        getList({ pageNum: 1, pageSize: 20 })
-    }, [accountId, userId])
+        getList()
+    }, [queryForm, userId])
     // 获取列表
-    const getList = useCallback((params: {
-        pageNum: number;
-        pageSize: number;
-        accountId?: string;
-        adcreativeName?: string;
-    }) => {
-        if (!params.adcreativeName || params.adcreativeName !== listAjax?.params[0]?.adcreativeName) {
-            !params.adcreativeName && delete params.adcreativeName
-            listAjax.run({ ...params, userId, accountIds:accountId?[accountId]:null })
-        }
-    }, [accountId, userId, listAjax])
+    const getList = useCallback(() => {
+        listAjax.run({ ...queryForm, userId })
+    }, [queryForm, userId, listAjax])
     // 同步 
     const sync = useCallback(() => {
         if (selectedRowKeys?.length === 0) {
@@ -61,21 +59,58 @@ function AdAccount(props:Props) {
             res ? message.success('同步成功!') : message.error('同步失败!')
 
         })
-    }, [adAccountId, listAjax,selectedRowKeys])
+    }, [adAccountId, listAjax, selectedRowKeys])
     return <div>
         <TableData
             isCard={false}
-            columns={()=>tableConfig(tableIdClick)}
+            columns={() => tableConfig()}
             ajax={listAjax}
             syncAjax={sync}
             dataSource={listAjax?.data?.data?.records}
             loading={listAjax?.loading || syncAjax?.loading}
-            scroll={{ y:550 }}
+            scroll={{ y: 550 }}
             total={listAjax?.data?.data?.total}
             page={listAjax?.data?.data?.current}
             pageSize={listAjax?.data?.data?.size}
             leftChild={<>
                 <Row gutter={[10, 10]}>
+                    <Input
+                        placeholder='广告账号'
+                        allowClear
+                        style={{ width: 150 }}
+                        onBlur={(e) => {
+                            let value = e.target.value
+                            let arr: any = []
+                            if (value) {
+                                value = value.replace(/[,,\s]/g, ',')
+                                arr = value.split(',').filter(a => a)
+                            }
+                            setQueryForm({ ...queryForm, accountIds: arr })
+                        }}
+                        onKeyDownCapture={(e: any) => {
+                            let key = e.key
+                            if (key === 'Enter') {
+                                let value = e.target.value
+                                let arr: any = []
+                                if (value) {
+                                    value = value.replace(/[,,\s]/g, ',')
+                                    arr = value.split(',').filter((a: any) => a)
+                                }
+                                setQueryForm({ ...queryForm, accountIds: arr })
+                            }
+                        }}
+                        onChange={(e) => {
+                            let value = e.target.value
+                            if (!value) {
+                                let arr: any = []
+                                if (value) {
+                                    value = value.replace(/[,,\s]/g, ',')
+                                    arr = value.split(',').filter((a: any) => a)
+                                }
+                                setQueryForm({ ...queryForm, accountIds: arr })
+                            }
+                        }}
+                    />
                 </Row>
             </>}
             rowSelection={{
@@ -86,7 +121,7 @@ function AdAccount(props:Props) {
             onChange={(props: any) => {
                 let { sortData, pagination } = props
                 let { current, pageSize } = pagination
-                getList({ pageNum: current, pageSize })
+                setQueryForm({ ...queryForm, pageNum: current, pageSize })
             }}
         />
     </div>

+ 14 - 28
src/pages/launchSystemNew/adq/adAccount/tableConfig.tsx

@@ -1,38 +1,24 @@
-import {  FundStatusEnum, } from '@/services/launchAdq/enum'
+import { FundStatusEnum, } from '@/services/launchAdq/enum'
 import React from 'react'
 import { Badge } from 'antd'
-function tableConfig(tableIdClick: (props: {
-    activeKey: string,
-    parma: {
-        accountId?: string,//账户ID
-        campaignId?: string,//计划ID
-        adgroupId?: string,//广告ID
-        adcreativeId?: string,//创意ID
-        pageId?: string,//落地页ID
-        targetingId?: string,//定向ID
-    }
-}) => void):any{
+import { copy } from '@/utils/utils'
+function tableConfig(): any {
     return [
         {
             title: 'ID',
             dataIndex: 'id',
             key: 'id',
             align: 'center',
-            width:50,
-            render:(a:string)=>{
-                return <a>{a}</a>
-            }
+            width: 50
         },
         {
             title: '账号ID',
             dataIndex: 'accountId',
             key: 'accountId',
             align: 'center',
-            width:90,
-            render:(a:string)=>{
-                return <a onClick={() => {
-                    tableIdClick({ activeKey: '1', parma: { accountId: a } })
-                }}>{a}</a>
+            width: 90,
+            render: (a: string) => {
+                return <a onClick={() => { copy(a) }}>{a}</a>
             }
         },
         {
@@ -58,26 +44,26 @@ function tableConfig(tableIdClick: (props: {
             dataIndex: 'balance',
             key: 'balance',
             align: 'center',
-            width:150,
+            width: 150,
         },
         {
             title: '资金状态',
             dataIndex: 'fundStatus',
             key: 'fundStatus',
             align: 'center',
-            width:130,
-           render:(a: string | number)=>{
-            return FundStatusEnum[a]
-           } 
+            width: 130,
+            render: (a: string | number) => {
+                return FundStatusEnum[a]
+            }
         },
         {
             title: '是否有效',
             dataIndex: 'enabled',
             key: 'enabled',
             align: 'center',
-            width:130,
+            width: 130,
             render: (a: any, b: any) => {
-                return  <Badge status={a ? "processing" :"error" } text={a? '是' : '否'} />
+                return <Badge status={a ? "processing" : "error"} text={a ? '是' : '否'} />
             }
         },
     ]

+ 24 - 24
src/pages/launchSystemNew/adq/index.tsx

@@ -179,31 +179,31 @@ function Adq() {
         <div className={style.right} style={!hide ? { width: 'calc(100% - 150px)' } : { width: '100%' }}>
             <div className={style.hiddenBtn}><Button size='small' type="primary" onClick={() => setHide(!hide)} icon={!hide ? <MenuFoldOutlined /> : <MenuUnfoldOutlined />} /></div>
             <Card>
-                <Tabs activeKey={activeKey} type="card" onChange={(activeKey) => { setActiveKey(activeKey) }} tabBarExtraContent={
-                    <Select
-                        placeholder='广点通账号'
-                        style={{ minWidth: 200 }}
-                        showSearch
-                        allowClear
-                        onChange={(value: any) => {
-                            let accountId = ''
-                            let adAccountId = ''
-                            if (value) {
-                                let arr = value.split('_')
-                                accountId = arr[0]
-                                adAccountId = arr[1]
-                            }
-                            setIds({ accountId, adAccountId })
-                        }}
-                        value={idS.accountId ? idS.accountId + '_' + idS.adAccountId : null}
-                    >
-                        {
-                            selectedArr?.map((item: any) => {
-                                return <Select.Option value={item.key} key={item.key}>{item.label}</Select.Option>
-                            })
+                <Tabs activeKey={activeKey} type="card" onChange={(activeKey) => { setActiveKey(activeKey) }} tabBarExtraContent={<>
+                    {/* <Select
+                    placeholder='广点通账号'
+                    style={{ minWidth: 200 }}
+                    showSearch
+                    allowClear
+                    onChange={(value: any) => {
+                        let accountId = ''
+                        let adAccountId = ''
+                        if (value) {
+                            let arr = value.split('_')
+                            accountId = arr[0]
+                            adAccountId = arr[1]
                         }
-                    </Select>
-                }>
+                        setIds({ accountId, adAccountId })
+                    }}
+                    value={idS.accountId ? idS.accountId + '_' + idS.adAccountId : null}
+                >
+                    {
+                        selectedArr?.map((item: any) => {
+                            return <Select.Option value={item.key} key={item.key}>{item.label}</Select.Option>
+                        })
+                    }
+                </Select> */}
+                </>}>
                     {
                         tabsConfig?.map(item => {
                             return <TabPane tab={item.tab} key={item.key} >

+ 6 - 4
src/pages/launchSystemNew/components/TableData/index.tsx

@@ -1,5 +1,5 @@
 import CustomListModel from '@/components/CustomList'
-import Tables from '@/components/Tables'
+import Tables, { DataType } from '@/components/Tables'
 import { quanpin } from '@/utils/fullScreen'
 import { FullscreenExitOutlined, FullscreenOutlined, RedoOutlined, SettingOutlined, SyncOutlined } from '@ant-design/icons'
 import { Button, Card, Col, Row, Space, Spin, Tooltip, } from 'antd'
@@ -47,10 +47,11 @@ interface Prosp {
     bodyStyle?: any
     gutter?: any
     isCard?: boolean
+    handleSave?: (row: DataType) => void
 }
 
 function TableData(props: Prosp) {
-    const { isZj, scroll, columns, title, dataSource, expandedRowRender, className, isCard = true, leftChild, page = undefined, rowSelection = false, pageSize = undefined, size = 'small', fixed = { left: 0, right: 1 }, total = 0, loading = false, onChange, config, configName, ajax, syncAjax, hoverable = true, myKey, gutter = [0, 20] } = props
+    const { isZj, scroll, columns, title, dataSource, expandedRowRender, className, isCard = true, leftChild, handleSave, page = undefined, rowSelection = false, pageSize = undefined, size = 'small', fixed = { left: 0, right: 1 }, total = 0, loading = false, onChange, config, configName, ajax, syncAjax, hoverable = true, myKey, gutter = [0, 20] } = props
     const { state: userState } = useModel('useOperating.useUser')
     const { isFell } = userState
     const [visible, setVisible] = useState<boolean>(false)
@@ -252,7 +253,7 @@ function TableData(props: Prosp) {
                 </Row>
             </Card> : <Row gutter={gutter}>
                 {header}
-                <Tab {...{ size, newColumns, handelResize, className, isZj, rowSelection, columns, loading, scroll, isFell, page, pageSize, dataSource, onChange, expandedRowRender, total, ajax, myKey }} />
+                <Tab {...{ size, newColumns, handelResize, className, isZj, rowSelection, columns, loading, handleSave, scroll, isFell, page, pageSize, dataSource, onChange, expandedRowRender, total, ajax, myKey }} />
             </Row>}
         </Col>
     </Row >
@@ -263,7 +264,7 @@ function TableData(props: Prosp) {
 
 /**表格 */
 const Tab = React.memo((props: any) => {
-    const { size, newColumns, className, handelResize, columns, scroll, loading, rowSelection, isFell, page, pageSize, dataSource, onChange, expandedRowRender, total, ajax, myKey } = props
+    const { size, newColumns, className, handelResize, columns, scroll, loading, handleSave, rowSelection, isFell, page, pageSize, dataSource, onChange, expandedRowRender, total, ajax, myKey } = props
     return < Col span={24} >
         <div className={`${style[size]} ${className ? style[className] : ''} `}>
             {dataSource || !ajax?.loading ? <Tables
@@ -285,6 +286,7 @@ const Tab = React.memo((props: any) => {
                 rowSelection={rowSelection}
                 handelResize={((columns: any) => handelResize(columns))}
                 myKey={myKey}
+                handleSave={handleSave}
             /> : <div className={style.example}>
                 <Spin />
             </div>}

+ 11 - 4
src/services/launchAdq/adq.ts

@@ -120,20 +120,26 @@ export async function delAdqAdgroupsApi({ adAccountId, adgroupId }: { adAccountI
 }
 
 export interface EditAdqAdgroupsProps {
-  adgroupIds: number[],   // 广告组id列表
-  adgroupsUpdateBidAmountDTO?: { // 出价
+  /** 广告组id列表 */
+  adgroupIds: number[],
+  /** 广告名称 */ 
+  adgroupName?: string,
+  /** 出价 */
+  adgroupsUpdateBidAmountDTO?: {
     bidAmount: number,  // 出价
     bidMode: string,    // 出价方式
     bidStrategy: string,// 出价策略
     optimizationGoal: string,  // 出价目标
   },
-  adgroupsUpdateDatetimeDTO?: { // 排期
+  /** 排期 */
+  adgroupsUpdateDatetimeDTO?: {
     beginDate: string,
     endDate?: string,
     firstDayBeginTime?: string,
     timeSeries?: string
   },
-  deepConversionSpec?: { // 深度优化
+  /** 深度优化 */
+  deepConversionSpec?: {
     deepConversionType: string,
     deepConversionBehaviorSpec?: {
       bidAmount: number,
@@ -148,6 +154,7 @@ export interface EditAdqAdgroupsProps {
       goal: string
     }
   },
+  /** 启停状态 */
   configuredStatus?: string
 }
 export async function editAdqAdgroupsDataApi(data: EditAdqAdgroupsProps) {