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
83c55773
Commit
83c55773
authored
Oct 27, 2023
by
zhaochengxiang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
新增为资产
parent
c1a1d299
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
345 additions
and
147 deletions
+345
-147
assetmanage.js
src/model/assetmanage.js
+16
-0
dataassetmanager.js
src/service/dataassetmanager.js
+16
-0
MetadataInfo.jsx
src/view/Manage/AssetManage/Component/MetadataInfo.jsx
+2
-2
add-resources.jsx
src/view/Manage/AssetManage/add-resources.jsx
+23
-17
asset-item.jsx
src/view/Manage/AssetManage/asset-item.jsx
+127
-0
table.jsx
src/view/Manage/AssetManage/table.jsx
+11
-42
add-to-asset.jsx
src/view/Manage/AssetResourceManage/add-to-asset.jsx
+147
-81
table.jsx
src/view/Manage/AssetResourceManage/table.jsx
+3
-5
No files found.
src/model/assetmanage.js
View file @
83c55773
...
...
@@ -232,6 +232,10 @@ export function* getAssetPaths(payload) {
return
yield
call
(
service
.
getAssetPaths
,
payload
);
}
export
function
*
getMetadataItems
(
payload
)
{
return
yield
call
(
service
.
getMetadataItems
,
payload
);
}
export
function
*
getResourceRelations
(
payload
)
{
return
yield
call
(
service
.
getResourceRelations
,
payload
);
}
...
...
@@ -324,6 +328,18 @@ export function* addOrUpdateResource(payload) {
return
yield
call
(
service
.
addOrUpdateResource
,
payload
)
}
export
function
*
resourceAddAsAsset
(
payload
)
{
return
yield
call
(
service
.
resourceAddAsAsset
,
payload
)
}
export
function
*
resourceFillElementValueBeforeAddAsAsset
(
payload
)
{
return
yield
call
(
service
.
resourceFillElementValueBeforeAddAsAsset
,
payload
)
}
export
function
*
resourceCombineDataAsset
(
payload
)
{
return
yield
call
(
service
.
resourceCombineDataAsset
,
payload
)
}
export
function
*
getTasks
(
payload
)
{
return
yield
call
(
service
.
getTasks
,
payload
)
}
...
...
src/service/dataassetmanager.js
View file @
83c55773
...
...
@@ -120,6 +120,10 @@ export function getAssetPaths(payload) {
return
GetJSON
(
"/dataassetmanager/dataAssetApi/getMultiPath"
,
payload
);
}
export
function
getMetadataItems
(
payload
)
{
return
PostJSON
(
"/dataassetmanager/dataAssetApi/getMetadataItems"
,
payload
);
}
export
function
addOrUpdateDirectory
(
payload
)
{
return
PostJSON
(
"/dataassetmanager/directoryApi/addOrUpdateDirectory"
,
payload
);
}
...
...
@@ -316,6 +320,18 @@ export function getPreviewRangeByDirId(payload) {
return
PostJSON
(
"/dataassetmanager/resourceApi/addResource"
,
payload
);
}
export
function
resourceAddAsAsset
(
payload
)
{
return
PostJSON
(
"/dataassetmanager/resourceApi/addAsAsset"
,
payload
);
}
export
function
resourceFillElementValueBeforeAddAsAsset
(
payload
)
{
return
GetJSON
(
"/dataassetmanager/resourceApi/fillElementValueBeforeAddAsAsset"
,
payload
);
}
export
function
resourceCombineDataAsset
(
payload
)
{
return
PostJSON
(
"/dataassetmanager/resourceApi/combineExistDataAsset"
,
payload
);
}
export
function
getTasks
(
payload
)
{
return
GetJSON
(
"/dataassetmanager/resource/taskApi/listTasksByPage"
,
payload
)
}
...
...
src/view/Manage/AssetManage/Component/MetadataInfo.jsx
View file @
83c55773
...
...
@@ -72,11 +72,11 @@ const ResourceItem = ({ data, config, terms }) => {
const
AssetItem
=
({
data
,
config
,
terms
})
=>
{
const
app
=
React
.
useContext
(
AppContext
)
return
(
<
div
className=
'flex'
>
<
div
className=
'flex'
style=
{
{
alignItems
:
'center'
}
}
>
{
(
typeof
data
===
'string'
)
?
<
span
style=
{
{
marginRight
:
5
}
}
>
{
highlightSearchContentByTerms
(
data
,
terms
)
}
</
span
>
:
(
IsArr
(
data
)
?
<
div
className=
'flex'
style=
{
{
flexDirection
:
'column'
}
}
>
</
span
>
:
(
IsArr
(
data
)
?
<
div
className=
'flex'
style=
{
{
flexDirection
:
'column'
,
lineHeight
:
'32px'
}
}
>
{
(
data
??[]).
map
((
item
,
index
)
=>
<
span
key=
{
index
}
>
<
Tooltip
...
...
src/view/Manage/AssetManage/add-resources.jsx
View file @
83c55773
...
...
@@ -13,7 +13,7 @@ import { MetadataColumn } from "../AssetResourceManage/table"
import
'./add-resources.less'
const
FC
=
(
props
)
=>
{
const
{
visible
,
item
,
onCancel
}
=
props
const
{
visible
,
item
,
onCancel
,
onOk
}
=
props
const
[
waiting
,
setWaiting
]
=
React
.
useState
(
false
)
const
basicRef
=
React
.
useRef
()
...
...
@@ -30,23 +30,29 @@ const FC = (props) => {
return
}
setWaiting
(
true
)
dispatch
({
type
:
'assetmanage.dataAssetAddResources'
,
payload
:
{
params
:
{
dataAssetId
:
item
?.
id
,
resourceIds
:
(
selectedRows
??[]).
map
(
item
=>
item
.
id
).
toString
()
onOk
?.(
selectedRows
)
if
(
item
)
{
setWaiting
(
true
)
dispatch
({
type
:
'assetmanage.dataAssetAddResources'
,
payload
:
{
params
:
{
dataAssetId
:
item
?.
id
,
resourceIds
:
(
selectedRows
??[]).
map
(
item
=>
item
.
id
).
toString
()
}
},
callback
:
data
=>
{
setWaiting
(
false
)
close
(
true
)
},
error
:
()
=>
{
setWaiting
(
false
)
}
},
callback
:
data
=>
{
setWaiting
(
false
)
close
(
true
)
},
error
:
()
=>
{
setWaiting
(
false
)
}
})
})
}
else
{
close
()
}
}
const
footer
=
React
.
useMemo
(()
=>
{
...
...
src/view/Manage/AssetManage/asset-item.jsx
0 → 100644
View file @
83c55773
import
React
from
'react'
import
{
Button
,
Tooltip
}
from
'antd'
import
{
AppContext
}
from
'../../../App'
import
{
highlightSearchContentByTerms
,
IsArr
}
from
'../../../util'
import
{
MetadataColumnTooltipTitle
}
from
'../AssetResourceManage/table'
import
AddResources
from
'./add-resources'
import
{
dispatch
}
from
'../../../model'
const
FC
=
({
value
,
onChange
,
readonly
=
true
,
terms
=
[]
})
=>
{
const
[
decodeData
,
setDecodeData
]
=
React
.
useState
()
const
[
addResourcesParams
,
setAddResourcesParams
]
=
React
.
useState
({
visible
:
false
,
})
const
app
=
React
.
useContext
(
AppContext
)
React
.
useMemo
(()
=>
{
if
(
value
)
{
try
{
setDecodeData
(
JSON
.
parse
(
value
))
}
catch
(
error
)
{
setDecodeData
(
value
)
}
}
else
{
setDecodeData
()
}
},
[
value
])
const
onAddResourcesOk
=
(
resources
)
=>
{
dispatch
({
type
:
'assetmanage.getMetadataItems'
,
payload
:
{
params
:
{
resourceIds
:
(
resources
??[]).
map
(
item
=>
item
.
id
).
toString
()
}
},
callback
:
data
=>
{
if
(
typeof
decodeData
===
'string'
)
{
onChange
?.(
JSON
.
stringify
(
data
??[]))
}
else
{
const
newData
=
[...
decodeData
??[]]
for
(
const
item
of
data
??[])
{
const
_index
=
(
newData
??[]).
findIndex
(
_item
=>
item
.
metadataId
===
_item
.
metadataId
)
if
(
_index
===
-
1
)
{
newData
.
push
(
item
)
}
}
onChange
?.(
JSON
.
stringify
(
newData
))
}
},
})
}
return
(
<
div
>
{
!
readonly
&&
<
Button
onClick=
{
()
=>
{
setAddResourcesParams
({
visible
:
true
})
}
}
>
添加资源
</
Button
>
}
{
(
typeof
decodeData
===
'string'
)
&&
<
div
className=
'flex'
style=
{
{
lineHeight
:
'32px'
,
alignItems
:
'center'
}
}
>
<
span
style=
{
{
marginRight
:
5
}
}
>
{
highlightSearchContentByTerms
(
decodeData
,
terms
)
}
</
span
>
{
!
readonly
&&
<
Button
size=
'small'
onClick=
{
()
=>
{
onChange
?.()
}
}
>
删除
</
Button
>
}
</
div
>
}
{
IsArr
(
decodeData
)
&&
<
div
>
{
//资源可能没有资源项
(
decodeData
??[]).
filter
(
item
=>
item
.
metadataId
).
map
((
item
,
index
)
=>
<
div
key=
{
index
}
className=
'flex'
style=
{
{
lineHeight
:
'32px'
,
alignItems
:
'center'
}
}
>
<
span
>
<
Tooltip
overlayClassName=
'tooltip-common'
title=
{
<
MetadataColumnTooltipTitle
data=
{
[
item
]
}
/>
}
>
<
a
onClick=
{
()
=>
{
app
?.
setGlobalState
?.({
message
:
'data-govern-show-metadata-message'
,
data
:
item
})
}
}
style=
{
{
marginRight
:
5
,
marginTop
:
readonly
?
0
:
5
}
}
>
{
highlightSearchContentByTerms
(
item
.
enName
,
terms
)
}
</
a
>
</
Tooltip
>
</
span
>
{
!
readonly
&&
<
Button
size=
'small'
onClick=
{
()
=>
{
const
newData
=
[...
decodeData
]
const
_index
=
(
newData
??[]).
findIndex
(
_item
=>
item
.
metadataId
===
_item
.
metadataId
)
if
(
_index
!==
-
1
)
{
newData
.
splice
(
_index
,
1
)
onChange
?.(
JSON
.
stringify
(
newData
))
}
}
}
>
删除
</
Button
>
}
</
div
>
)
}
</
div
>
}
<
AddResources
{
...
addResourcesParams
}
onCancel=
{
(
refresh
)
=>
{
setAddResourcesParams
({
visible
:
false
})
}
}
onOk=
{
onAddResourcesOk
}
/>
</
div
>
)
}
export
default
FC
\ No newline at end of file
src/view/Manage/AssetManage/table.jsx
View file @
83c55773
...
...
@@ -31,7 +31,8 @@ import './Component/AssetTable.less'
import
{
MetadataColumn
}
from
'../AssetResourceManage/table'
const
operationMap
=
{
addResource
:
'添加资源'
,
publish
:
'发布'
,
}
const
FC
=
(
props
)
=>
{
...
...
@@ -210,7 +211,7 @@ const FC = (props) => {
_exportAble
=
(
permissions
??[]).
findIndex
(
item
=>
item
===
'export'
)
!==
-
1
}
else
{
let
[
allowImport
,
allowExport
]
=
[
true
,
true
]
for
(
const
row
of
selectedRows
)
{
for
(
const
row
of
selectedRows
??[]
)
{
const
importIndex
=
(
row
.
allowButtons
??[]).
findIndex
(
item
=>
item
===
'import'
)
const
exportIndex
=
(
row
.
allowButtons
??[]).
findIndex
(
item
=>
item
===
'export'
)
if
(
importIndex
===
-
1
)
{
...
...
@@ -226,7 +227,7 @@ const FC = (props) => {
}
let
[
allowBatchEdit
,
allowChangeDirectory
,
allowDelete
]
=
[
true
,
true
,
true
]
for
(
const
row
of
selectedRows
)
{
for
(
const
row
of
selectedRows
??[]
)
{
const
batchEditIndex
=
(
row
.
allowButtons
??[]).
findIndex
(
item
=>
item
===
'batchEdit'
)
const
changeDirecotoryIndex
=
(
row
.
allowButtons
??[]).
findIndex
(
item
=>
item
===
'changeDir'
)
const
deleteIndex
=
(
row
.
allowButtons
??[]).
findIndex
(
item
=>
item
===
'delete'
)
...
...
@@ -259,45 +260,13 @@ const FC = (props) => {
},
[
rightRow
])
const
notElementCol
=
[
// {
// title: '梳理状态',
// dataIndex: 'sortingStatus',
// ellipsis: true,
// width: 120,
// render: (_, record) => record.resourceExtraAttribute?.sortingStatus
// },
// {
// title: '当前处理人',
// dataIndex: 'currentProcessor',
// ellipsis: true,
// width: 120,
// render: (_, record) => record.resourceExtraAttribute?.currentProcessor
// },
// {
// title: '任务编号',
// dataIndex: 'taskNO',
// ellipsis: true,
// width: 120,
// render: (_, record) => <a onClick={() => {
// window.open(`/center-home/menu/task-manage?id=${record.resourceExtraAttribute?.taskNO}`)
// }}>
// {record.resourceExtraAttribute?.taskNO}
// </a>
// },
// {
// title: '资产状态',
// dataIndex: 'resourceStatus',
// ellipsis: true,
// width: 120,
// render: (_, record) => record.resourceExtraAttribute?.resourceStatus
// },
// {
// title: '是否资产',
// dataIndex: 'transferDataAsset',
// ellipsis: true,
// width: 120,
// render: (_, record) => record.resourceExtraAttribute?.transferDataAsset
// },
{
title
:
'资产状态'
,
dataIndex
:
'publishStatus'
,
ellipsis
:
true
,
width
:
120
,
render
:
(
_
,
record
)
=>
record
.
assetExtraAttribute
?.
publishStatus
},
{
title
:
'标签'
,
dataIndex
:
'tag'
,
...
...
src/view/Manage/AssetResourceManage/add-to-asset.jsx
View file @
83c55773
This diff is collapsed.
Click to expand it.
src/view/Manage/AssetResourceManage/table.jsx
View file @
83c55773
...
...
@@ -37,8 +37,6 @@ const operationMap = {
addAsAsset
:
'新增为资产'
,
distribute
:
'分配'
,
reDistribute
:
'转分配'
,
autoDistribute
:
'自动分配'
,
batchEdit
:
'批量编辑'
,
check
:
'复核'
,
changeToNotAsset
:
'转为非资产'
,
changeToUncombed
:
'转为未梳理'
,
...
...
@@ -249,7 +247,7 @@ const FC = (props) => {
_exportAble
=
(
permissions
??[]).
findIndex
(
item
=>
item
===
'export'
)
!==
-
1
}
else
{
let
[
allowImport
,
allowExport
]
=
[
true
,
true
]
for
(
const
row
of
selectedRows
)
{
for
(
const
row
of
selectedRows
??[]
)
{
const
importIndex
=
(
row
.
allowButtons
??[]).
findIndex
(
item
=>
item
===
'import'
)
const
exportIndex
=
(
row
.
allowButtons
??[]).
findIndex
(
item
=>
item
===
'export'
)
if
(
importIndex
===
-
1
)
{
...
...
@@ -265,7 +263,7 @@ const FC = (props) => {
}
let
[
allowAddAsAsset
,
allowDistribute
,
allowBatchEdit
,
allowCheck
,
allowChangeDirectory
,
allowDelete
]
=
[
true
,
true
,
true
,
true
,
true
,
true
]
for
(
const
row
of
selectedRows
)
{
for
(
const
row
of
selectedRows
??[]
)
{
const
addAsAssetIndex
=
(
row
.
allowButtons
??[]).
findIndex
(
item
=>
item
===
'addAsAsset'
)
const
distributeIndex
=
(
row
.
allowButtons
??[]).
findIndex
(
item
=>
item
===
'distribute'
)
const
batchEditIndex
=
(
row
.
allowButtons
??[]).
findIndex
(
item
=>
item
===
'batchEdit'
)
...
...
@@ -898,7 +896,7 @@ const FC = (props) => {
onAutoDistributeTaskClick()
} else if (key === 'batchEdit') {
onBatchEditClick()
}else if (key === 'check') {
}
else if (key === 'check') {
onCheckClick()
} else if (key === 'import') {
onImportClick()
...
...
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