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
743c10f0
Commit
743c10f0
authored
Jan 25, 2024
by
zhaochengxiang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
资产收藏和取消收藏
parent
347c7970
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
133 additions
and
26 deletions
+133
-26
assetmanage.js
src/model/assetmanage.js
+8
-0
dataassetmanager.js
src/service/dataassetmanager.js
+9
-1
AssetAction.jsx
src/view/Manage/AssetManage/Component/AssetAction.jsx
+26
-25
subscribe-button.jsx
src/view/Manage/AssetManage/Component/subscribe-button.jsx
+90
-0
No files found.
src/model/assetmanage.js
View file @
743c10f0
...
@@ -383,6 +383,14 @@ export function* addSubscribe(payload) {
...
@@ -383,6 +383,14 @@ export function* addSubscribe(payload) {
return
yield
call
(
service
.
addSubscribe
,
payload
);
return
yield
call
(
service
.
addSubscribe
,
payload
);
}
}
export
function
*
deleteSubsribe
(
payload
)
{
return
yield
call
(
service
.
deleteSubsribe
,
payload
);
}
export
function
*
subsribeDataList
(
payload
)
{
return
yield
call
(
service
.
subsribeDataList
,
payload
);
}
export
function
*
startProcess
(
payload
)
{
export
function
*
startProcess
(
payload
)
{
return
yield
call
(
service
.
startProcess
,
payload
);
return
yield
call
(
service
.
startProcess
,
payload
);
}
}
...
...
src/service/dataassetmanager.js
View file @
743c10f0
import
{
PostJSON
,
GetJSON
,
PostFile
,
Post
,
Get
,
callFetchRawByFormData
}
from
"../util/axios"
import
{
PostJSON
,
GetJSON
,
PostFile
,
Post
,
Get
,
callFetchRawByFormData
,
Delete
}
from
"../util/axios"
export
function
importElement
(
payload
)
{
export
function
importElement
(
payload
)
{
return
PostFile
(
"/dataassetmanager/elementApi/import"
,
payload
);
return
PostFile
(
"/dataassetmanager/elementApi/import"
,
payload
);
...
@@ -365,6 +365,14 @@ export function addSubscribe(payload) {
...
@@ -365,6 +365,14 @@ export function addSubscribe(payload) {
return
PostJSON
(
"/informationmanagement/subscribe/add"
,
payload
)
return
PostJSON
(
"/informationmanagement/subscribe/add"
,
payload
)
}
}
export
function
deleteSubsribe
(
payload
)
{
return
Delete
(
"/informationmanagement/subscribe/dels"
,
payload
)
}
export
function
subsribeDataList
(
payload
)
{
return
GetJSON
(
"/informationmanagement/subscribe/subscribeDataList"
,
payload
)
}
export
function
startProcess
(
payload
)
{
export
function
startProcess
(
payload
)
{
return
PostJSON
(
"/dataassetmanager/flowApi/startProcess"
,
payload
)
return
PostJSON
(
"/dataassetmanager/flowApi/startProcess"
,
payload
)
}
}
...
...
src/view/Manage/AssetManage/Component/AssetAction.jsx
View file @
743c10f0
...
@@ -15,6 +15,7 @@ import { AnchorId, AnchorDirId, AssetManageReference, AssetRecycleReference, Ass
...
@@ -15,6 +15,7 @@ import { AnchorId, AnchorDirId, AssetManageReference, AssetRecycleReference, Ass
import
IndexCode
from
'./IndexCode'
;
import
IndexCode
from
'./IndexCode'
;
import
Upload
from
'./Upload'
;
import
Upload
from
'./Upload'
;
import
Table
from
'../../ResizeableTable'
;
import
Table
from
'../../ResizeableTable'
;
import
SubsribeButton
from
'./subscribe-button'
;
import
{
CancelSvg
,
EditSvg
,
SaveSvg
,
FullScreenSvg
,
CancelFullScreenSvg
}
from
'./AssetSvg'
;
import
{
CancelSvg
,
EditSvg
,
SaveSvg
,
FullScreenSvg
,
CancelFullScreenSvg
}
from
'./AssetSvg'
;
import
SelectUser
from
'../../Model/Component/SelectUsers'
;
import
SelectUser
from
'../../Model/Component/SelectUsers'
;
...
@@ -1150,30 +1151,30 @@ const AssetAction = (props) => {
...
@@ -1150,30 +1151,30 @@ const AssetAction = (props) => {
}
}
}
}
const onSubsrcibeClick = () => {
//
const onSubsrcibeClick = () => {
modal.confirm({
//
modal.confirm({
title: '提示',
//
title: '提示',
content: '是否确认收藏该资产目录?',
//
content: '是否确认收藏该资产目录?',
onOk: () => {
//
onOk: () => {
dispatch({
//
dispatch({
type: 'assetmanage.addSubscribe',
//
type: 'assetmanage.addSubscribe',
payload: {
//
payload: {
params: {
//
params: {
appType: 'dataAssetManager',
//
appType: 'dataAssetManager',
subType: assets?.templateType,
//
subType: assets?.templateType,
resourceIds: id,
//
resourceIds: id,
env: app?.env?.domainId||catalog||LocalStorage.get('assetsEnv'),
//
env: app?.env?.domainId||catalog||LocalStorage.get('assetsEnv'),
}
//
}
},
//
},
callback: () => {
//
callback: () => {
showMessage("success","收藏成功");
//
showMessage("success","收藏成功");
},
//
},
error: () => {
//
error: () => {
}
//
}
})
//
})
}
//
}
})
//
})
}
//
}
const onValuesChange = (changedValues, allValues) => {
const onValuesChange = (changedValues, allValues) => {
if (changedValues.hasOwnProperty('主题域分组')) {
if (changedValues.hasOwnProperty('主题域分组')) {
...
@@ -1268,7 +1269,7 @@ const AssetAction = (props) => {
...
@@ -1268,7 +1269,7 @@ const AssetAction = (props) => {
}
}
<Button onClick={shareAsset}>分享</Button>
<Button onClick={shareAsset}>分享</Button>
<
Button onClick={onSubsrcibeClick}>收藏</Button
>
<
SubsribeButton id={assets?.id} appType='dataAssetManager' subType={assets?.templateType} env={app?.env?.domainId||catalog||LocalStorage.get('assetsEnv')} /
>
{
{
!isPostAsset(assets?.templateType) && <Dropdown overlay={
!isPostAsset(assets?.templateType) && <Dropdown overlay={
<Menu onClick={({ key })=>{
<Menu onClick={({ key })=>{
...
...
src/view/Manage/AssetManage/Component/subscribe-button.jsx
0 → 100644
View file @
743c10f0
import
React
from
"react"
import
{
Button
,
Spin
}
from
"antd"
import
{
dispatch
}
from
'../../../../model'
import
{
showMessage
}
from
"../../../../util"
const
FC
=
({
id
,
appType
,
subType
,
env
})
=>
{
const
[
loading
,
setLoading
]
=
React
.
useState
(
false
)
const
[
waiting
,
setWaiting
]
=
React
.
useState
(
false
)
const
[
subsribeData
,
setSubsribeData
]
=
React
.
useState
()
React
.
useEffect
(()
=>
{
if
(
id
&&
appType
&&
subType
&&
env
)
{
getSubsribeData
()
}
},
[
id
,
appType
,
env
])
const
title
=
React
.
useMemo
(()
=>
{
return
subsribeData
?
'取消收藏'
:
'收藏'
},
[
subsribeData
])
const
getSubsribeData
=
()
=>
{
setLoading
(
true
)
dispatch
({
type
:
'assetmanage.subsribeDataList'
,
payload
:
{
appType
,
subType
,
env
,
resourceIds
:
id
,
},
callback
:
(
data
)
=>
{
setLoading
(
false
)
setSubsribeData
(
data
?.[
id
])
},
error
:
()
=>
{
setLoading
(
false
)
}
})
}
const
onSubsribeClick
=
()
=>
{
if
(
waiting
||
loading
)
return
setWaiting
(
true
)
if
(
subsribeData
?.
id
)
{
dispatch
({
type
:
'assetmanage.deleteSubsribe'
,
payload
:
{
subscribeIds
:
subsribeData
?.
id
,
},
callback
:
()
=>
{
setWaiting
(
false
)
showMessage
(
"success"
,
"操作成功"
)
getSubsribeData
()
},
error
:
()
=>
{
setWaiting
(
false
)
}
})
}
else
{
dispatch
({
type
:
'assetmanage.addSubscribe'
,
payload
:
{
params
:
{
appType
,
subType
,
resourceIds
:
id
,
env
,
}
},
callback
:
()
=>
{
setWaiting
(
false
)
showMessage
(
"success"
,
"操作成功"
)
getSubsribeData
()
},
error
:
()
=>
{
setWaiting
(
false
)
}
})
}
}
return
(
<
Button
onClick=
{
onSubsribeClick
}
loading=
{
loading
||
waiting
}
>
{
title
}
</
Button
>
)
}
export
default
FC
\ No newline at end of file
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