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
021312e7
Commit
021312e7
authored
Dec 07, 2023
by
zhaochengxiang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
增加权限
parent
84dee46d
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
62 additions
and
20 deletions
+62
-20
assetmanage.js
src/model/assetmanage.js
+12
-0
dataassetmanager.js
src/service/dataassetmanager.js
+12
-0
index.jsx
src/view/Manage/AssetDraft/index.jsx
+15
-5
AssetAction.jsx
src/view/Manage/AssetManage/Component/AssetAction.jsx
+23
-15
No files found.
src/model/assetmanage.js
View file @
021312e7
...
...
@@ -331,6 +331,10 @@ export function* getTemplates() {
return
yield
call
(
service
.
getTemplates
)
}
export
function
*
checkAdmin
()
{
return
yield
call
(
service
.
checkAdmin
)
}
export
function
*
getDrafts
(
payload
)
{
return
yield
call
(
service
.
getDrafts
,
payload
);
}
...
...
@@ -347,6 +351,14 @@ export function* deleteDrafts(payload) {
return
yield
call
(
service
.
deleteDrafts
,
payload
);
}
export
function
*
getDraftAssetPaths
(
payload
)
{
return
yield
call
(
service
.
getDraftAssetPaths
,
payload
);
}
export
function
*
checkDraftEditable
(
payload
)
{
return
yield
call
(
service
.
checkDraftEditable
,
payload
);
}
export
function
*
publishDrafts
(
payload
)
{
return
yield
call
(
service
.
publishDrafts
,
payload
);
}
...
...
src/service/dataassetmanager.js
View file @
021312e7
...
...
@@ -316,6 +316,10 @@ export function getTemplates() {
return
GetJSON
(
"/dataassetmanager/elementTemplateApi/listSupportTemplates"
)
}
export
function
checkAdmin
()
{
return
PostJSON
(
"/dataassetmanager/dataAssetApi/checkCurrentUserIsAdmin"
)
}
export
function
getDrafts
(
payload
)
{
return
GetJSON
(
"/dataassetmanager/draftApi/listDataAssetsByPage"
,
payload
)
}
...
...
@@ -332,6 +336,14 @@ export function deleteDrafts(payload) {
return
PostJSON
(
"/dataassetmanager/draftApi/deleteDrafts"
,
payload
)
}
export
function
getDraftAssetPaths
(
payload
)
{
return
GetJSON
(
"/dataassetmanager/draftApi/getMultiPath"
,
payload
)
}
export
function
checkDraftEditable
(
payload
)
{
return
PostJSON
(
"/dataassetmanager/draftApi/checkDraftEditable"
,
payload
)
}
export
function
publishDrafts
(
payload
)
{
return
PostJSON
(
"/dataassetmanager/draftApi/publishDrafts"
,
payload
)
}
...
...
src/view/Manage/AssetDraft/index.jsx
View file @
021312e7
...
...
@@ -11,7 +11,6 @@ import { AssetItem } from "../AssetManage/Component/AssetTable"
import
UpdateAsset
from
"../AssetManage/Component/AssetDetailDrawer"
import
{
AssetDraftReference
}
from
"../../../util/constant"
const
isAdmin
=
false
const
specialCol
=
[
'数据关键用户'
,
'业务数据owner'
,
'it责任人'
,
'创建人'
,
'更新人'
]
const
FC
=
(
props
)
=>
{
...
...
@@ -30,6 +29,7 @@ const FC = (props) => {
const
[
data
,
setData
]
=
React
.
useState
()
const
[
users
,
setUsers
]
=
React
.
useState
()
const
[
row
,
setRow
]
=
React
.
useState
()
const
[
isAdmin
,
setAdmin
]
=
React
.
useState
()
const
[
updateAssetParams
,
setUpdateAssetParams
]
=
React
.
useState
({
visible
:
false
,
id
:
undefined
,
...
...
@@ -39,22 +39,23 @@ const FC = (props) => {
const
[
modal
,
contextHolder
]
=
Modal
.
useModal
();
React
.
useEffect
(()
=>
{
getAdmin
()
getUsers
()
getTemplates
()
},
[])
React
.
useEffect
(()
=>
{
if
(
currentTemplateValue
)
{
if
(
currentTemplateValue
&&
isAdmin
!==
undefined
)
{
getElements
()
getFilterElements
()
}
},
[
currentTemplateValue
])
},
[
currentTemplateValue
,
isAdmin
])
useDebounceEffect
(()
=>
{
if
(
currentTemplateValue
)
{
if
(
currentTemplateValue
&&
isAdmin
!==
undefined
)
{
getDrafts
()
}
},
[
currentTemplateValue
,
keyword
,
currentElementValue
,
pagination
],
{
wait
:
300
})
},
[
currentTemplateValue
,
keyword
,
currentElementValue
,
pagination
,
isAdmin
],
{
wait
:
300
})
const
[
columns
,
tableData
,
total
]
=
React
.
useMemo
(()
=>
{
const
[
newColumns
,
newTableData
]
=
[[],
[]]
...
...
@@ -132,6 +133,15 @@ const FC = (props) => {
return
[
newColumns
,
newTableData
,
data
?.
total
??
0
]
},
[
filterElements
,
data
,
loadingFilterElements
,
users
])
const
getAdmin
=
()
=>
{
dispatch
({
type
:
'assetmanage.checkAdmin'
,
callback
:
(
data
)
=>
{
setAdmin
(
data
)
}
})
}
const
getUsers
=
()
=>
{
dispatch
({
type
:
'pds.getOwners'
,
...
...
src/view/Manage/AssetManage/Component/AssetAction.jsx
View file @
021312e7
...
...
@@ -244,12 +244,7 @@ const AssetAction = (props) => {
if
(
id
)
{
setPagination
({...
pagination
,
pageNum
:
1
});
getAssetPaths
();
if
(
reference
!==
AssetDraftReference
)
{
checkDataAssetEditable
();
}
else
{
setEdit
(
true
);
}
checkDataAssetEditable
();
getAsset
();
}
else
{
...
...
@@ -329,11 +324,18 @@ const AssetAction = (props) => {
}
const
getAssetPaths
=
()
=>
{
let
payload
=
{
dataAssetId
:
id
,
}
if
(
reference
===
AssetDraftReference
)
{
payload
=
{
draftId
:
id
,
}
}
dispatch
({
type
:
'assetmanage.getAssetPaths'
,
payload
:
{
dataAssetId
:
id
,
},
type
:
(
reference
===
AssetDraftReference
)?
'assetmanage.getDraftAssetPaths'
:
'assetmanage.getAssetPaths'
,
payload
,
callback
:
data
=>
{
setAssetPaths
(
data
||
[]);
}
...
...
@@ -401,15 +403,21 @@ const AssetAction = (props) => {
}
const
checkDataAssetEditable
=
()
=>
{
let
params
=
{
dataAssetId
:
id
,
}
if
(
reference
===
AssetDraftReference
)
{
params
=
{
draftId
:
id
,
}
}
dispatch
({
type
:
'assetmanage.checkDataAssetEditable'
,
type
:
(
reference
===
AssetDraftReference
)?
'assetmanage.checkDraftEditable'
:
'assetmanage.checkDataAssetEditable'
,
payload
:
{
params
:
{
dataAssetId
:
id
,
}
params
},
callback
:
value
=>
{
setEdit
(
value
===
'true'
?
true
:
false
);
setEdit
(
value
);
}
})
}
...
...
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