import { BizContainer, BizValueType, MaterialList, ModeType, ProFormUploadMaterial, } from '@/components'; import { business } from '@/services'; import { formatBankCard, formatIdCard, formatPhone } from '@/utils/format'; import { formatParam } from '@/utils/formatParam'; import { useIntl } from '@@/exports'; import { EyeInvisibleOutlined, EyeTwoTone } from '@ant-design/icons'; import { ActionType, ProColumns, ProFormText, } from '@ant-design/pro-components'; import { ProDescriptionsItemProps } from '@ant-design/pro-descriptions'; import React, { useRef, useState } from 'react'; interface ISupplierFarmerListProps { ghost?: boolean; supplierId?: BusinessAPI.SupplierVO['supplierId']; search?: boolean; onValueChange?: () => void; mode?: ModeType; trigger?: () => React.ReactNode; } export default function SupplierFarmerList(props: ISupplierFarmerListProps) { const { ghost = false, supplierId, search = true, mode = 'page', trigger, onValueChange, } = props; const intl = useIntl(); const intlPrefix = 'supplierFarmer'; const actionRef = useRef(); const [showIdCard, setShowIdCard] = useState>({}); const [showBankCard, setShowBankCard] = useState>({}); const [showPhone, setShowPhone] = useState>({}); const columns: ProColumns[] = [ { title: intl.formatMessage({ id: intlPrefix + '.column.name' }), dataIndex: 'name', key: 'name', renderText: (text: string) => {text}, }, { title: intl.formatMessage({ id: intlPrefix + '.column.idCard', }), dataIndex: 'idCard', key: 'idCard', render: (_, record) => (
{formatIdCard(record.idCard!, showIdCard[record.supplierId])} { setShowIdCard((prev) => ({ ...prev, [record.supplierId]: !prev[record.supplierId], })); }} > {showIdCard[record.supplierId] ? ( ) : ( )}
), }, { title: intl.formatMessage({ id: intlPrefix + '.column.phone' }), dataIndex: 'phone', key: 'phone', render: (_, record) => (
{formatPhone(record.phone, showPhone[record.supplierId])} { setShowPhone((prev) => ({ ...prev, [record.supplierId]: !prev[record.supplierId], })); }} > {showPhone[record.supplierId] ? ( ) : ( )}
), }, { title: intl.formatMessage({ id: intlPrefix + '.column.bankName' }), dataIndex: 'bankName', key: 'bankName', search: false, }, { title: intl.formatMessage({ id: intlPrefix + '.column.bankCard' }), dataIndex: 'bankCard', key: 'bankCard', render: (_, record) => (
{formatBankCard(record.bankCard, showBankCard[record.supplierId])} { setShowBankCard((prev) => ({ ...prev, [record.supplierId]: !prev[record.supplierId], })); }} > {showBankCard[record.supplierId] ? ( ) : ( )}
), }, { title: intl.formatMessage({ id: intlPrefix + '.column.wechatQr' }), dataIndex: 'wechatQr', valueType: 'image', key: 'wechatQr', search: false, }, ]; const formContext = [