Commit 7bc451a7 by zhangleyuan

feat:处理搜索的展示

parent 33d85cba
......@@ -475,7 +475,7 @@ function EmployeeManage() {
<Button className="update-user-btn" onClick={()=>{updateListData()}}>更新列表数据</Button>
<span className="origin-text">数据来源企业微信通讯录</span>
<a
href="https://www.yuque.com/wangzhong-zkqw0/qixue"
href="https://www.yuque.com/wangzhong-zkqw0/qixue/nsfcbi"
target="_blank"
>
<span className="view-text">查看数据更新说明</span>
......
......@@ -60,7 +60,7 @@ function DepartMentTabCon(props) {
{
title: "真实姓名",
dataIndex: "realName",
width: "15%",
width: 180,
render: (val, record) => {
return <span>{val}</span>;
},
......@@ -204,7 +204,7 @@ function DepartMentTabCon(props) {
idList = _.pluck(selectUser,'userId');
}
if(idList.length===0){
message.warning('请先选择要删除的学员')
message.warning('请先选择要移出的学员')
return;
}
switch (props.currentTab){
......@@ -359,7 +359,7 @@ function DepartMentTabCon(props) {
<Button className="update-user-btn" onClick={()=>{updateListData()}}>更新列表数据</Button>
<span className="origin-text">数据来源企业微信通讯录</span>
<a
href="https://www.yuque.com/wangzhong-zkqw0/qixue"
href="https://www.yuque.com/wangzhong-zkqw0/qixue/nsfcbi"
target="_blank"
>
<span className="view-text">查看数据更新说明</span>
......
import React, { useEffect, useState } from "react";
import { withRouter } from "react-router-dom";
import { Tree, Input, Dropdown, Menu,Button,Modal,message,AutoComplete} from "antd";
import { Tree, Input, Dropdown, Menu,Button,Modal,message,AutoComplete,Tooltip} from "antd";
import AddOrEditPostGroupModal from "../modal/AddOrEditPostGroupModal";
import User from '@/common/js/user'
import StoreService from "@/domains/store-domain/storeService";
......@@ -53,7 +53,7 @@ function LeftStructureTree(props) {
Bus.bind("changeTreeData",(record)=>{getTreeData(record.treeType)})
},[]);
const renderTitle = (title) => (
<span>
<span className="catalog-title">
{title}
</span>
);
......@@ -61,23 +61,32 @@ function LeftStructureTree(props) {
value: record.userName || record.name,
label: (
<div
className="search-result-item"
style={{
display: 'flex',
justifyContent: 'space-between',
}}
depId={record.id}
type={type}
>
{type === 'user'?
<div><WWOpenDataCom type="userName" openid={record.userName}/></div>
<div className="search-result-item__left">
<span className="icon iconfont title-icon">&#xe603;</span>
<WWOpenDataCom type="userName" openid={record.userName}/>
</div>
:
<div><WWOpenDataCom type="departmentName" openid={record.name}/></div>
}
{type === 'user' &&
record.postDepNamesList.map((item,index)=>{
return <span><WWOpenDataCom type="departmentName" openid={item}/></span>
})
}
<div className="search-result-item__left"><WWOpenDataCom type="departmentName" openid={record.name}/></div>
}
{type === 'user' && (
<div className="search-result-item__right">
<Tooltip title={<div>{handleDepName(record.depNamesList)}</div>} placement='top' arrowPointAtCenter>
{record.depNamesList.map((item,index)=>{
return <span><WWOpenDataCom type="departmentName" openid={item}/>{index<(record.depNamesList.length -1)?';':''}</span>
})}
</Tooltip>
</div>
)}
{type === 'post' &&
<span type='post' openid={record.parentName}>{record.parentName}</span>
}
......@@ -91,6 +100,12 @@ function LeftStructureTree(props) {
<div className="empty-text">暂无数据</div>
</div>
}
function handleDepName(depArray){
const depArrayDom = depArray.map((item, index) => {
return <span><WWOpenDataCom type="departmentName" openid={item}/></span>
});
return depArrayDom;
};
function handlePlaceHolder(){
let placeholder = '';
switch (props.treeType){
......@@ -124,7 +139,9 @@ function LeftStructureTree(props) {
function getCompleteOptionData(value){
// setQueryName(value);
setCompleteOption([]);
console.log("treeType",props.treeType);
if(!value){
return
}
const params = {
depType:DepType[props.treeType],
queryName:value,
......@@ -486,8 +503,8 @@ function LeftStructureTree(props) {
dropdownClassName="certain-category-search-dropdown"
dropdownMatchSelectWidth={250}
allowClear
onChange={(value)=>setQueryName(value)}
onSearch={(value)=>{getCompleteOptionData(value)}}
onChange={(value)=>{setQueryName(value);setOpen(true);getCompleteOptionData(value)}}
// onSearch={(value)=>{getCompleteOptionData(value)}}
notFoundContent={notFoundContentNode()}
value={queryName}
open={open}
......
......@@ -75,6 +75,31 @@
}
.certain-category-search-dropdown{
.catalog-title{
font-size:14px;
color:#666;
margin-bottom:14px;
}
.search-result-item{
padding:14px 0;
color:#333;
.title-icon{
color:#999;
margin-right:3px;
}
.search-result-item__left{
font-size:14px;
}
.search-result-item__right{
font-size:14px;
width:84px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
color:#999;
text-align:right;
}
}
.empty-con{
text-align:center;
.empty-img{
......
......@@ -73,7 +73,6 @@ function SearchUser(props) {
<div className="drop-down__item__con__item">
<div className="drop-down__item__con__item__left">
<span className="icon iconfont title-icon">&#xe603;</span>
<WWOpenDataCom type="userName" openid={item.userName}/>
</div>
<div className="drop-down__item__con__item__right">
......
......@@ -127,7 +127,6 @@ class NewChooseMembersModal extends React.Component {
}
_item.enterpriseVisibleUserId = item.enterpriseUserId;
_item.departmentId = this.props.selectDep.id;
}
return _item
})
......@@ -138,6 +137,7 @@ class NewChooseMembersModal extends React.Component {
}
Service.Hades('public/hades/addBatchUserAndDepartmentStoreCustomer', _params).then((res) => {
this.handleClose();
message.success('添加成功')
this.props.onConfirm();
})
}
......
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