Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
X
xiaomai-cloud-class-web
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
xiaomai-cloud-class
xiaomai-cloud-class-web
Commits
11f4ee76
Commit
11f4ee76
authored
Aug 09, 2021
by
yuananting
Browse files
Options
Browse Files
Download
Plain Diff
fix:解决合并人员组织架构分支的冲突
parents
422e709c
4c65917e
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
252 additions
and
102 deletions
+252
-102
src/modules/college-manage/EmployeeManage.less
+7
-0
src/modules/college-manage/EmployeeManage.tsx
+50
-19
src/modules/college-manage/components/DepartMentTabCon.jsx
+30
-12
src/modules/college-manage/components/DepartMentTabCon.less
+8
-0
src/modules/college-manage/components/LeftStructureTree.jsx
+112
-55
src/modules/college-manage/components/LeftStructureTree.less
+2
-1
src/modules/college-manage/components/MemberTree.jsx
+1
-0
src/modules/college-manage/modal/AddOrEditPostGroupModal.jsx
+12
-7
src/modules/college-manage/modal/ChooseMembersModal.jsx
+1
-1
src/modules/college-manage/modal/NewChooseMembersModal.jsx
+7
-1
src/modules/college-manage/modal/SetEmployeeModal.jsx
+19
-3
src/modules/root/Header.jsx
+3
-3
src/modules/store-manage/EmployeeAddOrEditModal.tsx
+0
-0
No files found.
src/modules/college-manage/EmployeeManage.less
View file @
11f4ee76
...
...
@@ -17,4 +17,10 @@
font-size:14px;
color:#5289FA;
}
.post-name{
max-width: 200px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
}
\ No newline at end of file
src/modules/college-manage/EmployeeManage.tsx
View file @
11f4ee76
...
...
@@ -9,7 +9,7 @@ import React, { useEffect, useState } from 'react';
import
{
withRouter
}
from
'react-router-dom'
;
import
_
from
'underscore'
;
import
{
CheckBox
,
PageControl
}
from
'@/components'
;
import
{
Button
,
Table
,
Modal
,
message
,
Input
}
from
'antd'
;
import
{
Button
,
Table
,
Modal
,
message
,
Input
,
Tooltip
}
from
'antd'
;
import
{
XMTable
}
from
'@/components'
;
import
college
from
'@/common/lottie/college.json'
;
import
StoreService
from
'@/domains/store-domain/storeService'
;
...
...
@@ -33,7 +33,7 @@ interface RecordTypes {
phone
:
string
;
avatar
?:
string
;
weChatAccount
?:
string
;
depNameList
:
Array
<
string
>
;
depNameList
:
any
;
}
interface
RoleItemType
{
...
...
@@ -58,6 +58,7 @@ interface ChoosedItemType {
avatar
?:
string
;
storeUserId
?:
string
;
weChatAccount
?:
string
;
depNameList
?:
any
;
}
function
EmployeeManage
()
{
...
...
@@ -140,7 +141,7 @@ function EmployeeManage() {
const
columns
=
[
{
title
:
'员工'
,
dataIndex
:
'
nickName
'
,
dataIndex
:
'
weChatAccount
'
,
render
:
(
val
:
string
,
record
:
RecordTypes
)
=>
{
return
(
<
div
className=
'employee-info'
>
...
...
@@ -170,14 +171,27 @@ function EmployeeManage() {
if
(
!
record
.
depNameList
)
{
return
<
span
>
-
</
span
>;
}
return
record
.
depNameList
.
map
((
item
,
index
)
=>
{
if
(
record
.
depNameList
.
length
===
0
)
{
return
<
span
>
-
</
span
>;
}
// return record.depNameList.map((item,index)=>{
// return <span><WWOpenDataCom type="departmentName" openid={item}/>{index<(record.depNameList.length -1)?';':''}</span>;
// })
return
(
<
Tooltip
title=
{
<
div
>
{
handleDepName
(
record
.
depNameList
)
}
</
div
>
}
placement=
'top'
arrowPointAtCenter
>
<
div
className=
'post-name'
>
{
' '
}
{
record
.
depNameList
.
map
((
item
:
any
,
index
:
any
)
=>
{
return
(
<
span
>
<
WWOpenDataCom
type=
'departmentName'
openid=
{
item
}
/>
{
index
<
record
.
depNameList
.
length
-
1
?
'、
'
:
''
}
{
index
<
record
.
depNameList
.
length
-
1
?
';
'
:
''
}
</
span
>
);
});
})
}
</
div
>
</
Tooltip
>
);
},
},
{
...
...
@@ -227,8 +241,19 @@ function EmployeeManage() {
return
columns
;
}
function
handleDepName
(
depArray
:
any
):
any
{
const
depArrayDom
=
depArray
.
map
((
item
:
any
,
index
:
any
)
=>
{
return
(
<
span
>
<
WWOpenDataCom
type=
'departmentName'
openid=
{
item
}
/>
;
</
span
>
);
});
return
depArrayDom
;
}
function
handleEditEmployee
(
record
:
RecordTypes
)
{
const
{
nickName
,
phone
,
roleCodes
,
avatar
,
id
,
weChatAccount
}
=
record
;
const
{
nickName
,
phone
,
roleCodes
,
avatar
,
id
,
weChatAccount
,
depNameList
}
=
record
;
const
_choosesItem
=
{
nickName
:
nickName
,
phone
:
phone
,
...
...
@@ -236,6 +261,7 @@ function EmployeeManage() {
avatar
:
avatar
,
storeUserId
:
id
,
weChatAccount
,
depNameList
:
depNameList
,
};
setChooseItem
(
_choosesItem
);
const
model
:
React
.
ReactNode
=
(
...
...
@@ -251,6 +277,7 @@ function EmployeeManage() {
avatar
:
''
,
storeUserId
:
''
,
weChatAccount
:
''
,
depNameList
:
[],
});
}
}
isWorkWechat=
{
isWorkWechat
}
...
...
@@ -326,10 +353,10 @@ function EmployeeManage() {
userType
:
'USER'
,
};
StoreService
.
syncWorkWeChatDepartment
(
params
).
then
((
res
)
=>
{
getEmployeeList
();
message
.
success
(
'已更新'
);
});
}
return
(
<
div
className=
'page employee-manage-page'
>
<
div
className=
'content-header'
>
角色管理
</
div
>
...
...
@@ -459,19 +486,22 @@ function EmployeeManage() {
bordered
/>
</
div
>
<
div
className=
'box-footer'
>
<
PageControl
current=
{
query
.
current
}
pageSize=
{
query
.
size
}
total=
{
total
}
toPage=
{
(
page
:
any
)
=>
{
const
queryStates
=
_
.
clone
(
query
);
queryStates
.
current
=
page
;
setQuery
(
queryStates
);
{
model
}
{
employeeModal
&&
(
<
NewChooseMembersModal
treeDepType=
'DEP_CHAT'
visible=
{
employeeModal
}
type=
'USER'
close=
{
()
=>
{
setEmployeeModal
(
false
);
}
}
onConfirm=
{
()
=>
{
setEmployeeModal
(
false
);
message
.
success
(
'添加成功'
);
getEmployeeList
();
}
}
/>
</
div
>
</
div
>
)
}
{
model
}
{
employeeModal
&&
(
<
NewChooseMembersModal
...
...
@@ -489,6 +519,7 @@ function EmployeeManage() {
/>
)
}
</
div
>
</
div
>
);
}
...
...
src/modules/college-manage/components/DepartMentTabCon.jsx
View file @
11f4ee76
import
React
,
{
useEffect
,
useState
}
from
"react"
;
import
{
withRouter
}
from
"react-router-dom"
;
import
{
Button
,
Input
,
message
,
Modal
}
from
"antd"
;
import
{
Button
,
Input
,
message
,
Modal
,
Tooltip
}
from
"antd"
;
import
NewChooseMembersModal
from
"@/modules/college-manage/modal/NewChooseMembersModal"
;
import
LeftStructureTree
from
"./LeftStructureTree"
;
import
{
XMTable
,
PageControl
}
from
"@/components"
;
...
...
@@ -37,8 +37,8 @@ function DepartMentTabCon(props) {
return
(
<
div
>
{
item
.
sourceEnum
===
"WORK_WE_CHAT"
?
<
span
>
<
WWOpenDataCom
type=
"userName"
openid=
{
val
}
/></
span
>:
<
span
>
{
val
}
</
span
>
<
Tooltip
title=
{
<
div
><
WWOpenDataCom
type=
"userName"
openid=
{
val
}
/></
div
>
}
><
span
className=
"student-name"
><
WWOpenDataCom
type=
"userName"
openid=
{
val
}
/></
span
></
Tooltip
>:
<
Tooltip
title=
{
val
}
><
span
className=
"student-name"
>
{
val
}
</
span
></
Tooltip
>
}
<
span
className=
"tag"
...
...
@@ -73,17 +73,17 @@ function DepartMentTabCon(props) {
title
:
"岗位"
,
dataIndex
:
"depNameList"
,
render
:
(
val
,
record
)
=>
{
if
(
!
record
.
depNameList
){
return
<
span
>
-
</
span
>
}
else
{
if
(
record
.
depNameList
.
length
===
0
){
return
<
span
>
-
</
span
>
}
return
<
div
className=
"post-name"
>
{
record
.
depNameList
.
map
((
item
,
index
)
=>
{
return
<
span
>
{
item
}{
index
!==
record
.
depNameList
.
length
-
1
&&
<
span
>
、
</
span
>
}
</
span
>;
return
<
Tooltip
title=
{
handleDepName
(
record
.
depNameList
)
}
placement=
'top'
arrowPointAtCenter
><
div
className=
"post-name"
>
{
record
.
depNameList
.
map
((
item
,
index
)
=>
{
return
<
span
>
{
item
}{
index
!==
record
.
depNameList
.
length
-
1
&&
<
span
>
;
</
span
>
}
</
span
>
})
}
</
div
>
</
Tooltip
>
}
}
...
...
@@ -92,7 +92,11 @@ function DepartMentTabCon(props) {
title
:
"手机号"
,
dataIndex
:
"phone"
,
render
:
(
val
,
item
)
=>
{
return
<
span
>
{
val
}
</
span
>;
if
(
!
val
){
return
<
span
>
-
</
span
>
}
else
{
return
<
span
>
{
item
.
phone
}
</
span
>
}
},
},
{
...
...
@@ -110,7 +114,8 @@ function DepartMentTabCon(props) {
return
(
<
div
className=
"operate"
>
{
props
.
currentTab
===
'departMentTab'
?
<
div
className=
"operate__item"
onClick=
{
()
=>
delUser
(
'single'
,
item
.
userId
)
}
>
删除
</
div
>
<
span
>
-
</
span
>
// <div className="operate__item" onClick=
{()
=>
delUser
(
'single'
,
item
.
userId
)}
>
删除
<
/div
>
:
<
div
className=
"operate__item"
onClick=
{
()
=>
delUser
(
'single'
,
item
.
userId
)
}
>
移出
</
div
>
}
...
...
@@ -119,6 +124,17 @@ function DepartMentTabCon(props) {
},
},
];
function
handleDepName
(
depArray
){
let
depStr
=
''
;
depArray
.
forEach
((
item
,
index
)
=>
{
if
(
index
<
depArray
.
length
-
1
)
{
depStr
=
depStr
+
item
+
';'
;
}
else
{
depStr
=
depStr
+
item
;
}
});
return
depStr
;
};
function
closeChooseMembersModal
()
{
setChooseMembersModalVisible
(
false
);
}
...
...
@@ -197,7 +213,7 @@ function DepartMentTabCon(props) {
storeId
:
User
.
getStoreId
()
}
console
.
log
(
'selectDep'
,
selectDep
)
if
(
selectDep
.
id
===
'1
00'
){
if
(
selectDep
.
depId
===
'100
00'
){
params
.
userType
=
'WE_CHAT'
;
}
else
{
params
.
userType
=
'WORK_WE_CHAT'
;
...
...
@@ -205,7 +221,7 @@ function DepartMentTabCon(props) {
StoreService
.
delDepartmentUser
(
params
).
then
((
res
)
=>
{
message
.
success
(
`删除成功`
);
getUserList
();
Bus
.
trigger
(
"changeTreeData"
);
Bus
.
trigger
(
"changeTreeData"
,{
treeType
:
props
.
currentTab
}
);
});
}
function
handleSelectUserList
(
record
,
selected
){
...
...
@@ -281,7 +297,7 @@ function DepartMentTabCon(props) {
<
div
className=
"table-con"
>
{
props
.
currentTab
===
"departMentTab"
&&
(
<
div
className=
"operate-area"
>
{
selectDep
.
id
!==
'1
00'
&&
{
selectDep
.
depId
!==
'100
00'
&&
<
Button
type=
"primary"
className=
"add-user-btn"
...
...
@@ -292,8 +308,10 @@ function DepartMentTabCon(props) {
添加学员
</
Button
>
}
{
(
props
.
currentTab
===
"postGrouptab"
||
props
.
currentTab
===
"customGroupTab"
)
&&
<
Button
className=
"del-user-btn"
onClick=
{
()
=>
delUser
(
'multiple'
)
}
>
删除学员
</
Button
>
{
selectDep
.
id
!==
'100'
&&
}
{
selectDep
.
depId
!==
'10000'
&&
<>
<
Button
className=
"update-user-btn"
onClick=
{
()
=>
{
updateListData
()}
}
>
更新列表数据
</
Button
>
<
span
className=
"origin-text"
>
数据来源企业微信通讯录
</
span
>
...
...
src/modules/college-manage/components/DepartMentTabCon.less
View file @
11f4ee76
...
...
@@ -9,6 +9,14 @@
text-overflow: ellipsis;
white-space: nowrap;
}
.student-name{
max-width: 120px;
white-space:nowrap;
overflow:hidden;
text-overflow:ellipsis;
vertical-align: middle;
display: inline-block;
}
.operate-area{
margin-bottom:16px;
.add-user-btn{
...
...
src/modules/college-manage/components/LeftStructureTree.jsx
View file @
11f4ee76
...
...
@@ -24,10 +24,32 @@ function LeftStructureTree(props) {
const
[
currentGroupData
,
setCurrentGroupData
]
=
useState
({});
const
[
completeOptions
,
setCompleteOption
]
=
useState
([]);
const
[
selectedKeys
,
setSelectedKeys
]
=
useState
([]);
// 设置选中的部门key值
const
[
queryName
,
setQueryName
]
=
useState
(
''
);
const
[
postGroupTreeData
,
setPostGroupTreeData
]
=
useState
([]);
const
[
queryName
,
setQueryName
]
=
useState
(
''
);
// 搜索框内的值
const
[
selctQueryName
,
setSelctQueryName
]
=
useState
(
''
);
// 搜索出结果后最终选择的名字
const
[
postGroupTreeData
,
setPostGroupTreeData
]
=
useState
([]);
// 为了判定创建和编辑时的数据会不会重明
const
[
open
,
setOpen
]
=
useState
(
false
);
useEffect
(()
=>
{
setQueryName
(
''
);
//切换tab时搜索置空
setCompleteOption
([]);
setOpen
(
false
);
//切换tab时搜索的下拉框置为空
getTreeData
().
then
((
res
)
=>
{
const
_defaultSelectedKeys
=
[];
if
(
res
.
length
>
0
){
_defaultSelectedKeys
.
push
(
res
[
0
].
id
);
setSelectedKeys
(
_defaultSelectedKeys
);
props
.
onChangeSelectDep
(
res
[
0
])
props
.
searchUserList
(
res
[
0
],
treeType
,
1
);
}
});
},[
props
.
treeType
]);
useEffect
(()
=>
{
Bus
.
bind
(
"addCustomer"
,(
record
)
=>
{
addCustomer
(
record
.
treeType
,
record
.
query
)})
},[]);
useEffect
(()
=>
{
Bus
.
bind
(
"changeTreeData"
,(
record
)
=>
{
getTreeData
(
record
.
treeType
)})
},[]);
const
renderTitle
=
(
title
)
=>
(
<
span
>
{
title
}
...
...
@@ -62,33 +84,28 @@ function LeftStructureTree(props) {
const
notFoundContentNode
=
()
=>
{
return
<
span
>
暂无数据
</
span
>
}
const
Complete
=
()
=>
(
<
AutoComplete
dropdownClassName=
"certain-category-search-dropdown"
dropdownMatchSelectWidth=
{
250
}
allowClear
// onChange={(value)=>{setQueryName(value)}}
onSearch=
{
(
value
)
=>
{
setQueryName
(
value
)}
}
notFoundContent=
{
notFoundContentNode
()
}
value=
{
queryName
}
open=
{
open
}
onFocus=
{
()
=>
{
setOpen
(
true
)}
}
onBlur=
{
()
=>
{
setOpen
(
false
)}
}
style=
{
{
width
:
250
,
}
}
options=
{
completeOptions
}
onSelect=
{
confirmSearchSelect
}
placeholder=
'搜索员工、部门'
>
</
AutoComplete
>
);
function
handlePlaceHolder
(){
let
placeholder
=
''
;
switch
(
props
.
treeType
){
case
'departMentTab'
:
placeholder
=
'搜索学员姓名、部门'
;
break
;
case
'postGrouptab'
:
placeholder
=
'搜索学员姓名/岗位/岗位组'
;
break
;
case
'customGroupTab'
:
placeholder
=
'搜索学员姓名/自定义分组集合/自定义分组'
;
break
;
default
:
break
;
}
return
placeholder
}
function
confirmSearchSelect
(
value
,
option
){
console
.
log
(
'option'
,
option
);
setOpen
(
false
);
setQueryName
(
value
);
// console.log('option',option);
// setSelctQueryName(option)
props
.
searchUserList
({
queryName
:
value
},
treeType
,
1
);
}
...
...
@@ -115,7 +132,7 @@ function LeftStructureTree(props) {
const
{
result
=
{}}
=
res
;
const
{
departmentUserVOList
=
[],
departmentVOList
=
[],
subLevelDepartmentVOList
=
[]}
=
result
;
if
(
departmentUserVOList
.
length
>
0
){
userObj
.
label
=
renderTitle
(
'
员工
'
);
userObj
.
label
=
renderTitle
(
'
学员
'
);
userObj
.
options
=
departmentUserVOList
.
map
((
item
,
index
)
=>
{
return
renderItem
(
item
,
'user'
);
})
...
...
@@ -166,27 +183,7 @@ function LeftStructureTree(props) {
});
}
useEffect
(()
=>
{
setQueryName
(
''
);
//切换tab时搜索置空
setCompleteOption
([]);
setOpen
(
false
);
//切换tab时搜索的下拉框置为空
getTreeData
().
then
((
res
)
=>
{
const
_defaultSelectedKeys
=
[];
if
(
res
.
length
>
0
){
_defaultSelectedKeys
.
push
(
res
[
0
].
id
);
setSelectedKeys
(
_defaultSelectedKeys
);
props
.
onChangeSelectDep
(
res
[
0
])
props
.
searchUserList
(
res
[
0
],
treeType
,
1
);
}
});
},[
props
.
treeType
]);
useEffect
(()
=>
{
Bus
.
bind
(
"addCustomer"
,(
record
)
=>
{
addCustomer
(
record
.
treeType
,
record
.
query
)})
},[]);
useEffect
(()
=>
{
Bus
.
bind
(
"changeTreeData"
,(
record
)
=>
{
getTreeData
()})
},[]);
async
function
addCustomer
(
treeType
,
query
){
await
getTreeData
(
treeType
);
props
.
searchUserList
(
query
,
treeType
,
1
);
...
...
@@ -214,6 +211,7 @@ function LeftStructureTree(props) {
}
function
handleData
(
dataArray
){
const
_dataArray
=
dataArray
.
map
((
item
,
index
)
=>
{
item
.
title
=
""
;
item
.
key
=
item
.
id
;
if
(
item
.
sonDepartmentVOList
){
item
.
children
=
item
.
sonDepartmentVOList
;
...
...
@@ -260,10 +258,21 @@ function LeftStructureTree(props) {
//添加岗位组/岗位
function
addPostGroup
(
level
,
record
)
{
if
(
treeData
.
length
===
10
)
{
if
(
level
===
0
){
if
(
treeData
.
length
>
9
)
{
message
.
error
(
"岗位组数量已达10个上限"
);
return
;
}
}
if
(
level
===
1
){
if
(
record
.
sonDepartmentVOList
){
if
(
record
.
sonDepartmentVOList
.
length
>
19
){
message
.
error
(
"岗位数量已达20个上限"
);
return
;
}
}
}
setCurrentGroupData
({});
setAddOrEditPostGroupShow
(
true
);
setOperatePostGroupModalType
(
"add"
);
...
...
@@ -295,8 +304,19 @@ function LeftStructureTree(props) {
}
else
{
setPostGroupModalTitle
(
'编辑岗位'
);
setPostGroupModalLable
(
'岗位'
);
setPostGroupTreeData
([]);
setPostGroupTreeData
(
getParentChildernData
(
record
.
parentId
));
}
}
// 获取父节点下的所有的子级数据
function
getParentChildernData
(
parentId
){
let
_parentChildernData
=
[]
treeData
.
map
((
item
,
index
)
=>
{
if
(
parentId
===
item
.
id
){
_parentChildernData
=
item
.
sonDepartmentVOList
}
})
return
_parentChildernData
}
function
delPostGroup
(
record
){
let
title
=
'确认删除该岗位组吗?'
;
...
...
@@ -336,10 +356,20 @@ function LeftStructureTree(props) {
//添加自定义分组集合/分组
function
addCustomGroup
(
level
,
record
)
{
if
(
treeData
.
length
===
10
)
{
message
.
error
(
"岗位组数量已达10个上限"
);
if
(
level
===
0
){
if
(
treeData
.
length
>
9
)
{
message
.
error
(
"自定义分组集合数量已达10个上限"
);
return
;
}
}
if
(
level
===
1
){
if
(
record
.
sonDepartmentVOList
){
if
(
record
.
sonDepartmentVOList
.
length
>
19
){
message
.
error
(
"自定义分组数量已达20个上限"
);
return
;
}
}
}
setCurrentGroupData
({});
setAddOrEditPostGroupShow
(
true
);
setOperatePostGroupModalType
(
"add"
);
...
...
@@ -362,14 +392,14 @@ function LeftStructureTree(props) {
setPostGroupModalLevel
(
record
.
level
);
setCurrentGroupData
(
record
)
//level为0的时候编辑的是岗位组 大于0的时候
if
(
record
.
l
evel
===
0
){
if
(
record
.
depL
evel
===
0
){
setPostGroupModalTitle
(
'编辑分组集合'
);
setPostGroupModalLable
(
'分组集合'
);
setPostGroupTreeData
(
treeData
);
}
else
{
setPostGroupModalTitle
(
'编辑分组'
);
setPostGroupModalLable
(
'分组'
);
setPostGroupTreeData
(
[]
);
setPostGroupTreeData
(
getParentChildernData
(
record
.
parentId
)
);
}
}
function
delCustomGroup
(
record
){
...
...
@@ -428,7 +458,7 @@ function LeftStructureTree(props) {
}
}
options=
{
completeOptions
}
onSelect=
{
confirmSearchSelect
}
placeholder=
'搜索员工、部门'
placeholder=
{
handlePlaceHolder
()
}
>
</
AutoComplete
>
</
div
>
...
...
@@ -457,6 +487,7 @@ function LeftStructureTree(props) {
</
div
>
)
}
<
div
className=
"tree-con"
>
{
!
selctQueryName
?
<
DirectoryTree
defaultExpandAll
showIcon=
{
false
}
...
...
@@ -532,6 +563,32 @@ function LeftStructureTree(props) {
);
}
}
/>
:
<
div
>
{
(
props
.
treeType
===
'departMentTab'
)
&&
<
div
>
{
option
.
name
?
<
WWOpenDataCom
type=
"departmentName"
openid=
{
option
.
name
}
/>
:
<
WWOpenDataCom
type=
"userName"
openid=
{
option
.
userName
}
/>
}
</
div
>
}
{
(
props
.
treeType
===
'postGrouptab'
||
props
.
treeType
===
'customGroupTab'
)
&&
<
div
>
{
option
.
name
?
<
span
>
{
option
.
name
}
</
span
>
:
<
span
>
{
option
.
userName
}
</
span
>
}
</
div
>
}
</
div
>
}
</
div
>
</
div
>
{
addOrEditPostGroupShow
&&
(
...
...
src/modules/college-manage/components/LeftStructureTree.less
View file @
11f4ee76
.left-structure-tree {
margin-right: 24px;
width:2
5
0px;
width:2
6
0px;
height: calc(~'100vh - 260px');
overflow-y: scroll;
.organization{
overflow: scroll;
.search-con{
...
...
src/modules/college-manage/components/MemberTree.jsx
View file @
11f4ee76
...
...
@@ -38,6 +38,7 @@ function MemberTree(props) {
}
function
handleData
(
dataArray
){
const
_dataArray
=
dataArray
.
map
((
item
,
index
)
=>
{
item
.
title
=
""
;
item
.
key
=
item
.
id
;
item
.
children
=
[]
if
(
item
.
departmentUserVOList
){
...
...
src/modules/college-manage/modal/AddOrEditPostGroupModal.jsx
View file @
11f4ee76
...
...
@@ -2,7 +2,7 @@
* @Author: wufan
* @Date: 2020-11-27 16:21:49
* @LastEditors: Please set LastEditors
* @LastEditTime: 2021-08-0
3 17:23:4
0
* @LastEditTime: 2021-08-0
6 17:10:5
0
* @Description: Description
* @@Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有
*/
...
...
@@ -16,25 +16,29 @@ function AddOrEditPostGroupModal(props) {
const
[
nameErrorMsg
,
setNameErrorMsg
]
=
useState
(
''
);
const
[
validateStatus
,
setValidateStatus
]
=
useState
(
'success'
);
const
[
postGroupName
,
setPostGroupName
]
=
useState
(
''
);
const
[
isError
,
setIsError
]
=
useState
(
false
)
useEffect
(()
=>
{
},[]);
function
changePostGroupName
(
e
){
let
isError
=
false
;
setIsError
(
false
)
setValidateStatus
(
'success'
);
setNameErrorMsg
(
''
);
if
((
!
e
.
target
.
value
)
||
/^
\s
+$/
.
test
(
e
.
target
.
value
)){
setValidateStatus
(
'error'
);
setNameErrorMsg
(
`
${
props
.
label
}
不能为空`
);
setIsError
(
true
)
}
props
.
postGroupTreeData
.
map
((
item
,
index
)
=>
{
if
(
item
.
name
===
e
.
target
.
value
){
setValidateStatus
(
'error'
);
setNameErrorMsg
(
`该
${
props
.
label
}
已存在`
);
isError
=
true
;
setIsError
(
true
)
}
return
item
;
})
if
(
!
isError
){
setPostGroupName
(
e
.
target
.
value
);
}
}
function
handleConfirm
(){
if
(
props
.
modalOperateType
===
'add'
){
...
...
@@ -44,10 +48,11 @@ function AddOrEditPostGroupModal(props) {
}
}
function
addGroup
(){
if
(
!
postGroupName
){
if
(
isError
){
return
;
}
const
{
postGroupModalLevel
,
currentTab
,
currentGroupData
,
label
}
=
props
let
parmas
=
{
depLevel
:
postGroupModalLevel
,
depType
:
DepType
[
currentTab
],
...
...
@@ -68,7 +73,7 @@ function AddOrEditPostGroupModal(props) {
});
}
function
editGroup
(){
if
(
!
postGroupName
){
if
(
isError
){
return
;
}
const
{
postGroupModalLevel
,
currentTab
,
currentGroupData
,
label
}
=
props
...
...
src/modules/college-manage/modal/ChooseMembersModal.jsx
View file @
11f4ee76
...
...
@@ -16,7 +16,6 @@ import './ChooseMembersModal.less';
import
_
from
'underscore'
;
const
{
Search
}
=
Input
;
class
ChooseMembersModal
extends
React
.
Component
{
constructor
(
props
)
{
super
(
props
);
...
...
@@ -162,6 +161,7 @@ class ChooseMembersModal extends React.Component {
})
}
})
}
addCustomer
=
()
=>
{
...
...
src/modules/college-manage/modal/NewChooseMembersModal.jsx
View file @
11f4ee76
...
...
@@ -119,9 +119,15 @@ class NewChooseMembersModal extends React.Component {
_item
.
departmentId
=
item
.
departmentId
;
_item
.
enterpriseVisibleUserId
=
item
.
userId
;
}
else
{
if
(
item
.
depId
===
'10000'
){
_item
.
depUserType
=
'WE_CHART_USER'
;
// depid=10000代表是微信学员
_item
.
userId
=
item
.
userId
;
}
else
{
_item
.
depUserType
=
'STORE_USER'
;
_item
.
departmentId
=
this
.
props
.
selectDep
.
id
;
}
_item
.
enterpriseVisibleUserId
=
item
.
enterpriseUserId
;
_item
.
departmentId
=
this
.
props
.
selectDep
.
id
;
}
return
_item
})
...
...
src/modules/college-manage/modal/SetEmployeeModal.jsx
View file @
11f4ee76
...
...
@@ -19,10 +19,25 @@ export default class SetEmployeeModal extends React.Component {
})
const
selectedData
=
list
[
0
]
||
{};
this
.
state
=
{
list
,
list
:
this
.
uniqArr
([...
list
])
,
selected
:
selectedData
.
userId
,
roleCode
:
selectedData
.
roleCode
,
submit
:
false
}
}
uniqArr
(
arr
){
let
obj
=
{};
arr
.
map
((
item
,
index
)
=>
{
// 若重复则删除该项
if
(
obj
.
hasOwnProperty
(
item
.
userId
)){
arr
.
splice
(
index
,
1
);
// 不重复则存入obj
}
else
{
obj
[
item
.
userId
]
=
item
.
userName
;
}
});
return
arr
;
}
handleChangeValues
(
value
)
{
...
...
@@ -33,7 +48,7 @@ export default class SetEmployeeModal extends React.Component {
}
})
this
.
props
.
onChange
(
selected
,
value
);
this
.
setState
({
roleCode
:
value
,
list
});
this
.
setState
({
roleCode
:
value
,
list
});
}
render
()
{
...
...
@@ -41,6 +56,7 @@ export default class SetEmployeeModal extends React.Component {
list
,
roleCode
,
selected
,
submit
}
=
this
.
state
;
return
(
<
Modal
...
...
@@ -55,7 +71,7 @@ export default class SetEmployeeModal extends React.Component {
<
div
className=
"modal-footer"
>
<
Button
style=
{
{
float
:
'left'
}
}
onClick=
{
()
=>
this
.
props
.
onClose
()
}
>
上一步
</
Button
>
<
Button
onClick=
{
()
=>
this
.
props
.
onCancel
()
}
>
取消
</
Button
>
<
Button
onClick=
{
()
=>
this
.
props
.
onOk
(
list
)
}
type=
"primary"
>
确定
</
Button
>
<
Button
onClick=
{
()
=>
{
this
.
setState
({
submit
:
true
},()
=>
this
.
props
.
onOk
(
list
))}
}
type=
"primary"
disabled=
{
submit
}
>
确定
</
Button
>
</
div
>
}
>
...
...
src/modules/root/Header.jsx
View file @
11f4ee76
...
...
@@ -2,7 +2,7 @@
* @Author: 吴文洁
* @Date: 2019-09-10 18:26:03
* @LastEditors: yuananting
* @LastEditTime: 2021-08-0
5 19:50:53
* @LastEditTime: 2021-08-0
9 19:20:55
* @Description:
*/
import
React
,
{
useRef
,
useContext
,
useEffect
,
useState
}
from
'react'
;
...
...
@@ -76,8 +76,8 @@ function Header(props) {
storeUserId
:
User
.
getStoreUserId
(),
};
BaseService
.
getStoreUser
(
param
).
then
((
res
)
=>
{
const
{
nickName
,
phone
}
=
res
.
result
;
setNickName
(
nickName
);
const
{
weChatAccount
,
phone
}
=
res
.
result
;
setNickName
(
weChatAccount
);
setPhone
(
phone
);
setAvatar
(
res
.
result
.
avatar
);
User
.
setAvatar
(
res
.
result
.
avatar
);
...
...
src/modules/store-manage/EmployeeAddOrEditModal.tsx
View file @
11f4ee76
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment