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
173c142e
Commit
173c142e
authored
Jul 05, 2024
by
zhaochengxiang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
模型负责人
parent
c940cb75
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
37 additions
and
20 deletions
+37
-20
ImportActionManage.jsx
src/view/Manage/Model/Component/ImportActionManage.jsx
+35
-20
start-flow.jsx
src/view/Manage/Model/Component/start-flow.jsx
+2
-0
No files found.
src/view/Manage/Model/Component/ImportActionManage.jsx
View file @
173c142e
...
...
@@ -15,8 +15,6 @@ const FC = (props) => {
const
{
editable
,
form
,
modelerData
,
action
,
onChange
}
=
props
const
[
isCollapse
,
setCollapse
]
=
React
.
useState
(
true
)
const
[
maintenanceRecords
,
setMaintenanceRecords
]
=
React
.
useState
()
const
[
loadingUsers
,
setLoadingUsers
]
=
React
.
useState
(
false
)
const
[
users
,
setUsers
]
=
React
.
useState
()
React
.
useEffect
(()
=>
{
const
$importActionSubject
=
importActionSubject
.
subscribe
((
props
)
=>
{
...
...
@@ -31,10 +29,6 @@ const FC = (props) => {
},
[
action
])
React
.
useEffect
(()
=>
{
getUsers
()
},
[])
React
.
useEffect
(()
=>
{
if
(
modelerData
?.
id
)
{
getMaintenanceRecords
()
}
...
...
@@ -125,12 +119,12 @@ const FC = (props) => {
<
Row
gutter=
{
10
}
>
<
Col
xs=
{
24
}
sm=
{
24
}
lg=
{
12
}
xl=
{
8
}
>
<
Form
.
Item
label=
'技术负责人'
name=
'technicalManagerUser'
>
<
UsersItem
loading=
{
loadingUsers
}
users=
{
users
}
/>
<
UsersItem
/>
</
Form
.
Item
>
</
Col
>
<
Col
xs=
{
24
}
sm=
{
24
}
lg=
{
12
}
xl=
{
8
}
>
<
Form
.
Item
label=
'业务负责人'
name=
'businessManagerUser'
>
<
UsersItem
loading=
{
loadingUsers
}
users=
{
users
}
/>
<
UsersItem
/>
</
Form
.
Item
>
</
Col
>
<
Col
xs=
{
24
}
sm=
{
24
}
lg=
{
12
}
xl=
{
8
}
>
...
...
@@ -145,10 +139,10 @@ const FC = (props) => {
)
:
(
<
Descriptions
column=
{
3
}
>
<
Descriptions
.
Item
label=
{
<
div
style=
{
{
textAlign
:
'right'
,
width
:
106
}
}
>
技术负责人
</
div
>
}
>
{
modelerData
?.
technicalManagerUser
?.
name
}
{
`${modelerData?.technicalManagerUser?.dname}(${modelerData?.technicalManagerUser?.name})`
}
</
Descriptions
.
Item
>
<
Descriptions
.
Item
label=
{
<
div
style=
{
{
textAlign
:
'right'
,
width
:
106
}
}
>
业务负责人
</
div
>
}
>
{
modelerData
?.
businessManagerUser
?.
name
}
{
`${modelerData?.businessManagerUser?.dname}(${modelerData?.businessManagerUser?.name})`
}
</
Descriptions
.
Item
>
<
Descriptions
.
Item
label=
{
<
div
style=
{
{
textAlign
:
'right'
,
width
:
106
}
}
>
维护历史
</
div
>
}
>
<
div
style=
{
{
maxHeight
:
70
,
overflow
:
'auto'
}
}
>
...
...
@@ -170,25 +164,46 @@ const FC = (props) => {
export
default
FC
const
UsersItem
=
({
loading
,
users
,
value
,
onChange
})
=>
{
const
UsersItem
=
({
value
,
onChange
})
=>
{
const
[
loading
,
setLoading
]
=
React
.
useState
(
false
)
const
[
searchValue
,
setSearchValue
]
=
React
.
useState
()
const
[
options
,
setOptions
]
=
React
.
useState
()
useDebounceEffect
(()
=>
{
if
(
searchValue
)
{
getUsers
()
}
else
{
setOptions
()
}
},
[
searchValue
],
{
wait
:
300
})
const
getUsers
=
()
=>
{
setLoading
(
true
)
dispatch
({
type
:
'datamodel.getCooperationUsers'
,
payload
:
{
match
:
searchValue
,
},
callback
:
data
=>
{
setLoading
(
false
)
setOptions
(
(
users
??[])
.
filter
(
item
=>
!
searchValue
||
(
item
.
name
??
''
).
indexOf
(
searchValue
)
!==-
1
||
(
item
.
dname
??
''
).
indexOf
(
searchValue
)
!==-
1
)
.
map
(
item
=>
({
label
:
item
.
name
,
value
:
item
.
name
,
(
data
??[]).
map
(
item
=>
({
label
:
`
${
item
.
dname
}
(
${
item
.
name
}
)`
,
value
:
`
${
item
.
dname
}
(
${
item
.
name
}
)`
,
...
item
}))
)
},
[
searchValue
,
users
],
{
wait
:
300
})
},
error
:
()
=>
{
setLoading
(
false
)
}
})
}
return
(
<
Select
loading=
{
loading
}
allowClear
showSearch
placeholder=
'请选择用户'
value=
{
(
options
??[]).
length
>
0
?
value
?.
name
:
undefined
}
value=
{
value
?
`${value.dname}(${value.name})`
:
undefined
}
searchValue=
{
searchValue
}
onSearch=
{
(
val
)
=>
{
setSearchValue
(
val
)
...
...
@@ -200,9 +215,9 @@ const UsersItem = ({ loading, users, value, onChange }) => {
options=
{
options
}
onChange=
{
(
val
)
=>
{
if
(
val
)
{
const
index
=
(
users
??[]).
findIndex
(
item
=>
item
.
nam
e
===
val
)
const
index
=
(
options
??[]).
findIndex
(
item
=>
item
.
valu
e
===
val
)
if
(
index
!==
-
1
)
{
onChange
?.(
user
s
[
index
])
onChange
?.(
option
s
[
index
])
}
}
else
{
onChange
?.()
...
...
src/view/Manage/Model/Component/start-flow.jsx
View file @
173c142e
...
...
@@ -220,6 +220,8 @@ const RuleReviewItem = ({ value = {}, onChange }) => {
useDebounceEffect
(()
=>
{
if
(
searchValue
)
{
getUsers
()
}
else
{
setOptions
()
}
},
[
searchValue
],
{
wait
:
300
})
...
...
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