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
5bd92c73
Commit
5bd92c73
authored
Apr 23, 2023
by
zhaochengxiang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
负责人不要用工号
parent
6a33a9c3
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
105 additions
and
32 deletions
+105
-32
index.js
src/model/index.js
+3
-3
AssetAction.jsx
src/view/Manage/AssetManage/Component/AssetAction.jsx
+23
-18
AssetDetail.jsx
src/view/Manage/AssetManage/Component/AssetDetail.jsx
+33
-9
AssetTable.jsx
src/view/Manage/AssetManage/Component/AssetTable.jsx
+46
-2
No files found.
src/model/index.js
View file @
5bd92c73
...
...
@@ -27,14 +27,14 @@ function* request(args) {
error
&&
error
(
ex
);
if
(
ex
)
{
if
(
ex
?.
ApiError
?.
cnMessage
)
{
showErrorNotifaction
(
'
系统异常
'
,
ex
.
ApiError
.
cnMessage
,
5
);
showErrorNotifaction
(
'
温馨提示
'
,
ex
.
ApiError
.
cnMessage
,
5
);
}
else
if
(
ex
?.
response
?.
data
)
{
let
newData
=
{};
try
{
newData
=
JSON
.
parse
(
ex
?.
response
?.
data
);
showErrorNotifaction
(
'
系统异常
'
,
newData
.
ApiError
?.
cnMessage
,
5
);
showErrorNotifaction
(
'
温馨提示
'
,
newData
.
ApiError
?.
cnMessage
,
5
);
}
catch
(
error
)
{
showErrorNotifaction
(
'
系统异常
'
,
ex
?.
response
?.
data
,
5
);
showErrorNotifaction
(
'
温馨提示
'
,
ex
?.
response
?.
data
,
5
);
}
}
}
...
...
src/view/Manage/AssetManage/Component/AssetAction.jsx
View file @
5bd92c73
...
...
@@ -429,7 +429,7 @@ const AssetAction = (props) => {
},
};
const elementComponent = (element) => {
const element
Edit
Component = (element) => {
if (element.name==='资产项') return <MetadataInfo />;
if (element.name === '数据源系统') {
...
...
@@ -489,6 +489,26 @@ const AssetAction = (props) => {
return <Input disabled={element.manualMaintain==='否'} />
}
const elementDetailComponent = (item) => {
if (item.name === '资产项') {
return <MetadataInfo config={false} value={item.value||''} terms={terms} />;
}
if (item.name === '指标标准编码') {
return <IndexCode value={item.value||''} terms={terms} />;
}
if (item.name==='数据关键用户' || item.name==='业务部门负责人' || item.name?.toLowerCase()==='it责任人') {
return <SelectUser
type='detail'
users={users}
value={item.value||''}
/>
}
return <span className='text-color'>{highlightSearchContentByTerms(item.value||'', terms)}</span>;
}
return (
<div
className='flex'
...
...
@@ -694,7 +714,7 @@ const AssetAction = (props) => {
key={_index}
style={{ marginBottom: (_index===sameAttributeElements.length-1)? 0 : 15 }}
>
{elementComponent(element)}
{element
Edit
Component(element)}
</Form.Item>
);
})
...
...
@@ -708,22 +728,7 @@ const AssetAction = (props) => {
(sameAttributeElements||[]).map((item, index) => {
return (
<Descriptions.Item label={<div className='title-common' style={{ textAlign: 'right', width: 60 }}>{item.name||''}</div>} key={index} style={{ paddingBottom: (index===sameAttributeElements.length-1)? 0 : 10 }}>
{
item.name==='资产项' && <MetadataInfo config={false} value={item.value||''} terms={terms} />
}
{
item.name==='指标标准编码' && <IndexCode value={item.value||''} terms={terms} />
}
{
(item.name==='数据关键用户' || item.name==='业务部门负责人' || item.name?.toLowerCase()==='it责任人') && <SelectUser
type='detail'
users={users}
value={item.value||''}
/>
}
{
item.name!=='资产项' && item.name!=='指标标准编码' && item.name!=='数据关键用户' && item.name!=='业务部门负责人' && item.name?.toLowerCase()!=='it责任人' && <span className='text-color'>{highlightSearchContentByTerms(item.value||'', terms)}</span>
}
{ elementDetailComponent(item) }
</Descriptions.Item>
);
})
...
...
src/view/Manage/AssetManage/Component/AssetDetail.jsx
View file @
5bd92c73
...
...
@@ -5,6 +5,7 @@ import MetadataInfo from './MetadataInfo';
import
{
highlightSearchContentByTerms
}
from
'../../../../util'
;
import
{
dispatch
}
from
'../../../../model'
;
import
IndexCode
from
'./IndexCode'
;
import
SelectUser
from
'../../Model/Component/SelectUsers'
;
const
AssetDetail
=
(
props
)
=>
{
...
...
@@ -12,11 +13,13 @@ const AssetDetail = (props)=>{
const
[
asset
,
setAsset
]
=
useState
(
''
);
const
[
types
,
setTypes
]
=
useState
([]);
const
[
loading
,
setLoading
]
=
useState
(
false
);
const
[
users
,
setUsers
]
=
useState
([]);
useEffect
(()
=>
{
if
((
id
||
''
)
!==
''
)
{
// getUserElements();
getUsers
();
getAsset
([]);
}
//eslint-disable-next-line react-hooks/exhaustive-deps
...
...
@@ -35,6 +38,15 @@ const AssetDetail = (props)=>{
})
}
const
getUsers
=
()
=>
{
dispatch
({
type
:
'pds.getOwners'
,
callback
:
(
data
)
=>
{
setUsers
(
data
);
}
})
}
const
getAsset
=
(
userElements
)
=>
{
setLoading
(
true
);
dispatch
({
...
...
@@ -73,6 +85,26 @@ const AssetDetail = (props)=>{
})
}
const
elementItemComponent
=
(
item
)
=>
{
if
(
item
.
name
===
'资产项'
)
{
return
<
MetadataInfo
config=
{
false
}
value=
{
item
.
value
||
''
}
terms=
{
terms
}
/>;
}
if
(
item
.
name
===
'指标标准编码'
)
{
return
<
IndexCode
value=
{
item
.
value
||
''
}
terms=
{
terms
}
/>;
}
if
(
item
.
name
===
'数据关键用户'
||
item
.
name
===
'业务部门负责人'
||
item
.
name
?.
toLowerCase
()
===
'it责任人'
)
{
return
<
SelectUser
type=
'detail'
users=
{
users
}
value=
{
item
.
value
||
''
}
/>
}
return
<
span
className=
'text-color'
>
{
highlightSearchContentByTerms
(
item
.
value
||
''
,
terms
)
}
</
span
>;
}
return
(
<
Spin
spinning=
{
loading
}
>
{
...
...
@@ -102,15 +134,7 @@ const AssetDetail = (props)=>{
(
_currentValues
||
[]).
map
((
item
,
index
)
=>
{
return
(
<
Descriptions
.
Item
label=
{
item
.
name
||
''
}
key=
{
index
}
>
{
item
.
name
===
'资产项'
&&
<
MetadataInfo
config=
{
false
}
value=
{
item
.
value
||
''
}
terms=
{
terms
}
/>
}
{
item
.
name
===
'指标标准编码'
&&
<
IndexCode
value=
{
item
.
value
||
''
}
terms=
{
terms
}
/>
}
{
item
.
name
!==
'资产项'
&&
item
.
name
!==
'指标标准编码'
&&
<
span
className=
'text-color'
>
{
highlightSearchContentByTerms
(
item
.
value
||
''
,
terms
)
}
</
span
>
}
{
elementItemComponent
(
item
)
}
</
Descriptions
.
Item
>
);
})
...
...
src/view/Manage/AssetManage/Component/AssetTable.jsx
View file @
5bd92c73
import
React
,{
useState
,
useEffect
,
useRef
,
useContext
}
from
"react"
;
import
React
,{
useState
,
useEffect
,
useRef
,
useContext
,
useMemo
}
from
"react"
;
import
{
Button
,
Pagination
,
Space
,
Modal
,
Input
,
Table
,
Tooltip
,
Checkbox
,
Typography
,
Dropdown
,
Menu
}
from
"antd"
;
import
classNames
from
'classnames'
;
import
{
Resizable
}
from
'react-resizable'
;
...
...
@@ -151,6 +151,7 @@ const AssetTable = (props) => {
const
[
compact
,
setCompact
]
=
useState
(
false
);
const
[
assetDeleteModalVisible
,
setAssetDeleteModalVisible
]
=
useState
(
false
);
const
[
startFlowModalVisible
,
setStartFlowModalVisible
]
=
useState
(
false
);
const
[
users
,
setUsers
]
=
useState
([]);
const
[
modal
,
contextHolder
]
=
Modal
.
useModal
();
const
anchorId
=
getQueryParam
(
AnchorId
,
props
?.
location
?.
search
);
...
...
@@ -181,6 +182,7 @@ const AssetTable = (props) => {
},
[
columns
,
TableWidth
])
useEffect
(()
=>
{
getUsers
();
window
?.
addEventListener
(
"storage"
,
storageChange
);
return
()
=>
{
...
...
@@ -226,6 +228,39 @@ const AssetTable = (props) => {
//eslint-disable-next-line react-hooks/exhaustive-deps
},
[
keyword
,
pagination
,
elementsChanged
,
assetActionChanged
,
recursive
,
fullSearch
])
const
realAssets
=
useMemo
(()
=>
{
const
newAssets
=
[...
assets
];
if
(
users
?.
length
>
0
&&
assets
?.
length
>
0
&&
columns
?.
length
>
0
)
{
const
index1
=
columns
.
findIndex
(
item
=>
item
.
title
===
'数据关键用户'
);
const
index2
=
columns
.
findIndex
(
item
=>
item
.
title
===
'业务部门负责人'
);
const
index3
=
columns
.
findIndex
(
item
=>
item
.
title
?.
toLowerCase
()
===
'it责任人'
);
newAssets
?.
forEach
(
item
=>
{
if
(
index1
!==
-
1
)
{
const
user
=
users
?.
filter
((
user
)
=>
(
user
.
pernr
===
item
[
`element
${
index1
+
1
}
`
]));
if
(
user
?.
length
>
0
)
{
item
[
`element
${
index1
+
1
}
`
]
=
user
[
0
].
nachn
;
}
}
if
(
index2
!==
-
1
)
{
const
user
=
users
?.
filter
((
user
)
=>
(
user
.
pernr
===
item
[
`element
${
index2
+
1
}
`
]));
if
(
user
?.
length
>
0
)
{
item
[
`element
${
index2
+
1
}
`
]
=
user
[
0
].
nachn
;
}
}
if
(
index3
!==
-
1
)
{
const
user
=
users
?.
filter
((
user
)
=>
(
user
.
pernr
===
item
[
`element
${
index3
+
1
}
`
]));
if
(
user
?.
length
>
0
)
{
item
[
`element
${
index3
+
1
}
`
]
=
user
[
0
].
nachn
;
}
}
})
}
return
newAssets
;
},
[
users
,
assets
,
columns
])
const
storageChange
=
(
e
)
=>
{
if
(
e
.
key
===
'assetRelationOnClickEvent'
)
{
remoteRelationRef
.
current
=
e
.
relation
;
...
...
@@ -239,6 +274,15 @@ const AssetTable = (props) => {
}
}
const
getUsers
=
()
=>
{
dispatch
({
type
:
'pds.getOwners'
,
callback
:
(
data
)
=>
{
setUsers
(
data
);
}
})
}
const
getDataAssetLocationByRelation
=
()
=>
{
setLoading
(
true
);
dispatch
({
...
...
@@ -1042,7 +1086,7 @@ const AssetTable = (props) => {
})
}
rowKey=
'id'
dataSource=
{
a
ssets
}
dataSource=
{
realA
ssets
}
pagination=
{
false
}
size=
'default'
scroll=
{
{
y
:
scrollY
}
}
...
...
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