Commit 9ed43168 authored by 前端-许佳敏's avatar 前端-许佳敏

fix: 业务员管理优化

parent d9500dd4
......@@ -83,6 +83,13 @@ const MemberDetail: React.FC<{}> = () => {
const { pageStatus, id} = usePageStatus()
const [tableData, setTableData] = useState<any[]>([])
const [keywordName, setKeywordName] = useState<string>('')
const fliterTableData = useMemo(() => {
if (!keywordName) {
return tableData
}
return tableData.filter(v => v.memberId.toString().includes(keywordName))
}, [tableData, keywordName])
const fetchMemberSaleChannel = async (params) => {
const userInfo = formAction.getFieldValue('userId')
if (userInfo && userInfo.length > 0) {
......@@ -120,6 +127,9 @@ const MemberDetail: React.FC<{}> = () => {
})
}
const handleSearchChannel = () => {
}
useEffect(() => {
staticData.current = realRowCtl.selectedRowKeys
}, [realRowCtl.selectedRowKeys])
......@@ -493,8 +503,8 @@ const MemberDetail: React.FC<{}> = () => {
<Button type='default' onClick={() => unBindMember()} disabled={pageStatus === PageStatus.PREVIEW}>批量解除绑定关系</Button>
</Col>
<Col style={{display: 'flex'}}>
<Input.Search value={keywordName} onChange={e => setKeywordName(e.target.value)} onPressEnter={fetchSaleChannel}/>
<Button type='default' style={{marginLeft: 20}}>重置</Button>
<Input.Search value={keywordName} onChange={e => setKeywordName(e.target.value)} onPressEnter={handleSearchChannel}/>
<Button type='default' style={{marginLeft: 20}} onClick={() => setKeywordName('')}>重置</Button>
</Col>
</Row>
<Button block type='dashed' onClick={() => setMemberVisible(true)} disabled={pageStatus === PageStatus.PREVIEW}>选择待绑定渠道会员</Button>
......@@ -503,7 +513,7 @@ const MemberDetail: React.FC<{}> = () => {
rowSelection={pageStatus !== PageStatus.PREVIEW && realRowSelection}
rowKey='relationId'
tableProps={{
dataSource: tableData
dataSource: fliterTableData
}}
/>
</TabsItem>
......
......@@ -35,9 +35,9 @@ const ChannelMember: React.FC<{}> = () => {
const columns: ColumnType<any>[] = [
{
title: '登录账号',
dataIndex: 'userId',
dataIndex: 'account',
align: 'center',
key: 'userId',
key: 'account',
},
{
title: '姓名',
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment