Commit 7bc451a7 by zhangleyuan

feat:处理搜索的展示

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