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