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
299abef3
Commit
299abef3
authored
Jun 20, 2023
by
zhaochengxiang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
资产右键功能调整
parent
cc6f5f04
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
64 additions
and
33 deletions
+64
-33
AssetTable.jsx
src/view/Manage/AssetManage/Component/AssetTable.jsx
+51
-30
ModelTable.jsx
src/view/Manage/Model/Component/ModelTable.jsx
+13
-3
No files found.
src/view/Manage/AssetManage/Component/AssetTable.jsx
View file @
299abef3
...
@@ -164,17 +164,38 @@ const AssetTable = (props) => {
...
@@ -164,17 +164,38 @@ const AssetTable = (props) => {
const
app
=
useContext
(
AppContext
)
const
app
=
useContext
(
AppContext
)
const
actionCol
=
{
title
:
'操作'
,
dataIndex
:
'action'
,
width
:
60
,
fixed
:
'right'
,
filter
:
false
,
render
:
(
_
,
record
)
=>
{
return
(
<
React
.
Fragment
>
{
(
reference
===
AssetManageReference
||
(
reference
===
AssetBrowseReference
&&
record
.
hasPermission
))
&&
<
a
onClick=
{
(
e
)
=>
{
e
.
stopPropagation
();
handleItemClick
(
'authorization'
,
record
);
}
}
>
授权
</
a
>
}
</
React
.
Fragment
>
)
}
}
useEffect
(()
=>
{
useEffect
(()
=>
{
if
(
TableWidth
>
0
&&
columns
.
length
>
0
)
{
if
(
TableWidth
>
0
&&
columns
.
length
>
0
)
{
const
currentWidth
=
(
columns
.
reduce
((
preVal
,
col
)
=>
(
col
.
width
?
col
.
width
:
0
)
+
preVal
,
0
))
+
32.0
;
const
newColumns
=
[...
columns
,
actionCol
];
const
currentWidth
=
(
newColumns
.
reduce
((
preVal
,
col
)
=>
(
col
.
width
?
col
.
width
:
0
)
+
preVal
,
0
))
+
32.0
;
if
(
currentWidth
<
TableWidth
)
{
if
(
currentWidth
<
TableWidth
)
{
c
olumns
.
forEach
(
column
=>
{
newC
olumns
.
forEach
(
column
=>
{
column
.
width
=
(
TableWidth
-
32.0
)
/
c
olumns
.
length
;
column
.
width
=
(
TableWidth
-
32.0
)
/
newC
olumns
.
length
;
})
})
}
}
setRealColumns
([...
c
olumns
,
<
Column
key=
'auto'
/>]);
setRealColumns
([...
newC
olumns
,
<
Column
key=
'auto'
/>]);
}
else
{
}
else
{
setRealColumns
([]);
setRealColumns
([]);
}
}
...
@@ -791,7 +812,7 @@ const AssetTable = (props) => {
...
@@ -791,7 +812,7 @@ const AssetTable = (props) => {
})
})
}
}
const
handleItemClick
=
(
{
id
,
event
,
props
}
)
=>
{
const
handleItemClick
=
(
id
,
record
)
=>
{
if
(
id
===
'uncombed'
)
{
if
(
id
===
'uncombed'
)
{
modal
.
confirm
({
modal
.
confirm
({
title
:
'提示'
,
title
:
'提示'
,
...
@@ -801,7 +822,7 @@ const AssetTable = (props) => {
...
@@ -801,7 +822,7 @@ const AssetTable = (props) => {
type
:
'assetmanage.updateResourceState'
,
type
:
'assetmanage.updateResourceState'
,
payload
:
{
payload
:
{
params
:
{
params
:
{
dataAssetId
:
contextMenuItem
.
id
,
dataAssetId
:
record
.
id
,
resourceState
:
'uncombed'
resourceState
:
'uncombed'
}
}
},
},
...
@@ -825,7 +846,7 @@ const AssetTable = (props) => {
...
@@ -825,7 +846,7 @@ const AssetTable = (props) => {
type
:
'assetmanage.updateResourceState'
,
type
:
'assetmanage.updateResourceState'
,
payload
:
{
payload
:
{
params
:
{
params
:
{
dataAssetId
:
contextMenuItem
.
id
,
dataAssetId
:
record
.
id
,
resourceState
:
'notRelatedAsset'
resourceState
:
'notRelatedAsset'
}
}
},
},
...
@@ -841,10 +862,10 @@ const AssetTable = (props) => {
...
@@ -841,10 +862,10 @@ const AssetTable = (props) => {
}
}
});
});
}
else
if
(
id
===
'authorization'
)
{
}
else
if
(
id
===
'authorization'
)
{
if
(
contextMenuItem
?
.
metadata
?.
metadataTableId
)
{
if
(
record
.
metadata
?.
metadataTableId
)
{
app
?.
setGlobalState
&&
app
?.
setGlobalState
({
app
?.
setGlobalState
&&
app
?.
setGlobalState
({
message
:
'data-govern-assets-admit'
,
message
:
'data-govern-assets-admit'
,
data
:
contextMenuItem
data
:
record
})
})
}
else
{
}
else
{
showMessage
(
"warn"
,
"该资产没有关联元数据信息"
);
showMessage
(
"warn"
,
"该资产没有关联元数据信息"
);
...
@@ -855,12 +876,12 @@ const AssetTable = (props) => {
...
@@ -855,12 +876,12 @@ const AssetTable = (props) => {
const
moreMenu
=
(
const
moreMenu
=
(
<
Menu
>
<
Menu
>
{
{
(
reference
===
AssetManageReference
)
&&
//
(reference===AssetManageReference) &&
<
Menu
.
Item
disabled=
{
(
checkedKeys
||
[]).
length
===
0
}
>
//
<Menu.Item disabled=
{(
checkedKeys
||
[]).
length
===
0
}
>
<
div
className=
'text-center'
onClick=
{
onStartFlowClick
}
>
//
<div className='text-center' onClick=
{
onStartFlowClick
}
>
申请
//
申请
</
div
>
//
</div>
</
Menu
.
Item
>
//
</Menu.Item>
}
}
{
{
(
reference
!==
AssetRecycleReference
)
&&
(
reference
!==
AssetRecycleReference
)
&&
...
@@ -945,10 +966,10 @@ const AssetTable = (props) => {
...
@@ -945,10 +966,10 @@ const AssetTable = (props) => {
}
}
{
{
(
reference
===
AssetBrowseReference
||
reference
===
ResourceBrowseReference
)
&&
//
(reference===AssetBrowseReference||reference===ResourceBrowseReference) &&
<
Tooltip
title=
{
(
checkedKeys
||
[]).
length
===
0
?
'请先选择资产'
:
''
}
>
//
<Tooltip title=
{(
checkedKeys
||
[]).
length
===
0
?
'请先选择资产'
:
''
}
>
<
Button
onClick=
{
onStartFlowClick
}
disabled=
{
(
checkedKeys
||
[]).
length
===
0
}
>
申请
</
Button
>
//
<Button onClick=
{
onStartFlowClick
}
disabled
=
{(
checkedKeys
||
[]).
length
===
0
}
>
申请
<
/Button>
</
Tooltip
>
//
</Tooltip>
}
}
{
{
...
@@ -956,10 +977,10 @@ const AssetTable = (props) => {
...
@@ -956,10 +977,10 @@ const AssetTable = (props) => {
<
Button
>
其他操作
</
Button
>
<
Button
>
其他操作
</
Button
>
</
Dropdown
>
:
<
React
.
Fragment
>
</
Dropdown
>
:
<
React
.
Fragment
>
{
{
(
reference
===
AssetManageReference
)
&&
//
(reference===AssetManageReference) &&
<
Tooltip
title=
{
(
checkedKeys
||
[]).
length
===
0
?
'请先选择资产'
:
''
}
>
//
<Tooltip title=
{(
checkedKeys
||
[]).
length
===
0
?
'请先选择资产'
:
''
}
>
<
Button
onClick=
{
onStartFlowClick
}
disabled=
{
(
checkedKeys
||
[]).
length
===
0
}
>
申请
</
Button
>
//
<Button onClick=
{
onStartFlowClick
}
disabled
=
{(
checkedKeys
||
[]).
length
===
0
}
>
申请
<
/Button>
</
Tooltip
>
//
</Tooltip>
}
}
{
{
...
@@ -1043,18 +1064,18 @@ const AssetTable = (props) => {
...
@@ -1043,18 +1064,18 @@ const AssetTable = (props) => {
setAssetDetailDrawerVisible
(
true
);
setAssetDetailDrawerVisible
(
true
);
},
},
onContextMenu
:
event
=>
{
onContextMenu
:
event
=>
{
if
((
reference
===
AssetManageReference
||
(
reference
===
AssetBrowseReference
&&
record
.
hasPermission
))
&&
(
record
.
resourceState
===
'uncombed'
||
record
.
resourceState
===
'notRelatedAsset'
))
{
//
if ((reference===AssetManageReference||(reference===AssetBrowseReference&&record.hasPermission)) && (record.resourceState==='uncombed'||record.resourceState==='notRelatedAsset'))
{
setContextMenuItem
(
record
);
//
setContextMenuItem(record);
displayMenu
(
event
);
//
displayMenu(event);
}
//
}
},
},
}
}
}
}
}
}
rowClassName=
{
(
record
,
index
)
=>
{
rowClassName=
{
(
record
,
index
)
=>
{
let
classNames
=
[];
let
classNames
=
[];
if
(
reference
===
AssetManageReference
&&
(
record
.
resourceState
===
'uncombed'
||
record
.
resourceState
===
'notRelatedAsset'
))
{
//
if (reference===AssetManageReference && (record.resourceState==='uncombed'||record.resourceState==='notRelatedAsset'))
{
classNames
.
push
(
'cursor-contextmenu'
);
//
classNames.push('cursor-contextmenu');
}
//
}
if
(
record
?.
id
===
anchorId
||
record
?.
id
===
selectItem
?.
id
)
{
if
(
record
?.
id
===
anchorId
||
record
?.
id
===
selectItem
?.
id
)
{
classNames
.
push
(
'yy-table-select-row'
);
classNames
.
push
(
'yy-table-select-row'
);
...
...
src/view/Manage/Model/Component/ModelTable.jsx
View file @
299abef3
...
@@ -177,6 +177,15 @@ const ModelTable = (props) => {
...
@@ -177,6 +177,15 @@ const ModelTable = (props) => {
},
},
width
:
60
,
width
:
60
,
ellipsis
:
true
,
ellipsis
:
true
,
filter
:
false
,
}
const
editorCol
=
{
title
:
'管理人'
,
dataIndex
:
'editor'
,
width
:
100
,
ellipsis
:
true
,
filter
:
false
,
}
}
const
actionCol
=
{
const
actionCol
=
{
...
@@ -184,6 +193,7 @@ const ModelTable = (props) => {
...
@@ -184,6 +193,7 @@ const ModelTable = (props) => {
dataIndex
:
'action'
,
dataIndex
:
'action'
,
width
:
240
,
width
:
240
,
fixed
:
'right'
,
fixed
:
'right'
,
filter
:
false
,
render
:
(
_
,
record
)
=>
{
render
:
(
_
,
record
)
=>
{
const
authActionTitles
=
[];
const
authActionTitles
=
[];
if
((
getDataModelerRole
(
user
)
!==
DataModelerRoleReader
)
&&
view
!==
'grant'
&&
!
isOnlyEnding
&&
(
record
.
editable
||
record
.
permitCheckOut
))
{
if
((
getDataModelerRole
(
user
)
!==
DataModelerRoleReader
)
&&
view
!==
'grant'
&&
!
isOnlyEnding
&&
(
record
.
editable
||
record
.
permitCheckOut
))
{
...
@@ -517,13 +527,13 @@ const ModelTable = (props) => {
...
@@ -517,13 +527,13 @@ const ModelTable = (props) => {
});
});
if (!modelId) {
if (!modelId) {
newCols = [indexCol, ...newCols, actionCol];
newCols = [indexCol, ...newCols,
editorCol,
actionCol];
} else {
} else {
newCols = [...newCols, actionCol];
newCols = [...newCols,
editorCol,
actionCol];
}
}
if ((visibleColNames||[]).length > 0) {
if ((visibleColNames||[]).length > 0) {
newCols = newCols.filter(col => visibleColNames.indexOf(col.title)!==-1 || col.
title==='序号' || col.title==='操作'
);
newCols = newCols.filter(col => visibleColNames.indexOf(col.title)!==-1 || col.
filter===false
);
if (newCols.length > 2) {
if (newCols.length > 2) {
newCols[newCols.length-2].width = null;
newCols[newCols.length-2].width = 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