|
|
@@ -6,7 +6,7 @@ import { connect, useModel } from 'umi'
|
|
|
import React, { useEffect, useState, useRef, useMemo } from 'react'
|
|
|
import consts from '@/consts'
|
|
|
import { useModal } from '@/components/Modal'
|
|
|
-import { formatValues } from '@/components/LazyCascader'
|
|
|
+import LazyCascader, { formatValues } from '@/components/LazyCascader'
|
|
|
import PersonLabel from '../Company/components/PersonLabel'
|
|
|
import {
|
|
|
TagTypeEnum,
|
|
|
@@ -21,7 +21,7 @@ import { refactorFilterField, refactorSortField } from '@/utils/utils'
|
|
|
import { PermDataTypeEunm } from '../Company/components/PermSelect'
|
|
|
import BasicTable from '@/components/Table'
|
|
|
import { getPermAuthCache } from '@/utils/auth'
|
|
|
-import FilterCascader from '@/components/Table/src/components/FilterCascader'
|
|
|
+// import FilterCascader from '@/components/Table/src/components/FilterCascader'
|
|
|
|
|
|
const Client = props => {
|
|
|
const { toggleDrawer, setDrawerProps } = useModal()
|
|
|
@@ -172,7 +172,8 @@ const Client = props => {
|
|
|
render: (clientName, record) => (
|
|
|
<span
|
|
|
onClick={() => showDrawer(record.id)}
|
|
|
- className="text-primary cursor-pointer hover:text-[#967bbd]">
|
|
|
+ className="text-primary cursor-pointer hover:text-[#967bbd]"
|
|
|
+ >
|
|
|
{clientName}
|
|
|
</span>
|
|
|
),
|
|
|
@@ -189,7 +190,8 @@ const Client = props => {
|
|
|
record.companyId !== consts.ENCRYPTION_ZERO ? (
|
|
|
<span
|
|
|
onClick={() => showDrawerComapny(record.companyId)}
|
|
|
- className="text-primary cursor-pointer hover:text-[#967bbd]">
|
|
|
+ className="text-primary cursor-pointer hover:text-[#967bbd]"
|
|
|
+ >
|
|
|
{companyName}
|
|
|
</span>
|
|
|
) : (
|
|
|
@@ -261,7 +263,7 @@ const Client = props => {
|
|
|
width: 75,
|
|
|
search: false,
|
|
|
ellipsis: true,
|
|
|
- filterDropdown: filterDropdownProps => <FilterCascader {...filterDropdownProps} />,
|
|
|
+ // filterDropdown: filterDropdownProps => <FilterCascader {...filterDropdownProps} />,
|
|
|
renderText: text => text?.replaceAll(' / ', ' , ')
|
|
|
},
|
|
|
{
|
|
|
@@ -295,7 +297,8 @@ const Client = props => {
|
|
|
tagType={TagTypeEnum.PERSONTAG}
|
|
|
tagColumn={TagDataTypeEnum.CLIENT}
|
|
|
checkCallBack={refreshData}
|
|
|
- modeType={LabelModeType.column}>
|
|
|
+ modeType={LabelModeType.column}
|
|
|
+ >
|
|
|
<Add theme="filled" size="20" fill="#868e96" className="cursor-pointer" />
|
|
|
</PersonLabel>
|
|
|
</div>
|
|
|
@@ -332,7 +335,8 @@ const Client = props => {
|
|
|
tagType={TagTypeEnum.TEAMTAG}
|
|
|
tagColumn={TagDataTypeEnum.CLIENT}
|
|
|
checkCallBack={refreshData}
|
|
|
- modeType={LabelModeType.column}>
|
|
|
+ modeType={LabelModeType.column}
|
|
|
+ >
|
|
|
<Add theme="filled" size="20" fill="#868e96" className="cursor-pointer" />
|
|
|
</PersonLabel>
|
|
|
</div>
|
|
|
@@ -440,12 +444,12 @@ const Client = props => {
|
|
|
setState({ ...state, params: { ...state.params, search: value } })
|
|
|
}
|
|
|
|
|
|
- // const onDistrictChange = value => {
|
|
|
- // if (!value) return
|
|
|
- // tRef.current.reset()
|
|
|
- // const [province = '', city = '', area = ''] = value || []
|
|
|
- // setState({ ...state, params: { ...state.params, province, city, area } })
|
|
|
- // }
|
|
|
+ const onDistrictChange = value => {
|
|
|
+ if (!value) return
|
|
|
+ tRef.current.reset()
|
|
|
+ const [province = '', city = '', area = ''] = value || []
|
|
|
+ setState({ ...state, params: { ...state.params, province, city, area } })
|
|
|
+ }
|
|
|
|
|
|
// 批量设置-确认触发
|
|
|
const tagsSettingConfirm = async clientIds => {
|
|
|
@@ -483,7 +487,8 @@ const Client = props => {
|
|
|
tagType={TagTypeEnum.PERSONTAG}
|
|
|
tagColumn={TagDataTypeEnum.CLIENT}
|
|
|
checkCallBack={toolbarOptionsChange}
|
|
|
- modeType={LabelModeType.toolbar}>
|
|
|
+ modeType={LabelModeType.toolbar}
|
|
|
+ >
|
|
|
{tagState.tagIds.length ? (
|
|
|
<Button>
|
|
|
{tagState.tagIds.map(item => (
|
|
|
@@ -508,7 +513,8 @@ const Client = props => {
|
|
|
tagType={TagTypeEnum.TEAMTAG}
|
|
|
tagColumn={TagDataTypeEnum.CLIENT}
|
|
|
checkCallBack={toolbarOptionsChange}
|
|
|
- modeType={LabelModeType.toolbar}>
|
|
|
+ modeType={LabelModeType.toolbar}
|
|
|
+ >
|
|
|
{tagState.tagCooperationIds.length ? (
|
|
|
<Button>
|
|
|
{tagState.tagCooperationIds.map(item => (
|
|
|
@@ -568,7 +574,7 @@ const Client = props => {
|
|
|
search: (
|
|
|
<Tooltip placement="bottom" title="输入客户、单位名称、电话邮箱等">
|
|
|
<Input.Search
|
|
|
- style={{ width: '300px' }}
|
|
|
+ style={{ width: '250px' }}
|
|
|
allowClear={true}
|
|
|
placeholder={`在${
|
|
|
permData[PermDataTypeEunm.CUSTOMER]?.find(
|
|
|
@@ -581,14 +587,14 @@ const Client = props => {
|
|
|
),
|
|
|
|
|
|
actions: [
|
|
|
- // <LazyCascader
|
|
|
- // key="lazyCascader"
|
|
|
- // onChange={onDistrictChange}
|
|
|
- // changeOnSelect={true}
|
|
|
- // bordered={false}
|
|
|
- // showFooter={true}
|
|
|
- // className="hover:bg-[rgba(0,0,0,0.1)]"
|
|
|
- // />,
|
|
|
+ <LazyCascader
|
|
|
+ key="lazyCascader"
|
|
|
+ onChange={onDistrictChange}
|
|
|
+ changeOnSelect={true}
|
|
|
+ bordered={false}
|
|
|
+ showFooter={true}
|
|
|
+ className="hover:bg-[rgba(0,0,0,0.1)]"
|
|
|
+ />,
|
|
|
<AddClient
|
|
|
modalProps={{ zIndex: 1050 }}
|
|
|
onConfirm={handleAddClient}
|