123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211 |
- import { FundStatusEnum } from "@/services/launchAdq/enum"
- import { EditOutlined, FileSearchOutlined, SettingOutlined, SwapOutlined, UploadOutlined, UserSwitchOutlined } from "@ant-design/icons"
- import { Badge, Button, Popconfirm, Space, Tooltip } from "antd"
- import React from "react"
- import DivideIntoGroups from "./divideIntoGroups"
- import './index.less'
- export function columnsMp(edit: (params: any) => void, setOpenServer: (data: any) => void, del: (groupId: number, accountId: number) => void, checkAccount: (value: any[]) => void, changeRecord: (accountId: number, id: number) => void, putUserHandle: (data: any) => void, activeKey: string, userId: string | undefined, groupId?: number, getAdAccountList?: any): any {
- return [
- {
- title: 'ID',
- dataIndex: 'id',
- key: 'id',
- align: 'center',
- width: 55,
- fixed: 'left'
- },
- {
- title: '广告主ID',
- dataIndex: 'accountId',
- key: 'accountId',
- align: 'center',
- width: 80,
- fixed: 'left'
- },
- {
- title: '类型',
- dataIndex: 'sourceType',
- key: 'sourceType',
- align: 'center',
- width: 60,
- render: (a: any, b: any) => {
- return <span>{a == 0 ? '微信' : 'QQ'}</span>
- }
- },
- {
- title: '投手',
- dataIndex: 'putUserInfo',
- key: 'putUserInfo',
- width: 70,
- align: 'center',
- ellipsis: true,
- render: (a: any, b: any) => {
- return <span>{a?.nickname || '-1'}</span>
- }
- },
- {
- title: '投放助理',
- dataIndex: 'accountUsers',
- key: 'accountUsers',
- width: 70,
- align: 'center',
- ellipsis: true,
- render: (a: any[], b: any) => {
- return a && a?.length > 0 ? a.map((item: { putUserName: string, putUseId: number }) => item.putUserName).toString() : '-1'
- }
- },
- {
- title: '投放信息',
- dataIndex: 'putResourceName',
- key: 'putResourceName',
- width: 110,
- align: 'center',
- ellipsis: true,
- },
- {
- title: '腾讯备注',
- dataIndex: 'memo',
- key: 'memo',
- align: 'center',
- width: 100,
- ellipsis: true,
- },
- {
- title: '本地备注',
- dataIndex: 'remark',
- key: 'remark',
- align: 'center',
- width: 100,
- ellipsis: true,
- },
- // {
- // title: '公众号信息',
- // dataIndex: 'wechatAccountName',
- // key: 'wechatAccountName',
- // width: 150,
- // align: 'center',
- // render: (a: any, b: any) => {
- // return <div className="verticalCenter">
- // <div><strong>{a}</strong></div>
- // <div style={{ color: "rgb(136, 136, 136)", fontSize: 13 }}>{b?.wechatAccountId}</div>
- // </div>
- // }
- // },
- {
- title: '企业名称',
- dataIndex: 'corporationName',
- key: 'corporationName',
- width: 150,
- align: 'center',
- ellipsis: true
- },
- {
- title: '服务商',
- dataIndex: 'serviceProviderName',
- key: 'serviceProviderName',
- width: 150,
- align: 'center',
- ellipsis: true
- },
- // {
- // title: '服务商ID列表',
- // dataIndex: 'agencyIdList',
- // key: 'agencyIdList',
- // width: 130,
- // align: 'center',
- // render: (a: any) => {
- // return <Tooltip title={a}>
- // <div className="name-wrapper">
- // <p>{ a }</p>
- // </div>
- // </Tooltip>
- // }
- // },
- {
- title: '行业ID',
- dataIndex: 'systemIndustryId',
- key: 'systemIndustryId',
- width: 105,
- align: 'center',
- render: (a: any) => {
- return <Tooltip title={a}>
- <div className="name-wrapper">{a}</div>
- </Tooltip>
- }
- },
- {
- title: '是否有效',
- dataIndex: 'enabled',
- key: 'enabled',
- align: 'center',
- width: 60,
- render: (a: any, b: any) => {
- return <Badge status={a ? "processing" : "error"} text={a ? '是' : '否'} />
- }
- },
- {
- title: '授权时间',
- dataIndex: 'createTime',
- key: 'createTime',
- align: 'center',
- width: 150
- },
- {
- title: '日限额(分)',
- dataIndex: 'dailyBudget',
- key: 'dailyBudget',
- align: 'center',
- width: 80
- },
- {
- title: '资金状态',
- dataIndex: 'fundStatus',
- key: 'fundStatus',
- align: 'center',
- width: 80,
- render: (a: string | number) => {
- return FundStatusEnum[a]
- }
- },
- {
- title: '操作',
- dataIndex: 'cz',
- key: 'cz',
- align: 'center',
- width: 200,
- fixed: 'right',
- render: (a: any, b: any) => {
- return <Space>
- <Tooltip title="配置服务商">
- <Button size="small" style={{ color: "#00bcd4" }} onClick={() => setOpenServer([b])} icon={<SettingOutlined />}></Button>
- </Tooltip>
- <Tooltip title="备注">
- <Button size="small" style={{ color: '#52c41a' }} onClick={() => edit(b)} icon={<EditOutlined />}></Button>
- </Tooltip>
- <Tooltip title="切号">
- <Button size="small" style={{ color: '#ea5506' }} onClick={() => checkAccount([b])} icon={<SwapOutlined />}></Button>
- </Tooltip>
- <Tooltip title="变更记录">
- <Button size="small" style={{ color: '#4d5aaf' }} onClick={() => changeRecord(b?.accountId, b?.id)} icon={<FileSearchOutlined />}></Button>
- </Tooltip>
- {activeKey === '1' && <>
- {userId == b?.putUserInfo?.userId?.toString() && <Tooltip title="指派投放助理">
- <Button size="small" style={{ color: '#0eb83a' }} onClick={() => putUserHandle([b])} icon={<UserSwitchOutlined />}></Button>
- </Tooltip>}
- {!groupId && <DivideIntoGroups groupIds={b?.groupIds} getAdAccountList={getAdAccountList} accountId={b?.accountId} />}
- </>}
- {groupId && <Popconfirm
- title={`是否把${b?.accountId}移出该分组?`}
- onConfirm={() => { del(groupId, b?.accountId) }}
- okText="是"
- cancelText="否"
- >
- <Tooltip title="移出分组">
- <Button size="small" style={{ color: 'red' }}><UploadOutlined /></Button>
- </Tooltip>
- </Popconfirm>}
- </Space>
- }
- },
- ]
- }
|