tableConfig.tsx 8.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247
  1. import { BidStrategyEnum } from '@/services/launchAdq/enum'
  2. import React from 'react'
  3. import { Badge, Space } from 'antd'
  4. import '../index.less'
  5. import { copy } from '@/utils/utils'
  6. import { ADGROUP_STATUS } from '../const'
  7. import SwitchStatus from './switchStatus'
  8. import TimeSeriesLook from '@/pages/launchSystemNew/adq/ad/timeSeriesLook'
  9. import CreativePreview from '../../adMonitorListV3/CreativePreview'
  10. import { BID_MODE_ENUM, OPTIMIZATIONGOAL_ENUM } from '../../tencentAdPutIn/const'
  11. function tableConfig(onChange: () => void, creativeHandle?: (id: number) => void): any {
  12. return [
  13. {
  14. title: '启停',
  15. dataIndex: 'configuredStatus',
  16. key: 'configuredStatus',
  17. align: 'center',
  18. width: 40,
  19. fixed: 'left',
  20. render: (a: string, b: any) => {
  21. return <SwitchStatus configuredStatus={a} accountId={b?.accountId} isDeleted={b?.isDeleted} adgroupId={b?.adgroupId} onChange={onChange} />
  22. }
  23. },
  24. {
  25. title: '所属账号',
  26. dataIndex: 'accountId',
  27. key: 'accountId',
  28. align: 'center',
  29. width: 80,
  30. ellipsis: true,
  31. render: (a: string) => {
  32. return <Space>
  33. <a onClick={() => copy(a)} >{a}</a>
  34. </Space>
  35. }
  36. },
  37. {
  38. title: '腾讯备注',
  39. dataIndex: 'memo',
  40. key: 'memo',
  41. align: 'center',
  42. width: 80,
  43. ellipsis: true,
  44. render: (a: string) => {
  45. return a || '--'
  46. }
  47. },
  48. {
  49. title: '本地备注',
  50. dataIndex: 'remark',
  51. key: 'remark',
  52. align: 'center',
  53. width: 80,
  54. ellipsis: true,
  55. render: (a: string) => {
  56. return a || '--'
  57. }
  58. },
  59. {
  60. title: '广告ID',
  61. dataIndex: 'adgroupId',
  62. key: 'adgroupId',
  63. align: 'center',
  64. width: 100,
  65. ellipsis: true,
  66. render: (a: string, b: any) => {
  67. return <Space>
  68. <a onClick={() => copy(a)} >{a}</a>
  69. </Space>
  70. }
  71. },
  72. {
  73. title: '投手',
  74. dataIndex: 'putUserName',
  75. key: 'putUserName',
  76. align: 'center',
  77. width: 70,
  78. ellipsis: true
  79. },
  80. {
  81. title: '广告名称',
  82. dataIndex: 'adgroupName',
  83. key: 'adgroupName',
  84. width: 280,
  85. ellipsis: true,
  86. render: (a: string, b: any) => {
  87. return <a onClick={() => { creativeHandle?.(b?.adgroupId) }}>{a}</a>
  88. // return <InputUpdate title={a} dataIndex={'adgroupName'} record={b} handleSave={handleSave} />
  89. }
  90. },
  91. {
  92. title: '投放日期',
  93. dataIndex: 'beginDate',
  94. key: 'beginDate',
  95. align: 'center',
  96. width: 150,
  97. ellipsis: true,
  98. sorter: true,
  99. render: (a: string, b: { endDate: string }) => {
  100. return b?.endDate ? a + '~' + b.endDate : a + '~' + '长期投放'
  101. }
  102. },
  103. {
  104. title: '投放时间',
  105. dataIndex: 'timeSeries',
  106. key: 'timeSeries',
  107. align: 'center',
  108. width: 55,
  109. render: (a: string, b: { endDate: string }) => {
  110. return <TimeSeriesLook timeSeries={a} />
  111. }
  112. },
  113. {
  114. title: '首日开始投放时间',
  115. dataIndex: 'firstDayBeginTime',
  116. key: 'firstDayBeginTime',
  117. align: 'center',
  118. width: 70,
  119. },
  120. {
  121. title: '出价',
  122. dataIndex: 'bidAmount',
  123. key: 'bidAmount',
  124. width: 140,
  125. align: 'right',
  126. ellipsis: true,
  127. render: (a: string, b: { bidMode: string, optimizationGoal: string }) => {
  128. return `${BID_MODE_ENUM[b?.bidMode as keyof typeof BID_MODE_ENUM]} ${a}元/${b?.bidMode === 'BID_MODE_CPM' ? '千次曝光' : b?.bidMode === 'BID_MODE_CPC' ? '点击' : OPTIMIZATIONGOAL_ENUM[b?.optimizationGoal as keyof typeof OPTIMIZATIONGOAL_ENUM]}`
  129. }
  130. },
  131. {
  132. title: '深度优化行为出价',
  133. dataIndex: 'deepConversionBehaviorBid',
  134. key: 'deepConversionBehaviorBid',
  135. width: 140,
  136. align: 'center',
  137. render: (a: string, b: any) => {
  138. return b?.deepConversionSpec?.deepConversionWorthSpec?.expectedRoi || '--'
  139. }
  140. },
  141. {
  142. title: '出价类型',
  143. dataIndex: 'smartBidType',
  144. key: 'smartBidType',
  145. align: 'center',
  146. width: 80,
  147. ellipsis: true,
  148. render: (a: string, b: { endDate: string }) => {
  149. return a === 'SMART_BID_TYPE_CUSTOM' ? '手动出价' : '自动出价'
  150. }
  151. },
  152. {
  153. title: '出价策略',
  154. dataIndex: 'bidStrategy',
  155. key: 'bidStrategy',
  156. align: 'center',
  157. width: 70,
  158. ellipsis: true,
  159. render: (a: string, b: { endDate: string }) => {
  160. return BidStrategyEnum[a as keyof typeof BidStrategyEnum]
  161. }
  162. },
  163. {
  164. title: '广告组日预算(元)',
  165. dataIndex: 'dailyBudget',
  166. key: 'dailyBudget',
  167. align: 'center',
  168. width: 70,
  169. // render: (a: string, b: any) => {
  170. // return <InputUpdate title={a} isNum={true} dataIndex={'dailyBudget'} record={b} handleSave={handleSaveDaily} />
  171. // }
  172. },
  173. {
  174. title: '是否开启自动版位功能',
  175. dataIndex: 'automaticSiteEnabled',
  176. key: 'automaticSiteEnabled',
  177. align: 'center',
  178. width: 80,
  179. render: (a: any, b: any) => {
  180. return a ? '开' : '关'
  181. }
  182. },
  183. {
  184. title: '定向条件描述',
  185. dataIndex: 'targetingTranslation',
  186. key: 'targetingTranslation',
  187. align: 'center',
  188. width: 80,
  189. render: (a: any) => {
  190. return a || '--'
  191. }
  192. },
  193. {
  194. title: '创建时间',
  195. dataIndex: 'createdTime',
  196. key: 'createdTime',
  197. align: 'center',
  198. width: 140,
  199. ellipsis: true,
  200. },
  201. {
  202. title: '是否已删除',
  203. dataIndex: 'isDeleted',
  204. key: 'isDeleted',
  205. align: 'center',
  206. width: 60,
  207. render: (a: any, b: any) => {
  208. return <Badge status={!a ? "processing" : "error"} text={a ? '是' : '否'} />
  209. }
  210. },
  211. {
  212. title: '广告状态',
  213. dataIndex: 'systemStatus',
  214. key: 'systemStatus',
  215. align: 'center',
  216. width: 90,
  217. fixed: 'right',
  218. ellipsis: true,
  219. render: (a: string, b: any) => {
  220. return ADGROUP_STATUS[a as keyof typeof ADGROUP_STATUS]
  221. }
  222. },
  223. {
  224. title: '创意预览',
  225. dataIndex: 'dynamicCreativeList',
  226. key: 'dynamicCreativeList',
  227. width: 150,
  228. fixed: 'right',
  229. render: (a: any, b: any) => {
  230. return <Space><CreativePreview creativePreview={a?.map((item: { creativeComponents: any }) => ({ ...item?.creativeComponents })) || []} /><a onClick={() => { creativeHandle?.(b?.adgroupId) }}>详情</a></Space>
  231. // return <Space><BoxOther creativeComponents={a?.[0]?.creativeComponents || {}} /><a onClick={() => { creativeHandle?.(b?.adgroupId) }}>详情</a></Space>
  232. }
  233. },
  234. {
  235. title: '操作',
  236. dataIndex: 'cz',
  237. key: 'cz',
  238. width: 65,
  239. align: 'center',
  240. fixed: 'right',
  241. render: (a: any, b: any) => {
  242. return <a style={{ color: '#1890ff' }} onClick={() => window.open(`https://ad.qq.com/atlas/${b?.accountId}/admanage/index?tab=adgroup&query={%22operation_status%22:[%22CALCULATE_STATUS_EXCLUDE_DEL%22],%22system_status%22:[],%22search_name%22:%22${b.adgroupId}%22}`)} target="_blank">腾讯广告</a>
  243. }
  244. },
  245. ]
  246. }
  247. export default tableConfig