Commit 3db3e5a0 by zhangleyuan

feat:处理搜索模块

parent c7471eda
......@@ -200,11 +200,18 @@ function DepartMentTabCon(props) {
};
function updateListData(){
let num = 1;
let num;
const params = {
enterpriseId:User.getEnterpriseId(),
storeId:User.getStoreId(),
userType:'CUSTOMER'
}
StoreService.getSyncCount(params).then((res) => {
num = res.result;
if(num<3){
return confirm({
title: "确定更新列表数据吗?",
content: `员工数据来源企微通讯录,一天只能更新3次,今日还能更新${3-num}次。`,
content: `学员数据来源企微通讯录,一天只能更新3次,今日还能更新${3-num}次。`,
icon: (
<span className="icon iconfont default-confirm-icon">&#xe839; </span>
),
......@@ -218,7 +225,7 @@ function DepartMentTabCon(props) {
Modal.warning({
title: '提示',
okText: '我知道了',
content: '员工数据今日更新次数已达上限(3次),无法继续更新。',
content: '学员数据今日更新次数已达上限(3次),无法继续更新。',
icon: (
<span className='icon iconfont default-confirm-icon' style={{ color: '#FFBB54 !important' }}>
&#xe834;
......@@ -226,10 +233,14 @@ function DepartMentTabCon(props) {
),
});
}
});
}
function confirmUpdateListData(){
const params = {
enterpriseId:User.getEnterpriseId(),
storeId:User.getStoreId(),
userType:'CUSTOMER'
}
StoreService.syncWorkWeChatDepartment(params).then((res) => {
message.success('已更新');
......
......@@ -23,7 +23,7 @@ function LeftStructureTree(props) {
const [selectDepParams,setSelectDepParams] = useState({}); // 设置选择的部门、岗位组、自定分组的参数
const [completeOptions,setCompleteOption] = useState([]);
const [selectedKeys,setSelectedKeys]= useState([]); // 设置选中的部门key值
const [queryName,setQueryName] = useState('');
const renderTitle = (title) => (
<span>
{title}
......@@ -62,6 +62,7 @@ function LeftStructureTree(props) {
dropdownClassName="certain-category-search-dropdown"
dropdownMatchSelectWidth={250}
allowClear
value={queryName}
onChange={getCompleteOptionData}
notFoundContent={notFoundContentNode()}
style={{
......@@ -69,12 +70,13 @@ function LeftStructureTree(props) {
}}
options={completeOptions}
>
<Input size="large" placeholder="搜索部门/学员姓名" />
<Input.Search size="large" placeholder="input here" enterButton />
</AutoComplete>
);
// 获取关键词的搜索结果
function getCompleteOptionData(value){
setQueryName(value)
const params = {
depType:DepType[props.treeType],
queryName:value,
......@@ -89,7 +91,7 @@ function LeftStructureTree(props) {
const userObj = {};
const departmentGroupObj = {};
const postobj = {};
const {departmentUserVOList,departmentVOList} = res.result;
const {departmentUserVOList=[],departmentVOList=[]} = res.result;
if(departmentUserVOList.records.length>0){
userObj.label=renderTitle('员工');
userObj.options=departmentUserVOList.records.map((item,index)=>{
......@@ -121,7 +123,14 @@ function LeftStructureTree(props) {
_completeOptions.push(departmentGroupObj);
}
console.log('_completeOptions',_completeOptions);
// setCompleteOption(_completeOptions);
const options = [
{
label: renderTitle('Libraries'),
options: [renderItem({name:'张乐园'}, 'department')],
}
];
setCompleteOption(_completeOptions);
});
}
......@@ -356,12 +365,6 @@ function LeftStructureTree(props) {
<div className="left-structure-tree">
<div className="organization">
<div className="search-con">
{/* <Search
placeholder="搜索部门/学员姓名"
className="search search-input"
style={{ width: 245 }}
enterButton={<span className="icon iconfont">&#xe832;</span>}
/> */}
<Complete/>
</div>
{ (props.treeType==='postGrouptab' || props.treeType=== 'customGroupTab') && (
......
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