|
|
@@ -1,16 +1,30 @@
|
|
|
-import { Row, Col } from 'antd'
|
|
|
+import { Row, Col, Tooltip } from 'antd'
|
|
|
import React from 'react'
|
|
|
import EditableForm from '@/components/EditableForm'
|
|
|
import ChangeCompanyInput from '@/pages/customer/Contact/components/ChangeCompany'
|
|
|
+import { connect } from 'umi'
|
|
|
+import PersonLabel from '@/pages/customer/Company/components/PersonLabel'
|
|
|
+import { IconPark } from '@/components/SvgIcon'
|
|
|
+import { TagTypeEnum } from '@/pages/customer/Company/components/PersonLabel'
|
|
|
+import { TagDataTypeEnum } from '@/pages/customer/Company/components/PersonLabel'
|
|
|
+import { LabelModeType } from '@/pages/customer/Company/components/PersonLabel'
|
|
|
|
|
|
const ContanctForm = props => {
|
|
|
- const { client } = props
|
|
|
+ const { client, personTagColorMap, personTags, teamTagColorMap, teamTags, dispatch } = props
|
|
|
const changeCopInputData = {
|
|
|
customerName: client.companyName,
|
|
|
customerId: client.companyId,
|
|
|
clientName: client.clientName,
|
|
|
clientId: client.id
|
|
|
}
|
|
|
+
|
|
|
+ const refreshClient = () => {
|
|
|
+ dispatch({
|
|
|
+ type: 'refresh/commitAction',
|
|
|
+ payload: 'contact'
|
|
|
+ })
|
|
|
+ }
|
|
|
+
|
|
|
const columns = [
|
|
|
{
|
|
|
dataIndex: 'clientName',
|
|
|
@@ -111,17 +125,73 @@ const ContanctForm = props => {
|
|
|
label: '备注',
|
|
|
span: 24,
|
|
|
editCellType: 'textarea'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ dataIndex: 'tagIds',
|
|
|
+ label: '个人标签',
|
|
|
+ editCellType: 'custom',
|
|
|
+ customCell: (
|
|
|
+ <div className="editable-cell-value-wrap text-center flex flex-wrap items-center">
|
|
|
+ {client.tagIds?.map(item => (
|
|
|
+ <Tooltip title={personTags.find(i => i.id === item)?.name} key={client.id + item}>
|
|
|
+ <span
|
|
|
+ className="zh-circle-icon mr-3px"
|
|
|
+ style={{ backgroundColor: personTagColorMap[item] }}
|
|
|
+ />
|
|
|
+ </Tooltip>
|
|
|
+ ))}
|
|
|
+ <PersonLabel
|
|
|
+ dataId={client.id}
|
|
|
+ tagIds={client.tagIds}
|
|
|
+ tagType={TagTypeEnum.PERSONTAG}
|
|
|
+ tagColumn={TagDataTypeEnum.CONTACT}
|
|
|
+ checkCallBack={refreshClient}
|
|
|
+ modeType={LabelModeType.column}>
|
|
|
+ <IconPark
|
|
|
+ type="add"
|
|
|
+ theme="filled"
|
|
|
+ size="20"
|
|
|
+ fill="#868e96"
|
|
|
+ className="cursor-pointer"
|
|
|
+ />
|
|
|
+ </PersonLabel>
|
|
|
+ </div>
|
|
|
+ ),
|
|
|
+ span: 24
|
|
|
+ },
|
|
|
+ {
|
|
|
+ dataIndex: 'tagCooperationIds',
|
|
|
+ label: '协作标签',
|
|
|
+ editCellType: 'custom',
|
|
|
+ customCell: (
|
|
|
+ <div className="editable-cell-value-wrap text-center flex flex-wrap items-center">
|
|
|
+ {client.tagCooperationIds?.map(item => (
|
|
|
+ <Tooltip title={teamTags.find(i => i.id === item)?.name} key={client.id + item}>
|
|
|
+ <span
|
|
|
+ className="zh-square-icon mr-3px"
|
|
|
+ style={{ backgroundColor: teamTagColorMap[item] }}
|
|
|
+ />
|
|
|
+ </Tooltip>
|
|
|
+ ))}
|
|
|
+ <PersonLabel
|
|
|
+ dataId={client.id}
|
|
|
+ tagIds={client.tagCooperationIds}
|
|
|
+ tagType={TagTypeEnum.TEAMTAG}
|
|
|
+ tagColumn={TagDataTypeEnum.CONTACT}
|
|
|
+ checkCallBack={refreshClient}
|
|
|
+ modeType={LabelModeType.column}>
|
|
|
+ <IconPark
|
|
|
+ type="add"
|
|
|
+ theme="filled"
|
|
|
+ size="20"
|
|
|
+ fill="#868e96"
|
|
|
+ className="cursor-pointer"
|
|
|
+ />
|
|
|
+ </PersonLabel>
|
|
|
+ </div>
|
|
|
+ ),
|
|
|
+ span: 24
|
|
|
}
|
|
|
- // {
|
|
|
- // dataIndex: 'gerenbiaoqian',
|
|
|
- // label: '个人标签',
|
|
|
- // span: 24
|
|
|
- // },
|
|
|
- // {
|
|
|
- // dataIndex: 'xiezuobiaoqian',
|
|
|
- // label: '协作标签',
|
|
|
- // span: 24
|
|
|
- // }
|
|
|
]
|
|
|
|
|
|
return (
|
|
|
@@ -149,4 +219,9 @@ const ContanctForm = props => {
|
|
|
)
|
|
|
}
|
|
|
|
|
|
-export default ContanctForm
|
|
|
+export default connect(({ contact }) => ({
|
|
|
+ personTagColorMap: contact.personTagColorMap,
|
|
|
+ personTags: contact.personTags,
|
|
|
+ teamTagColorMap: contact.teamTagColorMap,
|
|
|
+ teamTags: contact.teamTags
|
|
|
+}))(ContanctForm)
|