import { copy } from "@/utils/utils" import { Badge, Button, Space, Typography } from "antd" import { ColumnsType } from "antd/es/table" import { tableDfixed } from "@/utils/tableDfixed" const { Text } = Typography; export function TableConfig(handle: (data: any, type: string) => void): ColumnsType { let arr: ColumnsType = [ { title: '企微名称', dataIndex: 'corpName', key: 'corpName', width: 150, ellipsis: true, fixed: 'left' }, { title: 'corpId', dataIndex: 'corpId', key: 'corpId', align: 'center', width: 150, ellipsis: true, fixed: 'left', render: (a: any) => { return copy(a)}>{a} } }, { title: '企微ID', dataIndex: 'originCorpId', key: 'originCorpId', align: 'center', width: 125, ellipsis: true, render(value) { return value || '--' }, }, { title: '用户规模', dataIndex: 'corpUserMax', key: 'corpUserMax', align: 'center', width: 100, render(value) { return value && value === 0 ? value : '--' }, }, { title: '授权方企业类型', dataIndex: 'corpType', key: 'corpType', align: 'center', width: 60, render: (a: string) => { return {{ verified: '认证号', unverified: '注册号' }[a] || '--'} } }, { title: '认证到期时间', dataIndex: 'verifiedEndTime', key: 'verifiedEndTime', align: 'center', width: 120, render(value) { return value || '--' }, }, { title: '授权状态', dataIndex: 'authStatus', key: 'authStatus', align: 'center', width: 80, render: (a: any) => { return {a === 1 ? : } } }, { title: '配置状态', dataIndex: 'configStatus', key: 'configStatus', align: 'center', width: 80, render: (a: any) => { return {({ 'SUCCESS': , 'ING': } as any)[a] || } } }, { title: '回调地址', dataIndex: 'externalUserCallbackUrl', key: 'externalUserCallbackUrl', width: 150, ellipsis: true, render: (a: any) => { return copy(a)}>{a || '--'} } }, { title: 'Token', dataIndex: 'externalUserToken', key: 'externalUserToken', width: 150, ellipsis: true, render: (a: any) => { return copy(a)}>{a || '--'} } }, { title: 'AESKey', dataIndex: 'externalUserAesKey', key: 'externalUserAesKey', width: 150, ellipsis: true, render: (a: any) => { return copy(a)}>{a || '--'} } }, { title: '授权时间', dataIndex: 'createTime', key: 'createTime', align: 'center', width: 130, ellipsis: true, }, { title: '备注', dataIndex: 'remark', key: 'remark', width: 200, ellipsis: true, render(value) { return value || '--' }, }, { title: '操作', dataIndex: 'cz', key: 'cz', align: 'center', width: 100, fixed: 'right', render: (a, b) => { return handle(b, 'sx')}>修改 handle(b, 'txl')}>企微通讯录 } }, ] return tableDfixed(arr) } export function TableMailConfig(handle?: (data: any, type: string) => void, setAccountOpen?: (d: any) => void, setChangeLog?: (d: any) => void): ColumnsType { let arr: ColumnsType = [ { title: '企微号ID', dataIndex: 'corpUserId', key: 'corpUserId', align: 'center', width: 80, ellipsis: true, fixed: 'left' }, { title: '企微号', dataIndex: 'name', key: 'name', align: 'center', width: 90, ellipsis: true, }, { title: '公众号', dataIndex: 'mpAccountInfo.name', key: 'mpAccountInfo.name', align: 'center', width: 90, ellipsis: true, render: (a: any, b: any) => { return b?.mpAccountInfo?.name || '--' } }, { title: '书城', dataIndex: 'mpAccountInfo.platformName', key: 'mpAccountInfo.platformName', align: 'center', width: 90, ellipsis: true, render: (a: any, b: any) => { return b?.mpAccountInfo?.platformName || '--' } }, { title: '运营', dataIndex: 'operUserId', key: 'operUserId', align: 'center', width: 90, ellipsis: true, render: (a: any, b: any) => { return b?.operUser?.nickName || '--' } }, { title: '投手', dataIndex: 'putUserId', key: 'putUserId', align: 'center', width: 90, ellipsis: true, render: (a: any, b: any) => { return b?.putUser?.nickName || '--' } }, { title: '运营助手', dataIndex: 'userList', key: 'userList', align: 'center', width: 90, ellipsis: true, render: (a: any[], b: any) => { return {a?.map(item => item?.nickname)?.toString() || '--'} } }, { title: '状态', dataIndex: 'status', key: 'status', align: 'center', width: 80, render: (a: number) => { return {a === 1 ? '已激活' : a === 2 ? '已禁用' : a === 4 ? '未激活' : a === 5 ? '退出企业' : '--'} } }, { title: '创建时间', dataIndex: 'createTime', key: 'createTime', align: 'center', ellipsis: true, width: 120 }, { title: '操作', dataIndex: 'cz', key: 'cz', align: 'center', width: 200, fixed: 'right', render: (a, b) => { return } }, ] return tableDfixed(arr) } export function TableChangeLogConfig(): ColumnsType { let arr: ColumnsType = [ { title: 'ID', dataIndex: 'id', key: 'id', align: 'center', width: 30, ellipsis: true, }, { title: '变更时间', dataIndex: 'createTime', key: 'createTime', align: 'center', width: 120, ellipsis: true, }, { title: '变更后公众号', dataIndex: 'mpAccount.name', key: 'mpAccount.name', align: 'center', width: 80, ellipsis: true, render: (a: any, b: any) => { return b?.mpAccount?.name || '--' } }, { title: '变更后书城', dataIndex: 'mpAccount.platformName', key: 'mpAccount.platformName', align: 'center', width: 80, ellipsis: true, render: (a: any, b: any) => { return b?.mpAccount?.platformName || '--' } }, ] return arr }