|
|
@@ -5,7 +5,6 @@ import { Input, Button, message, Tooltip } from 'antd'
|
|
|
import { connect, useModel } from 'umi'
|
|
|
import React, { useEffect, useState, useRef, useMemo } from 'react'
|
|
|
import consts from '@/consts'
|
|
|
-import LazyCascader from '@/components/LazyCascader'
|
|
|
import { useModal } from '@/components/Modal'
|
|
|
import { formatValues } from '@/components/LazyCascader'
|
|
|
import PersonLabel from '../Company/components/PersonLabel'
|
|
|
@@ -18,10 +17,11 @@ import { Add, Down, Check } from '@icon-park/react'
|
|
|
import { apiAddClient, queryClient } from '@/services/customer'
|
|
|
import { apiBatchLink } from '@/services/customer'
|
|
|
import styles from './index.less'
|
|
|
-import { refactorSortField } from '@/utils/utils'
|
|
|
+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'
|
|
|
|
|
|
const Client = props => {
|
|
|
const { toggleDrawer, setDrawerProps } = useModal()
|
|
|
@@ -183,7 +183,7 @@ const Client = props => {
|
|
|
title: '单位名称',
|
|
|
dataIndex: 'companyName',
|
|
|
key: 'companyName',
|
|
|
- width: 150,
|
|
|
+ width: 100,
|
|
|
ellipsis: true,
|
|
|
render: (companyName, record) => (
|
|
|
<span
|
|
|
@@ -258,6 +258,7 @@ const Client = props => {
|
|
|
width: 75,
|
|
|
search: false,
|
|
|
ellipsis: true,
|
|
|
+ filterDropdown: filterDropdownProps => <FilterCascader {...filterDropdownProps} />,
|
|
|
renderText: text => text?.replaceAll(' / ', ' , ')
|
|
|
},
|
|
|
{
|
|
|
@@ -436,12 +437,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 => {
|
|
|
@@ -542,10 +543,11 @@ const Client = props => {
|
|
|
columns={columns}
|
|
|
request={async (params, sort, filter) => {
|
|
|
const srotOrder = refactorSortField(sort)
|
|
|
+ const nFilter = refactorFilterField(filter)
|
|
|
const {
|
|
|
code = -1,
|
|
|
data: { client = [], total = 0 }
|
|
|
- } = await queryClient({ ...params, ...srotOrder, ...filter })
|
|
|
+ } = await queryClient({ ...params, ...srotOrder, ...nFilter })
|
|
|
setState({ ...state, orderIds: client.map(item => item.id) })
|
|
|
return {
|
|
|
data: client,
|
|
|
@@ -576,14 +578,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}
|