Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
szse
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
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
zhaochengxiang
szse
Commits
a9707f53
Commit
a9707f53
authored
Jun 21, 2024
by
zhaochengxiang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
oa用户接口替换
parent
5a440613
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
51 additions
and
70 deletions
+51
-70
start-flow.jsx
src/view/Manage/Model/Component/start-flow.jsx
+51
-70
No files found.
src/view/Manage/Model/Component/start-flow.jsx
View file @
a9707f53
...
@@ -92,6 +92,8 @@ export default FC
...
@@ -92,6 +92,8 @@ export default FC
const
Basic
=
React
.
forwardRef
(
function
({},
ref
)
{
const
Basic
=
React
.
forwardRef
(
function
({},
ref
)
{
const
[
uploading
,
setUploading
]
=
React
.
useState
(
false
)
const
[
uploading
,
setUploading
]
=
React
.
useState
(
false
)
const
[
loadingUsers
,
setLoadingUsers
]
=
React
.
useState
(
false
)
const
[
users
,
setUsers
]
=
React
.
useState
()
const
[
form
]
=
Form
.
useForm
()
const
[
form
]
=
Form
.
useForm
()
...
@@ -106,9 +108,38 @@ const Basic = React.forwardRef(function ({}, ref) {
...
@@ -106,9 +108,38 @@ const Basic = React.forwardRef(function ({}, ref) {
uploading
,
uploading
,
}),
[
form
,
uploading
])
}),
[
form
,
uploading
])
React
.
useEffect
(()
=>
{
getUsers
()
},
[])
const
marginBottom
=
React
.
useMemo
(()
=>
{
const
marginBottom
=
React
.
useMemo
(()
=>
{
return
15
return
15
},
[])
},
[])
const
getUsers
=
()
=>
{
setLoadingUsers
(
true
)
// setTimeout(() => {
// setLoadingUsers(false)
// setUsers(
// Array.from({ length: 10000 }).map((_, i) => ({
// id: `${i}`,
// loginName: `test${i}`,
// realName: `测试${i}`,
// }))
// )
// }, 1000)
dispatch
({
type
:
'user.getOAUsers'
,
callback
:
data
=>
{
setLoadingUsers
(
false
)
setUsers
(
data
)
},
error
:
()
=>
{
setLoadingUsers
(
false
)
}
})
}
const
onValuesChange
=
(
changedValues
,
allValues
)
=>
{
const
onValuesChange
=
(
changedValues
,
allValues
)
=>
{
...
@@ -167,7 +198,7 @@ const Basic = React.forwardRef(function ({}, ref) {
...
@@ -167,7 +198,7 @@ const Basic = React.forwardRef(function ({}, ref) {
style=
{
{
marginBottom
}
}
style=
{
{
marginBottom
}
}
rules=
{
[{
required
:
true
,
message
:
'请选择设计评审人员!'
}]
}
rules=
{
[{
required
:
true
,
message
:
'请选择设计评审人员!'
}]
}
>
>
<
DesignUsersItem
/>
<
DesignUsersItem
loading=
{
loadingUsers
}
users=
{
users
}
/>
</
Form
.
Item
>
</
Form
.
Item
>
<
Form
.
Item
<
Form
.
Item
...
@@ -190,7 +221,7 @@ const Basic = React.forwardRef(function ({}, ref) {
...
@@ -190,7 +221,7 @@ const Basic = React.forwardRef(function ({}, ref) {
}
}
}]
}
}]
}
>
>
<
RuleReviewItem
/>
<
RuleReviewItem
loading=
{
loadingUsers
}
users=
{
users
}
/>
</
Form
.
Item
>
</
Form
.
Item
>
<
Form
.
Item
<
Form
.
Item
...
@@ -212,46 +243,21 @@ const Basic = React.forwardRef(function ({}, ref) {
...
@@ -212,46 +243,21 @@ const Basic = React.forwardRef(function ({}, ref) {
)
)
})
})
const
RuleReviewItem
=
({
value
=
{},
onChange
})
=>
{
const
RuleReviewItem
=
({
value
=
{},
onChange
,
loading
,
users
})
=>
{
const
[
ruleReviewSelected
,
setRuleReviewSelected
]
=
React
.
useState
()
const
[
ruleReviewSelected
,
setRuleReviewSelected
]
=
React
.
useState
()
const
[
loading
,
setLoading
]
=
React
.
useState
(
false
)
const
[
users
,
setUsers
]
=
React
.
useState
()
const
[
searchValue
,
setSearchValue
]
=
React
.
useState
()
const
[
searchValue
,
setSearchValue
]
=
React
.
useState
()
const
[
options
,
setOptions
]
=
React
.
useState
()
const
[
options
,
setOptions
]
=
React
.
useState
()
useDebounceEffect
(()
=>
{
useDebounceEffect
(()
=>
{
if
(
searchValue
)
{
setOptions
(
getUsers
()
(
users
??[])
}
.
filter
(
item
=>
!
searchValue
||
(
item
.
loginName
??
''
).
indexOf
(
searchValue
)
!==-
1
||
(
item
.
realName
??
''
).
indexOf
(
searchValue
)
!==-
1
)
},
[
searchValue
],
{
wait
:
300
})
.
map
(
item
=>
({
const
getUsers
=
()
=>
{
setLoading
(
true
)
dispatch
({
type
:
'datamodel.getApprovalUsers'
,
payload
:
{
userName
:
searchValue
},
callback
:
data
=>
{
setLoading
(
false
)
const
newUsers
=
produce
(
data
?[
data
]:[],
(
draft
)
=>
{
draft
?.
forEach
(
item
=>
{
item
.
id
=
`
${
item
.
id
}
`
})
})
setUsers
(
newUsers
)
setOptions
((
newUsers
??[]).
map
(
item
=>
({
label
:
`
${
item
.
realName
}
(
${
item
.
loginName
}
)`
,
label
:
`
${
item
.
realName
}
(
${
item
.
loginName
}
)`
,
value
:
item
.
id
,
value
:
`
${
item
.
id
}
`
,
})))
}))
},
)
error
:
()
=>
{
},
[
searchValue
,
users
],
{
wait
:
300
})
setLoading
(
false
)
}
})
}
const
triggerChange
=
(
changedValue
)
=>
{
const
triggerChange
=
(
changedValue
)
=>
{
onChange
?.({
onChange
?.({
...
@@ -398,45 +404,20 @@ const List = React.forwardRef(function ({ items }, ref) {
...
@@ -398,45 +404,20 @@ const List = React.forwardRef(function ({ items }, ref) {
)
)
})
})
const
DesignUsersItem
=
({
value
,
onChange
})
=>
{
const
DesignUsersItem
=
({
value
,
onChange
,
loading
,
users
})
=>
{
const
[
loading
,
setLoading
]
=
React
.
useState
(
false
)
const
[
users
,
setUsers
]
=
React
.
useState
()
const
[
searchValue
,
setSearchValue
]
=
React
.
useState
()
const
[
searchValue
,
setSearchValue
]
=
React
.
useState
()
const
[
options
,
setOptions
]
=
React
.
useState
()
const
[
options
,
setOptions
]
=
React
.
useState
()
useDebounceEffect
(()
=>
{
useDebounceEffect
(()
=>
{
if
(
searchValue
)
{
setOptions
(
getUsers
()
(
users
??[])
}
.
filter
(
item
=>
!
searchValue
||
(
item
.
loginName
??
''
).
indexOf
(
searchValue
)
!==-
1
||
(
item
.
realName
??
''
).
indexOf
(
searchValue
)
!==-
1
)
},
[
searchValue
],
{
wait
:
300
})
.
map
(
item
=>
({
const
getUsers
=
()
=>
{
setLoading
(
true
)
dispatch
({
type
:
'datamodel.getApprovalUsers'
,
payload
:
{
userName
:
searchValue
},
callback
:
data
=>
{
setLoading
(
false
)
const
newUsers
=
produce
(
data
?[
data
]:[],
(
draft
)
=>
{
draft
?.
forEach
(
item
=>
{
item
.
id
=
`
${
item
.
id
}
`
})
})
setUsers
(
newUsers
)
setOptions
((
newUsers
??[]).
map
(
item
=>
({
label
:
`
${
item
.
realName
}
(
${
item
.
loginName
}
)`
,
label
:
`
${
item
.
realName
}
(
${
item
.
loginName
}
)`
,
value
:
item
.
id
,
value
:
`
${
item
.
id
}
`
,
})))
}))
},
)
error
:
()
=>
{
},
[
searchValue
,
users
],
{
wait
:
300
})
setLoading
(
false
)
}
})
}
return
(
return
(
<
Select
showSearch
loading=
{
loading
}
allowClear
<
Select
showSearch
loading=
{
loading
}
allowClear
...
...
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