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
d34128da
Commit
d34128da
authored
Dec 04, 2023
by
zhaochengxiang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bug fix
parent
3c05c301
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
67 additions
and
39 deletions
+67
-39
AssetAction.jsx
src/view/Manage/AssetManage/Component/AssetAction.jsx
+60
-38
AssetTable.jsx
src/view/Manage/AssetManage/Component/AssetTable.jsx
+7
-1
No files found.
src/view/Manage/AssetManage/Component/AssetAction.jsx
View file @
d34128da
...
@@ -66,6 +66,7 @@ const AssetAction = (props) => {
...
@@ -66,6 +66,7 @@ const AssetAction = (props) => {
const
[
modal
,
contextHolder
]
=
Modal
.
useModal
();
const
[
modal
,
contextHolder
]
=
Modal
.
useModal
();
const
[
permissions
,
setPermissions
]
=
useState
(
undefined
);
const
[
permissions
,
setPermissions
]
=
useState
(
undefined
);
const
[
keyword
,
setKeyword
]
=
useState
(
''
);
const
[
keyword
,
setKeyword
]
=
useState
(
''
);
const
[
standardList
,
setStandardList
]
=
useState
(
undefined
);
const
app
=
useContext
(
AppContext
);
const
app
=
useContext
(
AppContext
);
const
uploadRef
=
useRef
(
undefined
);
const
uploadRef
=
useRef
(
undefined
);
...
@@ -115,19 +116,6 @@ const AssetAction = (props) => {
...
@@ -115,19 +116,6 @@ const AssetAction = (props) => {
// }
// }
// },
// },
{
{
title
:
'业务规则'
,
dataIndex
:
'businessRules'
,
width
:
240
,
ellipsis
:
true
,
render
:
(
text
,
_
)
=>
highlightSearchContentByTerms
(
text
||
''
,
terms
)
},
{
title
:
'计量单位'
,
dataIndex
:
'unitOfMeasurement'
,
ellipsis
:
true
,
render
:
(
text
,
_
)
=>
highlightSearchContentByTerms
(
text
||
''
,
terms
)
},
{
title
:
'备注信息'
,
title
:
'备注信息'
,
dataIndex
:
'remarks'
,
dataIndex
:
'remarks'
,
ellipsis
:
true
,
ellipsis
:
true
,
...
@@ -146,25 +134,25 @@ const AssetAction = (props) => {
...
@@ -146,25 +134,25 @@ const AssetAction = (props) => {
width
:
60
,
width
:
60
,
ellipsis
:
true
,
ellipsis
:
true
,
},
},
//
{
{
// title: '引用
标准',
title
:
'关联
标准'
,
//
dataIndex: 'standard',
dataIndex
:
'standard'
,
//
ellipsis: true,
ellipsis
:
true
,
//
render: (_, record) => {
render
:
(
_
,
record
)
=>
{
//
return <AppContext.Consumer>
return
<
AppContext
.
Consumer
>
//
{
{
//
appValue => <a onClick={() => {
appValue
=>
<
a
onClick=
{
()
=>
{
//
appValue?.setGlobalState && appValue?.setGlobalState({
appValue
?.
setGlobalState
&&
appValue
?.
setGlobalState
({
//
message: 'data-govern-show-index-detail-message',
message
:
'data-govern-show-index-detail-message'
,
//
data: { id: record.standard?.standardId }
data
:
{
id
:
record
.
standard
?.
standardId
}
//
})
})
//
}}>
}
}
>
//
<span>{record.standard?.standardName}</span>
<
span
>
{
record
.
standard
?.
standardName
}
</
span
>
//
</a>
</
a
>
//
}
}
//
</AppContext.Consumer>
</
AppContext
.
Consumer
>
//
}
}
//
},
},
];
];
useEffect
(()
=>
{
useEffect
(()
=>
{
...
@@ -222,21 +210,30 @@ const AssetAction = (props) => {
...
@@ -222,21 +210,30 @@ const AssetAction = (props) => {
},
[
currentDomainGroup
,
currentBussinessDomain
,
treeDataMap
])
},
[
currentDomainGroup
,
currentBussinessDomain
,
treeDataMap
])
const
tableData
=
useMemo
(()
=>
{
const
tableData
=
useMemo
(()
=>
{
if
(
metadataColumnList
)
{
if
(
metadataColumnList
&&
standardList
)
{
const
newMetadataColumnList
=
metadataColumnList
.
filter
(
item
=>
{
const
newMetadataColumnList
=
[];
metadataColumnList
.
filter
(
item
=>
{
return
(
return
(
!
keyword
!
keyword
||
(
item
.
name
??
''
).
indexOf
(
keyword
)
!==-
1
||
(
item
.
name
??
''
).
indexOf
(
keyword
)
!==-
1
||
(
item
.
cnName
??
''
).
indexOf
(
keyword
)
!==-
1
||
(
item
.
cnName
??
''
).
indexOf
(
keyword
)
!==-
1
||
(
item
.
businessRules
??
''
).
indexOf
(
keyword
)
!==-
1
)
)
}).
forEach
(
item
=>
{
const
index
=
standardList
?.
findIndex
(
_item
=>
_item
.
metadataId
===
item
.
_id
);
let
newItem
=
{...
item
};
if
(
index
!==
-
1
)
{
newItem
.
standard
=
standardList
[
index
];
}
newMetadataColumnList
.
push
(
newItem
);
});
});
return
paginate
(
newMetadataColumnList
,
pageNum
,
pageSize
);
return
paginate
(
newMetadataColumnList
,
pageNum
,
pageSize
);
}
}
return
[];
return
[];
},
[
metadataColumnList
,
pagination
,
keyword
])
},
[
metadataColumnList
,
standardList
,
pagination
,
keyword
])
const
getPermission
=
()
=>
{
const
getPermission
=
()
=>
{
// dispatch({
// dispatch({
...
@@ -396,6 +393,7 @@ const AssetAction = (props) => {
...
@@ -396,6 +393,7 @@ const AssetAction = (props) => {
try
{
try
{
setMetadata
(
JSON
.
parse
(
metadataValue
));
setMetadata
(
JSON
.
parse
(
metadataValue
));
getMetadataAttributes
();
getMetadataAttributes
();
getMetadataStandardList
();
}
catch
(
error
)
{
}
catch
(
error
)
{
}
}
...
@@ -821,6 +819,30 @@ const AssetAction = (props) => {
...
@@ -821,6 +819,30 @@ const AssetAction = (props) => {
// }
// }
// }
// }
const getMetadataStandardList = () => {
setMetadata(prevMetadata => {
if (prevMetadata.metadataTableId) {
dispatch({
type: 'assetmanage.getMetadataStandardList',
payload: {
data: {
parentMetadataId: prevMetadata?.metadataTableId
},
params: {
page: 1,
size: 999999
}
},
callback: data => {
setStandardList(data?.content);
},
});
}
return prevMetadata;
})
}
const onValuesChange = (changedValues, allValues) => {
const onValuesChange = (changedValues, allValues) => {
if (changedValues.hasOwnProperty('主题域分组')) {
if (changedValues.hasOwnProperty('主题域分组')) {
setCurrentDomainGroup(changedValues['主题域分组']);
setCurrentDomainGroup(changedValues['主题域分组']);
...
@@ -1065,7 +1087,7 @@ const AssetAction = (props) => {
...
@@ -1065,7 +1087,7 @@ const AssetAction = (props) => {
</Button>
</Button>
</Dropdown> */}
</Dropdown> */}
<Input size="middle"
<Input size="middle"
placeholder="搜索中英文名称
/业务规则
"
placeholder="搜索中英文名称"
value={keyword}
value={keyword}
bordered={true} allowClear
bordered={true} allowClear
style={{ width: 200 }}
style={{ width: 200 }}
...
@@ -1093,7 +1115,7 @@ const AssetAction = (props) => {
...
@@ -1093,7 +1115,7 @@ const AssetAction = (props) => {
pagination={{
pagination={{
position: ['bottomLeft'],
position: ['bottomLeft'],
size: 'small',
size: 'small',
total: (
tableData
||[]).length,
total: (
metadataColumnList
||[]).length,
showTotal: (total) => `
共
$
{
total
}
项
`,
showTotal: (total) => `
共
$
{
total
}
项
`,
showSizeChanger: true,
showSizeChanger: true,
current: pageNum,
current: pageNum,
...
...
src/view/Manage/AssetManage/Component/AssetTable.jsx
View file @
d34128da
...
@@ -80,7 +80,13 @@ const AssetItem = (props) => {
...
@@ -80,7 +80,13 @@ const AssetItem = (props) => {
</
div
>
}
</
div
>
}
>
>
<
Text
ellipsis=
{
true
}
>
<
Text
ellipsis=
{
true
}
>
{
content
||
''
}
{
(
typeof
metadata
===
'string'
)
?
(
content
||
''
)
:
<
a
onClick=
{
()
=>
{
}
}
>
{
metadata
?.
tableEnName
??
metadata
?.
tableCnName
}
</
a
>
}
</
Text
>
</
Text
>
</
Tooltip
>
</
Tooltip
>
);
);
...
...
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