فهرست منبع

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

wjx 2 سال پیش
والد
کامیت
68a04e83ca

+ 1 - 1
src/components/Tables/EditableCell.tsx

@@ -62,7 +62,7 @@ const EditableCell: React.FC<EditableCellProps> = ({
             name={dataIndex}
             rules={[{ required: true, message: `${title} is required.` }]}
         >
-            <Input ref={inputRef} onPressEnter={save} onBlur={save} />
+            <Input ref={inputRef} size="small" onPressEnter={save} onBlur={save} bordered/>
         </Form.Item>) : (<div className="editable-cell-value-wrap ellipsisText" onClick={toggleEdit}>
             {children}
         </div>);

+ 2 - 2
src/components/Tables/index.less

@@ -15,13 +15,13 @@
 }
 
 .editable-cell-value-wrap {
-    padding: 5px;
+    padding: 1px 2px;
     cursor: pointer;
     box-sizing: border-box;
 }
 
 .editable-cell-value-wrap:hover {
-    padding: 5px;
+    padding: 1px 2px;
     box-shadow: 0 0 0 1px #d9d9d9;
     border-radius: 4px;
 }

+ 15 - 10
src/pages/launchSystemNew/adq/ad/index.tsx

@@ -10,6 +10,7 @@ import { CopyOutlined, DeleteOutlined, FieldTimeOutlined, PauseCircleOutlined, P
 import UpdateAd from './updateAd'
 import Copy from './copy'
 import PlanDetail from '@/pages/adMonitor/adMonitorList/components/planDetail'
+import { txAdConfig } from '../config'
 
 type Props = {
     accountId: string,
@@ -199,6 +200,7 @@ const Ad: React.FC<Props> = (props) => {
             columns={() => tableConfig(onChange, details, tableIdClick)}
             ajax={listAjax}
             syncAjax={sync}
+            fixed={{ left: 2, right: 4 }}
             dataSource={listAjax?.data?.data?.records}
             loading={listAjax?.loading || syncAjax?.loading}
             scroll={{ y: 560 }}
@@ -207,13 +209,16 @@ const Ad: React.FC<Props> = (props) => {
             pageSize={listAjax?.data?.data?.size}
             myKey={'adgroupId'}
             handleSave={handleSave}
+            gutter={[0, 10]}
+            config={txAdConfig}
+            configName="腾讯广告"
             leftChild={<Space direction='vertical'>
-                <Row gutter={[10, 10]} align='middle'>
+                <Row gutter={[6, 6]} align='middle'>
                     <Col>
                         <Input
                             placeholder='广告账号'
                             allowClear
-                            style={{ width: 150 }}
+                            style={{ width: 120 }}
                             onBlur={(e) => {
                                 let value = e.target.value
                                 let arr: any = []
@@ -255,7 +260,7 @@ const Ad: React.FC<Props> = (props) => {
                         <Input
                             placeholder='广告名称'
                             allowClear
-                            style={{ width: 150 }}
+                            style={{ width: 120 }}
                             onBlur={(e) => {
                                 let value = e.target.value
                                 set_queryFrom({ ...queryFrom, adgroupName: value })
@@ -282,7 +287,7 @@ const Ad: React.FC<Props> = (props) => {
                         <Input
                             placeholder='广告ID'
                             allowClear
-                            style={{ width: 150 }}
+                            style={{ width: 120 }}
                             onBlur={(e) => {
                                 let value = e.target.value
                                 let arr: any = []
@@ -324,7 +329,7 @@ const Ad: React.FC<Props> = (props) => {
                         <Input
                             placeholder='计划ID'
                             allowClear
-                            style={{ width: 150 }}
+                            style={{ width: 120 }}
                             onBlur={(e) => {
                                 let value = e.target.value
                                 let arr: any = []
@@ -365,7 +370,7 @@ const Ad: React.FC<Props> = (props) => {
                     <Col>
                         <Select
                             placeholder='推广目标选择'
-                            style={{ width: 150 }}
+                            style={{ width: 120 }}
                             showSearch
                             filterOption={(input: any, option: any) =>
                                 (option!.children as unknown as string).toLowerCase().includes(input.toLowerCase())
@@ -384,7 +389,7 @@ const Ad: React.FC<Props> = (props) => {
                     <Col>
                         <Select
                             placeholder='是否已删除'
-                            style={{ width: 150 }}
+                            style={{ width: 120 }}
                             showSearch
                             filterOption={(input: any, option: any) =>
                                 (option!.children as unknown as string).toLowerCase().includes(input.toLowerCase())
@@ -403,7 +408,7 @@ const Ad: React.FC<Props> = (props) => {
                         <Select
                             placeholder='广告状态'
                             mode="multiple"
-                            style={{ width: 200 }}
+                            style={{ width: 120 }}
                             showSearch
                             filterOption={(input: any, option: any) =>
                                 (option!.children as unknown as string).toLowerCase().includes(input.toLowerCase())
@@ -425,7 +430,7 @@ const Ad: React.FC<Props> = (props) => {
                         <Input
                             placeholder='腾讯备注'
                             allowClear
-                            style={{ width: 150 }}
+                            style={{ width: 120 }}
                             onBlur={(e) => {
                                 let value = e.target.value
                                 let arr: any = []
@@ -467,7 +472,7 @@ const Ad: React.FC<Props> = (props) => {
                         <Input
                             placeholder='本地备注'
                             allowClear
-                            style={{ width: 150 }}
+                            style={{ width: 120 }}
                             onBlur={(e) => {
                                 let value = e.target.value
                                 let arr: any = []

+ 1 - 1
src/pages/launchSystemNew/adq/ad/switchStatus.tsx

@@ -33,7 +33,7 @@ const SwitchStatus: React.FC<Props> = (prosp) => {
         })
     }
 
-    return <Switch checked={configuredStatus === 'AD_STATUS_NORMAL'} loading={editAdqAdgroupsData.loading} disabled={isDeleted} onChange={(checked) => switchHandle([adgroupId] ,checked ? 'AD_STATUS_NORMAL' : 'AD_STATUS_SUSPEND')}/>
+    return <Switch size="small" checked={configuredStatus === 'AD_STATUS_NORMAL'} loading={editAdqAdgroupsData.loading} disabled={isDeleted} onChange={(checked) => switchHandle([adgroupId] ,checked ? 'AD_STATUS_NORMAL' : 'AD_STATUS_SUSPEND')}/>
 }
 
 

+ 16 - 16
src/pages/launchSystemNew/adq/ad/tableConfig.tsx

@@ -28,7 +28,7 @@ function tableConfig(
             dataIndex: 'configuredStatus',
             key: 'configuredStatus',
             align: 'center',
-            width: 55,
+            width: 40,
             fixed: 'left',
             render: (a: string, b: any) => {
                 return <SwitchStatus configuredStatus={a} isDeleted={b?.isDeleted} adgroupId={b?.adgroupId} onChange={onChange} />
@@ -40,7 +40,6 @@ function tableConfig(
             key: 'accountId',
             align: 'center',
             width: 100,
-            fixed: 'left',
             ellipsis: true,
             render: (a: string) => {
                 return <Space>
@@ -55,8 +54,7 @@ function tableConfig(
             dataIndex: 'memo',
             key: 'memo',
             align: 'center',
-            width: 90,
-            fixed: 'left',
+            width: 80,
             ellipsis: true,
         },
         {
@@ -64,8 +62,7 @@ function tableConfig(
             dataIndex: 'remark',
             key: 'remark',
             align: 'center',
-            width: 90,
-            fixed: 'left',
+            width: 80,
             ellipsis: true,
         },
         {
@@ -74,7 +71,6 @@ function tableConfig(
             key: 'adgroupId',
             align: 'center',
             width: 120,
-            fixed: 'left',
             ellipsis: true,
             render: (a: string, b: any) => {
                 return <Space>
@@ -91,7 +87,6 @@ function tableConfig(
             key: 'campaignId',
             align: 'center',
             width: 120,
-            fixed: 'left',
             ellipsis: true,
             render: (a: string, b: any) => {
                 return <Space >
@@ -115,7 +110,8 @@ function tableConfig(
             dataIndex: 'promotedObjectType',
             key: 'promotedObjectType',
             align: 'center',
-            width: 85,
+            width: 75,
+            ellipsis: true,
             render: (a: string | number) => {
                 return PromotedObjectType[a]
             }
@@ -135,7 +131,8 @@ function tableConfig(
             dataIndex: 'beginDate',
             key: 'beginDate',
             align: 'center',
-            width: 160,
+            width: 150,
+            ellipsis: true,
             render: (a: string, b: { endDate: string }) => {
                 return b?.endDate ? a + '~' + b.endDate : a + '~' + '长期投放'
             }
@@ -155,13 +152,13 @@ function tableConfig(
             dataIndex: 'firstDayBeginTime',
             key: 'firstDayBeginTime',
             align: 'center',
-            width: 75,
+            width: 70,
         },
         {
             title: '出价',
             dataIndex: 'bidAmount',
             key: 'bidAmount',
-            width: 150,
+            width: 140,
             ellipsis: true,
             render: (a: string, b: { bidMode: string, optimizationGoal: string }) => {
                 return `${BidModeEnum[b?.bidMode]} ${a}元/${b?.bidMode === 'BID_MODE_CPM' ? '千次曝光' : b?.bidMode === 'BID_MODE_CPC' ? '点击' : OptimizationGoalEnum[b?.optimizationGoal]}`
@@ -173,6 +170,7 @@ function tableConfig(
             key: 'smartBidType',
             align: 'center',
             width: 80,
+            ellipsis: true,
             render: (a: string, b: { endDate: string }) => {
                 return a === 'SMART_BID_TYPE_CUSTOM' ? '手动出价' : '自动出价'
             }
@@ -182,7 +180,8 @@ function tableConfig(
             dataIndex: 'bidStrategy',
             key: 'bidStrategy',
             align: 'center',
-            width: 80,
+            width: 70,
+            ellipsis: true,
             render: (a: string, b: { endDate: string }) => {
                 return BidStrategyEnum[a]
             }
@@ -192,7 +191,7 @@ function tableConfig(
             dataIndex: 'dailyBudget',
             key: 'dailyBudget',
             align: 'center',
-            width: 80,
+            width: 70,
         },
         {
             title: '是否开启自动版位功能',
@@ -210,6 +209,7 @@ function tableConfig(
             key: 'createdTime',
             align: 'center',
             width: 140,
+            ellipsis: true,
         },
         // {
         //     title: '客户设置的状态',
@@ -227,7 +227,6 @@ function tableConfig(
             key: 'isDeleted',
             align: 'center',
             width: 60,
-            fixed: 'right',
             render: (a: any, b: any) => {
                 return <Badge status={!a ? "processing" : "error"} text={a ? '是' : '否'} />
             }
@@ -237,8 +236,9 @@ function tableConfig(
             dataIndex: 'status',
             key: 'status',
             align: 'center',
-            width: 80,
+            width: 70,
             fixed: 'right',
+            ellipsis: true,
             render: (a: string) => {
                 return AdStatusEnum[a]
             }

+ 34 - 0
src/pages/launchSystemNew/adq/config.ts

@@ -0,0 +1,34 @@
+/**广告 */
+const txAdConfig = [
+    {
+        label: '设置信息',
+        data: [
+            { title: '启停', dataIndex: 'configuredStatus', label: '设置信息', default: 1, width: 40 },
+            { title: '所属账号', dataIndex: 'accountId', label: '设置信息', default: 2, width: 100 },
+            { title: '腾讯备注', dataIndex: 'memo', label: '设置信息', default: 3, width: 80 },
+            { title: '本地备注', dataIndex: 'remark', label: '设置信息', default: 4, width: 80 },
+            { title: '广告ID', dataIndex: 'adgroupId', label: '设置信息', default: 5, width: 120 },
+            { title: '所属计划ID', dataIndex: 'campaignId', label: '设置信息', default: 6, width: 120 },
+            { title: '广告名称', dataIndex: 'adgroupName', label: '设置信息', default: 7, width: 280 },
+            { title: '推广目标类型', dataIndex: 'promotedObjectType', label: '设置信息', default: 8, width: 75 },
+            { title: '投放日期', dataIndex: 'beginDate', label: '设置信息', default: 9, width: 150 },
+            { title: '投放时间', dataIndex: 'timeSeries', label: '设置信息', default: 10, width: 55 },
+            { title: '首日开始投放时间', dataIndex: 'firstDayBeginTime', label: '设置信息', default: 11, width: 70 },
+            { title: '出价', dataIndex: 'bidAmount', label: '设置信息', default: 12, width: 140 },
+            { title: '出价类型', dataIndex: 'smartBidType', label: '设置信息', default: 13, width: 80 },
+            { title: '广告组日预算(分)', dataIndex: 'dailyBudget', label: '设置信息', default: 14, width: 70 },
+            { title: '是否开启自动版位功能', dataIndex: 'automaticSiteEnabled', label: '设置信息', default: 15, width: 80 },
+            { title: '创建时间', dataIndex: 'createdTime', label: '设置信息', default: 16, width: 140 },
+            { title: '是否已删除', dataIndex: 'isDeleted', label: '设置信息', default: 17, width: 60 },
+            { title: '广告状态', dataIndex: 'status', label: '设置信息', default: 18, width: 70 },
+            { title: '创意预览', dataIndex: 'creativePreview', label: '设置信息', default: 19, width: 70 },
+            { title: '单位时间消耗速度', dataIndex: 'costSpeed', label: '设置信息', default: 20, width: 80 },
+            { title: '操作', dataIndex: 'cz', label: '设置信息', default: 21, width: 65 },
+        ]
+    }
+]
+
+
+export {
+    txAdConfig
+}

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

@@ -178,8 +178,8 @@ function Adq() {
         </div>}
         <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={<>
+            <Card bodyStyle={{ padding: '12px 16px' }}>
+                <Tabs activeKey={activeKey} size="small" type="card" onChange={(activeKey) => { setActiveKey(activeKey) }} tabBarExtraContent={<>
                     {/* <Select
                     placeholder='广点通账号'
                     style={{ minWidth: 200 }}