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
d9d316a2
Commit
d9d316a2
authored
Dec 06, 2023
by
zhaochengxiang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
资产草稿详情
parent
2acef775
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
38 additions
and
70 deletions
+38
-70
constant.js
src/util/constant.js
+3
-2
index.jsx
src/view/Manage/AssetDraft/index.jsx
+7
-9
update.jsx
src/view/Manage/AssetDraft/update.jsx
+0
-33
AssetAction.jsx
src/view/Manage/AssetManage/Component/AssetAction.jsx
+28
-26
No files found.
src/util/constant.js
View file @
d9d316a2
...
@@ -28,4 +28,5 @@ export const AssetManageReference = 'asset-manage';
...
@@ -28,4 +28,5 @@ export const AssetManageReference = 'asset-manage';
export
const
AssetBrowseReference
=
'asset-browse'
;
export
const
AssetBrowseReference
=
'asset-browse'
;
export
const
ResourceBrowseReference
=
'resource-browse'
;
export
const
ResourceBrowseReference
=
'resource-browse'
;
export
const
AssetRecycleReference
=
'asset-recycle'
;
export
const
AssetRecycleReference
=
'asset-recycle'
;
export
const
AssetMountReference
=
'asset-mount'
;
export
const
AssetMountReference
=
'asset-mount'
;
\ No newline at end of file
export
const
AssetDraftReference
=
'asset-draft'
;
\ No newline at end of file
src/view/Manage/AssetDraft/index.jsx
View file @
d9d316a2
...
@@ -8,7 +8,8 @@ import { dispatch } from '../../../model'
...
@@ -8,7 +8,8 @@ import { dispatch } from '../../../model'
import
Table
from
'../ResizeableTable'
import
Table
from
'../ResizeableTable'
import
{
isSzseEnv
,
showMessage
}
from
"../../../util"
import
{
isSzseEnv
,
showMessage
}
from
"../../../util"
import
{
AssetItem
}
from
"../AssetManage/Component/AssetTable"
import
{
AssetItem
}
from
"../AssetManage/Component/AssetTable"
import
UpdateAsset
from
"./update"
import
UpdateAsset
from
"../AssetManage/Component/AssetDetailDrawer"
import
{
AssetDraftReference
}
from
"../../../util/constant"
const
isAdmin
=
false
const
isAdmin
=
false
const
specialCol
=
[
'数据关键用户'
,
'业务数据owner'
,
'it责任人'
,
'创建人'
,
'更新人'
]
const
specialCol
=
[
'数据关键用户'
,
'业务数据owner'
,
'it责任人'
,
'创建人'
,
'更新人'
]
...
@@ -31,8 +32,7 @@ const FC = (props) => {
...
@@ -31,8 +32,7 @@ const FC = (props) => {
const
[
row
,
setRow
]
=
React
.
useState
()
const
[
row
,
setRow
]
=
React
.
useState
()
const
[
updateAssetParams
,
setUpdateAssetParams
]
=
React
.
useState
({
const
[
updateAssetParams
,
setUpdateAssetParams
]
=
React
.
useState
({
visible
:
false
,
visible
:
false
,
action
:
undefined
,
id
:
undefined
,
item
:
undefined
,
})
})
const
[
modal
,
contextHolder
]
=
Modal
.
useModal
();
const
[
modal
,
contextHolder
]
=
Modal
.
useModal
();
...
@@ -291,8 +291,7 @@ const FC = (props) => {
...
@@ -291,8 +291,7 @@ const FC = (props) => {
const onEditClick = (record) => {
const onEditClick = (record) => {
setUpdateAssetParams({
setUpdateAssetParams({
visible: true,
visible: true,
action: 'edit',
id: record?.id,
item: record
})
})
}
}
...
@@ -389,8 +388,7 @@ const FC = (props) => {
...
@@ -389,8 +388,7 @@ const FC = (props) => {
setRow(record)
setRow(record)
setUpdateAssetParams({
setUpdateAssetParams({
visible: true,
visible: true,
action: 'detail',
id: record?.id,
item: record
})
})
}
}
}
}
...
@@ -420,11 +418,11 @@ const FC = (props) => {
...
@@ -420,11 +418,11 @@ const FC = (props) => {
</div>
</div>
<UpdateAsset
<UpdateAsset
{...updateAssetParams}
{...updateAssetParams}
reference={AssetDraftReference}
onCancel={() => {
onCancel={() => {
setUpdateAssetParams({
setUpdateAssetParams({
visible: false,
visible: false,
action: undefined,
id: undefined,
item: undefined,
})
})
}}
}}
/>
/>
...
...
src/view/Manage/AssetDraft/update.jsx
deleted
100644 → 0
View file @
2acef775
import
React
from
"react"
import
{
Drawer
}
from
"antd"
const
FC
=
(
props
)
=>
{
const
{
visible
,
item
,
action
,
onCancel
}
=
props
return
(
<
Drawer
visible=
{
visible
}
title=
'资产目录详情'
width=
'80%'
placement=
"right"
closable
destroyOnClose
onClose=
{
()
=>
{
onCancel
?.()
}
}
>
<
Basic
action=
{
action
}
item=
{
item
}
/>
</
Drawer
>
)
}
export
default
FC
const
Basic
=
({
action
,
item
})
=>
{
return
(
<
div
>
basic
</
div
>
)
}
\ No newline at end of file
src/view/Manage/AssetManage/Component/AssetAction.jsx
View file @
d9d316a2
...
@@ -10,7 +10,7 @@ import { highlightSearchContentByTerms, showMessage, paginate } from '../../../.
...
@@ -10,7 +10,7 @@ import { highlightSearchContentByTerms, showMessage, paginate } from '../../../.
import
{
AppContext
,
appId
}
from
'../../../../App'
;
import
{
AppContext
,
appId
}
from
'../../../../App'
;
import
Tag
from
'../../Tag'
;
import
Tag
from
'../../Tag'
;
import
Separate
from
'./Separate'
;
import
Separate
from
'./Separate'
;
import
{
AnchorId
,
AnchorDirId
,
AssetManageReference
,
AssetRecycleReference
}
from
'../../../../util/constant'
;
import
{
AnchorId
,
AnchorDirId
,
AssetManageReference
,
AssetRecycleReference
,
AssetDraftReference
}
from
'../../../../util/constant'
;
import
IndexCode
from
'./IndexCode'
;
import
IndexCode
from
'./IndexCode'
;
import
Upload
from
'./Upload'
;
import
Upload
from
'./Upload'
;
import
Table
from
'../../ResizeableTable'
;
import
Table
from
'../../ResizeableTable'
;
...
@@ -29,7 +29,7 @@ const AssetAction = (props) => {
...
@@ -29,7 +29,7 @@ const AssetAction = (props) => {
const
{
id
,
dirId
,
action
,
terms
,
onChange
,
reference
,
form
,
onMetadataChange
,
onElementsChange
,
readonly
=
false
,
permissionId
}
=
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
:
[]
});
const
[
elements
,
setElements
]
=
useState
([]);
const
[
elements
,
setElements
]
=
useState
([]);
const
[
currentAttribute
,
setCurrentAttribute
]
=
useState
();
const
[
currentAttribute
,
setCurrentAttribute
]
=
useState
();
const
[
metadataId
,
setMetadataId
]
=
useState
(
''
);
const
[
metadataId
,
setMetadataId
]
=
useState
(
''
);
...
@@ -37,7 +37,7 @@ const AssetAction = (props) => {
...
@@ -37,7 +37,7 @@ const AssetAction = (props) => {
const
[
confirmLoading
,
setConfirmLoading
]
=
useState
(
false
);
const
[
confirmLoading
,
setConfirmLoading
]
=
useState
(
false
);
const
[
fullScreen
,
setFullScreen
]
=
useState
(
false
);
const
[
fullScreen
,
setFullScreen
]
=
useState
(
false
);
const
[
assetPaths
,
setAssetPaths
]
=
useState
([]);
const
[
assetPaths
,
setAssetPaths
]
=
useState
([]);
const
{
assets
,
attributes
,
attributesFoldMap
}
=
assetParams
;
const
{
assets
,
attributes
}
=
assetParams
;
const
[
assetTagModalVisible
,
setAssetTagModalVisible
]
=
useState
(
false
);
const
[
assetTagModalVisible
,
setAssetTagModalVisible
]
=
useState
(
false
);
const
[
selectTag
,
setSelectTag
]
=
useState
({});
const
[
selectTag
,
setSelectTag
]
=
useState
({});
const
[
systems
,
setSystems
]
=
useState
([]);
const
[
systems
,
setSystems
]
=
useState
([]);
...
@@ -216,12 +216,14 @@ const AssetAction = (props) => {
...
@@ -216,12 +216,14 @@ const AssetAction = (props) => {
}
else
{
}
else
{
setCurrentAction
(
'detail'
);
setCurrentAction
(
'detail'
);
if
(
(
id
||
''
)
!==
''
)
{
if
(
id
)
{
setPagination
({...
pagination
,
pageNum
:
1
});
setPagination
({...
pagination
,
pageNum
:
1
});
getAssetPaths
();
getAssetPaths
();
checkDataAssetEditable
();
if
(
reference
!==
AssetDraftReference
)
{
getAsset
();
checkDataAssetEditable
();
}
getAsset
();
}
else
{
}
else
{
setMetadataId
(
''
);
setMetadataId
(
''
);
setAssetParams
({...
assetParams
,
...{
assets
:
{},
attributes
:
[]}});
setAssetParams
({...
assetParams
,
...{
assets
:
{},
attributes
:
[]}});
...
@@ -386,13 +388,25 @@ const AssetAction = (props) => {
...
@@ -386,13 +388,25 @@ const AssetAction = (props) => {
const
getAsset
=
()
=>
{
const
getAsset
=
()
=>
{
setLoading
(
true
);
setLoading
(
true
);
let
url
=
'assetmanage.getDataAssetDetail'
;
let
payload
=
{
dataAssetId
:
id
,
dirId
:
dirId
,
checkPermission
:
reference
!==
AssetManageReference
};
if
(
reference
===
AssetDraftReference
)
{
url
=
'assetmanage.getDraftDetail'
;
payload
=
{
params
:
{
draftId
:
id
,
}
};
}
dispatch
({
dispatch
({
type
:
'assetmanage.getDataAssetDetail'
,
type
:
url
,
payload
:
{
payload
,
dataAssetId
:
id
,
dirId
:
dirId
,
checkPermission
:
reference
!==
AssetManageReference
},
callback
:
data
=>
{
callback
:
data
=>
{
setLoading
(
false
);
setLoading
(
false
);
...
@@ -415,21 +429,9 @@ const AssetAction = (props) => {
...
@@ -415,21 +429,9 @@ const AssetAction = (props) => {
setMetadataId
(
data
?.
metadataId
||
''
);
setMetadataId
(
data
?.
metadataId
||
''
);
onMetadataChange
&&
onMetadataChange
(
data
?.
metadataId
||
''
);
onMetadataChange
&&
onMetadataChange
(
data
?.
metadataId
||
''
);
const
_attributes
=
[];
const
_attributes
=
Array
.
from
(
new
Set
((
data
?.
elements
??[]).
map
(
item
=>
item
.
type
)))
(
data
?.
elements
||
[]).
forEach
(
element
=>
{
if
(
_attributes
.
indexOf
(
element
.
type
)
===
-
1
)
{
_attributes
.
push
(
element
.
type
||
''
);
}
})
let
newAttributesFoldMap
=
{...
attributesFoldMap
};
(
_attributes
||
[]).
forEach
(
attribute
=>
{
if
(
newAttributesFoldMap
[
attribute
]
===
undefined
||
newAttributesFoldMap
[
attribute
]
===
null
)
{
newAttributesFoldMap
[
attribute
]
=
true
;
}
})
setAssetParams
({
assets
:
data
,
attributes
:
_attributes
,
attributesFoldMap
:
newAttributesFoldMap
});
setAssetParams
({
assets
:
data
,
attributes
:
_attributes
});
if
((
_attributes
??[]).
length
>
0
)
{
if
((
_attributes
??[]).
length
>
0
)
{
setCurrentAttribute
(
_attributes
[
0
])
setCurrentAttribute
(
_attributes
[
0
])
}
}
...
...
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