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
24c17156
Commit
24c17156
authored
Jun 03, 2024
by
zhaochengxiang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
草稿详情 编辑
parent
935b6557
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
32 additions
and
64 deletions
+32
-64
draft.jsx
src/view/Manage/AssetDraft/draft.jsx
+17
-1
index.less
src/view/Manage/AssetDraft/index.less
+2
-1
AssetAction.jsx
src/view/Manage/AssetManage/Component/AssetAction.jsx
+10
-32
AssetDetailDrawer.jsx
src/view/Manage/AssetManage/Component/AssetDetailDrawer.jsx
+2
-2
asset-relation-assets.jsx
...ew/Manage/AssetManage/Component/asset-relation-assets.jsx
+1
-28
No files found.
src/view/Manage/AssetDraft/draft.jsx
View file @
24c17156
...
@@ -49,8 +49,10 @@ const FC = (props) => {
...
@@ -49,8 +49,10 @@ const FC = (props) => {
})
})
const
[
updateAssetParams
,
setUpdateAssetParams
]
=
React
.
useState
({
const
[
updateAssetParams
,
setUpdateAssetParams
]
=
React
.
useState
({
visible
:
false
,
visible
:
false
,
action
:
undefined
,
id
:
undefined
,
id
:
undefined
,
dirId
:
undefined
,
dirId
:
undefined
,
readonly
:
false
,
})
})
const
[
startProcessParams
,
setStartProcessParams
]
=
React
.
useState
({
const
[
startProcessParams
,
setStartProcessParams
]
=
React
.
useState
({
visible
:
false
,
visible
:
false
,
...
@@ -395,8 +397,20 @@ const FC = (props) => {
...
@@ -395,8 +397,20 @@ const FC = (props) => {
const onRightDetailClick = () => {
const onRightDetailClick = () => {
setUpdateAssetParams({
setUpdateAssetParams({
visible: true,
visible: true,
action: 'detail',
id: rightRow?.id,
id: rightRow?.id,
dirId: rightRow?.dirId,
dirId: rightRow?.dirId,
readonly: true,
})
}
const onRightEditClick = () => {
setUpdateAssetParams({
visible: true,
action: 'edit',
id: rightRow?.id,
dirId: rightRow?.dirId,
readonly: false,
})
})
}
}
...
@@ -404,7 +418,7 @@ const FC = (props) => {
...
@@ -404,7 +418,7 @@ const FC = (props) => {
if (key === '查看') {
if (key === '查看') {
onRightDetailClick()
onRightDetailClick()
} else if (key === '编辑') {
} else if (key === '编辑') {
onRightEditClick()
} else if (key === '删除') {
} else if (key === '删除') {
} else if (key === '分配') {
} else if (key === '分配') {
...
@@ -543,8 +557,10 @@ const FC = (props) => {
...
@@ -543,8 +557,10 @@ const FC = (props) => {
onCancel={(refresh) => {
onCancel={(refresh) => {
setUpdateAssetParams({
setUpdateAssetParams({
visible: false,
visible: false,
action: undefined,
id: undefined,
id: undefined,
dirId: undefined,
dirId: undefined,
readonly: false,
})
})
refresh && getDrafts()
refresh && getDrafts()
...
...
src/view/Manage/AssetDraft/index.less
View file @
24c17156
...
@@ -4,6 +4,6 @@
...
@@ -4,6 +4,6 @@
overflow: auto;
overflow: auto;
.yy-tabs-nav {
.yy-tabs-nav {
margin: 0;
margin: 0
!important
;
}
}
}
}
\ No newline at end of file
src/view/Manage/AssetManage/Component/AssetAction.jsx
View file @
24c17156
...
@@ -54,7 +54,6 @@ const AssetAction = React.forwardRef(function (props, ref) {
...
@@ -54,7 +54,6 @@ const AssetAction = React.forwardRef(function (props, ref) {
const
[
loadingEditPermission
,
setLoadingEditPermission
]
=
useState
(
false
);
const
[
loadingEditPermission
,
setLoadingEditPermission
]
=
useState
(
false
);
const
[
canEdit
,
setEdit
]
=
useState
(
false
);
const
[
canEdit
,
setEdit
]
=
useState
(
false
);
const
[
metadata
,
setMetadata
]
=
useState
(
undefined
);
const
[
metadata
,
setMetadata
]
=
useState
(
undefined
);
const
[
loadingMetadataColumnList
,
setLoadingMetadataColumnList
]
=
useState
(
false
);
const
[
metadataColumnList
,
setMetadataColumnList
]
=
useState
(
undefined
);
const
[
metadataColumnList
,
setMetadataColumnList
]
=
useState
(
undefined
);
const
[
modifyMetadataColumnList
,
setModifyMetadataColumnList
]
=
useState
();
const
[
modifyMetadataColumnList
,
setModifyMetadataColumnList
]
=
useState
();
const
[
pagination
,
setPagination
]
=
useState
({
pageNum
:
1
,
pageSize
:
20
});
const
[
pagination
,
setPagination
]
=
useState
({
pageNum
:
1
,
pageSize
:
20
});
...
@@ -64,6 +63,7 @@ const AssetAction = React.forwardRef(function (props, ref) {
...
@@ -64,6 +63,7 @@ const AssetAction = React.forwardRef(function (props, ref) {
const
[
keyword
,
setKeyword
]
=
useState
(
''
);
const
[
keyword
,
setKeyword
]
=
useState
(
''
);
const
[
publishedAssetPaths
,
setPublishedAssetPaths
]
=
useState
([]);
const
[
publishedAssetPaths
,
setPublishedAssetPaths
]
=
useState
([]);
const
[
publishedAsset
,
setPublishedAsset
]
=
useState
();
const
[
publishedAsset
,
setPublishedAsset
]
=
useState
();
const
[
isStructured
,
setStructured
]
=
useState
();
const
[
loadingSaveAsDraft
,
setLoadingSaveAsDraft
]
=
React
.
useState
(
false
)
const
[
loadingSaveAsDraft
,
setLoadingSaveAsDraft
]
=
React
.
useState
(
false
)
const
[
needSaveAsDraft
,
setNeedSaveAsDraft
]
=
React
.
useState
()
const
[
needSaveAsDraft
,
setNeedSaveAsDraft
]
=
React
.
useState
()
...
@@ -231,7 +231,6 @@ const AssetAction = React.forwardRef(function (props, ref) {
...
@@ -231,7 +231,6 @@ const AssetAction = React.forwardRef(function (props, ref) {
if
(
action
===
'add'
)
{
if
(
action
===
'add'
)
{
getElements
();
getElements
();
}
else
{
}
else
{
setCurrentAction
(
'detail'
);
if
(
id
)
{
if
(
id
)
{
setPagination
({...
pagination
,
pageNum
:
1
});
setPagination
({...
pagination
,
pageNum
:
1
});
getAssetPaths
();
getAssetPaths
();
...
@@ -254,12 +253,6 @@ const AssetAction = React.forwardRef(function (props, ref) {
...
@@ -254,12 +253,6 @@ const AssetAction = React.forwardRef(function (props, ref) {
},
[
assets
])
},
[
assets
])
useEffect
(()
=>
{
useEffect
(()
=>
{
if
(
assets
)
{
getMetadataAttributes
()
}
},
[
assets
])
useEffect
(()
=>
{
if
(
permissionId
)
{
if
(
permissionId
)
{
getPermission
();
getPermission
();
}
}
...
@@ -286,10 +279,17 @@ const AssetAction = React.forwardRef(function (props, ref) {
...
@@ -286,10 +279,17 @@ const AssetAction = React.forwardRef(function (props, ref) {
return
[];
return
[];
},
[
currentDomainGroup
,
currentBussinessDomain
,
treeDataMap
])
},
[
currentDomainGroup
,
currentBussinessDomain
,
treeDataMap
])
const
isStructured
=
useMemo
(()
=>
{
useEffect
(()
=>
{
return
template
?.
structured
||
assets
?.
structured
setStructured
(
template
?.
structured
||
assets
?.
structured
)
},
[
assets
,
template
])
},
[
assets
,
template
])
useEffect
(()
=>
{
if
(
assets
)
{
setMetadataColumnList
(
isStructured
?
assets
.
columns
:
assets
.
businessColumns
)
setModifyMetadataColumnList
(
isStructured
?
assets
.
columns
:
assets
.
businessColumns
)
}
},
[
assets
,
isStructured
])
const
cols
=
useMemo
(()
=>
{
const
cols
=
useMemo
(()
=>
{
let
newCols
=
[]
let
newCols
=
[]
...
@@ -550,26 +550,6 @@ const AssetAction = React.forwardRef(function (props, ref) {
...
@@ -550,26 +550,6 @@ const AssetAction = React.forwardRef(function (props, ref) {
})
})
}
}
const
getMetadataAttributes
=
()
=>
{
if
(
assets
?.
id
)
{
setLoadingMetadataColumnList
(
true
);
dispatch
({
type
:
isStructured
?
'assetmanage.getColumns'
:
'assetmanage.getBusinessColumns'
,
payload
:
{
dataAssetId
:
assets
?.
id
},
callback
:
data
=>
{
setLoadingMetadataColumnList
(
false
);
setMetadataColumnList
(
data
);
setModifyMetadataColumnList
(
data
);
},
error
:
()
=>
{
setLoadingMetadataColumnList
(
false
);
}
});
}
}
const
onMetadataColumnEditableItemChange
=
(
val
,
dataIndex
,
index
)
=>
{
const
onMetadataColumnEditableItemChange
=
(
val
,
dataIndex
,
index
)
=>
{
const
_index
=
(
pageNum
-
1
)
*
pageSize
+
index
;
const
_index
=
(
pageNum
-
1
)
*
pageSize
+
index
;
setModifyMetadataColumnList
(
setModifyMetadataColumnList
(
...
@@ -949,7 +929,6 @@ const AssetAction = React.forwardRef(function (props, ref) {
...
@@ -949,7 +929,6 @@ const AssetAction = React.forwardRef(function (props, ref) {
{
{
isStructured ? <Table
isStructured ? <Table
className='mt-3'
className='mt-3'
loading={loadingMetadataColumnList}
columns={cols??[]}
columns={cols??[]}
rowKey='_id'
rowKey='_id'
dataSource={tableData||[]}
dataSource={tableData||[]}
...
@@ -990,7 +969,6 @@ const AssetAction = React.forwardRef(function (props, ref) {
...
@@ -990,7 +969,6 @@ const AssetAction = React.forwardRef(function (props, ref) {
<Form form={columnForm}>
<Form form={columnForm}>
<Table
<Table
className='mt-3'
className='mt-3'
loading={loadingMetadataColumnList}
columns={cols??[]}
columns={cols??[]}
rowKey='_id'
rowKey='_id'
dataSource={tableData||[]}
dataSource={tableData||[]}
...
...
src/view/Manage/AssetManage/Component/AssetDetailDrawer.jsx
View file @
24c17156
...
@@ -6,7 +6,7 @@ import { AssetDraftReference } from '../../../../util/constant';
...
@@ -6,7 +6,7 @@ import { AssetDraftReference } from '../../../../util/constant';
import
{
dispatch
}
from
'../../../../model'
;
import
{
dispatch
}
from
'../../../../model'
;
const
AssetDetailDrawer
=
(
props
)
=>
{
const
AssetDetailDrawer
=
(
props
)
=>
{
const
{
onCancel
,
visible
,
id
,
dirId
,
reference
,
readonly
=
false
}
=
props
;
const
{
onCancel
,
visible
,
id
,
dirId
,
action
=
'detail'
,
reference
,
readonly
=
false
}
=
props
;
const
[
animated
,
setAnimated
]
=
React
.
useState
(
true
)
const
[
animated
,
setAnimated
]
=
React
.
useState
(
true
)
const
[
draftAsset
,
setDraftAsset
]
=
React
.
useState
()
const
[
draftAsset
,
setDraftAsset
]
=
React
.
useState
()
...
@@ -57,7 +57,7 @@ const AssetDetailDrawer = (props) => {
...
@@ -57,7 +57,7 @@ const AssetDetailDrawer = (props) => {
}
}
}
}
>
>
{
{
visible
&&
!
animated
&&
<
AssetAction
reference=
{
reference
}
id=
{
id
}
dirId=
{
dirId
}
action=
'detail'
readonly=
{
readonly
}
onChange=
{
()
=>
{
visible
&&
!
animated
&&
<
AssetAction
reference=
{
reference
}
id=
{
id
}
dirId=
{
dirId
}
action=
{
action
}
readonly=
{
readonly
}
onChange=
{
()
=>
{
onCancel
?.(
true
);
onCancel
?.(
true
);
}
}
/>
}
}
/>
}
}
...
...
src/view/Manage/AssetManage/Component/asset-relation-assets.jsx
View file @
24c17156
...
@@ -15,7 +15,6 @@ const FC = React.forwardRef(function ({ item, reference, action, onChange }, ref
...
@@ -15,7 +15,6 @@ const FC = React.forwardRef(function ({ item, reference, action, onChange }, ref
pageNum
:
1
,
pageNum
:
1
,
pageSize
:
20
,
pageSize
:
20
,
})
})
const
[
loadingAssets
,
setLoadingAssets
]
=
React
.
useState
(
false
)
const
[
assets
,
setAssets
]
=
React
.
useState
()
const
[
assets
,
setAssets
]
=
React
.
useState
()
const
[
selectedRows
,
setSelectedRows
]
=
React
.
useState
()
const
[
selectedRows
,
setSelectedRows
]
=
React
.
useState
()
const
[
selectResourceParams
,
setSelectResourceParams
]
=
React
.
useState
({
const
[
selectResourceParams
,
setSelectResourceParams
]
=
React
.
useState
({
...
@@ -41,9 +40,7 @@ const FC = React.forwardRef(function ({ item, reference, action, onChange }, ref
...
@@ -41,9 +40,7 @@ const FC = React.forwardRef(function ({ item, reference, action, onChange }, ref
},
[
assets
])
},
[
assets
])
React
.
useEffect
(()
=>
{
React
.
useEffect
(()
=>
{
if
(
item
?.
id
)
{
setAssets
(
item
?.
businessRelations
)
getRelatedAssets
()
}
},
[
item
])
},
[
item
])
const
[
tableData
,
total
]
=
React
.
useMemo
(()
=>
{
const
[
tableData
,
total
]
=
React
.
useMemo
(()
=>
{
...
@@ -96,29 +93,6 @@ const FC = React.forwardRef(function ({ item, reference, action, onChange }, ref
...
@@ -96,29 +93,6 @@ const FC = React.forwardRef(function ({ item, reference, action, onChange }, ref
}
}
]
]
const
getRelatedAssets
=
()
=>
{
setLoadingAssets
(
true
)
let
url
=
(
reference
===
AssetDraftReference
)?
'assetmanage.getDraftRelatedAssets'
:
'assetmanage.getRelatedAssets'
let
params
=
(
reference
===
AssetDraftReference
)?{
draftId
:
item
?.
id
}:{
dataAssetId
:
item
?.
id
}
dispatch
({
type
:
url
,
payload
:
params
,
callback
:
(
data
)
=>
{
setLoadingAssets
(
false
)
setAssets
(
data
)
},
error
:
()
=>
{
setLoadingAssets
(
false
)
}
})
}
const
onEditClick
=
()
=>
{
const
onEditClick
=
()
=>
{
setSelectResourceParams
({
setSelectResourceParams
({
visible
:
true
,
visible
:
true
,
...
@@ -173,7 +147,6 @@ const FC = React.forwardRef(function ({ item, reference, action, onChange }, ref
...
@@ -173,7 +147,6 @@ const FC = React.forwardRef(function ({ item, reference, action, onChange }, ref
<
Table
<
Table
extraColWidth=
{
32
}
extraColWidth=
{
32
}
rowKey=
'relatedDataAssetId'
rowKey=
'relatedDataAssetId'
loading=
{
loadingAssets
}
columns=
{
assetCols
}
columns=
{
assetCols
}
dataSource=
{
tableData
??[]
}
dataSource=
{
tableData
??[]
}
pagination=
{
false
}
pagination=
{
false
}
...
...
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