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
df7b6659
Commit
df7b6659
authored
Jun 30, 2023
by
zhaochengxiang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
资产详情授权
parent
fd140c55
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
48 additions
and
5 deletions
+48
-5
App.js
src/App.js
+1
-1
assetmanage.js
src/model/assetmanage.js
+6
-2
dataassetmanager.js
src/service/dataassetmanager.js
+5
-0
AssetAction.jsx
src/view/Manage/AssetManage/Component/AssetAction.jsx
+36
-2
No files found.
src/App.js
View file @
df7b6659
...
@@ -92,7 +92,7 @@ export class App extends React.Component {
...
@@ -92,7 +92,7 @@ export class App extends React.Component {
setGlobalState
,
setGlobalState
,
onGlobalStateChange
onGlobalStateChange
}}
>
}}
>
<
AssetAction
reference
=
{
AssetBrowseReference
}
id
=
{
id
}
action
=
'detail'
terms
=
{
terms
}
readonly
=
{
true
}
/
>
<
AssetAction
reference
=
{
AssetBrowseReference
}
id
=
{
id
}
permissionId
=
{
hostParams
?.
permissionId
}
action
=
'detail'
terms
=
{
terms
}
readonly
=
{
true
}
/
>
{
/* <AssetDetail
{
/* <AssetDetail
reference='full-search'
reference='full-search'
id={id}
id={id}
...
...
src/model/assetmanage.js
View file @
df7b6659
...
@@ -318,4 +318,8 @@ export function* importIndicator(payload) {
...
@@ -318,4 +318,8 @@ export function* importIndicator(payload) {
export
function
*
importIndicatorLog
(
payload
)
{
export
function
*
importIndicatorLog
(
payload
)
{
return
yield
call
(
service
.
importIndicatorLog
,
payload
);
return
yield
call
(
service
.
importIndicatorLog
,
payload
);
}
}
\ No newline at end of file
export
function
*
getPermission
(
payload
)
{
return
yield
call
(
service
.
getPermission
,
payload
);
}
\ No newline at end of file
src/service/dataassetmanager.js
View file @
df7b6659
...
@@ -302,4 +302,8 @@ export function importIndicator(payload) {
...
@@ -302,4 +302,8 @@ export function importIndicator(payload) {
export
function
importIndicatorLog
(
payload
)
{
export
function
importIndicatorLog
(
payload
)
{
return
GetJSON
(
'/standard/indicator/importLog'
,
payload
);
return
GetJSON
(
'/standard/indicator/importLog'
,
payload
);
}
export
function
getPermission
(
payload
)
{
return
GetJSON
(
"/dataassetmanager/permissionApi/getPermissionDetail"
,
payload
);
}
}
\ No newline at end of file
src/view/Manage/AssetManage/Component/AssetAction.jsx
View file @
df7b6659
...
@@ -25,7 +25,7 @@ import AttributeMaintain from './AttributeMaintain';
...
@@ -25,7 +25,7 @@ import AttributeMaintain from './AttributeMaintain';
import
'./AssetAction.less'
;
import
'./AssetAction.less'
;
const
AssetAction
=
(
props
)
=>
{
const
AssetAction
=
(
props
)
=>
{
const
{
id
,
dirId
,
action
,
terms
,
onChange
,
reference
,
form
,
onMetadataChange
,
onElementsChange
,
readonly
=
false
}
=
props
;
const
{
id
,
dirId
,
action
,
terms
,
onChange
,
reference
,
form
,
onMetadataChange
,
onElementsChange
,
readonly
=
false
,
permissionId
}
=
props
;
const
[
currentAction
,
setCurrentAction
]
=
useState
(
action
);
const
[
currentAction
,
setCurrentAction
]
=
useState
(
action
);
const
[
assetParams
,
setAssetParams
]
=
useState
({
assets
:
{},
attributes
:
[],
attributesFoldMap
:
{}
});
const
[
assetParams
,
setAssetParams
]
=
useState
({
assets
:
{},
attributes
:
[],
attributesFoldMap
:
{}
});
...
@@ -63,6 +63,7 @@ const AssetAction = (props) => {
...
@@ -63,6 +63,7 @@ const AssetAction = (props) => {
const
[
pagination
,
setPagination
]
=
useState
({
pageNum
:
1
,
pageSize
:
20
});
const
[
pagination
,
setPagination
]
=
useState
({
pageNum
:
1
,
pageSize
:
20
});
const
{
pageNum
,
pageSize
}
=
pagination
;
const
{
pageNum
,
pageSize
}
=
pagination
;
const
[
modal
,
contextHolder
]
=
Modal
.
useModal
();
const
[
modal
,
contextHolder
]
=
Modal
.
useModal
();
const
[
permissions
,
setPermissions
]
=
useState
(
undefined
);
const
app
=
useContext
(
AppContext
);
const
app
=
useContext
(
AppContext
);
const
uploadRef
=
useRef
(
undefined
);
const
uploadRef
=
useRef
(
undefined
);
...
@@ -92,6 +93,20 @@ const AssetAction = (props) => {
...
@@ -92,6 +93,20 @@ const AssetAction = (props) => {
ellipsis
:
true
,
ellipsis
:
true
,
},
},
{
{
title
:
'是否授权'
,
dataIndex
:
'permission'
,
width
:
200
,
ellipsis
:
true
,
render
:
(
_
,
record
)
=>
{
const
index
=
(
permissions
||
[]).
findIndex
(
item
=>
item
.
columnMetadataId
===
record
.
_id
);
if
(
index
!==-
1
)
{
return
permissions
[
index
].
visible
===
'Y'
?
'是'
:
'否'
;
}
return
'否'
;
}
},
{
title
:
'业务规则'
,
title
:
'业务规则'
,
dataIndex
:
'businessRules'
,
dataIndex
:
'businessRules'
,
width
:
240
,
width
:
240
,
...
@@ -210,6 +225,12 @@ const AssetAction = (props) => {
...
@@ -210,6 +225,12 @@ const AssetAction = (props) => {
//eslint-disable-next-line react-hooks/exhaustive-deps
//eslint-disable-next-line react-hooks/exhaustive-deps
},
[
id
,
dirId
])
},
[
id
,
dirId
])
useEffect
(()
=>
{
if
(
permissionId
)
{
getPermission
();
}
},
[
permissionId
,
app
?.
env
])
const
domains
=
useMemo
(()
=>
{
const
domains
=
useMemo
(()
=>
{
if
(
currentDomainGroup
&&
treeDataMap
)
{
if
(
currentDomainGroup
&&
treeDataMap
)
{
return
treeDataMap
[
currentDomainGroup
];
return
treeDataMap
[
currentDomainGroup
];
...
@@ -251,6 +272,19 @@ const AssetAction = (props) => {
...
@@ -251,6 +272,19 @@ const AssetAction = (props) => {
return
[];
return
[];
},
[
metadataColumnList
,
standardList
,
pagination
])
},
[
metadataColumnList
,
standardList
,
pagination
])
const
getPermission
=
()
=>
{
dispatch
({
type
:
'assetmanage.getPermission'
,
payload
:
{
permissionId
,
env
:
app
?.
env
},
callback
:
data
=>
{
setPermissions
(
data
.
columnPermissions
);
}
});
}
const
getAssetPaths
=
()
=>
{
const
getAssetPaths
=
()
=>
{
dispatch
({
dispatch
({
type
:
'assetmanage.getAssetPaths'
,
type
:
'assetmanage.getAssetPaths'
,
...
@@ -1031,7 +1065,7 @@ const AssetAction = (props) => {
...
@@ -1031,7 +1065,7 @@ const AssetAction = (props) => {
<Table
<Table
className='mt-2'
className='mt-2'
loading={loadingMetadataColumnList}
loading={loadingMetadataColumnList}
columns={
columns
}
columns={
permissionId?columns:columns.filter(item => item.dataIndex !== 'permission')
}
rowKey='_id'
rowKey='_id'
dataSource={tableData||[]}
dataSource={tableData||[]}
pagination={{
pagination={{
...
...
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