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
eccec6d7
Commit
eccec6d7
authored
Dec 13, 2023
by
zhaochengxiang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bug fix
parent
5831c260
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
52 additions
and
39 deletions
+52
-39
AssetAction.jsx
src/view/Manage/AssetManage/Component/AssetAction.jsx
+9
-2
AssetTable.jsx
src/view/Manage/AssetManage/Component/AssetTable.jsx
+18
-18
SelectUsers.jsx
src/view/Manage/Model/Component/SelectUsers.jsx
+25
-19
No files found.
src/view/Manage/AssetManage/Component/AssetAction.jsx
View file @
eccec6d7
...
...
@@ -919,18 +919,25 @@ const AssetAction = (props) => {
} else if (changedValues.hasOwnProperty('主题域')) {
setCurrentBussinessDomain(changedValues['主题域']);
form.setFieldsValue({'业务对象': ''});
} else if (changedValues.hasOwnProperty('数据关键用户')) {
if (changedValues['数据关键用户']) {
const index = (users||[]).findIndex(item => item.pernr === changedValues['数据关键用户']);
if (index !== -1) {
form.setFieldsValue({'数据关键用户姓名': users[index].nachn});
}
}
} else if (changedValues.hasOwnProperty('业务数据Owner')) {
if (changedValues['业务数据Owner']) {
const index = (users||[]).findIndex(item => item.pernr === changedValues['业务数据Owner']);
if (index !== -1) {
form.setFieldsValue({'业务责任部门': users[index].orgtx});
form.setFieldsValue({'业务
数据Owner姓名': users[index].nachn, '业务
责任部门': users[index].orgtx});
}
}
} else if (changedValues.hasOwnProperty('IT责任人')) {
if (changedValues['IT责任人']) {
const index = (users||[]).findIndex(item => item.pernr === changedValues['IT责任人']);
if (index !== -1) {
form.setFieldsValue({'IT责任部门': users[index].orgtx});
form.setFieldsValue({'IT责任
人姓名': users[index].nachn, 'IT责任
部门': users[index].orgtx});
}
}
}
...
...
src/view/Manage/AssetManage/Component/AssetTable.jsx
View file @
eccec6d7
...
...
@@ -250,25 +250,25 @@ const AssetTable = (props) => {
const
realAssets
=
useMemo
(()
=>
{
const
newAssets
=
[...
assets
];
if
(
users
?.
length
>
0
&&
assets
?.
length
>
0
&&
columns
?.
length
>
0
)
{
const
specialCol
=
[
'数据关键用户'
,
'业务数据owner'
,
'it责任人'
,
'创建人'
,
'更新人'
];
const
indexArray
=
[];
columns
.
forEach
((
item
,
index
)
=>
{
if
(
specialCol
.
indexOf
(
item
.
title
?.
toLowerCase
())
!==
-
1
)
{
indexArray
.
push
(
index
);
}
});
//
if (users?.length > 0 && assets?.length > 0 && columns?.length > 0) {
//
const specialCol = ['数据关键用户', '业务数据owner', 'it责任人', '创建人', '更新人'];
//
const indexArray = [];
//
columns.forEach((item, index) => {
//
if (specialCol.indexOf(item.title?.toLowerCase()) !== -1) {
//
indexArray.push(index);
//
}
//
});
newAssets
?.
forEach
((
item
)
=>
{
indexArray
?.
forEach
(
index
=>
{
const
user
=
users
?.
filter
((
user
)
=>
(
user
.
pernr
===
item
[
`element
${
index
+
1
}
`
]));
if
(
user
&&
user
.
length
>
0
)
{
item
[
`element
${
index
+
1
}
`
]
=
user
[
0
].
nachn
?
`
${
user
[
0
].
nachn
}
(
${
user
[
0
].
pernr
}
)`
:
user
[
0
].
pernr
;
}
})
})
}
//
newAssets?.forEach((item) => {
//
indexArray?.forEach(index => {
//
const user = users?.filter((user)=>(user.pernr===item[`element${index+1}`]));
//
if (user && user.length > 0) {
//
item[`element${index+1}`] = user[0].nachn?`${user[0].nachn}(${user[0].pernr})`:user[0].pernr;
//
}
//
})
//
})
//
}
return
newAssets
;
},
[
users
,
assets
,
columns
])
...
...
src/view/Manage/Model/Component/SelectUsers.jsx
View file @
eccec6d7
...
...
@@ -52,27 +52,33 @@ const SelectUser:React.FC=(props)=>{
</
Select
>
)
}
else
if
(
type
===
'detail'
){
try
{
const
user
=
(
users
??[]).
filter
((
item
)
=>
(
item
.
pernr
===
value
))
let
publishedUser
=
null
;
if
(
publishedValue
&&
publishedValue
!==
value
)
{
publishedUser
=
(
users
??[]).
filter
((
item
)
=>
(
item
.
pernr
===
publishedValue
))
return
<
span
>
<
Typography
.
Text
>
{
highlightSearchContentByTerms
(
value
,
terms
)
}
</
Typography
.
Text
>
{
publishedValue
&&
publishedValue
!==
value
&&
<
Typography
.
Text
className=
'ml-2'
type=
'danger'
><
del
>
{
publishedValue
}
</
del
></
Typography
.
Text
>
}
</
span
>
// try {
// const user = (users??[]).filter((item)=>(item.pernr===value))
// let publishedUser = null;
// if (publishedValue && publishedValue !== value) {
// publishedUser = (users??[]).filter((item)=>(item.pernr===publishedValue))
// }
return
<
span
>
<
Typography
.
Text
>
{
highlightSearchContentByTerms
(
`${user[0].nachn}(${user[0].pernr})`
,
terms
)
}
</
Typography
.
Text
>
{
publishedUser
&&
<
Typography
.
Text
className=
'ml-2'
type=
'danger'
><
del
>
{
`${publishedUser[0].nachn}(${publishedUser[0].pernr})`
}
</
del
></
Typography
.
Text
>
}
</
span
>;
}
catch
(
error
)
{
return
<
span
>
<
Typography
.
Text
>
{
highlightSearchContentByTerms
(
value
,
terms
)
}
</
Typography
.
Text
>
{
publishedValue
&&
publishedValue
!==
value
&&
<
Typography
.
Text
className=
'ml-2'
type=
'danger'
><
del
>
{
publishedValue
}
</
del
></
Typography
.
Text
>
}
</
span
>
}
//
return <span>
//
<Typography.Text>{highlightSearchContentByTerms(`${user[0].nachn}(${user[0].pernr})`, terms)}</Typography.Text>
//
{
//
publishedUser && <Typography.Text className='ml-2' type='danger'><del>{`${publishedUser[0].nachn}(${publishedUser[0].pernr})`}</del></Typography.Text>
//
}
//
</span>;
//
} catch (error) {
//
return <span>
//
<Typography.Text>{highlightSearchContentByTerms(value, terms)}</Typography.Text>
//
{
//
publishedValue && publishedValue!==value && <Typography.Text className='ml-2' type='danger'><del>{publishedValue}</del></Typography.Text>
//
}
//
</span>
//
}
}
else
{
return
null
}
...
...
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