Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
CivManage
Project
Project
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
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ReactWeb5
CivManage
Commits
a3da4a1b
Commit
a3da4a1b
authored
Jan 09, 2023
by
皮倩雯
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: '机构,站点树支持搜索'
parent
79275726
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
629 additions
and
407 deletions
+629
-407
changeAdd.jsx
...ges/bsmanager/base/tablemanager/filedConfig/changeAdd.jsx
+121
-98
index.jsx
src/pages/bsmanager/base/tablemanager/index.jsx
+3
-2
AddModal.jsx
...s/bsmanager/patrolMaintenance/patrolFeedback/AddModal.jsx
+1
-0
incident.jsx
src/pages/bsmanager/workOrder/incident/incident.jsx
+15
-11
flow.jsx
src/pages/bsmanager/workOrder/workFlow/flow.jsx
+19
-2
SiteManage.jsx
src/pages/userCenter/siteManage/SiteManage.jsx
+240
-159
SiteManage.less
src/pages/userCenter/siteManage/SiteManage.less
+4
-2
RelateRoleModal.jsx
src/pages/userCenter/userManage/RelateRoleModal.jsx
+1
-1
UserManage.jsx
src/pages/userCenter/userManage/UserManage.jsx
+208
-127
UserManage.less
src/pages/userCenter/userManage/UserManage.less
+14
-4
api.js
src/services/userManage/api.js
+3
-1
No files found.
src/pages/bsmanager/base/tablemanager/filedConfig/changeAdd.jsx
View file @
a3da4a1b
import
React
,
{
useState
,
useEffect
,
useCallback
,
useRef
}
from
'react'
;
import
React
,
{
useState
,
useEffect
,
useCallback
,
useRef
}
from
'react'
;
import
{
Form
,
Modal
,
Space
,
Divider
,
Radio
,
Checkbox
}
from
'antd'
;
import
{
Form
,
Modal
,
Space
,
Divider
,
Radio
,
Checkbox
}
from
'antd'
;
import
{
import
{}
from
'@/services/tablemanager/tablemanager'
;
}
from
'@/services/tablemanager/tablemanager'
import
styles
from
'./index.less'
import
Sortable
from
'sortablejs'
;
import
Sortable
from
'sortablejs'
;
import
styles
from
'./index.less'
const
CheckboxGroup
=
Checkbox
.
Group
;
const
CheckboxGroup
=
Checkbox
.
Group
;
const
AddModal
=
props
=>
{
const
AddModal
=
props
=>
{
const
{
callBackSubmit
=
()
=>
{
},
isType
,
formObj
,
visible
,
filed
,
characterValue
,
newCheckedList
}
=
props
;
const
{
callBackSubmit
=
()
=>
{},
isType
,
formObj
,
visible
,
filed
,
characterValue
,
newCheckedList
,
}
=
props
;
const
[
loading
,
setLoading
]
=
useState
(
false
);
const
[
loading
,
setLoading
]
=
useState
(
false
);
const
[
value
,
setValue
]
=
useState
(
''
);
const
[
value
,
setValue
]
=
useState
(
''
);
const
[
checkValue
,
setCheckValue
]
=
useState
([]);
const
[
checkValue
,
setCheckValue
]
=
useState
([]);
const
[
form
]
=
Form
.
useForm
();
const
[
form
]
=
Form
.
useForm
();
const
[
title
,
setTitle
]
=
useState
([])
const
[
title
,
setTitle
]
=
useState
([])
;
const
{
Item
}
=
Form
;
const
{
Item
}
=
Form
;
const
[
checkedList
,
setCheckedList
]
=
useState
([]);
//
选中的复选框内容
const
[
checkedList
,
setCheckedList
]
=
useState
([]);
//
选中的复选框内容
const
[
indeterminate
,
setIndeterminate
]
=
useState
([]);
const
[
indeterminate
,
setIndeterminate
]
=
useState
([]);
const
[
checkAll
,
setCheckAll
]
=
useState
([]);
const
[
checkAll
,
setCheckAll
]
=
useState
([]);
const
[
selectData
,
setSelectData
]
=
useState
([])
const
[
selectData
,
setSelectData
]
=
useState
([])
;
let
objArr
=
[]
let
objArr
=
[]
;
const
onChangeList
=
(
list
,
index
,
title
)
=>
{
const
onChangeList
=
(
list
,
index
,
title
)
=>
{
const
checkedListArr
=
[...
checkedList
]
const
checkedListArr
=
[...
checkedList
]
;
checkedListArr
[
index
]
=
list
checkedListArr
[
index
]
=
list
;
setCheckedList
(
checkedListArr
);
setCheckedList
(
checkedListArr
);
const
indeterminateArr
=
[...
indeterminate
]
const
indeterminateArr
=
[...
indeterminate
]
;
const
checkAllArr
=
[...
checkAll
]
const
checkAllArr
=
[...
checkAll
]
;
indeterminateArr
[
index
]
=
!!
list
.
length
&&
list
.
length
<
filed
[
title
].
length
indeterminateArr
[
index
]
=
!!
list
.
length
&&
list
.
length
<
filed
[
title
].
length
;
checkAllArr
[
index
]
=
list
.
length
===
filed
[
title
].
length
checkAllArr
[
index
]
=
list
.
length
===
filed
[
title
].
length
;
setIndeterminate
(
indeterminateArr
)
setIndeterminate
(
indeterminateArr
)
;
setCheckAll
(
checkAllArr
);
setCheckAll
(
checkAllArr
);
};
};
const
onCheckAllChange
=
e
=>
{
const
onCheckAllChange
=
e
=>
{
const
indeterminateArr
=
[...
indeterminate
]
const
indeterminateArr
=
[...
indeterminate
];
const
checkAllArr
=
[...
checkAll
]
const
checkAllArr
=
[...
checkAll
];
const
checkedListArr
=
[...
checkedList
]
const
checkedListArr
=
[...
checkedList
];
checkAllArr
[
e
.
target
.
index
]
=
e
.
target
.
checked
checkAllArr
[
e
.
target
.
index
]
=
e
.
target
.
checked
;
indeterminateArr
[
e
.
target
.
index
]
=
false
indeterminateArr
[
e
.
target
.
index
]
=
false
;
e
.
target
.
checked
?
checkedListArr
[
e
.
target
.
index
]
=
e
.
target
.
checkvalue
:
checkedListArr
[
e
.
target
.
index
]
=
[]
e
.
target
.
checked
?
(
checkedListArr
[
e
.
target
.
index
]
=
e
.
target
.
checkvalue
)
:
(
checkedListArr
[
e
.
target
.
index
]
=
[]);
setCheckedList
(
checkedListArr
);
setCheckedList
(
checkedListArr
);
setIndeterminate
(
indeterminateArr
);
setIndeterminate
(
indeterminateArr
);
setCheckAll
(
checkAllArr
);
setCheckAll
(
checkAllArr
);
};
};
//监听用户选择的字段名
//
监听用户选择的字段名
useEffect
(()
=>
{
useEffect
(()
=>
{
selectAll
()
selectAll
()
;
},
[
checkedList
]);
},
[
checkedList
]);
const
selectAll
=
()
=>
{
const
selectAll
=
()
=>
{
objArr
=
[]
objArr
=
[]
;
checkedList
.
map
(
item
=>
{
checkedList
.
map
(
item
=>
{
objArr
=
objArr
.
concat
(
item
)
objArr
=
objArr
.
concat
(
item
)
;
})
})
;
setSelectData
(
objArr
)
setSelectData
(
objArr
)
;
}
}
;
const
onSubmit
=
()
=>
{
const
onSubmit
=
()
=>
{
isType
===
'rule'
?
callBackSubmit
(
`
${
value
===
'无'
||
value
===
''
?
''
:
value
+
','
}${
checkValue
.
join
(
','
)}
`
)
:
callBackSubmit
({
checkedList
,
str
:
selectData
.
join
(
","
)
});
isType
===
'rule'
?
callBackSubmit
(
`
${
value
===
'无'
||
value
===
''
?
''
:
value
+
','
}${
checkValue
.
join
(
','
)}
`
,
)
:
callBackSubmit
({
checkedList
,
str
:
selectData
.
join
(
','
)
});
};
};
useEffect
(()
=>
{
useEffect
(()
=>
{
if
(
isType
!=
''
&&
isType
===
'rule'
)
{
if
(
isType
!=
''
&&
isType
===
'rule'
)
{
setValue
(
formObj
.
numerical
)
setValue
(
formObj
.
numerical
);
setCheckValue
(
formObj
.
rule
)
setCheckValue
(
formObj
.
rule
);
}
}
else
if
(
isType
===
'characteristics'
)
{
else
if
(
isType
===
'characteristics'
)
{
let
arr
=
Object
.
keys
(
filed
);
let
arr
=
Object
.
keys
(
filed
)
setTitle
(
arr
);
setTitle
(
arr
)
let
checkArr
=
[];
let
checkArr
=
[]
let
indeterminateArr
=
[];
let
indeterminateArr
=
[]
let
checkAllArr
=
[];
let
checkAllArr
=
[]
arr
.
map
((
item
,
index
)
=>
{
arr
.
map
((
item
,
index
)
=>
{
checkArr
[
index
]
=
[]
checkArr
[
index
]
=
[]
;
newCheckedList
.
map
(
checkItem
=>
{
newCheckedList
.
map
(
checkItem
=>
{
if
(
filed
[
item
].
includes
(
checkItem
))
{
if
(
filed
[
item
].
includes
(
checkItem
))
{
checkArr
[
index
].
push
(
checkItem
)
checkArr
[
index
].
push
(
checkItem
)
;
}
}
})
});
indeterminateArr
.
push
(
!!
checkArr
[
index
].
length
&&
checkArr
[
index
].
length
<
filed
[
item
].
length
)
indeterminateArr
.
push
(
checkAllArr
.
push
(
checkArr
[
index
].
length
===
filed
[
item
].
length
)
!!
checkArr
[
index
].
length
&&
checkArr
[
index
].
length
<
filed
[
item
].
length
,
);
})
checkAllArr
.
push
(
checkArr
[
index
].
length
===
filed
[
item
].
length
);
setCheckedList
(
checkArr
)
});
setIndeterminate
(
indeterminateArr
)
setCheckedList
(
checkArr
);
setCheckAll
(
checkAllArr
)
setIndeterminate
(
indeterminateArr
);
let
newArr
=
characterValue
.
length
?
characterValue
.
split
(
","
):[]
setCheckAll
(
checkAllArr
);
setSelectData
(
newArr
)
let
newArr
=
characterValue
.
length
?
characterValue
.
split
(
','
)
:
[];
draftSort
()
setSelectData
(
newArr
);
draftSort
();
}
}
},
[
visible
]);
},
[
visible
]);
//单选框变化时触发的事件
//
单选框变化时触发的事件
const
handleChange
=
(
e
)
=>
{
const
handleChange
=
e
=>
{
setValue
(
e
.
target
.
value
)
setValue
(
e
.
target
.
value
)
;
if
(
e
.
target
.
value
===
'无'
)
{
if
(
e
.
target
.
value
===
'无'
)
{
setCheckValue
([])
setCheckValue
([])
;
}
}
}
}
;
//复选框变化时触发的事件
//
复选框变化时触发的事件
const
onChange
=
(
e
)
=>
{
const
onChange
=
e
=>
{
setCheckValue
(
e
)
setCheckValue
(
e
)
;
if
(
e
.
length
&&
value
==
'无'
)
{
if
(
e
.
length
&&
value
==
'无'
)
{
setValue
(
''
)
setValue
(
''
)
;
}
}
}
}
;
//拖拽初始化及逻辑
//
拖拽初始化及逻辑
const
draftSort
=
()
=>
{
const
draftSort
=
()
=>
{
let
el
=
document
.
getElementById
(
'doctor-drag-items'
);
let
el
=
document
.
getElementById
(
'doctor-drag-items'
);
if
(
el
)
{
if
(
el
)
{
let
sortable
=
Sortable
.
create
(
el
,
{
let
sortable
=
Sortable
.
create
(
el
,
{
animation
:
100
,
//动画参数
animation
:
100
,
//
动画参数
onEnd
:
function
(
evt
)
{
//拖拽完毕之后发生,只需关注该事件
onEnd
(
evt
)
{
//拖拽完毕之后发生,只需关注该事件
let
arr
=
[];
let
arr
=
[];
let
len
=
evt
.
from
.
children
.
length
;
let
len
=
evt
.
from
.
children
.
length
;
for
(
let
i
=
0
;
i
<
len
;
i
++
)
{
for
(
let
i
=
0
;
i
<
len
;
i
++
)
{
arr
.
push
(
evt
.
from
.
children
[
i
].
getAttribute
(
'drag-id'
))
arr
.
push
(
evt
.
from
.
children
[
i
].
getAttribute
(
'drag-id'
))
}
}
setSelectData
(
arr
)
setSelectData
(
arr
)
}
}
,
});
});
}
}
};
}
return
(
return
(
<
Modal
<
Modal
...
@@ -130,31 +140,35 @@ const AddModal = props => {
...
@@ -130,31 +140,35 @@ const AddModal = props => {
style=
{
{
top
:
'10px'
}
}
style=
{
{
top
:
'10px'
}
}
width=
"700px"
width=
"700px"
destroyOnClose
destroyOnClose
centered
={
true
}
centered=
{
true
}
maskClosable=
{
false
}
maskClosable=
{
false
}
cancelText=
"取消"
cancelText=
"取消"
okText=
"确认"
okText=
"确认"
{
...
props
}
{
...
props
}
onOk=
{
()
=>
onSubmit
()
}
onOk=
{
()
=>
onSubmit
()
}
confirmLoading=
{
loading
}
confirmLoading=
{
loading
}
forceRender
=
{
true
}
forceRender
getContainer=
{
false
}
getContainer=
{
false
}
>
>
{
visible
&&
isType
===
'rule'
&&
(
{
visible
&&
isType
===
'rule'
&&
(
<>
<>
<
Radio
.
Group
onChange=
{
handleChange
}
value=
{
value
}
>
<
Radio
.
Group
onChange=
{
handleChange
}
value=
{
value
}
>
<
Space
direction=
"vertical"
>
<
Space
direction=
"vertical"
>
<
Radio
value=
'无'
>
无(清空选中)
</
Radio
>
<
Radio
value=
"无"
>
无(清空选中)
</
Radio
>
<
Radio
value=
'number'
>
数值(number)
</
Radio
>
<
Radio
value=
"number"
>
数值(number)
</
Radio
>
<
Radio
value=
'digits'
>
整数(digits)
</
Radio
>
<
Radio
value=
"digits"
>
整数(digits)
</
Radio
>
<
Radio
value=
'email'
>
邮箱(email)
</
Radio
>
<
Radio
value=
"email"
>
邮箱(email)
</
Radio
>
<
Radio
value=
'identity'
>
身份证号(identity)
</
Radio
>
<
Radio
value=
"identity"
>
身份证号(identity)
</
Radio
>
<
Radio
value=
'mobile'
>
手机号(mobile)
</
Radio
>
<
Radio
value=
"mobile"
>
手机号(mobile)
</
Radio
>
<
Radio
value=
'bankAccount'
>
银行卡号(bankAccount)
</
Radio
>
<
Radio
value=
"bankAccount"
>
银行卡号(bankAccount)
</
Radio
>
<
Radio
value=
'timeControl'
>
时间控制(timeControl)
</
Radio
>
<
Radio
value=
"timeControl"
>
时间控制(timeControl)
</
Radio
>
</
Space
>
</
Space
>
</
Radio
.
Group
>
</
Radio
.
Group
>
<
Checkbox
.
Group
style=
{
{
width
:
'100%'
,
marginTop
:
'1rem'
}
}
onChange=
{
onChange
}
value=
{
checkValue
}
>
<
Checkbox
.
Group
style=
{
{
width
:
'100%'
,
marginTop
:
'1rem'
}
}
onChange=
{
onChange
}
value=
{
checkValue
}
>
<
Space
direction=
"vertical"
>
<
Space
direction=
"vertical"
>
<
Checkbox
value=
"required"
>
必填(required)
</
Checkbox
>
<
Checkbox
value=
"required"
>
必填(required)
</
Checkbox
>
<
Checkbox
value=
"emphasis"
>
强调(emphasis)
</
Checkbox
>
<
Checkbox
value=
"emphasis"
>
强调(emphasis)
</
Checkbox
>
...
@@ -166,17 +180,25 @@ const AddModal = props => {
...
@@ -166,17 +180,25 @@ const AddModal = props => {
{
visible
&&
isType
===
'characteristics'
&&
(
{
visible
&&
isType
===
'characteristics'
&&
(
<
div
className=
{
styles
.
listCard
}
>
<
div
className=
{
styles
.
listCard
}
>
<
div
className=
{
styles
.
cardItem
}
style=
{
{
borderRight
:
'1px solid #99bbe8'
}
}
>
<
div
className=
{
styles
.
cardItem
}
style=
{
{
borderRight
:
'1px solid #99bbe8'
}
}
>
<
Divider
orientation=
"left"
style=
{
{
margin
:
'0 0 10px 0'
,
backgroundColor
:
'#dfe8f6'
}
}
>
待选字段列表
</
Divider
>
<
Divider
orientation=
"left"
style=
{
{
margin
:
'0 0 10px 0'
,
backgroundColor
:
'#dfe8f6'
}
}
>
待选字段列表
</
Divider
>
<
div
className=
{
styles
.
cardContent
}
>
<
div
className=
{
styles
.
cardContent
}
>
{
title
.
map
((
item
,
index
)
=>
{
{
title
.
map
((
item
,
index
)
=>
<
div
className=
{
styles
.
cardItemData
}
key=
{
index
}
>
return
<
div
className=
{
styles
.
cardItemData
}
key=
{
index
}
>
<
Divider
orientation=
"left"
style=
{
{
margin
:
'0 0 10px 0'
,
color
:
'#15428b'
,
borderTopColor
:
'#99bbe8'
}
}
>
{
item
}
<
Checkbox
indeterminate=
{
indeterminate
[
index
]
}
onChange=
{
onCheckAllChange
}
index=
{
index
}
checkvalue=
{
filed
[
item
]
}
checked=
{
checkAll
[
index
]
}
>
</
Checkbox
></
Divider
>
<
Divider
orientation=
"left"
style=
{
{
margin
:
'0 0 10px 0'
,
color
:
'#15428b'
,
borderTopColor
:
'#99bbe8'
}
}
>
{
item
}
<
Checkbox
indeterminate=
{
indeterminate
[
index
]
}
onChange=
{
onCheckAllChange
}
index=
{
index
}
checkvalue=
{
filed
[
item
]
}
checked=
{
checkAll
[
index
]
}
>
</
Checkbox
></
Divider
>
<
CheckboxGroup
options=
{
filed
[
item
]
}
value=
{
checkedList
[
index
]
}
onChange=
{
(
e
)
=>
onChangeList
(
e
,
index
,
item
)
}
/></
div
>
<
CheckboxGroup
options=
{
filed
[
item
]
}
value=
{
checkedList
[
index
]
}
onChange=
{
(
e
)
=>
onChangeList
(
e
,
index
,
item
)
}
/></
div
>)
}
})
}
</
div
>
</
div
>
</
div
>
</
div
>
<
div
className=
{
styles
.
cardItem
}
>
<
div
className=
{
styles
.
cardItem
}
>
<
Divider
orientation=
"left"
style=
{
{
margin
:
'0 0 10px 0'
,
backgroundColor
:
'#dfe8f6'
}
}
>
已选字段列表
</
Divider
>
<
Divider
orientation=
"left"
style=
{
{
margin
:
'0 0 10px 0'
,
backgroundColor
:
'#dfe8f6'
}
}
>
已选字段列表
</
Divider
>
<
div
className=
{
styles
.
cardContent
}
>
<
div
className=
{
styles
.
cardContent
}
>
<
div
className=
{
styles
.
doctorTable
}
>
<
div
className=
{
styles
.
doctorTable
}
>
<
table
>
<
table
>
...
@@ -185,25 +207,26 @@ const AddModal = props => {
...
@@ -185,25 +207,26 @@ const AddModal = props => {
<
td
>
字段名
</
td
>
<
td
>
字段名
</
td
>
</
tr
>
</
tr
>
</
thead
>
</
thead
>
<
tbody
id=
'doctor-drag-items'
>
<
tbody
id=
"doctor-drag-items"
>
{
selectData
&&
selectData
.
length
>
0
?
{
selectData
&&
selectData
.
length
>
0
?
(
selectData
.
map
((
item
,
index
)
=>
{
selectData
.
map
((
item
,
index
)
=>
<
tr
drag
-
id=
{
item
}
key=
{
index
}
style=
{
{
cursor
:
'move'
}
}
>
return
<
tr
drag
-
id=
{
item
}
key=
{
index
}
style=
{
{
cursor
:
'move'
}
}
>
<
td
><
span
title=
{
item
}
>
{
item
}
</
span
></
td
>
<
td
><
span
title=
{
item
}
>
{
item
}
</
span
></
td
>
</
tr
>
</
tr
>
)
}
)
}
)
:
<
tr
><
td
colSpan=
'10'
style=
{
{
textAlign
:
'center'
}
}
>
暂无数据
</
td
></
tr
>
) : (
}
<
tr
>
<
td
colSpan=
"10"
style=
{
{
textAlign
:
'center'
}
}
>
暂无数据
</
td
>
</
tr
>
)
}
</
tbody
>
</
tbody
>
<
/
table
>
<
/
table
>
</
div
>
</
div
>
<
/
div
>
<
/
div
>
</
div
>
</
div
>
<
/
div
>
<
/
div
>
)
)}
}
</
Modal
>
</
Modal
>
);
);
};
};
...
...
src/pages/bsmanager/base/tablemanager/index.jsx
View file @
a3da4a1b
...
@@ -19,6 +19,7 @@ import {
...
@@ -19,6 +19,7 @@ import {
Menu
,
Menu
,
Modal
,
Modal
,
message
,
message
,
Tag
,
}
from
'antd'
;
}
from
'antd'
;
import
{
import
{
EditOutlined
,
EditOutlined
,
...
@@ -425,11 +426,11 @@ const TableManager = props => {
...
@@ -425,11 +426,11 @@ const TableManager = props => {
if
(
record
)
{
if
(
record
)
{
return
(
return
(
<
Tooltip
title=
{
record
}
>
<
Tooltip
title=
{
record
}
>
<
span
style=
{
{
color
:
'#50aefc'
,
cursor
:
'pointer'
}
}
>
有
</
span
>
<
Tag
color=
"success"
>
有
</
Tag
>
</
Tooltip
>
</
Tooltip
>
);
);
}
}
return
<
span
>
无
</
span
>;
return
<
Tag
color=
"processing"
>
无
</
Tag
>;
},
},
},
},
{
{
...
...
src/pages/bsmanager/patrolMaintenance/patrolFeedback/AddModal.jsx
View file @
a3da4a1b
...
@@ -395,6 +395,7 @@ const AddModal = props => {
...
@@ -395,6 +395,7 @@ const AddModal = props => {
const
pickFiled
=
fileds
=>
{
const
pickFiled
=
fileds
=>
{
if
(
form
.
getFieldsValue
().
tableName
)
{
if
(
form
.
getFieldsValue
().
tableName
)
{
let
pp
=
formateArrDataA
(
nu
,
'groupName'
);
let
pp
=
formateArrDataA
(
nu
,
'groupName'
);
console
.
log
(
pp
);
if
(
form
.
getFieldValue
(
fileds
))
{
if
(
form
.
getFieldValue
(
fileds
))
{
let
ab
=
form
.
getFieldValue
(
fileds
).
split
(
','
);
let
ab
=
form
.
getFieldValue
(
fileds
).
split
(
','
);
let
arr
=
Object
.
keys
(
pp
);
let
arr
=
Object
.
keys
(
pp
);
...
...
src/pages/bsmanager/workOrder/incident/incident.jsx
View file @
a3da4a1b
...
@@ -23,6 +23,7 @@ import {
...
@@ -23,6 +23,7 @@ import {
Modal
,
Modal
,
Input
,
Input
,
message
,
message
,
Tag
,
}
from
'antd'
;
}
from
'antd'
;
import
{
import
{
...
@@ -165,17 +166,20 @@ const incident = () => {
...
@@ -165,17 +166,20 @@ const incident = () => {
// width: 80,
// width: 80,
// },
// },
{
// {
title
:
'编辑'
,
// title: '编辑',
dataIndex
:
'editable'
,
// dataIndex: 'editable',
key
:
'editable'
,
// key: 'editable',
width
:
50
,
// width: 50,
render
:
item
=>
(
// align: 'center',
<
span
style=
{
{
color
:
'grey'
}
}
key=
{
item
}
>
// render: record => {
{
item
}
// if (record == '是') {
</
span
>
// return <Tag color="success">{record}</Tag>;
),
// } else {
},
// return <Tag color="processing">{record}</Tag>;
// }
// },
// },
{
{
title
:
'编辑字段'
,
title
:
'编辑字段'
,
dataIndex
:
'editableFields'
,
dataIndex
:
'editableFields'
,
...
...
src/pages/bsmanager/workOrder/workFlow/flow.jsx
View file @
a3da4a1b
import
React
,
{
useEffect
,
useState
}
from
'react'
;
import
React
,
{
useEffect
,
useState
}
from
'react'
;
import
{
useHistory
}
from
'react-router-dom'
;
import
{
useHistory
}
from
'react-router-dom'
;
import
{
reloadFlows
,
removeFlowExtend
}
from
'@/services/flow/flow'
;
import
{
reloadFlows
,
removeFlowExtend
}
from
'@/services/flow/flow'
;
import
{
Card
,
Space
,
Table
,
Popconfirm
,
Spin
,
Tooltip
,
notification
,
message
,
Button
}
from
'antd'
;
import
{
Tag
,
Card
,
Space
,
Table
,
Popconfirm
,
Spin
,
Tooltip
,
notification
,
message
,
Button
}
from
'antd'
;
import
{
import
{
DoubleLeftOutlined
,
DoubleLeftOutlined
,
DoubleRightOutlined
,
DoubleRightOutlined
,
...
@@ -158,6 +158,13 @@ const Flow = () => {
...
@@ -158,6 +158,13 @@ const Flow = () => {
dataIndex
:
'useFixedCodingRule'
,
dataIndex
:
'useFixedCodingRule'
,
width
:
80
,
width
:
80
,
align
:
'center'
,
align
:
'center'
,
render
:
record
=>
{
if
(
record
==
'是'
)
{
return
<
Tag
color=
"success"
>
{
record
}
</
Tag
>;
}
else
{
return
<
Tag
color=
"processing"
>
{
record
}
</
Tag
>;
}
},
},
},
{
{
title
:
'异常节点'
,
title
:
'异常节点'
,
...
@@ -169,7 +176,17 @@ const Flow = () => {
...
@@ -169,7 +176,17 @@ const Flow = () => {
title
:
'接口配置'
,
title
:
'接口配置'
,
dataIndex
:
'interfaceConfig'
,
dataIndex
:
'interfaceConfig'
,
align
:
'center'
,
align
:
'center'
,
render
:
text
=>
<
span
style=
{
{
color
:
text
===
'(无)'
?
'grey'
:
'000000D9'
}
}
>
{
text
}
</
span
>,
// render: text => <span style={{ color: text === '(无)' ? 'grey' : '000000D9' }}>{text}</span>,
render
:
record
=>
{
if
(
record
!=
'(无)'
)
{
return
(
<
Tooltip
title=
{
record
}
>
<
Tag
color=
"success"
>
有
</
Tag
>
</
Tooltip
>
);
}
return
<
Tag
color=
"processing"
>
无
</
Tag
>;
},
},
},
{
{
title
:
'操作'
,
title
:
'操作'
,
...
...
src/pages/userCenter/siteManage/SiteManage.jsx
View file @
a3da4a1b
...
@@ -5,7 +5,7 @@
...
@@ -5,7 +5,7 @@
/* eslint-disable eqeqeq */
/* eslint-disable eqeqeq */
import
React
,
{
useEffect
,
useState
}
from
'react'
;
import
React
,
{
useEffect
,
useState
}
from
'react'
;
import
{
import
{
//
Tree,
Tree
,
message
,
message
,
Input
,
Input
,
notification
,
notification
,
...
@@ -32,11 +32,11 @@ import {
...
@@ -32,11 +32,11 @@ import {
}
from
'@ant-design/icons'
;
}
from
'@ant-design/icons'
;
import
PageContainer
from
'@/components/BasePageContainer'
;
import
PageContainer
from
'@/components/BasePageContainer'
;
import
Tree
from
'@/components/ExpendableTree'
;
import
Tree
Components
from
'@/components/ExpendableTree'
;
import
voca
from
'voca'
;
import
voca
from
'voca'
;
import
zhCN
from
'antd/es/locale/zh_CN'
;
import
zhCN
from
'antd/es/locale/zh_CN'
;
import
qs
from
'qs'
;
import
qs
from
'qs'
;
import
lodash
,
{
clone
}
from
'lodash'
;
import
lodash
,
{
clone
,
set
}
from
'lodash'
;
import
styles
from
'./SiteManage.less'
;
import
styles
from
'./SiteManage.less'
;
import
{
import
{
...
@@ -76,7 +76,7 @@ const SiteManageV2 = () => {
...
@@ -76,7 +76,7 @@ const SiteManageV2 = () => {
});
});
const
[
total
,
setTotal
]
=
useState
(
0
);
// 分页总数
const
[
total
,
setTotal
]
=
useState
(
0
);
// 分页总数
const
[
page
,
setPage
]
=
useState
({
pageNum
:
1
,
pageSize
:
10
});
const
[
page
,
setPage
]
=
useState
({
pageNum
:
1
,
pageSize
:
10
});
const
[
selectList
,
setSelectList
]
=
useState
(
[]
);
// 已勾选列表数据
const
[
selectList
,
setSelectList
]
=
useState
(
new
Map
()
);
// 已勾选列表数据
const
[
updatePageUser
,
setUpdatePageUser
]
=
useState
(
1
);
//
const
[
updatePageUser
,
setUpdatePageUser
]
=
useState
(
1
);
//
const
[
updateCheck
,
setUpdateCheck
]
=
useState
(
1
);
const
[
updateCheck
,
setUpdateCheck
]
=
useState
(
1
);
const
[
name
,
setName
]
=
useState
(
''
);
const
[
name
,
setName
]
=
useState
(
''
);
...
@@ -84,16 +84,29 @@ const SiteManageV2 = () => {
...
@@ -84,16 +84,29 @@ const SiteManageV2 = () => {
const
[
data
,
setData
]
=
useState
(
''
);
const
[
data
,
setData
]
=
useState
(
''
);
const
[
ch
,
setCh
]
=
useState
(
''
);
const
[
ch
,
setCh
]
=
useState
(
''
);
const
[
keepTree
,
setKeepTree
]
=
useState
([]);
// 保存所有一级id用于控制只展开一项一级菜单
const
[
keepTree
,
setKeepTree
]
=
useState
([]);
// 保存所有一级id用于控制只展开一项一级菜单
const
[
indeterminate
,
setIndeterminate
]
=
useState
(
new
Map
());
const
[
searchTreeValue
,
setSearchTreeValue
]
=
useState
(
''
);
let
a
=
[];
let
a
=
[];
// 渲染机构树
// 渲染机构树
const
mapTree
=
org
=>
{
const
mapTree
=
org
=>
{
const
haveChildren
=
Array
.
isArray
(
org
.
children
)
&&
org
.
children
.
length
>
0
;
const
haveChildren
=
Array
.
isArray
(
org
.
children
)
&&
org
.
children
.
length
>
0
;
const
indexsearch
=
org
.
text
.
indexOf
(
searchTreeValue
);
const
beforeStr
=
org
.
text
.
substring
(
0
,
indexsearch
);
const
afterStr
=
org
.
text
.
slice
(
indexsearch
+
searchTreeValue
.
length
);
return
{
return
{
title
:
(
title
:
(
<
div
className=
{
styles
.
title
}
>
<
div
className=
{
styles
.
title
}
>
<
div
className=
{
styles
.
titleText
}
>
{
org
.
text
}
</
div
>
{
org
.
text
.
includes
(
searchTreeValue
)
&&
searchTreeValue
!=
''
?
(
<
div
className=
{
styles
.
titleText
}
>
{
beforeStr
}
<
span
className=
{
styles
.
titleSearch
}
>
{
searchTreeValue
}
</
span
>
{
afterStr
}
</
div
>
)
:
(
<
div
className=
{
styles
.
titleText
}
>
{
org
.
text
}
</
div
>
)
}
<
div
className=
{
styles
.
tip
}
>
<
div
className=
{
styles
.
tip
}
>
<
Tooltip
title=
"添加下级站点"
className=
{
styles
.
fs
}
>
<
Tooltip
title=
"添加下级站点"
className=
{
styles
.
fs
}
>
<
PlusSquareOutlined
<
PlusSquareOutlined
...
@@ -146,16 +159,18 @@ const SiteManageV2 = () => {
...
@@ -146,16 +159,18 @@ const SiteManageV2 = () => {
handleShowModal
(
'editVisible'
,
true
);
handleShowModal
(
'editVisible'
,
true
);
};
};
// 重新渲染树
// 重新渲染树
const
updateTrees
=
()
=>
{
const
updateTrees
=
value
=>
{
setTreeLoading
(
true
);
setTreeLoading
(
true
);
getSiteTree
({
selectNode
:
-
1
}).
then
(
res
=>
{
getSiteTree
({
selectNode
:
-
1
,
keyword
:
value
}).
then
(
res
=>
{
if
(
res
.
data
.
length
>
0
)
{
if
(
res
.
code
===
0
)
{
setTreeLoading
(
false
);
setTreeLoading
(
false
);
setTreeData
(
res
.
data
);
setTreeData
(
res
.
data
);
let
aa
=
[];
let
aa
=
[];
res
.
data
.
forEach
(
i
=>
{
if
(
res
.
data
.
length
>
0
)
{
aa
.
push
(
i
.
id
);
res
.
data
.
forEach
(
i
=>
{
});
aa
.
push
(
i
.
id
);
});
}
setKeepTree
(
aa
);
setKeepTree
(
aa
);
setTreeDataCopy
(
res
.
data
);
setTreeDataCopy
(
res
.
data
);
// 第一次加载,默认选择第一个组织
// 第一次加载,默认选择第一个组织
...
@@ -198,6 +213,7 @@ const SiteManageV2 = () => {
...
@@ -198,6 +213,7 @@ const SiteManageV2 = () => {
},
[
currentStation
,
updateCheck
]);
},
[
currentStation
,
updateCheck
]);
const
getList
=
()
=>
{
const
getList
=
()
=>
{
indeterminate
.
clear
();
let
params
=
{
let
params
=
{
PageIndex
:
+
page
.
pageNum
,
PageIndex
:
+
page
.
pageNum
,
PageSize
:
+
page
.
pageSize
,
PageSize
:
+
page
.
pageSize
,
...
@@ -210,25 +226,34 @@ const SiteManageV2 = () => {
...
@@ -210,25 +226,34 @@ const SiteManageV2 = () => {
setShowSearchStyle
(
true
);
setShowSearchStyle
(
true
);
let
list
=
res
.
data
.
data
;
let
list
=
res
.
data
.
data
;
// 还原选择的数据
// 还原选择的数据
if
(
selectList
.
length
>
0
)
{
let
indete
=
indeterminate
;
selectList
.
forEach
(
item
=>
{
if
(
selectList
.
size
>
0
)
{
[...
selectList
].
map
(
item
=>
{
list
.
forEach
((
value
,
index
)
=>
{
list
.
forEach
((
value
,
index
)
=>
{
if
(
item
.
groupId
==
value
.
groupId
)
{
// if (item[1].groupId == value.groupId) {
list
[
index
].
users
.
forEach
((
user
,
userIndex
)
=>
{
list
[
index
].
users
.
forEach
((
user
,
userIndex
)
=>
{
if
(
user
.
userId
===
item
.
userId
)
{
if
(
user
.
userId
===
item
[
1
].
userId
)
{
list
[
index
].
users
[
userIndex
].
isChecked
=
true
;
list
[
index
].
users
[
userIndex
].
isChecked
=
true
;
}
list
[
index
].
users
[
userIndex
].
groupName
=
value
.
groupName
;
});
let
checkedLen
=
list
[
index
].
users
.
filter
(
v
=>
v
.
isChecked
).
length
;
if
(
checkedLen
===
list
[
index
].
users
.
length
)
{
list
[
index
].
isChecked
=
true
;
}
}
});
let
checkedLen
=
list
[
index
].
users
.
filter
(
v
=>
v
.
isChecked
).
length
;
if
(
checkedLen
===
list
[
index
].
users
.
length
)
{
list
[
index
].
isChecked
=
true
;
indete
.
set
(
value
.
groupId
,
false
);
}
else
if
(
checkedLen
<
list
[
index
].
users
.
length
&&
checkedLen
!=
0
)
{
list
[
index
].
isChecked
=
false
;
indete
.
set
(
value
.
groupId
,
true
);
}
else
{
list
[
index
].
isChecked
=
false
;
indete
.
set
(
value
.
groupId
,
false
);
}
}
// }
});
});
});
});
}
}
setIndeterminate
(
lodash
.
cloneDeep
(
indete
));
handleShowModal
(
'loading'
,
false
);
handleShowModal
(
'loading'
,
false
);
console
.
log
(
lodash
.
cloneDeep
(
list
));
setdataList
(
lodash
.
cloneDeep
(
list
));
setdataList
(
lodash
.
cloneDeep
(
list
));
setTotal
(
res
.
data
.
count
);
setTotal
(
res
.
data
.
count
);
}
else
{
}
else
{
...
@@ -240,6 +265,7 @@ const SiteManageV2 = () => {
...
@@ -240,6 +265,7 @@ const SiteManageV2 = () => {
};
};
// 搜索状态时获取当前站点可编辑用户(已勾选和未勾选)分页展示
// 搜索状态时获取当前站点可编辑用户(已勾选和未勾选)分页展示
const
getSearchList
=
value
=>
{
const
getSearchList
=
value
=>
{
indeterminate
.
clear
();
let
params
=
{
let
params
=
{
PageIndex
:
1
,
PageIndex
:
1
,
PageSize
:
10
,
PageSize
:
10
,
...
@@ -252,23 +278,33 @@ const SiteManageV2 = () => {
...
@@ -252,23 +278,33 @@ const SiteManageV2 = () => {
setShowSearchStyle
(
true
);
setShowSearchStyle
(
true
);
let
list
=
res
.
data
.
data
;
let
list
=
res
.
data
.
data
;
// 还原选择的数据
// 还原选择的数据
let
indete
=
indeterminate
;
if
(
selectList
.
length
>
0
)
{
if
(
selectList
.
length
>
0
)
{
selectList
.
forEach
(
item
=>
{
selectList
.
forEach
(
item
=>
{
list
.
forEach
((
value
,
index
)
=>
{
list
.
forEach
((
value
,
index
)
=>
{
if
(
item
.
groupId
==
value
.
groupId
)
{
// if (item.groupId == value.groupId) {
list
[
index
].
users
.
forEach
((
user
,
userIndex
)
=>
{
list
[
index
].
users
.
forEach
((
user
,
userIndex
)
=>
{
if
(
user
.
userId
===
item
.
userId
)
{
if
(
user
.
userId
===
item
.
userId
)
{
list
[
index
].
users
[
userIndex
].
isChecked
=
true
;
list
[
index
].
users
[
userIndex
].
isChecked
=
true
;
}
list
[
index
].
users
[
userIndex
].
groupName
=
value
.
groupName
;
});
let
checkedLen
=
list
[
index
].
users
.
filter
(
v
=>
v
.
isChecked
).
length
;
if
(
checkedLen
===
list
[
index
].
users
.
length
)
{
list
[
index
].
isChecked
=
true
;
}
}
});
let
checkedLen
=
list
[
index
].
users
.
filter
(
v
=>
v
.
isChecked
).
length
;
if
(
checkedLen
===
list
[
index
].
users
.
length
)
{
list
[
index
].
isChecked
=
true
;
indete
.
set
(
value
.
groupId
,
false
);
}
else
if
(
checkedLen
<
list
[
index
].
users
.
length
&&
checkedLen
!=
0
)
{
list
[
index
].
isChecked
=
false
;
indete
.
set
(
value
.
groupId
,
true
);
}
else
{
list
[
index
].
isChecked
=
false
;
indete
.
set
(
value
.
groupId
,
false
);
}
}
// }
});
});
});
});
}
}
setIndeterminate
(
lodash
.
cloneDeep
(
indete
));
handleShowModal
(
'loading'
,
false
);
handleShowModal
(
'loading'
,
false
);
setdataList
(
lodash
.
cloneDeep
(
list
));
setdataList
(
lodash
.
cloneDeep
(
list
));
setTotal
(
res
.
data
.
count
);
setTotal
(
res
.
data
.
count
);
...
@@ -282,33 +318,47 @@ const SiteManageV2 = () => {
...
@@ -282,33 +318,47 @@ const SiteManageV2 = () => {
// 重置
// 重置
const
restButton
=
()
=>
{
const
restButton
=
()
=>
{
setName
(
''
);
indeterminate
.
clear
();
let
params
=
{
let
params
=
{
PageIndex
:
1
,
PageIndex
:
1
,
PageSize
:
10
,
PageSize
:
10
,
};
};
params
=
{
...
params
};
params
=
{
...
params
};
setCheckLoading
(
true
);
getGroupUserTree
(
params
).
then
(
res
=>
{
getGroupUserTree
(
params
).
then
(
res
=>
{
setCheckLoading
(
false
);
if
(
res
.
code
===
0
&&
res
.
data
)
{
if
(
res
.
code
===
0
&&
res
.
data
)
{
setShowSearchStyle
(
true
);
setShowSearchStyle
(
true
);
let
list
=
res
.
data
.
data
;
let
list
=
res
.
data
.
data
;
// 还原选择的数据
// 还原选择的数据
let
indete
=
indeterminate
;
if
(
selectList
.
length
>
0
)
{
if
(
selectList
.
length
>
0
)
{
selectList
.
forEach
(
item
=>
{
selectList
.
forEach
(
item
=>
{
list
.
forEach
((
value
,
index
)
=>
{
list
.
forEach
((
value
,
index
)
=>
{
if
(
item
.
groupId
==
value
.
groupId
)
{
// if (item.groupId == value.groupId) {
list
[
index
].
users
.
forEach
((
user
,
userIndex
)
=>
{
list
[
index
].
users
.
forEach
((
user
,
userIndex
)
=>
{
if
(
user
.
userId
===
item
.
userId
)
{
if
(
user
.
userId
===
item
.
userId
)
{
list
[
index
].
users
[
userIndex
].
isChecked
=
true
;
list
[
index
].
users
[
userIndex
].
isChecked
=
true
;
}
list
[
index
].
users
[
userIndex
].
groupName
=
value
.
groupName
;
});
let
checkedLen
=
list
[
index
].
users
.
filter
(
v
=>
v
.
isChecked
).
length
;
if
(
checkedLen
===
list
[
index
].
users
.
length
)
{
list
[
index
].
isChecked
=
true
;
}
}
});
let
checkedLen
=
list
[
index
].
users
.
filter
(
v
=>
v
.
isChecked
).
length
;
if
(
checkedLen
===
list
[
index
].
users
.
length
)
{
list
[
index
].
isChecked
=
true
;
indete
.
set
(
value
.
groupId
,
false
);
}
else
if
(
checkedLen
<
list
[
index
].
users
.
length
&&
checkedLen
!=
0
)
{
list
[
index
].
isChecked
=
false
;
indete
.
set
(
value
.
groupId
,
true
);
}
else
{
list
[
index
].
isChecked
=
false
;
indete
.
set
(
value
.
groupId
,
false
);
}
}
// }
});
});
});
});
}
}
setIndeterminate
(
lodash
.
cloneDeep
(
indete
));
handleShowModal
(
'loading'
,
false
);
handleShowModal
(
'loading'
,
false
);
setdataList
(
lodash
.
cloneDeep
(
list
));
setdataList
(
lodash
.
cloneDeep
(
list
));
setTotal
(
res
.
data
.
count
);
setTotal
(
res
.
data
.
count
);
...
@@ -323,26 +373,26 @@ const SiteManageV2 = () => {
...
@@ -323,26 +373,26 @@ const SiteManageV2 = () => {
const
handleChange
=
e
=>
{
const
handleChange
=
e
=>
{
setName
(
e
.
target
.
value
);
setName
(
e
.
target
.
value
);
handleSearch
(
e
.
target
.
value
);
};
};
// 获取当前站点所有已经勾选的用户新接口
// 获取当前站点所有已经勾选的用户新接口
const
getAllCheckListNew
=
()
=>
{
const
getAllCheckListNew
=
()
=>
{
selectList
.
clear
();
getStationUsers
({
getStationUsers
({
stationId
:
currentStation
,
stationId
:
currentStation
,
}).
then
(
res
=>
{
}).
then
(
res
=>
{
let
list
=
[];
if
(
res
.
data
.
length
>
0
)
{
if
(
res
.
data
.
length
>
0
)
{
res
.
data
.
map
((
item
,
index
)
=>
{
res
.
data
.
map
((
item
,
index
)
=>
{
list
.
push
({
console
.
log
(
selectList
);
groupId
:
+
item
.
OUID
,
selectList
.
set
(
`
${
item
.
userID
}
|
${
item
.
OUID
.
toString
()}
`
,
{
groupId
:
item
.
OUID
,
groupName
:
item
.
OUName
,
groupName
:
item
.
OUName
,
userName
:
item
.
userName
,
userName
:
item
.
userName
,
userId
:
item
.
userID
,
userId
:
item
.
userID
.
toString
()
,
});
});
});
});
}
}
setSelectList
(
lodash
.
cloneDeep
(
list
)
);
console
.
log
(
selectList
);
setUpdatePageUser
(
updatePageUser
+
1
);
setUpdatePageUser
(
updatePageUser
+
1
);
});
});
};
};
...
@@ -425,87 +475,100 @@ const SiteManageV2 = () => {
...
@@ -425,87 +475,100 @@ const SiteManageV2 = () => {
}
}
});
});
};
};
// 每组全选全不选
// 每组全选全不选
const
handleChangeAll
=
(
e
,
index
)
=>
{
const
handleChangeAll
=
(
e
,
index
,
groupName
)
=>
{
dataList
[
index
].
isChecked
=
e
.
target
.
checked
;
dataList
[
index
].
isChecked
=
e
.
target
.
checked
;
setdataList
(
lodash
.
cloneDeep
(
dataList
));
let
select
=
selectList
;
dataList
[
index
].
users
.
forEach
(
item
=>
{
dataList
[
index
].
users
.
forEach
(
item
=>
{
item
.
isChecked
=
e
.
target
.
checked
;
let
datalist
=
item
;
let
delIndex
=
selectList
.
findIndex
(
datalist
.
groupName
=
groupName
;
v
=>
v
.
groupId
==
dataList
[
index
].
groupId
&&
v
.
userId
==
item
.
userId
,
);
if
(
e
.
target
.
checked
)
{
if
(
e
.
target
.
checked
)
{
if
(
delIndex
===
-
1
)
{
select
.
set
(
`
${
item
.
userId
}
|
${
item
.
groupId
}
`
,
datalist
);
selectList
.
push
({
}
else
{
groupId
:
dataList
[
index
].
groupId
,
select
.
delete
(
`
${
item
.
userId
}
|
${
item
.
groupId
}
`
);
groupName
:
dataList
[
index
].
groupName
,
userName
:
item
.
userName
,
userId
:
item
.
userId
,
});
}
}
if
(
!
e
.
target
.
checked
)
{
selectList
.
splice
(
delIndex
,
1
);
}
}
const
indeterminateArr
=
indeterminate
;
indeterminateArr
.
set
(
item
.
groupId
,
false
);
setIndeterminate
(
lodash
.
cloneDeep
(
indeterminateArr
));
});
});
setSelectList
(
lodash
.
cloneDeep
(
selectList
));
setSelectList
(
lodash
.
cloneDeep
(
select
));
setdataList
(
lodash
.
cloneDeep
(
dataList
));
};
};
// 单个选择checkbox
// 单个选择checkbox
const
handleChangeSignel
=
(
e
,
index
,
vIndex
)
=>
{
const
handleChangeSignel
=
(
e
,
index
,
vIndex
,
item
,
groupName
)
=>
{
dataList
[
index
].
users
[
vIndex
].
isChecked
=
e
.
target
.
checked
;
let
select
=
selectList
;
let
checked
=
isAllChecked
(
index
);
let
datalist
=
item
;
let
hasIndex
=
selectList
.
findIndex
(
datalist
.
groupName
=
groupName
;
item
=>
if
(
e
.
target
.
checked
)
{
item
.
userId
==
dataList
[
index
].
users
[
vIndex
].
userId
&&
select
.
set
(
`
${
item
.
userId
}
|
${
item
.
groupId
}
`
,
datalist
);
item
.
groupId
==
dataList
[
index
].
groupId
,
setSelectList
(
lodash
.
cloneDeep
(
select
));
);
}
else
{
dataList
[
index
].
isChecked
=
checked
;
select
.
delete
(
`
${
item
.
userId
}
|
${
item
.
groupId
}
`
);
if
(
e
.
target
.
checked
&&
hasIndex
===
-
1
)
{
setSelectList
(
lodash
.
cloneDeep
(
select
));
selectList
.
push
({
}
groupId
:
dataList
[
index
].
groupId
,
// 全选状态样式
groupName
:
dataList
[
index
].
groupName
,
let
data
=
[];
userName
:
dataList
[
index
].
users
[
vIndex
].
userName
,
[...
select
].
map
(
i
=>
{
userId
:
dataList
[
index
].
users
[
vIndex
].
userId
,
if
(
i
[
1
].
groupId
==
item
.
groupId
)
{
});
data
.
push
(
i
[
1
]);
// 分组中已选的数据
}
});
console
.
log
(
data
);
console
.
log
(
dataList
[
index
].
users
.
length
);
const
indeterminateArr
=
indeterminate
;
if
(
dataList
[
index
].
users
.
length
==
data
.
length
)
{
indeterminateArr
.
set
(
item
.
groupId
,
false
);
dataList
[
index
].
isChecked
=
true
;
}
else
if
(
data
.
length
<
dataList
[
index
].
users
.
length
&&
data
.
length
!=
0
)
{
indeterminateArr
.
set
(
item
.
groupId
,
true
);
dataList
[
index
].
isChecked
=
false
;
}
else
{
}
else
{
selectList
.
splice
(
hasIndex
,
1
);
indeterminateArr
.
set
(
item
.
groupId
,
false
);
dataList
[
index
].
isChecked
=
false
;
}
}
set
SelectList
(
lodash
.
cloneDeep
(
selectList
));
set
Indeterminate
(
lodash
.
cloneDeep
(
indeterminateArr
));
setdataList
(
lodash
.
cloneDeep
(
dataList
));
setdataList
(
lodash
.
cloneDeep
(
dataList
));
};
};
const
isAllChecked
=
index
=>
dataList
[
index
].
users
.
filter
(
item
=>
item
.
isChecked
).
length
===
dataList
[
index
].
users
.
length
;
// 删除已选列表
// 删除已选列表
const
handleDel
=
index
=>
{
const
handleDel
=
(
e
,
item
)
=>
{
let
{
groupId
,
userId
}
=
selectList
[
index
];
let
select
=
selectList
;
let
outerIndex
=
dataList
.
findIndex
(
item
=>
item
.
groupId
==
groupId
);
select
.
delete
(
item
[
0
]);
if
(
outerIndex
>
-
1
)
{
setSelectList
(
lodash
.
cloneDeep
(
select
));
let
innerIndex
=
dataList
[
outerIndex
].
users
.
findIndex
(
item
=>
item
.
userId
==
userId
);
dataList
[
outerIndex
].
users
[
innerIndex
].
isChecked
=
false
;
// 全选样式
dataList
[
outerIndex
].
isChecked
=
isAllChecked
(
outerIndex
);
let
data
=
[];
[...
select
].
map
(
i
=>
{
if
(
i
[
1
].
groupId
==
item
[
1
].
groupId
)
{
data
.
push
(
i
[
1
]);
}
});
const
indeterminateArr
=
indeterminate
;
[...
indeterminateArr
].
map
((
i
,
j
)
=>
{
if
(
i
[
0
]
==
item
[
1
].
groupId
)
{
dataList
[
j
].
isChecked
=
false
;
}
});
if
(
data
.
length
>
0
)
{
indeterminateArr
.
set
(
item
[
1
].
groupId
,
true
);
}
else
{
indeterminateArr
.
set
(
item
[
1
].
groupId
,
false
);
}
}
selectList
.
splice
(
index
,
1
);
setSelectList
(
lodash
.
cloneDeep
(
selectList
));
setdataList
(
lodash
.
cloneDeep
(
dataList
));
setdataList
(
lodash
.
cloneDeep
(
dataList
));
setIndeterminate
(
lodash
.
cloneDeep
(
indeterminateArr
));
};
};
// 提交
// 提交
const
handleCommitBtn
=
()
=>
{
const
handleCommitBtn
=
()
=>
{
handleShowModal
(
'btnLoading'
,
true
);
handleShowModal
(
'btnLoading'
,
true
);
let
result
=
[];
let
result
=
[];
let
obj
=
{};
let
aa
=
selectList
;
selectList
.
forEach
(
item
=>
{
[...
aa
].
map
(
i
=>
{
if
(
obj
[
item
.
groupId
])
{
console
.
log
(
i
[
1
].
userId
);
obj
[
item
.
groupId
].
push
(
item
.
userId
);
result
.
push
(
i
[
1
].
userId
);
}
else
{
obj
[
item
.
groupId
]
=
[
item
.
userId
];
}
});
});
// dataList.forEach(item => {
// if (obj[item.GroupId] && item.Users.length === obj[item.GroupId].length) {
// obj[item.GroupId].push(item.GroupId);
// }
// });
result
=
Object
.
values
(
obj
);
// 数据处理成后台需要的格式
// 数据处理成后台需要的格式
if
(
result
.
length
===
0
)
if
(
result
.
length
===
0
)
return
notification
.
warning
({
return
notification
.
warning
({
...
@@ -520,7 +583,6 @@ const SiteManageV2 = () => {
...
@@ -520,7 +583,6 @@ const SiteManageV2 = () => {
handleShowModal
(
'btnLoading'
,
false
);
handleShowModal
(
'btnLoading'
,
false
);
if
(
res
.
code
===
0
)
{
if
(
res
.
code
===
0
)
{
setSelectList
([]);
setUpdateCheck
(
updateCheck
+
1
);
setUpdateCheck
(
updateCheck
+
1
);
notification
.
success
({
notification
.
success
({
message
:
'提示'
,
message
:
'提示'
,
...
@@ -629,27 +691,6 @@ const SiteManageV2 = () => {
...
@@ -629,27 +691,6 @@ const SiteManageV2 = () => {
});
});
};
};
const
indeterminate
=
i
=>
{
let
aa
=
[];
i
.
users
.
map
(
i
=>
{
if
(
i
.
isChecked
)
{
aa
.
push
(
i
.
userName
);
}
});
if
(
i
.
isChecked
)
{
console
.
log
(
12
);
return
false
;
}
if
(
!
i
.
isChecked
&&
aa
.
length
<
i
.
users
.
length
&&
aa
.
length
!=
0
)
{
console
.
log
(
34
);
return
true
;
}
if
(
!
i
.
isChecked
&&
aa
.
length
==
0
)
{
console
.
log
(
56
);
return
false
;
}
};
const
Panels
=
React
.
memo
(
props
=>
{
const
Panels
=
React
.
memo
(
props
=>
{
let
{
index
,
groupId
,
groupName
,
users
,
isChecked
,
isShow
,
color
,
item
}
=
props
;
let
{
index
,
groupId
,
groupName
,
users
,
isChecked
,
isShow
,
color
,
item
}
=
props
;
return
(
return
(
...
@@ -668,8 +709,8 @@ const SiteManageV2 = () => {
...
@@ -668,8 +709,8 @@ const SiteManageV2 = () => {
key=
"0"
key=
"0"
className=
{
styles
.
siteListTitle
}
className=
{
styles
.
siteListTitle
}
checked=
{
isChecked
}
checked=
{
isChecked
}
indeterminate=
{
indeterminate
(
item
)
}
indeterminate=
{
indeterminate
.
get
(
groupId
)
}
onClick=
{
e
=>
props
.
handleChangeAll
(
e
,
index
)
}
onClick=
{
e
=>
props
.
handleChangeAll
(
e
,
index
,
groupName
)
}
>
>
全选
全选
</
Checkbox
>
</
Checkbox
>
...
@@ -679,9 +720,12 @@ const SiteManageV2 = () => {
...
@@ -679,9 +720,12 @@ const SiteManageV2 = () => {
users
.
map
((
v
,
vIndex
)
=>
(
users
.
map
((
v
,
vIndex
)
=>
(
<
CheckBoxRow
<
CheckBoxRow
{
...
v
}
{
...
v
}
item=
{
v
}
groupName=
{
groupName
}
index=
{
index
}
index=
{
index
}
vIndex=
{
vIndex
}
vIndex=
{
vIndex
}
key=
{
v
.
userId
}
key=
{
v
.
userId
}
selectList=
{
selectList
}
handleChangeSignel=
{
props
.
handleChangeSignel
}
handleChangeSignel=
{
props
.
handleChangeSignel
}
/>
/>
))
}
))
}
...
@@ -690,6 +734,11 @@ const SiteManageV2 = () => {
...
@@ -690,6 +734,11 @@ const SiteManageV2 = () => {
);
);
});
});
const
onSearch
=
value
=>
{
setSearchTreeValue
(
value
);
updateTrees
(
value
);
};
return
(
return
(
<
PageContainer
className=
{
styles
.
siteManageContainer
}
>
<
PageContainer
className=
{
styles
.
siteManageContainer
}
>
<
div
className=
{
styles
.
contentContainer
}
>
<
div
className=
{
styles
.
contentContainer
}
>
...
@@ -711,23 +760,57 @@ const SiteManageV2 = () => {
...
@@ -711,23 +760,57 @@ const SiteManageV2 = () => {
}
}
}
}
/>
/>
</
Tooltip
>
</
Tooltip
>
{
treeData
.
length
>
0
&&
(
<
hr
style=
{
{
width
:
'95%'
,
color
:
'#eeecec'
,
marginLeft
:
'15px'
}
}
/>
<
div
style=
{
{
height
:
'100%'
,
overflowY
:
'scroll'
}
}
>
<
Search
<
Tree
style=
{
{
showIcon=
"true"
marginBottom
:
8
,
showLine=
{
{
showLeafIcon
:
false
}
}
width
:
'98%'
,
blockNode
marginLeft
:
'7px'
,
autoExpandParent
}
}
selectedKeys=
{
[
currentStation
]
}
placeholder=
"快速搜索站点"
onSelect=
{
onSelect
}
onSearch=
{
onSearch
}
treeData=
{
treeData
.
map
(
t
=>
mapTree
(
t
))
}
/>
expandedKeys=
{
treeData
[
0
].
id
}
{
searchTreeValue
!==
''
?
(
draggable
<>
onDrop=
{
handleDrop
}
{
treeData
.
length
>
0
&&
(
keepTree=
{
keepTree
}
<
div
style=
{
{
height
:
'100%'
,
overflowY
:
'scroll'
}
}
>
/>
<
Tree
</
div
>
showIcon=
"true"
showLine=
{
{
showLeafIcon
:
false
}
}
blockNode
defaultExpandAll
selectedKeys=
{
[
currentStation
]
}
onSelect=
{
onSelect
}
treeData=
{
treeData
.
map
(
t
=>
mapTree
(
t
))
}
draggable
onDrop=
{
handleDrop
}
keepTree=
{
keepTree
}
/>
</
div
>
)
}
</>
)
:
(
<>
{
treeData
.
length
>
0
&&
(
<
div
style=
{
{
height
:
'100%'
,
overflowY
:
'scroll'
}
}
>
<
TreeComponents
showIcon=
"true"
showLine=
{
{
showLeafIcon
:
false
}
}
blockNode
autoExpandParent
selectedKeys=
{
[
currentStation
]
}
onSelect=
{
onSelect
}
treeData=
{
treeData
.
map
(
t
=>
mapTree
(
t
))
}
expandedKeys=
{
treeData
[
0
].
id
}
draggable
onDrop=
{
handleDrop
}
keepTree=
{
keepTree
}
/>
</
div
>
)
}
</>
)
}
)
}
<
div
className=
{
styles
.
switcher
}
>
<
div
className=
{
styles
.
switcher
}
>
{
treeVisible
&&
(
{
treeVisible
&&
(
<
Tooltip
title=
"隐藏站点列表"
>
<
Tooltip
title=
"隐藏站点列表"
>
...
@@ -790,8 +873,8 @@ const SiteManageV2 = () => {
...
@@ -790,8 +873,8 @@ const SiteManageV2 = () => {
allowClear
allowClear
placeholder=
{
placeholder
}
placeholder=
{
placeholder
}
onSearch=
{
handleSearch
}
onSearch=
{
handleSearch
}
//
value={name}
value=
{
name
}
//
onChange={e => handleChange(e)}
onChange=
{
e
=>
handleChange
(
e
)
}
enterButton
enterButton
/>
/>
...
@@ -824,13 +907,11 @@ const SiteManageV2 = () => {
...
@@ -824,13 +907,11 @@ const SiteManageV2 = () => {
}
}
}
}
>
>
<
ul
className=
{
styles
.
siteSelectUl
}
>
<
ul
className=
{
styles
.
siteSelectUl
}
>
{
selectList
.
map
((
item
,
index
)
=>
(
{
[...
selectList
]
.
map
((
item
,
index
)
=>
(
<
li
<
li
key=
{
`${item.userName}${item.groupId}${index}`
}
key=
{
`${item.userName}${item.groupId}${index}`
}
onClick=
{
()
=>
handleDel
(
index
)
}
onClick=
{
e
=>
handleDel
(
e
,
item
)
}
>
>
{
`${item[1].userName}(${item[1].groupName})`
}
</
li
>
{
`${item.userName}(${item.groupName})`
}
</
li
>
))
}
))
}
</
ul
>
</
ul
>
</
div
>
</
div
>
...
@@ -912,16 +993,16 @@ const SiteManageV2 = () => {
...
@@ -912,16 +993,16 @@ const SiteManageV2 = () => {
);
);
};
};
const
CheckBoxRow
=
React
.
memo
(
props
=>
{
const
CheckBoxRow
=
props
=>
{
let
{
vIndex
,
index
,
isChecked
,
userName
}
=
props
;
let
{
vIndex
,
index
,
isChecked
,
userName
,
item
,
selectList
,
groupName
}
=
props
;
return
(
return
(
<
Checkbox
<
Checkbox
className=
{
styles
.
siteList
}
className=
{
styles
.
siteList
}
checked=
{
isChecked
}
checked=
{
selectList
.
size
>
0
&&
selectList
.
has
(
`${item.userId}|${item.groupId}`
)
}
onClick=
{
e
=>
props
.
handleChangeSignel
(
e
,
index
,
vIndex
)
}
onClick=
{
e
=>
props
.
handleChangeSignel
(
e
,
index
,
vIndex
,
item
,
groupName
)
}
>
>
{
userName
}
{
userName
}
</
Checkbox
>
</
Checkbox
>
);
);
}
)
;
};
export
default
SiteManageV2
;
export
default
SiteManageV2
;
src/pages/userCenter/siteManage/SiteManage.less
View file @
a3da4a1b
...
@@ -377,4 +377,7 @@
...
@@ -377,4 +377,7 @@
overflow: hidden;
overflow: hidden;
white-space: nowrap;
white-space: nowrap;
text-overflow: ellipsis;
text-overflow: ellipsis;
}
}
\ No newline at end of file
.titleSearch {
color: #f50;
}
src/pages/userCenter/userManage/RelateRoleModal.jsx
View file @
a3da4a1b
...
@@ -54,7 +54,7 @@ const RelateRoleModal = props => {
...
@@ -54,7 +54,7 @@ const RelateRoleModal = props => {
const
submitRole
=
()
=>
{
const
submitRole
=
()
=>
{
console
.
log
(
1212121212
);
console
.
log
(
1212121212
);
SetUserRelationList
(
SetUserRelationList
(
currentUser
.
userI
D
,
currentUser
.
userI
d
,
Object
.
keys
(
roleValueList
)
Object
.
keys
(
roleValueList
)
.
map
(
k
=>
roleValueList
[
k
])
.
map
(
k
=>
roleValueList
[
k
])
.
flat
(),
.
flat
(),
...
...
src/pages/userCenter/userManage/UserManage.jsx
View file @
a3da4a1b
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
/* eslint-disable eqeqeq */
/* eslint-disable eqeqeq */
import
React
,
{
useState
,
useEffect
,
useRef
}
from
'react'
;
import
React
,
{
useState
,
useEffect
,
useRef
}
from
'react'
;
import
{
import
{
//
Tree,
Tree
,
Table
,
Table
,
Space
,
Space
,
message
,
message
,
...
@@ -18,6 +18,7 @@ import {
...
@@ -18,6 +18,7 @@ import {
Popconfirm
,
Popconfirm
,
Form
,
Form
,
Radio
,
Radio
,
Pagination
,
}
from
'antd'
;
}
from
'antd'
;
import
{
import
{
UserOutlined
,
UserOutlined
,
...
@@ -69,7 +70,7 @@ import {
...
@@ -69,7 +70,7 @@ import {
SetGroupManager
,
SetGroupManager
,
}
from
'@/services/userManage/api'
;
}
from
'@/services/userManage/api'
;
import
{
AddUserAuthSetting
,
GetUserAuthSet
}
from
'@/services/database/api'
;
import
{
AddUserAuthSetting
,
GetUserAuthSet
}
from
'@/services/database/api'
;
import
Tree
from
'@/components/ExpendableTree'
;
import
Tree
Components
from
'@/components/ExpendableTree'
;
import
classnames
from
'classnames'
;
import
classnames
from
'classnames'
;
import
DraggleLayout
from
'components/DraggleLayout'
;
import
DraggleLayout
from
'components/DraggleLayout'
;
import
AddUserModal
from
'./AddUserModal'
;
import
AddUserModal
from
'./AddUserModal'
;
...
@@ -176,8 +177,14 @@ const UserManage = () => {
...
@@ -176,8 +177,14 @@ const UserManage = () => {
const
[
keepDataList
,
setKeepDataList
]
=
useState
([]);
const
[
keepDataList
,
setKeepDataList
]
=
useState
([]);
const
[
siteList
,
setSiteList
]
=
useState
([]);
const
[
siteList
,
setSiteList
]
=
useState
([]);
const
setRowClassName
=
record
=>
const
setRowClassName
=
record
=>
record
.
userI
D
===
selectColor
.
userID
?
styles
.
clickRowStyle
:
''
;
record
.
userI
d
===
selectColor
.
userId
?
styles
.
clickRowStyle
:
''
;
const
[
demoVisivle
,
setDemoVisible
]
=
useState
(
false
);
const
[
searchTreeValue
,
setSearchTreeValue
]
=
useState
(
''
);
const
[
total
,
setTotal
]
=
useState
(
0
);
const
[
pageSize
,
setPageSize
]
=
useState
(
20
);
const
[
currentPage
,
setCurrentPage
]
=
useState
(
1
);
// 用户表列名
// 用户表列名
const
columns
=
[
const
columns
=
[
{
{
...
@@ -197,13 +204,13 @@ const UserManage = () => {
...
@@ -197,13 +204,13 @@ const UserManage = () => {
},
},
{
{
title
:
'所在机构'
,
title
:
'所在机构'
,
dataIndex
:
'
OU
Name'
,
dataIndex
:
'
group
Name'
,
key
:
'
OU
Name'
,
key
:
'
group
Name'
,
// width: 150,
// width: 150,
ellipsis
:
true
,
ellipsis
:
true
,
filters
:
orgFilters
,
filters
:
orgFilters
,
filteredValue
,
filteredValue
,
onFilter
:
(
value
,
record
)
=>
record
.
OU
Name
===
value
,
onFilter
:
(
value
,
record
)
=>
record
.
group
Name
===
value
,
},
},
{
{
title
:
'手机号码'
,
title
:
'手机号码'
,
...
@@ -272,7 +279,7 @@ const UserManage = () => {
...
@@ -272,7 +279,7 @@ const UserManage = () => {
cancelText=
"取消"
cancelText=
"取消"
onConfirm=
{
()
=>
{
onConfirm=
{
()
=>
{
console
.
log
(
groupId
,
'groupId'
);
console
.
log
(
groupId
,
'groupId'
);
SetGroupManager
({
groupId
,
userId
:
record
.
userI
D
}).
then
(
res
=>
{
SetGroupManager
({
groupId
,
userId
:
record
.
userI
d
}).
then
(
res
=>
{
if
(
res
.
code
===
0
)
{
if
(
res
.
code
===
0
)
{
// eslint-disable-next-line no-unused-expressions
// eslint-disable-next-line no-unused-expressions
currentSelectOrg
===
'-1'
?
submitSearchUser
()
:
onSelect
([
currentSelectOrg
]);
currentSelectOrg
===
'-1'
?
submitSearchUser
()
:
onSelect
([
currentSelectOrg
]);
...
@@ -523,7 +530,7 @@ const UserManage = () => {
...
@@ -523,7 +530,7 @@ const UserManage = () => {
setSelectedRowKeys
(
RowKeys
);
setSelectedRowKeys
(
RowKeys
);
getCheckList
(
RowKeys
);
getCheckList
(
RowKeys
);
setUserIDs
(
RowKeys
.
toString
());
// 数组转字符串,逗号连接
setUserIDs
(
RowKeys
.
toString
());
// 数组转字符串,逗号连接
setOrgIDs
(
Rows
.
map
(
item
=>
item
.
OUID
).
toString
());
setOrgIDs
(
Rows
.
map
(
item
=>
item
.
groupId
).
toString
());
// 选中行数大于0时设置批量操作可行
// 选中行数大于0时设置批量操作可行
if
(
RowKeys
.
length
>
0
)
{
if
(
RowKeys
.
length
>
0
)
{
setSelectColor
({});
setSelectColor
({});
...
@@ -538,6 +545,9 @@ const UserManage = () => {
...
@@ -538,6 +545,9 @@ const UserManage = () => {
// 渲染机构树
// 渲染机构树
const
mapTree
=
org
=>
{
const
mapTree
=
org
=>
{
const
haveChildren
=
Array
.
isArray
(
org
.
children
)
&&
org
.
children
.
length
>
0
;
const
haveChildren
=
Array
.
isArray
(
org
.
children
)
&&
org
.
children
.
length
>
0
;
const
indexsearch
=
org
.
text
.
indexOf
(
searchTreeValue
);
const
beforeStr
=
org
.
text
.
substring
(
0
,
indexsearch
);
const
afterStr
=
org
.
text
.
slice
(
indexsearch
+
searchTreeValue
.
length
);
return
{
return
{
title
:
(
title
:
(
<
div
className=
{
styles
.
title1
}
>
<
div
className=
{
styles
.
title1
}
>
...
@@ -554,7 +564,15 @@ const UserManage = () => {
...
@@ -554,7 +564,15 @@ const UserManage = () => {
)
:
(
)
:
(
<
span
/>
<
span
/>
)
}
)
}
<
span
style=
{
{
marginLeft
:
'5px'
}
}
>
{
org
.
text
}
</
span
>
{
org
.
text
.
includes
(
searchTreeValue
)
&&
searchTreeValue
!=
''
?
(
<
span
>
{
beforeStr
}
<
span
className=
{
styles
.
titleSearch
}
>
{
searchTreeValue
}
</
span
>
{
afterStr
}
</
span
>
)
:
(
<
span
>
{
org
.
text
}
</
span
>
)
}
</
span
>
</
span
>
<
span
<
span
className=
{
classnames
({
className=
{
classnames
({
...
@@ -617,7 +635,7 @@ const UserManage = () => {
...
@@ -617,7 +635,7 @@ const UserManage = () => {
};
};
// 重新渲染树
// 重新渲染树
const
updateTrees
=
()
=>
{
const
updateTrees
=
e
=>
{
setTreeLoading
(
true
);
setTreeLoading
(
true
);
// getUserTree(-1, -1)
// getUserTree(-1, -1)
// .then(res => {
// .then(res => {
...
@@ -642,14 +660,15 @@ const UserManage = () => {
...
@@ -642,14 +660,15 @@ const UserManage = () => {
// setTreeLoading(false);
// setTreeLoading(false);
// message.error(err);
// message.error(err);
// });
// });
GetOUTreeNew
({
selectOU
:
-
1
})
GetOUTreeNew
({
selectOU
:
-
1
,
keyword
:
e
})
.
then
(
newres
=>
{
.
then
(
newres
=>
{
setTreeLoading
(
false
);
if
(
newres
.
code
===
0
)
{
if
(
newres
.
code
===
0
)
{
let
res
=
newres
.
data
;
let
res
=
newres
.
data
;
console
.
log
(
res
);
console
.
log
(
res
);
setTreeLoading
(
false
);
setTreeData
(
res
);
setTreeData
(
res
);
setTreeDataCopy
(
res
);
//
setTreeDataCopy(res);
let
aa
=
[];
let
aa
=
[];
res
.
forEach
(
i
=>
{
res
.
forEach
(
i
=>
{
aa
.
push
(
i
.
id
);
aa
.
push
(
i
.
id
);
...
@@ -711,9 +730,7 @@ const UserManage = () => {
...
@@ -711,9 +730,7 @@ const UserManage = () => {
};
};
// 点击树节点,获取当前机构下所有用户
// 点击树节点,获取当前机构下所有用户
const
onSelect
=
(
props
,
e
)
=>
{
const
onSelect
=
(
props
,
e
,
size
,
index
)
=>
{
console
.
log
(
props
);
console
.
log
(
e
);
if
(
e
)
{
if
(
e
)
{
props
[
0
]
=
e
.
node
.
key
;
props
[
0
]
=
e
.
node
.
key
;
}
else
{
}
else
{
...
@@ -747,39 +764,47 @@ const UserManage = () => {
...
@@ -747,39 +764,47 @@ const UserManage = () => {
// eslint-disable-next-line no-console
// eslint-disable-next-line no-console
setGroupId
(
props
[
0
]);
setGroupId
(
props
[
0
]);
getOneOUUserListNew
(
props
[
0
]
||
currentSelectOrg
)
let
sizedata
=
''
;
let
currentData
=
''
;
if
(
currentSelectOrg
!==
props
[
0
])
{
setPageSize
(
20
);
setCurrentPage
(
1
);
sizedata
=
size
?
size
:
20
;
currentData
=
index
?
index
:
1
;
}
else
{
// 分页查询
sizedata
=
size
?
size
:
pageSize
;
currentData
=
index
?
index
:
currentPage
;
}
getOneOUUserListNew
(
props
[
0
]
||
currentSelectOrg
,
sizedata
,
currentData
)
.
then
(
res
=>
{
.
then
(
res
=>
{
setCurrentOrgOperate
(
false
);
// 重置禁用当前机构操作为false
setCurrentOrgOperate
(
false
);
// 重置禁用当前机构操作为false
setMultiOperate
(
true
);
// 重新禁止用户批量操作
setMultiOperate
(
true
);
// 重新禁止用户批量操作
setSelectedRowKeys
([]);
// 重置选中用户数
setSelectedRowKeys
([]);
// 重置选中用户数
if
(
res
.
code
===
0
)
{
if
(
res
.
code
===
0
)
{
setTotal
(
res
.
data
.
count
);
setTableLoading
(
false
);
setTableLoading
(
false
);
setSearchWord
(
''
);
// 搜索框置空
setSearchWord
(
''
);
// 搜索框置空
setOrgTitle
(
res
.
data
.
GroupName
);
setOrgTitle
(
res
.
data
.
GroupName
);
setDescription
(
res
.
data
.
Description
);
// 返回用户表数据结构处理,扁平化
// 返回用户表数据结构处理,扁平化
console
.
log
(
res
.
data
);
let
temp
=
res
.
data
.
data
;
const
temp
=
flatten
(
getUsers
(
res
.
data
));
console
.
log
(
temp
);
// 设置过滤字段
// 设置过滤字段
let
arr
=
temp
.
map
(
item
=>
item
.
OUName
);
let
arr
=
temp
.
map
(
item
=>
item
.
groupName
);
console
.
log
(
arr
);
arr
=
arr
.
filter
((
value
,
index
)
=>
arr
.
indexOf
(
value
)
===
index
);
arr
=
arr
.
filter
((
value
,
index
)
=>
arr
.
indexOf
(
value
)
===
index
);
console
.
log
(
arr
);
setOrgFilters
(
arr
.
map
(
item
=>
({
text
:
item
,
value
:
item
})));
setOrgFilters
(
arr
.
map
(
item
=>
({
text
:
item
,
value
:
item
})));
setTableLength
(
temp
.
length
);
setTableLength
(
temp
.
length
);
let
datalist
=
[];
let
datalist
=
[];
const
table
=
temp
.
map
((
item
,
index
)
=>
{
const
table
=
temp
.
map
((
item
,
index
)
=>
{
console
.
log
(
item
);
if
(
item
.
loginName
==
'panda'
||
item
.
loginName
==
'admin'
)
{
if
(
item
.
loginName
==
'panda'
||
item
.
loginName
==
'admin'
)
{
datalist
.
push
(
item
.
userI
D
);
datalist
.
push
(
item
.
userI
d
);
}
}
item
.
key
=
index
;
item
.
key
=
index
;
return
item
;
return
item
;
});
});
console
.
log
(
datalist
);
setKeepDataList
(
datalist
);
setKeepDataList
(
datalist
);
setShowSearchStyle
(
false
);
setShowSearchStyle
(
false
);
console
.
log
(
table
);
setTableData
(
table
);
setTableData
(
table
);
}
else
{
}
else
{
setTableLoading
(
false
);
setTableLoading
(
false
);
...
@@ -798,46 +823,47 @@ const UserManage = () => {
...
@@ -798,46 +823,47 @@ const UserManage = () => {
}
}
};
};
// 添加用户刷新表数据
// // 添加用户刷新表数据
const
onSelect1
=
()
=>
{
// const onSelect1 = () => {
console
.
log
(
orgID
);
// console.log(orgID);
setTableLoading
(
true
);
// setTableLoading(true);
// eslint-disable-next-line no-console
// // eslint-disable-next-line no-console
getOneOUUserListNew
(
orgID
.
id
||
currentSelectOrg
)
// getOneOUUserListNew(orgID.id || currentSelectOrg, pageSize, currentPage)
.
then
(
res
=>
{
// .then(res => {
setCurrentOrgOperate
(
false
);
// 重置禁用当前机构操作为false
// setCurrentOrgOperate(false); // 重置禁用当前机构操作为false
setMultiOperate
(
true
);
// 重新禁止用户批量操作
// setMultiOperate(true); // 重新禁止用户批量操作
setSelectedRowKeys
([]);
// 重置选中用户数
// setSelectedRowKeys([]); // 重置选中用户数
if
(
res
.
code
===
0
)
{
// if (res.code === 0) {
setTableLoading
(
false
);
// setTableLoading(false);
setSearchWord
(
''
);
// 搜索框置空
// setSearchWord(''); // 搜索框置空
setOrgTitle
(
res
.
data
.
GroupName
);
// setOrgTitle(res.data.GroupName);
setDescription
(
res
.
data
.
Description
);
// // setDescription(res.data.Description);
// 返回用户表数据结构处理,扁平化
// // 返回用户表数据结构处理,扁平化
const
temp
=
flatten
(
getUsers
(
res
.
data
));
// let temp = res.data.data;
// 设置过滤字段
// // const temp = flatten(getUsers(res.data));
let
arr
=
temp
.
map
(
item
=>
item
.
OUName
);
// // 设置过滤字段
arr
=
arr
.
filter
((
value
,
index
)
=>
arr
.
indexOf
(
value
)
===
index
);
// let arr = temp.map(item => item.groupName);
setOrgFilters
(
arr
.
map
(
item
=>
({
text
:
item
,
value
:
item
})));
// arr = arr.filter((value, index) => arr.indexOf(value) === index);
setTableLength
(
temp
.
length
);
// setOrgFilters(arr.map(item => ({ text: item, value: item })));
const
table
=
temp
.
map
((
item
,
index
)
=>
{
// setTableLength(temp.length);
item
.
key
=
index
;
// const table = temp.map((item, index) => {
return
item
;
// item.key = index;
});
// return item;
setShowSearchStyle
(
false
);
// });
setTableData
(
table
);
// setShowSearchStyle(false);
}
else
{
// setTableData(table);
setTableLoading
(
false
);
// } else {
}
// setTableLoading(false);
})
// }
.
catch
(
err
=>
{
// })
setTableLoading
(
false
);
// .catch(err => {
message
.
error
(
err
);
// setTableLoading(false);
});
// message.error(err);
};
// });
// };
const
getDescription
=
e
=>
{
const
getDescription
=
e
=>
{
getOneOUUserListNew
(
e
).
then
(
res
=>
{
getOneOUUserListNew
(
e
,
pageSize
,
currentPage
).
then
(
res
=>
{
if
(
res
.
code
===
0
)
{
if
(
res
.
code
===
0
)
{
setDescription
(
res
.
data
.
Description
);
setDescription
(
res
.
data
.
Description
);
}
}
...
@@ -856,16 +882,16 @@ const UserManage = () => {
...
@@ -856,16 +882,16 @@ const UserManage = () => {
});
});
};
};
// 返回用户表数据结构处理,扁平化
// 返回用户表数据结构处理,扁平化
const
getUsers
=
orgObj
=>
{
//
const getUsers = orgObj => {
let
result
=
orgObj
.
Users
;
//
let result = orgObj.Users;
result
.
map
(
item
=>
{
//
result.map(item => {
item
.
OUID
=
orgObj
.
GroupId
;
//
item.OUID = orgObj.GroupId;
item
.
OUName
=
orgObj
.
GroupName
;
//
item.OUName = orgObj.GroupName;
return
item
;
//
return item;
});
//
});
if
(
orgObj
.
Childs
.
length
>
0
)
result
=
[...
result
,
...
orgObj
.
Childs
.
map
(
o
=>
getUsers
(
o
))];
//
if (orgObj.Childs.length > 0) result = [...result, ...orgObj.Childs.map(o => getUsers(o))];
return
result
;
//
return result;
};
//
};
const
flatten
=
arr
=>
{
const
flatten
=
arr
=>
{
while
(
arr
.
some
(
item
=>
Array
.
isArray
(
item
)))
{
while
(
arr
.
some
(
item
=>
Array
.
isArray
(
item
)))
{
arr
=
[].
concat
(...
arr
);
arr
=
[].
concat
(...
arr
);
...
@@ -907,7 +933,7 @@ const UserManage = () => {
...
@@ -907,7 +933,7 @@ const UserManage = () => {
// 在currentUser变化后获取角色列表
// 在currentUser变化后获取角色列表
// useEffect(() => {
// useEffect(() => {
// if (currentUser && currentUser.userI
D
) {
// if (currentUser && currentUser.userI
d
) {
// getRoleList();
// getRoleList();
// }
// }
// }, [currentUser]);
// }, [currentUser]);
...
@@ -921,7 +947,7 @@ const UserManage = () => {
...
@@ -921,7 +947,7 @@ const UserManage = () => {
setRoleVisible
(
true
);
setRoleVisible
(
true
);
setMultiRelateRoles
(
true
);
setMultiRelateRoles
(
true
);
};
};
// 更改机构
//
批量
更改机构
const
changeOrgs
=
()
=>
{
const
changeOrgs
=
()
=>
{
setChangeOrgVisible
(
true
);
setChangeOrgVisible
(
true
);
setMultiChangeOrgs
(
true
);
setMultiChangeOrgs
(
true
);
...
@@ -935,7 +961,7 @@ const UserManage = () => {
...
@@ -935,7 +961,7 @@ const UserManage = () => {
/** ***右侧表格相关操作****** */
/** ***右侧表格相关操作****** */
// 关联角色
// 关联角色
const
relateRole
=
record
=>
{
const
relateRole
=
record
=>
{
// getEmptyRoleList(record.userI
D
);
// getEmptyRoleList(record.userI
d
);
setMult
(
'No'
);
setMult
(
'No'
);
console
.
log
(
record
);
console
.
log
(
record
);
getRoleList
(
record
);
getRoleList
(
record
);
...
@@ -946,9 +972,10 @@ const UserManage = () => {
...
@@ -946,9 +972,10 @@ const UserManage = () => {
// 更改机构
// 更改机构
const
changeOrg
=
record
=>
{
const
changeOrg
=
record
=>
{
setChangeOrgVisible
(
true
);
setChangeOrgVisible
(
true
);
setMultiChangeOrgs
(
false
);
setCurrentUser
(
record
);
setCurrentUser
(
record
);
setSelectColor
(
record
);
setSelectColor
(
record
);
setCurrentSelectOldOrg
(
record
.
OUID
);
setCurrentSelectOldOrg
(
record
.
groupId
);
};
};
// 修改密码
// 修改密码
const
changePassword
=
record
=>
{
const
changePassword
=
record
=>
{
...
@@ -975,7 +1002,7 @@ const UserManage = () => {
...
@@ -975,7 +1002,7 @@ const UserManage = () => {
}
else
{
}
else
{
state
=
'0'
;
state
=
'0'
;
}
}
UserStateOUNew
({
ouid
:
record
.
userI
D
})
UserStateOUNew
({
ouid
:
record
.
userI
d
})
.
then
(
res
=>
{
.
then
(
res
=>
{
if
(
res
.
code
===
0
)
{
if
(
res
.
code
===
0
)
{
// 重新获取用户表
// 重新获取用户表
...
@@ -1003,8 +1030,7 @@ const UserManage = () => {
...
@@ -1003,8 +1030,7 @@ const UserManage = () => {
setCurrentUser
(
record
.
userName
);
setCurrentUser
(
record
.
userName
);
setSelectColor
(
record
);
setSelectColor
(
record
);
DeleteUserNew
({
DeleteUserNew
({
userID
:
record
.
userID
,
userId
:
record
.
userId
,
ouID
:
record
.
OUID
,
})
})
.
then
(
res
=>
{
.
then
(
res
=>
{
if
(
res
.
code
===
0
)
{
if
(
res
.
code
===
0
)
{
...
@@ -1029,9 +1055,9 @@ const UserManage = () => {
...
@@ -1029,9 +1055,9 @@ const UserManage = () => {
// 用户鉴权
// 用户鉴权
// useEffect(() => {
// useEffect(() => {
// currentUser.userI
D
// currentUser.userI
d
// GetUserAuthSet({
// GetUserAuthSet({
// UserId: currentUser.userI
D
// UserId: currentUser.userI
d
// }).then(
// }).then(
// res => {
// res => {
// if(res.code == 0){
// if(res.code == 0){
...
@@ -1044,7 +1070,7 @@ const UserManage = () => {
...
@@ -1044,7 +1070,7 @@ const UserManage = () => {
// }, [currentUser])
// }, [currentUser])
const
jianquan
=
record
=>
{
const
jianquan
=
record
=>
{
GetUserAuthSet
({
GetUserAuthSet
({
UserId
:
record
.
userI
D
,
UserId
:
record
.
userI
d
,
}).
then
(
res
=>
{
}).
then
(
res
=>
{
if
(
res
.
code
===
0
)
{
if
(
res
.
code
===
0
)
{
setSelctValue
(
res
.
data
);
setSelctValue
(
res
.
data
);
...
@@ -1059,7 +1085,7 @@ const UserManage = () => {
...
@@ -1059,7 +1085,7 @@ const UserManage = () => {
setCurrentUser
(
record
);
setCurrentUser
(
record
);
console
.
log
(
selectValue
);
console
.
log
(
selectValue
);
AddUserAuthSetting
({
AddUserAuthSetting
({
userId
:
record
.
userI
D
,
userId
:
record
.
userI
d
,
userLevel
:
selectValue
,
userLevel
:
selectValue
,
}).
then
(
res
=>
{
}).
then
(
res
=>
{
if
(
res
.
code
===
0
)
{
if
(
res
.
code
===
0
)
{
...
@@ -1074,9 +1100,11 @@ const UserManage = () => {
...
@@ -1074,9 +1100,11 @@ const UserManage = () => {
// message.warning('请输入搜索内容');
// message.warning('请输入搜索内容');
// return;
// return;
// }
// }
setTableLoading
(
true
);
let
data
=
searchWord
!=
''
?
{
key
:
searchWord
}
:
''
;
let
data
=
searchWord
!=
''
?
{
key
:
searchWord
}
:
''
;
GetUserByKeyNew
(
data
)
GetUserByKeyNew
(
data
)
.
then
(
res
=>
{
.
then
(
res
=>
{
setTableLoading
(
false
);
if
(
res
.
code
===
0
)
{
if
(
res
.
code
===
0
)
{
setSelectedRowKeys
([]);
// 重置选中用户数
setSelectedRowKeys
([]);
// 重置选中用户数
setCurrentOrgOperate
(
true
);
// 禁止当前机构操作
setCurrentOrgOperate
(
true
);
// 禁止当前机构操作
...
@@ -1101,10 +1129,10 @@ const UserManage = () => {
...
@@ -1101,10 +1129,10 @@ const UserManage = () => {
};
};
/** ***表单提交相关操作****** */
/** ***表单提交相关操作****** */
// 根据当前 userI
D
获取用户关联角色
// 根据当前 userI
d
获取用户关联角色
const
getRoleList
=
e
=>
{
const
getRoleList
=
e
=>
{
setLoading
(
true
);
setLoading
(
true
);
GetUserRelationListNew
({
userI
D
:
e
.
userID
})
GetUserRelationListNew
({
userI
d
:
e
.
userId
})
.
then
(
res
=>
{
.
then
(
res
=>
{
console
.
log
(
111
);
console
.
log
(
111
);
...
@@ -1128,7 +1156,7 @@ const UserManage = () => {
...
@@ -1128,7 +1156,7 @@ const UserManage = () => {
// 获取全部未勾选的角色列表与站点列表
// 获取全部未勾选的角色列表与站点列表
const
getEmptyRoleList
=
()
=>
{
const
getEmptyRoleList
=
()
=>
{
setLoading
(
true
);
setLoading
(
true
);
GetUserRelationListNew
({
userI
D
:
0
})
GetUserRelationListNew
({
userI
d
:
0
})
.
then
(
res
=>
{
.
then
(
res
=>
{
console
.
log
(
222
);
console
.
log
(
222
);
if
(
res
.
code
===
0
)
{
if
(
res
.
code
===
0
)
{
...
@@ -1175,7 +1203,7 @@ const UserManage = () => {
...
@@ -1175,7 +1203,7 @@ const UserManage = () => {
};
};
// 提交-更改机构
// 提交-更改机构
const
submitChangeOrg
=
()
=>
{
const
submitChangeOrg
=
()
=>
{
// addToOrg(currentUser.userI
D
, currentUser.OUID, newOrgID)
// addToOrg(currentUser.userI
d
, currentUser.OUID, newOrgID)
// .then(res => {
// .then(res => {
// if (res.success) {
// if (res.success) {
// setChangeOrgVisible(false);
// setChangeOrgVisible(false);
...
@@ -1196,9 +1224,10 @@ const UserManage = () => {
...
@@ -1196,9 +1224,10 @@ const UserManage = () => {
// .catch(err => {
// .catch(err => {
// message.error(err);
// message.error(err);
// });
// });
console
.
log
(
currentUser
);
JumpToAnotherOUNew
({
JumpToAnotherOUNew
({
userI
D
:
currentUser
.
userID
,
userI
d
:
currentUser
.
userId
,
oldOUID
:
currentUser
.
OUID
,
oldOUID
:
currentUser
.
groupId
,
newOUID
:
newOrgID
,
newOUID
:
newOrgID
,
})
})
.
then
(
res
=>
{
.
then
(
res
=>
{
...
@@ -1257,7 +1286,7 @@ const UserManage = () => {
...
@@ -1257,7 +1286,7 @@ const UserManage = () => {
// } else {
// } else {
// state = '0';
// state = '0';
// }
// }
// // postSetUserState(currentUser.userI
D
, state)
// // postSetUserState(currentUser.userI
d
, state)
// // .then(res => {
// // .then(res => {
// // if (res.success) {
// // if (res.success) {
// // setFreezeUserVisible(false);
// // setFreezeUserVisible(false);
...
@@ -1281,7 +1310,7 @@ const UserManage = () => {
...
@@ -1281,7 +1310,7 @@ const UserManage = () => {
// // setTableLoading(false);
// // setTableLoading(false);
// // message.error(err);
// // message.error(err);
// // });
// // });
// UserStateOUNew({ ouid: currentUser.userI
D
, state })
// UserStateOUNew({ ouid: currentUser.userI
d
, state })
// .then(res => {
// .then(res => {
// if (res.code === 0) {
// if (res.code === 0) {
// // setFreezeUserVisible(false);
// // setFreezeUserVisible(false);
...
@@ -1309,8 +1338,7 @@ const UserManage = () => {
...
@@ -1309,8 +1338,7 @@ const UserManage = () => {
// 提交-删除用户
// 提交-删除用户
const
submitDeleteUser
=
()
=>
{
const
submitDeleteUser
=
()
=>
{
DeleteUserNew
({
DeleteUserNew
({
userID
:
currentUser
.
userID
,
userId
:
currentUser
.
userId
,
ouID
:
currentUser
.
OUID
,
})
})
.
then
(
res
=>
{
.
then
(
res
=>
{
if
(
res
.
code
===
0
)
{
if
(
res
.
code
===
0
)
{
...
@@ -1334,9 +1362,6 @@ const UserManage = () => {
...
@@ -1334,9 +1362,6 @@ const UserManage = () => {
};
};
// 提交-批量删除用户
// 提交-批量删除用户
const
submitDeleteUsers
=
()
=>
{
const
submitDeleteUsers
=
()
=>
{
console
.
log
(
userIDs
);
console
.
log
(
keepDataList
);
console
.
log
(
userIDs
.
split
(
','
));
let
data
=
[];
let
data
=
[];
keepDataList
.
length
>
0
&&
keepDataList
.
length
>
0
&&
keepDataList
.
map
(
i
=>
{
keepDataList
.
map
(
i
=>
{
...
@@ -1566,6 +1591,18 @@ const UserManage = () => {
...
@@ -1566,6 +1591,18 @@ const UserManage = () => {
setUserVisible
(
false
);
setUserVisible
(
false
);
};
};
const
onSearch
=
value
=>
{
setSearchTreeValue
(
value
);
updateTrees
(
value
);
};
// 监听分页
const
paginationChange
=
(
page
,
pageSizes
)
=>
{
setCurrentPage
(
page
);
setPageSize
(
pageSizes
);
onSelect
([
currentSelectOrg
],
''
,
pageSizes
,
page
);
};
return
(
return
(
<
PageContainer
className=
{
styles
.
userManageContainer
}
>
<
PageContainer
className=
{
styles
.
userManageContainer
}
>
<
div
className=
{
styles
.
contentContainer
}
>
<
div
className=
{
styles
.
contentContainer
}
>
...
@@ -1600,24 +1637,54 @@ const UserManage = () => {
...
@@ -1600,24 +1637,54 @@ const UserManage = () => {
}
}
}
}
/>
/>
</
Tooltip
>
</
Tooltip
>
</
div
>
</
div
>
<
hr
style=
{
{
width
:
'95%'
,
color
:
'#eeecec'
,
marginLeft
:
'15px'
}
}
/>
<
hr
style=
{
{
width
:
'95%'
,
color
:
'#eeecec'
,
marginLeft
:
'15px'
}
}
/>
{
treeData
.
length
>
0
&&
(
<
Search
<
div
style=
{
{
height
:
'100%'
,
overflowY
:
'scroll'
}
}
>
style=
{
{
<
Tree
marginBottom
:
8
,
showIcon=
"true"
width
:
'98%'
,
blockNode
marginLeft
:
'7px'
,
autoExpandParent
}
}
onSelect=
{
onSelect
}
placeholder=
"快速搜索机构"
treeData=
{
treeData
.
map
(
t
=>
mapTree
(
t
))
}
onSearch=
{
onSearch
}
draggable
/>
onDrop=
{
handleDrop
}
{
searchTreeValue
!==
''
?
(
selectedKeys=
{
[
menuID
]
}
<>
keepTree=
{
keepTree
}
{
treeData
.
length
>
0
&&
(
expandedKeys=
{
expendKey
}
<
div
style=
{
{
height
:
'100%'
,
overflowY
:
'scroll'
}
}
>
/>
<
Tree
</
div
>
showIcon=
"true"
blockNode
defaultExpandAll
onSelect=
{
onSelect
}
treeData=
{
treeData
.
map
(
t
=>
mapTree
(
t
))
}
draggable
onDrop=
{
handleDrop
}
selectedKeys=
{
[
menuID
]
}
keepTree=
{
keepTree
}
/>
</
div
>
)
}
</>
)
:
(
<>
{
treeData
.
length
>
0
&&
(
<
div
style=
{
{
height
:
'100%'
,
overflowY
:
'scroll'
}
}
>
<
TreeComponents
showIcon=
"true"
blockNode
autoExpandParent
onSelect=
{
onSelect
}
treeData=
{
treeData
.
map
(
t
=>
mapTree
(
t
))
}
draggable
onDrop=
{
handleDrop
}
selectedKeys=
{
[
menuID
]
}
keepTree=
{
keepTree
}
expandedKeys=
{
expendKey
}
/>
</
div
>
)
}
</>
)
}
)
}
</
div
>
</
div
>
<
div
className=
{
styles
.
switcher
}
>
<
div
className=
{
styles
.
switcher
}
>
...
@@ -1679,7 +1746,7 @@ const UserManage = () => {
...
@@ -1679,7 +1746,7 @@ const UserManage = () => {
}
}
}
}
rowClassName=
{
setRowClassName
}
rowClassName=
{
setRowClassName
}
size=
"small"
size=
"small"
rowKey=
{
record
=>
record
.
userI
D
}
rowKey=
{
record
=>
record
.
userI
d
}
locale=
{
zhCN
}
locale=
{
zhCN
}
bordered
bordered
columns=
{
columns
}
columns=
{
columns
}
...
@@ -1689,14 +1756,7 @@ const UserManage = () => {
...
@@ -1689,14 +1756,7 @@ const UserManage = () => {
x
:
'max-content'
,
x
:
'max-content'
,
y
:
`calc(${userContainer.current.clientHeight}px - 150px)`
,
y
:
`calc(${userContainer.current.clientHeight}px - 150px)`
,
}
}
}
}
// scroll=
{{
x
:
'
max
-
content
'
}}
pagination=
{
false
}
pagination=
{
{
showTotal
:
(
total
,
range
)
=>
`第${range[0]}-${range[1]} 条/共 ${total} 条`
,
pageSizeOptions
:
[
10
,
20
,
50
,
100
],
defaultPageSize
:
20
,
showQuickJumper
:
true
,
showSizeChanger
:
true
,
}
}
onRow=
{
record
=>
({
onRow=
{
record
=>
({
onDoubleClick
:
()
=>
{
onDoubleClick
:
()
=>
{
editUser
(
record
);
editUser
(
record
);
...
@@ -1705,6 +1765,28 @@ const UserManage = () => {
...
@@ -1705,6 +1765,28 @@ const UserManage = () => {
onChange=
{
onChangeInput
}
onChange=
{
onChangeInput
}
/>
/>
)
}
)
}
<
div
style=
{
{
display
:
'flex'
,
justifyContent
:
'flex-end'
,
marginTop
:
'10px'
,
marginRight
:
'5px'
,
}
}
>
<
Pagination
total=
{
total
}
showTotal=
{
(
totals
,
range
)
=>
`第${range[0]}-${range[1]} 条/共 ${totals} 条`
}
defaultPageSize=
{
pageSize
}
defaultCurrent=
{
1
}
showSizeChanger
pageSizeOptions=
{
[
10
,
20
,
40
,
100
]
}
current=
{
currentPage
}
onChange=
{
paginationChange
}
style=
{
{
marginBottom
:
'10px'
}
}
size=
"small"
showQuickJumper
/>
</
div
>
</
div
>
</
div
>
{
/* Modal弹框 */
}
{
/* Modal弹框 */
}
...
@@ -1732,7 +1814,7 @@ const UserManage = () => {
...
@@ -1732,7 +1814,7 @@ const UserManage = () => {
visible=
{
editOrgVisible
}
visible=
{
editOrgVisible
}
orgID=
{
orgID
}
orgID=
{
orgID
}
orgTitle1=
{
orgTitle1
}
orgTitle1=
{
orgTitle1
}
description=
{
description
}
//
description={description}
onCancel=
{
()
=>
setEditOrgVisible
(
false
)
}
onCancel=
{
()
=>
setEditOrgVisible
(
false
)
}
updateTrees=
{
updateTrees
}
updateTrees=
{
updateTrees
}
/>
/>
...
@@ -1745,7 +1827,6 @@ const UserManage = () => {
...
@@ -1745,7 +1827,6 @@ const UserManage = () => {
updateTrees=
{
updateTrees
}
updateTrees=
{
updateTrees
}
onCancel=
{
()
=>
setDeleteOrgVisible
(
false
)
}
onCancel=
{
()
=>
setDeleteOrgVisible
(
false
)
}
/>
/>
{
/* 关联角色 */
}
{
/* 关联角色 */
}
<
RelateRoleModal
<
RelateRoleModal
currentUser=
{
currentUser
}
currentUser=
{
currentUser
}
...
@@ -1790,7 +1871,7 @@ const UserManage = () => {
...
@@ -1790,7 +1871,7 @@ const UserManage = () => {
/>
/>
<
div
style=
{
{
height
:
'500px'
,
overflowY
:
'scroll'
}
}
>
<
div
style=
{
{
height
:
'500px'
,
overflowY
:
'scroll'
}
}
>
{
changeOrgVisible
&&
treeDataCopy
.
length
>
0
&&
(
{
changeOrgVisible
&&
treeDataCopy
.
length
>
0
&&
(
<
Tree
<
Tree
Components
showIcon=
"true"
showIcon=
"true"
showLine=
{
{
showLeafIcon
:
false
}
}
showLine=
{
{
showLeafIcon
:
false
}
}
// defaultExpandAll
// defaultExpandAll
...
...
src/pages/userCenter/userManage/UserManage.less
View file @
a3da4a1b
...
@@ -264,11 +264,11 @@
...
@@ -264,11 +264,11 @@
overflow: hidden;
overflow: hidden;
.ant-table-wrapper {
.ant-table-wrapper {
height: calc(100% -
5
0px);
height: calc(100% -
10
0px);
}
}
.ant-table {
.ant-table {
height: calc(100% -
5
0px)
height: calc(100% -
10
0px)
}
}
.title {
.title {
...
@@ -404,4 +404,14 @@
...
@@ -404,4 +404,14 @@
// .ant-tree {
// .ant-tree {
// overflow-y: scroll;
// overflow-y: scroll;
// height: calc(100vh - 150px);
// height: calc(100vh - 150px);
// }
// }
\ No newline at end of file
.titleTop {
width: 20rem;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
padding-left: 10px;
}
.titleSearch {
color: #f50;
}
\ No newline at end of file
src/services/userManage/api.js
View file @
a3da4a1b
...
@@ -15,9 +15,11 @@ export const getUserTree = (selectOU, node) =>
...
@@ -15,9 +15,11 @@ export const getUserTree = (selectOU, node) =>
// OUID,
// OUID,
// });
// });
export
const
getOneOUUserListNew
=
OUID
=>
export
const
getOneOUUserListNew
=
(
OUID
,
size
,
index
)
=>
get
(
`
${
PUBLISH_SERVICE
}
/UserCenter/GroupUserList`
,
{
get
(
`
${
PUBLISH_SERVICE
}
/UserCenter/GroupUserList`
,
{
groupId
:
OUID
,
groupId
:
OUID
,
pageSize
:
size
,
pageIndex
:
index
,
});
});
/**
/**
...
...
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