import { Row, Col, Tooltip } from 'antd'
import React, { useEffect, useMemo } from 'react'
import EditableForm from '@/components/EditableForm'
import ChangeCompanyInput from '@/pages/Customer/Company/components/ChangeCompany'
import { connect } from 'umi'
import PersonLabel from '@/pages/Customer/Company/components/PersonLabel'
import { Add } from '@icon-park/react'
import {
TagTypeEnum,
TagDataTypeEnum,
LabelModeType
} from '@/pages/Customer/Company/components/PersonLabel/const'
const ContanctForm = props => {
const {
client,
personTagColorMap,
personTags,
teamTagColorMap,
teamTags,
dispatch,
filterTag = false
} = props
const changeCopInputData = {
customerName: client.companyName,
customerId: client.companyId,
targetName: client.clientName,
dataId: client.id
}
const refreshClient = () => {
dispatch({
type: 'refresh/commitAction',
payload: 'client'
})
}
useEffect(() => {
if (!personTags.length) {
dispatch({
type: 'client/fetchPersonTags',
payload: { tagType: TagTypeEnum.PERSONTAG, tagColumn: TagDataTypeEnum.CLIENT }
})
}
if (!teamTags.length) {
dispatch({
type: 'client/fetchTeamTags',
payload: { tagType: TagTypeEnum.TEAMTAG, tagColumn: TagDataTypeEnum.CLIENT }
})
}
}, [])
const defaultCompanyValue = {
districtIds: client.districtIds,
address: client.address,
ride: client.ride,
stay: client.stay,
landmarks: client.landmarks
}
const columns = useMemo(() => {
const pColumns = [
{
dataIndex: 'clientName',
label: '姓名',
span: 24
},
{
dataIndex: 'districtIds',
label: '客户地区',
editCellType: 'cascader',
span: 24
},
{
dataIndex: 'companyName',
label: '单位名称',
editCellType: 'custom',
customCell: (