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
e6f49a4f
Commit
e6f49a4f
authored
Oct 23, 2021
by
zhaochengxiang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改资产项问题
parent
827ee000
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
8 deletions
+19
-8
AssetTable.jsx
src/view/Manage/AssetManage/Component/AssetTable.jsx
+14
-5
MetadataInfo.jsx
src/view/Manage/AssetManage/Component/MetadataInfo.jsx
+5
-3
No files found.
src/view/Manage/AssetManage/Component/AssetTable.jsx
View file @
e6f49a4f
...
@@ -277,9 +277,19 @@ const AssetTable = (props) => {
...
@@ -277,9 +277,19 @@ const AssetTable = (props) => {
}
}
}
}
const onAssetCheckboxChange = (value) => {
const onAssetCheckboxChange = (e) => {
setSelectedKeys(value||[]);
setCheckAllValue((value||[].length!==0) && (value||[]).length===(assets||[]).length);
let newSelectedKeys = [...selectedKeys];
if (e.target.checked) {
newSelectedKeys = [...newSelectedKeys, e.target.value];
} else {
const index = newSelectedKeys.findIndex((key) => key === e.target.value);
newSelectedKeys.splice(index, 1);
}
setSelectedKeys(newSelectedKeys||[]);
setCheckAllValue((newSelectedKeys||[].length!==0) && (newSelectedKeys||[]).length===(assets||[]).length);
}
}
const deleteAssets = () => {
const deleteAssets = () => {
...
@@ -423,7 +433,6 @@ const AssetTable = (props) => {
...
@@ -423,7 +433,6 @@ const AssetTable = (props) => {
<>
<>
<Checkbox.Group
<Checkbox.Group
style={{ width: '100%' }}
style={{ width: '100%' }}
onChange={ onAssetCheckboxChange }
value={ selectedKeys }
value={ selectedKeys }
>
>
<AutoSizer>
<AutoSizer>
...
@@ -456,7 +465,7 @@ const AssetTable = (props) => {
...
@@ -456,7 +465,7 @@ const AssetTable = (props) => {
<>
<>
<div className='d-flex mt-3 mb-1' style={{ alignItems: 'center' }}>
<div className='d-flex mt-3 mb-1' style={{ alignItems: 'center' }}>
<div className='textOverflow' style={{ flex: 1 }}>
<div className='textOverflow' style={{ flex: 1 }}>
<Checkbox value={item.id}></Checkbox>
<Checkbox value={item.id}
onChange={onAssetCheckboxChange}
></Checkbox>
<span title={assetNames[index]||''} style={{ marginLeft:8, fontSize: 18, fontWeight: 'bold' }}>{assetNames[index]||''}</span>
<span title={assetNames[index]||''} style={{ marginLeft:8, fontSize: 18, fontWeight: 'bold' }}>{assetNames[index]||''}</span>
</div>
</div>
<Space className='m-3' style={{ marginLeft: 'auto' }} size='small'>
<Space className='m-3' style={{ marginLeft: 'auto' }} size='small'>
...
...
src/view/Manage/AssetManage/Component/MetadataInfo.jsx
View file @
e6f49a4f
...
@@ -10,24 +10,26 @@ const MetadataInfo = ({ value = '', config = true }) => {
...
@@ -10,24 +10,26 @@ const MetadataInfo = ({ value = '', config = true }) => {
try
{
try
{
metadata
=
JSON
.
parse
(
value
);
metadata
=
JSON
.
parse
(
value
);
}
catch
(
error
)
{
}
catch
(
error
)
{
metadata
=
value
;
}
}
return
(
return
(
<
AppContext
.
Consumer
>
<
AppContext
.
Consumer
>
{
{
value
=>
<
span
>
value
=>
<
span
>
<
a
onClick=
{
()
=>
{
{
(
typeof
metadata
===
'string'
)
?
<
span
style=
{
{
marginRight
:
5
}
}
>
{
metadata
||
''
}
</
span
>
:
<
a
onClick=
{
()
=>
{
value
?.
setGlobalState
({
value
?.
setGlobalState
({
message
:
'data-govern-show-metadata-message'
,
message
:
'data-govern-show-metadata-message'
,
data
:
metadata
data
:
metadata
})
})
}
}
style=
{
{
marginRight
:
5
}
}
>
{
metadata
?.
tableName
||
''
}
</
a
>
}
}
style=
{
{
marginRight
:
5
}
}
>
{
metadata
?.
tableName
||
''
}
</
a
>
}
{
{
config
&&
<
Button
icon=
{
<
SettingFilled
/>
}
onClick=
{
()
=>
{
config
&&
<
Button
icon=
{
<
SettingFilled
/>
}
onClick=
{
()
=>
{
value
?.
setGlobalState
&&
value
?.
setGlobalState
({
value
?.
setGlobalState
&&
value
?.
setGlobalState
({
message
:
'data-govern-show-metadata-list-message'
,
message
:
'data-govern-show-metadata-list-message'
,
data
:
metadata
data
:
(
typeof
metadata
===
'string'
)
?
{}
:
metadata
})
})
}
}
/>
}
}
/>
}
}
...
...
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