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
e519385d
Commit
e519385d
authored
Jan 10, 2024
by
zhaochengxiang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
目录新增负责人
parent
67d00570
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
44 additions
and
5 deletions
+44
-5
UpdateDirectoryModal.jsx
...iew/Manage/AssetManage/Component/UpdateDirectoryModal.jsx
+44
-5
No files found.
src/view/Manage/AssetManage/Component/UpdateDirectoryModal.jsx
View file @
e519385d
...
...
@@ -3,6 +3,7 @@ import { Modal, Form, Input, Space, Button, Radio, Select, Spin } from 'antd';
import
{
dispatch
}
from
'../../../../model'
;
import
{
showMessage
}
from
'../../../../util'
;
import
SelectUser
from
'../../Model/Component/SelectUsers'
;
// const resourceTypes = [
// // { key: 'innerSource', name: '内部资源' },
...
...
@@ -39,9 +40,12 @@ const UpdateDirectoryModal = (props) => {
const
[
dir
,
setDir
]
=
useState
(
null
);
const
[
confirmLoading
,
setConfirmLoading
]
=
useState
(
false
);
const
[
isThemeAdd
,
setIsThemeAdd
]
=
useState
(
false
);
const
[
users
,
setUsers
]
=
useState
([]);
const
[
loadingUsers
,
setLoadingUsers
]
=
useState
(
false
);
useEffect
(()
=>
{
if
(
visible
&&
dirId
)
{
getUsers
();
getDirectory
();
}
//eslint-disable-next-line react-hooks/exhaustive-deps
...
...
@@ -59,10 +63,35 @@ const UpdateDirectoryModal = (props) => {
return
false
;
},
[
action
,
dir
,
isThemeAdd
])
const
responsibilityer
=
React
.
useMemo
(()
=>
{
if
(
dir
?.
responsibilityer
)
{
const
user
=
users
?.
filter
((
user
)
=>
(
user
.
pernr
===
dir
?.
responsibilityer
))
if
((
user
??[]).
length
>
0
)
{
return
user
[
0
].
nachn
?
`
${
user
[
0
].
nachn
}
(
${
user
[
0
].
pernr
}
)`
:
user
[
0
].
pernr
;
}
}
return
''
},
[
dir
,
users
])
const
marginBottom
=
useMemo
(()
=>
{
return
(
action
===
'detail'
)
?
5
:
15
},
[
action
])
const
getUsers
=
()
=>
{
setLoadingUsers
(
true
);
dispatch
({
type
:
'pds.getOwners'
,
callback
:
(
data
)
=>
{
setLoadingUsers
(
false
);
setUsers
(
data
);
},
error
:
()
=>
{
setLoadingUsers
(
false
);
}
})
}
const
getDirectory
=
()
=>
{
setLoading
(
true
);
dispatch
({
...
...
@@ -75,7 +104,7 @@ const UpdateDirectoryModal = (props) => {
setDir
(
data
);
if
(
action
!==
'add'
)
{
form
.
setFieldsValue
(
{
code
:
data
?.
code
,
name
:
data
?.
name
||
''
,
desc
:
data
?.
desc
||
''
,
remarks
:
data
?.
remarks
||
''
});
form
.
setFieldsValue
(
data
)
}
},
error
:
()
=>
{
...
...
@@ -92,10 +121,7 @@ const UpdateDirectoryModal = (props) => {
let
payload
=
{
data
:
{
code
:
row
.
code
,
name
:
row
.
name
,
desc
:
row
.
desc
,
remarks
:
row
.
remarks
,
...
row
,
resourceType
:
'dataAsset'
,
}
};
...
...
@@ -282,6 +308,19 @@ const UpdateDirectoryModal = (props) => {
(
action
===
'detail'
)
?
<
span
>
{
dir
?.
remarks
}
</
span
>
:
<
Input
.
TextArea
placeholder=
"请输入备注"
autoSize=
{
{
minRows
:
4
,
maxRows
:
4
}
}
/>
}
</
Form
.
Item
>
<
Form
.
Item
label=
"目录负责人"
name=
"responsibilityer"
style=
{
{
marginBottom
}
}
>
{
(
action
===
'detail'
)
?
<
span
>
{
responsibilityer
}
</
span
>
:
<
SelectUser
type=
'edit'
loading=
{
loadingUsers
}
users=
{
users
}
/>
}
</
Form
.
Item
>
</
Form
>
</
Spin
>
</
Modal
>
...
...
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