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
9b61897e
Commit
9b61897e
authored
Jan 17, 2024
by
zhaochengxiang
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' into 'modeler-v2'
# Conflicts: # src/view/Manage/Model/Component/tag-help.jsx
parents
c73afbd6
75c5a171
Show whitespace changes
Inline
Side-by-side
Showing
36 changed files
with
527 additions
and
159 deletions
+527
-159
assetmanage.js
src/model/assetmanage.js
+5
-4
datasource.js
src/model/datasource.js
+9
-0
dataassetmanager.js
src/service/dataassetmanager.js
+6
-5
datasourcemanager.js
src/service/datasourcemanager.js
+9
-0
axios.js
src/util/axios.js
+1
-1
index.js
src/util/index.js
+4
-4
table.jsx
src/view/Manage/AssetBrowse/table.jsx
+2
-1
AddAssetModel.jsx
src/view/Manage/AssetManage/Component/AddAssetModel.jsx
+0
-16
AssetAction.jsx
src/view/Manage/AssetManage/Component/AssetAction.jsx
+4
-18
AssetDetailPage.jsx
src/view/Manage/AssetManage/Component/AssetDetailPage.jsx
+34
-10
AssetDirectory.jsx
src/view/Manage/AssetManage/Component/AssetDirectory.jsx
+3
-1
FilterElementModal.jsx
src/view/Manage/AssetManage/Component/FilterElementModal.jsx
+2
-2
ImportAssetDrawer.jsx
src/view/Manage/AssetManage/Component/ImportAssetDrawer.jsx
+4
-12
change-element-value.jsx
...iew/Manage/AssetManage/Component/change-element-value.jsx
+1
-0
change-catalog.jsx
src/view/Manage/AssetManage/change-catalog.jsx
+3
-1
table.jsx
src/view/Manage/AssetManage/table.jsx
+5
-3
tree.jsx
src/view/Manage/AssetManage/tree.jsx
+7
-2
index.jsx
src/view/Manage/AssetOperation/index.jsx
+5
-3
change-catalog.jsx
src/view/Manage/AssetRecycle/change-catalog.jsx
+3
-1
table.jsx
src/view/Manage/AssetResourceBrowse/table.jsx
+2
-1
add-to-asset.jsx
src/view/Manage/AssetResourceManage/add-to-asset.jsx
+1
-1
change-catalog.jsx
src/view/Manage/AssetResourceManage/change-catalog.jsx
+3
-1
distribute-task.jsx
src/view/Manage/AssetResourceManage/distribute-task.jsx
+63
-26
edit-assets.jsx
src/view/Manage/AssetResourceManage/edit-assets.jsx
+12
-4
filter-element-value.jsx
src/view/Manage/AssetResourceManage/filter-element-value.jsx
+8
-5
select-batch-edit-elements.jsx
...Manage/AssetResourceManage/select-batch-edit-elements.jsx
+1
-1
table.jsx
src/view/Manage/AssetResourceManage/table.jsx
+11
-5
tree.jsx
src/view/Manage/AssetResourceManage/tree.jsx
+8
-5
update-node.jsx
src/view/Manage/AssetResourceManage/update-node.jsx
+23
-11
index.jsx
src/view/Manage/AssetTask/index.jsx
+10
-9
APIConfigModal.jsx
...view/Manage/DatasourceManage/Component/APIConfigModal.jsx
+245
-0
DatasourceList.jsx
...view/Manage/DatasourceManage/Component/DatasourceList.jsx
+7
-2
ETLConfigModal.jsx
...view/Manage/DatasourceManage/Component/ETLConfigModal.jsx
+1
-1
index.jsx
src/view/Manage/DatasourceManage/index.jsx
+16
-0
Task.jsx
src/view/Manage/MetadataHarvester/Component/Task.jsx
+8
-2
UpdateTask.jsx
src/view/Manage/MetadataHarvester/Component/UpdateTask.jsx
+1
-1
No files found.
src/model/assetmanage.js
View file @
9b61897e
...
@@ -50,10 +50,6 @@ export function* addOrUpdateDataAsset(payload) {
...
@@ -50,10 +50,6 @@ export function* addOrUpdateDataAsset(payload) {
return
yield
call
(
service
.
addOrUpdateDataAsset
,
payload
);
return
yield
call
(
service
.
addOrUpdateDataAsset
,
payload
);
}
}
export
function
*
checkCodeIsExist
(
payload
)
{
return
yield
call
(
service
.
checkCodeIsExist
,
payload
);
}
export
function
*
addDataAssetByDirIds
(
payload
)
{
export
function
*
addDataAssetByDirIds
(
payload
)
{
return
yield
call
(
service
.
addDataAssetByDirIds
,
payload
);
return
yield
call
(
service
.
addDataAssetByDirIds
,
payload
);
}
}
...
@@ -415,3 +411,7 @@ export function* getOperationPopularDataAssetRanking() {
...
@@ -415,3 +411,7 @@ export function* getOperationPopularDataAssetRanking() {
export
function
*
getOperationLatestDataAssetRanking
()
{
export
function
*
getOperationLatestDataAssetRanking
()
{
return
yield
call
(
service
.
getOperationLatestDataAssetRanking
)
return
yield
call
(
service
.
getOperationLatestDataAssetRanking
)
}
}
export
function
*
getNoticeTemplate
(
payload
)
{
return
yield
call
(
service
.
getNoticeTemplate
,
payload
)
}
\ No newline at end of file
src/model/datasource.js
View file @
9b61897e
...
@@ -128,6 +128,14 @@ export function* updateEtlSystemMapping(payload) {
...
@@ -128,6 +128,14 @@ export function* updateEtlSystemMapping(payload) {
return
yield
call
(
service
.
updateEtlSystemMapping
,
payload
);
return
yield
call
(
service
.
updateEtlSystemMapping
,
payload
);
}
}
export
function
*
getApiDataSourceMappingList
(
payload
)
{
return
yield
call
(
service
.
getApiDataSourceMappingList
,
payload
);
}
export
function
*
updateApiDataSourcesMapping
(
payload
)
{
return
yield
call
(
service
.
updateApiDataSourcesMapping
,
payload
);
}
export
function
*
getPermissions
(
payload
)
{
export
function
*
getPermissions
(
payload
)
{
return
yield
call
(
service
.
getPermissions
,
payload
);
return
yield
call
(
service
.
getPermissions
,
payload
);
}
}
\ No newline at end of file
src/service/dataassetmanager.js
View file @
9b61897e
...
@@ -48,10 +48,6 @@ export function addOrUpdateDataAsset(payload) {
...
@@ -48,10 +48,6 @@ export function addOrUpdateDataAsset(payload) {
return
PostJSON
(
"/dataassetmanager/dataAssetApi/addDataAsset"
,
payload
);
return
PostJSON
(
"/dataassetmanager/dataAssetApi/addDataAsset"
,
payload
);
}
}
export
function
checkCodeIsExist
(
payload
)
{
return
Post
(
"/dataassetmanager/dataAssetApi/checkDataAssetCodeIsExist"
,
payload
);
}
export
function
addDataAssetByDirIds
(
payload
)
{
export
function
addDataAssetByDirIds
(
payload
)
{
return
PostJSON
(
"/dataassetmanager/dataAssetApi/addDataAssetByDirIds"
,
payload
);
return
PostJSON
(
"/dataassetmanager/dataAssetApi/addDataAssetByDirIds"
,
payload
);
}
}
...
@@ -305,7 +301,7 @@ export function getPreviewRangeByDirId(payload) {
...
@@ -305,7 +301,7 @@ export function getPreviewRangeByDirId(payload) {
}
}
export
function
getResourceBatchEditInfo
(
payload
)
{
export
function
getResourceBatchEditInfo
(
payload
)
{
return
Ge
tJSON
(
"/dataassetmanager/resourceApi/getBatchEditInfo"
,
payload
)
return
Pos
tJSON
(
"/dataassetmanager/resourceApi/getBatchEditInfo"
,
payload
)
}
}
export
function
resourceBatchEdit
(
payload
)
{
export
function
resourceBatchEdit
(
payload
)
{
...
@@ -403,3 +399,7 @@ export function getPreviewRangeByDirId(payload) {
...
@@ -403,3 +399,7 @@ export function getPreviewRangeByDirId(payload) {
export
function
getOperationLatestDataAssetRanking
()
{
export
function
getOperationLatestDataAssetRanking
()
{
return
GetJSON
(
"/dataassetmanager/operationApi/getLatestDataAssetRanking"
)
return
GetJSON
(
"/dataassetmanager/operationApi/getLatestDataAssetRanking"
)
}
}
export
function
getNoticeTemplate
(
payload
)
{
return
Get
(
"/baseservice/noticeTemplate/getTemplateContent"
,
payload
)
}
\ No newline at end of file
src/service/datasourcemanager.js
View file @
9b61897e
...
@@ -124,6 +124,14 @@ export function updateEtlSystemMapping(payload) {
...
@@ -124,6 +124,14 @@ export function updateEtlSystemMapping(payload) {
return
PostJSON
(
"/metadataharvester/etlSystemMapping/update"
,
payload
);
return
PostJSON
(
"/metadataharvester/etlSystemMapping/update"
,
payload
);
}
}
export
function
getApiDataSourceMappingList
(
payload
)
{
return
PostJSON
(
"/metadataharvester/apiDataSourcesMapping/list"
,
payload
);
}
export
function
updateApiDataSourcesMapping
(
payload
)
{
return
PostJSON
(
"/metadataharvester/apiDataSourcesMapping/update"
,
payload
);
}
export
function
getPermissions
(
payload
)
{
export
function
getPermissions
(
payload
)
{
return
GetJSON
(
"/metadataharvester/auth/getAllowButtons"
,
payload
);
return
GetJSON
(
"/metadataharvester/auth/getAllowButtons"
,
payload
);
}
}
\ No newline at end of file
src/util/axios.js
View file @
9b61897e
...
@@ -96,7 +96,7 @@ const callback = resp => {
...
@@ -96,7 +96,7 @@ const callback = resp => {
throw
resp
.
data
;
throw
resp
.
data
;
}
}
return
resp
.
data
||
resp
;
return
resp
.
data
;
}
}
export
function
Get
(
url
,
params
)
{
export
function
Get
(
url
,
params
)
{
...
...
src/util/index.js
View file @
9b61897e
...
@@ -459,19 +459,19 @@ export function checkMenuAdmit(menuinfo) {
...
@@ -459,19 +459,19 @@ export function checkMenuAdmit(menuinfo) {
if
((
menumessage
.
bit
&
totalbit
)
===
menumessage
.
bit
){
if
((
menumessage
.
bit
&
totalbit
)
===
menumessage
.
bit
){
return
true
return
true
}
else
{
}
else
{
showInfoNotifaction
(
'提示'
,
`暂无访问路由【
${
menumessage
.
name
}
】的权限`
);
showInfoNotifaction
(
'提示'
,
`暂无访问路由【
${
menumessage
.
name
}
】的权限`
,
5
);
return
false
return
false
}
}
}
else
{
}
else
{
showInfoNotifaction
(
'提示'
,
`暂无访问路由【
${
menumessage
.
name
}
】的权限`
);
showInfoNotifaction
(
'提示'
,
`暂无访问路由【
${
menumessage
.
name
}
】的权限`
,
5
);
return
false
;
return
false
;
}
}
}
catch
(
error
)
{
}
catch
(
error
)
{
showInfoNotifaction
(
'提示'
,
`暂无访问路由$【
${
menumessage
.
name
}
】的权限`
);
showInfoNotifaction
(
'提示'
,
`暂无访问路由$【
${
menumessage
.
name
}
】的权限`
,
5
);
return
false
;
return
false
;
}
}
}
else
{
}
else
{
showInfoNotifaction
(
'提示'
,
`暂无访问路由【
${
menumessage
.
name
}
】的权限`
);
showInfoNotifaction
(
'提示'
,
`暂无访问路由【
${
menumessage
.
name
}
】的权限`
,
5
);
return
false
return
false
}
}
}
}
...
...
src/view/Manage/AssetBrowse/table.jsx
View file @
9b61897e
...
@@ -279,7 +279,8 @@ const FC = (props) => {
...
@@ -279,7 +279,8 @@ const FC = (props) => {
keyword
:
args
.
params
.
keyword
,
keyword
:
args
.
params
.
keyword
,
range
:
getAssetRange
(
AssetBrowseReference
),
range
:
getAssetRange
(
AssetBrowseReference
),
recursive
,
recursive
,
isCustomDir
:
(
node
?.
resourceType
===
'custom'
||
node
?.
type
===
'custom'
)
isCustomDir
:
(
node
?.
resourceType
===
'custom'
||
node
?.
type
===
'custom'
),
checkPermission
:
true
,
}
}
},
},
callback
:
data
=>
{
callback
:
data
=>
{
...
...
src/view/Manage/AssetManage/Component/AddAssetModel.jsx
View file @
9b61897e
...
@@ -42,16 +42,6 @@ const AddAssetModel = (props) => {
...
@@ -42,16 +42,6 @@ const AddAssetModel = (props) => {
setConfirmLoading
(
true
);
setConfirmLoading
(
true
);
dispatch
({
dispatch
({
type
:
'assetmanage.checkCodeIsExist'
,
payload
:
{
data
:
{
elements
:
newElements
}
},
callback
:
isExist
=>
{
if
(
isExist
===
'true'
)
{
setConfirmLoading
(
false
);
showMessage
(
'warn'
,
'已存在相同的资产编号,请重新输入'
);
}
else
{
dispatch
({
type
:
(
reference
===
ResourceManageReference
)?
'assetmanage.addOrUpdateResource'
:
'assetmanage.addOrUpdateDataAsset'
,
type
:
(
reference
===
ResourceManageReference
)?
'assetmanage.addOrUpdateResource'
:
'assetmanage.addOrUpdateDataAsset'
,
payload
:
{
payload
:
{
params
,
params
,
...
@@ -66,12 +56,6 @@ const AddAssetModel = (props) => {
...
@@ -66,12 +56,6 @@ const AddAssetModel = (props) => {
setConfirmLoading
(
false
);
setConfirmLoading
(
false
);
}
}
})
})
}
},
error
:
()
=>
{
setConfirmLoading
(
false
);
}
})
}
catch
(
errInfo
)
{
}
catch
(
errInfo
)
{
console
.
log
(
'Validate Failed:'
,
errInfo
);
console
.
log
(
'Validate Failed:'
,
errInfo
);
...
...
src/view/Manage/AssetManage/Component/AssetAction.jsx
View file @
9b61897e
...
@@ -287,16 +287,6 @@ const AssetAction = (props) => {
...
@@ -287,16 +287,6 @@ const AssetAction = (props) => {
setConfirmLoading(true);
setConfirmLoading(true);
dispatch({
dispatch({
type: 'assetmanage.checkCodeIsExist',
payload: {
data: action==='add' ? { elements: newElements } : { ...assets, elements: newElements }
},
callback: isExist => {
if (isExist === 'true') {
setConfirmLoading(false);
showMessage('warn', '已存在相同的资产编号,请重新输入');
} else {
dispatch({
type: (reference===ResourceManageReference)?'assetmanage.addOrUpdateResource':'assetmanage.addOrUpdateDataAsset',
type: (reference===ResourceManageReference)?'assetmanage.addOrUpdateResource':'assetmanage.addOrUpdateDataAsset',
payload: {
payload: {
params,
params,
...
@@ -314,12 +304,6 @@ const AssetAction = (props) => {
...
@@ -314,12 +304,6 @@ const AssetAction = (props) => {
setConfirmLoading(false);
setConfirmLoading(false);
}
}
})
})
}
},
error: () => {
setConfirmLoading(false);
}
})
} catch (errInfo) {
} catch (errInfo) {
console.log('Validate Failed:', errInfo);
console.log('Validate Failed:', errInfo);
...
@@ -430,7 +414,7 @@ const AssetAction = (props) => {
...
@@ -430,7 +414,7 @@ const AssetAction = (props) => {
</div>
</div>
}
}
{
{
(!previewAble && !loading && assets?.allowButtons && (assets?.allowButtons||[]).findIndex(item => item==='preview') === -1) ? <div className='m-
1
'>暂无权限</div> : <React.Fragment>
(!previewAble && !loading && assets?.allowButtons && (assets?.allowButtons||[]).findIndex(item => item==='preview') === -1) ? <div className='m-
4
'>暂无权限</div> : <React.Fragment>
{
{
(action!=='add' && (id||'')!=='') && <div>
(action!=='add' && (id||'')!=='') && <div>
<div className='pl-common py-compact-common'>
<div className='pl-common py-compact-common'>
...
@@ -454,7 +438,8 @@ const AssetAction = (props) => {
...
@@ -454,7 +438,8 @@ const AssetAction = (props) => {
</div>
</div>
</Descriptions.Item>
</Descriptions.Item>
<Descriptions.Item label={<div className='title-text' style={{ textAlign: 'right', width: 60 }}>资产标签</div>} style={{ paddingBottom: 15 }}>
<Descriptions.Item label={<div className='title-text' style={{ textAlign: 'right', width: 60 }}>资产标签</div>} style={{ paddingBottom: 15 }}>
<DataQuality
{
assets?.id && <DataQuality
type={DataQualityFeignTagList}
type={DataQualityFeignTagList}
data={{
data={{
type: 'dataAsset',
type: 'dataAsset',
...
@@ -462,6 +447,7 @@ const AssetAction = (props) => {
...
@@ -462,6 +447,7 @@ const AssetAction = (props) => {
did: dirId,
did: dirId,
}}
}}
/>
/>
}
</Descriptions.Item>
</Descriptions.Item>
<Descriptions.Item
<Descriptions.Item
label={<div className='title-text' style={{ textAlign: 'right', width: 60 }}>关联关系</div>}
label={<div className='title-text' style={{ textAlign: 'right', width: 60 }}>关联关系</div>}
...
...
src/view/Manage/AssetManage/Component/AssetDetailPage.jsx
View file @
9b61897e
import
React
,
{
useEffect
,
useState
}
from
"react"
;
import
React
,
{
useEffect
,
useState
}
from
"react"
;
import
{
Spin
}
from
"antd"
;
import
AssetDetail
from
'./AssetDetail'
;
import
AssetDetail
from
'./AssetDetail'
;
import
{
getQueryParam
}
from
'../../../../util'
;
import
{
getQueryParam
}
from
'../../../../util'
;
import
{
dispatch
}
from
'../../../../model'
import
'./AssetDetailPage.less'
;
import
'./AssetDetailPage.less'
;
const
AssetDetailPage
=
(
props
)
=>
{
const
AssetDetailPage
=
(
props
)
=>
{
const
id
=
getQueryParam
(
'id'
,
props
.
location
?.
search
)
const
[
data
,
setData
]
=
useState
({
id
:
''
,
dirId
:
''
});
const
[
dirId
,
setDirId
]
=
useState
(
getQueryParam
(
'dirId'
,
props
.
location
?.
search
))
const
[
loading
,
setLoading
]
=
useState
(
false
)
const
{
id
,
dirId
}
=
data
;
useEffect
(()
=>
{
useEffect
(()
=>
{
if
(
!
dirId
)
{
const
_id
=
getQueryParam
(
'id'
,
props
.
location
.
search
);
getAssetPaths
()
const
_dirId
=
getQueryParam
(
'dirId'
,
props
.
location
.
search
);
}
setData
({
id
:
_id
,
dirId
:
_dirId
});
//eslint-disable-next-line react-hooks/exhaustive-deps
//eslint-disable-next-line react-hooks/exhaustive-deps
},
[])
},
[])
const
getAssetPaths
=
()
=>
{
if
(
id
)
{
setLoading
(
true
);
dispatch
({
type
:
'assetmanage.getAssetPaths'
,
payload
:
{
dataAssetId
:
id
,
},
callback
:
data
=>
{
setLoading
(
false
);
if
((
data
??[]).
length
>
0
)
{
setDirId
(
data
[
0
].
dirId
)
}
},
error
:
()
=>
{
setLoading
(
false
);
}
})
}
}
return
(
return
(
<
div
className=
'asset-detail position-relative'
>
<
div
className=
'asset-detail position-relative'
>
<
div
className=
'detail-header'
>
<
div
className=
'detail-header'
>
<
span
style=
{
{
fontSize
:
16
,
fontWeight
:
'bold'
,
color
:
'#fff'
}
}
>
资产详情
</
span
>
<
span
style=
{
{
fontSize
:
16
,
fontWeight
:
'bold'
,
color
:
'#fff'
}
}
>
资产详情
</
span
>
</
div
>
</
div
>
<
Spin
spinning=
{
loading
}
>
<
div
className=
'detail-container'
>
<
div
className=
'detail-container'
>
<
div
className=
'detail-container-card'
>
<
div
className=
'detail-container-card'
>
<
AssetDetail
id=
{
id
}
dirId=
{
dirId
}
/>
{
dirId
&&
<
AssetDetail
id=
{
id
}
dirId=
{
dirId
}
/>
}
</
div
>
</
div
>
</
div
>
</
div
>
</
Spin
>
</
div
>
</
div
>
)
)
}
}
...
...
src/view/Manage/AssetManage/Component/AssetDirectory.jsx
View file @
9b61897e
...
@@ -200,7 +200,8 @@ const AssetDirectory = (props) => {
...
@@ -200,7 +200,8 @@ const AssetDirectory = (props) => {
资产属性管理
资产属性管理
</
div
>
</
div
>
</
PermissionMenuItem
>
</
PermissionMenuItem
>
<
PermissionMenuItem
{
(
reference
===
ResourceManageReference
)
&&
<
PermissionMenuItem
key=
'attributeRelate'
key=
'attributeRelate'
permissionKey=
'attributeRelate'
permissionKey=
'attributeRelate'
permissions=
{
permissions
}
permissions=
{
permissions
}
...
@@ -209,6 +210,7 @@ const AssetDirectory = (props) => {
...
@@ -209,6 +210,7 @@ const AssetDirectory = (props) => {
资产属性关联
资产属性关联
</
div
>
</
div
>
</
PermissionMenuItem
>
</
PermissionMenuItem
>
}
<
PermissionMenuItem
<
PermissionMenuItem
defaultPermission=
'true'
defaultPermission=
'true'
key=
'elementValueChangeManage'
key=
'elementValueChangeManage'
...
...
src/view/Manage/AssetManage/Component/FilterElementModal.jsx
View file @
9b61897e
...
@@ -117,7 +117,7 @@ const FilterElementModal = (props) => {
...
@@ -117,7 +117,7 @@ const FilterElementModal = (props) => {
});
});
}
else
{
}
else
{
(
elements
||
[]).
forEach
(
element
=>
{
(
elements
||
[]).
forEach
(
element
=>
{
if
(
element
.
selectAble
===
'否
'
)
{
if
(
element
.
defaultSelected
===
'是
'
)
{
_selectedKeys
.
push
(
element
.
id
||
''
);
_selectedKeys
.
push
(
element
.
id
||
''
);
}
}
});
});
...
@@ -213,7 +213,7 @@ const FilterElementModal = (props) => {
...
@@ -213,7 +213,7 @@ const FilterElementModal = (props) => {
return
(
return
(
<
Col
className=
'mb-3'
key=
{
_index
}
md=
{
6
}
>
<
Col
className=
'mb-3'
key=
{
_index
}
md=
{
6
}
>
<
div
className=
'd-flex'
>
<
div
className=
'd-flex'
>
<
Checkbox
checked=
{
selectedKeys
.
indexOf
(
element
.
id
||
''
)
!==-
1
}
value=
{
element
.
id
||
''
}
onChange=
{
onCheckChange
}
disabled=
{
element
.
selectAble
===
'否
'
}
>
<
Checkbox
checked=
{
selectedKeys
.
indexOf
(
element
.
id
||
''
)
!==-
1
}
value=
{
element
.
id
||
''
}
onChange=
{
onCheckChange
}
disabled=
{
element
.
defaultSelected
===
'是
'
}
>
</
Checkbox
>
</
Checkbox
>
<
Typography
.
Paragraph
className=
'ml-1'
title=
{
element
.
name
||
''
}
ellipsis
>
<
Typography
.
Paragraph
className=
'ml-1'
title=
{
element
.
name
||
''
}
ellipsis
>
{
element
.
name
||
''
}
{
element
.
name
||
''
}
...
...
src/view/Manage/AssetManage/Component/ImportAssetDrawer.jsx
View file @
9b61897e
...
@@ -134,17 +134,14 @@ const ImportAssetDrawer = (props) => {
...
@@ -134,17 +134,14 @@ const ImportAssetDrawer = (props) => {
setConfirmLoading
(
true
);
setConfirmLoading
(
true
);
dispatch
({
dispatch
({
type
:
'assetmanage.
getDirectoryById
'
,
type
:
'assetmanage.
assetImport
'
,
payload
:
{
payload
:
{
dirId
:
nodeId
,
fileList
:
fileList
,
params
:
{
dataAssetType
:
getAssetType
(
reference
)
dataAssetType
:
getAssetType
(
reference
)
}
},
},
callback
:
data
=>
{
callback
:
data
=>
{
console
.
log
(
'path'
,
data
.
path
);
dispatch
({
type
:
'assetmanage.assetImport'
,
payload
:
{
fileList
:
fileList
,
params
:
{
parentPath
:
data
?.
path
||
''
}
},
callback
:
data
=>
{
setConfirmLoading
(
false
);
setConfirmLoading
(
false
);
setFileList
([]);
setFileList
([]);
getLogs
(
pageNum
,
pageSize
);
getLogs
(
pageNum
,
pageSize
);
...
@@ -154,11 +151,6 @@ const ImportAssetDrawer = (props) => {
...
@@ -154,11 +151,6 @@ const ImportAssetDrawer = (props) => {
setConfirmLoading
(
false
);
setConfirmLoading
(
false
);
}
}
});
});
},
error
:
()
=>
{
setConfirmLoading
(
false
);
}
});
}
}
const
reset
=
()
=>
{
const
reset
=
()
=>
{
...
...
src/view/Manage/AssetManage/Component/change-element-value.jsx
View file @
9b61897e
...
@@ -140,6 +140,7 @@ export const Basic = React.forwardRef(function ({ type, elements }, ref) {
...
@@ -140,6 +140,7 @@ export const Basic = React.forwardRef(function ({ type, elements }, ref) {
if
(
index
!==
-
1
)
{
if
(
index
!==
-
1
)
{
setCurrentElement
(
elements
[
index
])
setCurrentElement
(
elements
[
index
])
}
}
form
?.
setFieldsValue
({
source
:
null
})
getSources
(
changedValues
.
elementId
)
getSources
(
changedValues
.
elementId
)
}
}
}
}
...
...
src/view/Manage/AssetManage/change-catalog.jsx
View file @
9b61897e
...
@@ -3,8 +3,9 @@ import { Button, Modal, Spin, Tree, AutoComplete } from 'antd'
...
@@ -3,8 +3,9 @@ import { Button, Modal, Spin, Tree, AutoComplete } from 'antd'
import
{
dispatch
}
from
'../../../model'
import
{
dispatch
}
from
'../../../model'
import
produce
from
'immer'
import
produce
from
'immer'
import
{
highlightSearchContentByTerms
,
showMessage
,
showNotifaction
}
from
'../../../util'
import
{
getAssetType
,
highlightSearchContentByTerms
,
showMessage
,
showNotifaction
}
from
'../../../util'
import
{
generateList
}
from
'../AssetResourceManage/tree'
import
{
generateList
}
from
'../AssetResourceManage/tree'
import
{
AssetManageReference
}
from
'../../../util/constant'
const
FC
=
(
props
)
=>
{
const
FC
=
(
props
)
=>
{
const
{
visible
,
items
,
onCancel
}
=
props
const
{
visible
,
items
,
onCancel
}
=
props
...
@@ -31,6 +32,7 @@ const FC = (props) => {
...
@@ -31,6 +32,7 @@ const FC = (props) => {
payload
:
{
payload
:
{
params
:
{
params
:
{
dirId
:
checkedKeys
.
join
(
","
),
dirId
:
checkedKeys
.
join
(
","
),
dataAssetType
:
getAssetType
(
AssetManageReference
),
},
},
data
:
(
items
??[]).
map
(
item
=>
item
.
id
)
data
:
(
items
??[]).
map
(
item
=>
item
.
id
)
},
},
...
...
src/view/Manage/AssetManage/table.jsx
View file @
9b61897e
...
@@ -639,8 +639,10 @@ const FC = (props) => {
...
@@ -639,8 +639,10 @@ const FC = (props) => {
dataAssetIds: rightRow?.id
dataAssetIds: rightRow?.id
}
}
},
},
callback: () => {
callback: (data) => {
showMessage("success","发布成功")
if (data?.message) {
showMessage("success", data?.message)
}
getAssets()
getAssets()
setSelectedRows([])
setSelectedRows([])
}
}
...
@@ -986,7 +988,7 @@ const FC = (props) => {
...
@@ -986,7 +988,7 @@ const FC = (props) => {
if (refresh) {
if (refresh) {
setTimeout(() => {
setTimeout(() => {
window.open(`
/
data
-
govern
/
edit
-
assets
?
ids
=
$
{(
selectedRows
??[]).
map
(
item
=>
item
.
id
).
toString
()}
&
elementIds
=
$
{(
value
??[]).
toString
()}
`)
window.open(`
/
data
-
govern
/
edit
-
assets
?
ids
=
$
{(
selectedRows
??[]).
map
(
item
=>
item
.
id
).
toString
()}
&
elementIds
=
$
{(
value
??[]).
toString
()}
&
type
=
$
{
AssetManageReference
}
`)
}, 300)
}, 300)
}
}
}}
}}
...
...
src/view/Manage/AssetManage/tree.jsx
View file @
9b61897e
...
@@ -238,7 +238,12 @@ const FC = (props) => {
...
@@ -238,7 +238,12 @@ const FC = (props) => {
onOk
:
()
=>
{
onOk
:
()
=>
{
dispatch
({
dispatch
({
type
:
'assetmanage.deleteDirectory'
,
type
:
'assetmanage.deleteDirectory'
,
payload
:
{
data
:
[
rightSelectedNode
?.
nodeId
]},
payload
:
{
data
:
[
rightSelectedNode
?.
nodeId
],
params
:
{
dataAssetType
:
getAssetType
(
AssetManageReference
)
}
},
callback
:
()
=>
{
callback
:
()
=>
{
showMessage
(
"success"
,
"删除成功"
)
showMessage
(
"success"
,
"删除成功"
)
if
(
rightSelectedNode
?.
nodeId
===
selectedKey
)
{
if
(
rightSelectedNode
?.
nodeId
===
selectedKey
)
{
...
@@ -403,7 +408,7 @@ const FC = (props) => {
...
@@ -403,7 +408,7 @@ const FC = (props) => {
dataAssetType
:
getAssetType
(
AssetManageReference
)
dataAssetType
:
getAssetType
(
AssetManageReference
)
},
},
callback
:
data
=>
{
callback
:
data
=>
{
window
.
open
(
`/api/dataassetmanager/directoryApi/export?parentPath=${data.path}`
);
window
.
open
(
`/api/dataassetmanager/directoryApi/export?parentPath=${data.path}
&dataAssetType=${getAssetType(AssetManageReference)}
`
);
}
}
})
})
}
else
{
}
else
{
...
...
src/view/Manage/AssetOperation/index.jsx
View file @
9b61897e
...
@@ -426,11 +426,14 @@ const StackedLine = ({ data }) => {
...
@@ -426,11 +426,14 @@ const StackedLine = ({ data }) => {
let
option
=
{
let
option
=
{
tooltip
:
{
tooltip
:
{
trigger
:
'axis'
trigger
:
'axis'
,
//解决截断问题
appendToBody
:
true
,
},
},
legend
:
{
legend
:
{
bottom
:
0
,
bottom
:
0
,
data
:
serieNames
data
:
serieNames
,
type
:
'scroll'
,
},
},
grid
:
{
grid
:
{
left
:
'3%'
,
left
:
'3%'
,
...
@@ -451,7 +454,6 @@ const StackedLine = ({ data }) => {
...
@@ -451,7 +454,6 @@ const StackedLine = ({ data }) => {
return
({
return
({
name
,
name
,
type
:
'line'
,
type
:
'line'
,
stack
:
'Total'
,
data
:
(
data
??[]).
map
(
item
=>
item
[
`
${
name
}
`
])
data
:
(
data
??[]).
map
(
item
=>
item
[
`
${
name
}
`
])
})
})
})
})
...
...
src/view/Manage/AssetRecycle/change-catalog.jsx
View file @
9b61897e
...
@@ -3,8 +3,9 @@ import { Button, Modal, Spin, Tree, AutoComplete } from 'antd'
...
@@ -3,8 +3,9 @@ import { Button, Modal, Spin, Tree, AutoComplete } from 'antd'
import
{
dispatch
}
from
'../../../model'
import
{
dispatch
}
from
'../../../model'
import
produce
from
'immer'
import
produce
from
'immer'
import
{
highlightSearchContentByTerms
,
showMessage
,
showNotifaction
}
from
'../../../util'
import
{
getAssetType
,
highlightSearchContentByTerms
,
showMessage
,
showNotifaction
}
from
'../../../util'
import
{
generateList
}
from
'../AssetResourceManage/tree'
import
{
generateList
}
from
'../AssetResourceManage/tree'
import
{
AssetManageReference
}
from
'../../../util/constant'
const
FC
=
(
props
)
=>
{
const
FC
=
(
props
)
=>
{
const
{
visible
,
items
,
onCancel
}
=
props
const
{
visible
,
items
,
onCancel
}
=
props
...
@@ -31,6 +32,7 @@ const FC = (props) => {
...
@@ -31,6 +32,7 @@ const FC = (props) => {
payload
:
{
payload
:
{
params
:
{
params
:
{
dirId
:
(
checkedKeys
??[]).
toString
(),
dirId
:
(
checkedKeys
??[]).
toString
(),
dataAssetType
:
getAssetType
(
AssetManageReference
),
},
},
data
:
(
items
??[]).
map
(
item
=>
item
.
id
)
data
:
(
items
??[]).
map
(
item
=>
item
.
id
)
},
},
...
...
src/view/Manage/AssetResourceBrowse/table.jsx
View file @
9b61897e
...
@@ -279,7 +279,8 @@ const FC = (props) => {
...
@@ -279,7 +279,8 @@ const FC = (props) => {
keyword
:
args
.
params
.
keyword
,
keyword
:
args
.
params
.
keyword
,
range
:
getAssetRange
(
ResourceBrowseReference
),
range
:
getAssetRange
(
ResourceBrowseReference
),
recursive
,
recursive
,
isCustomDir
:
(
node
?.
resourceType
===
'custom'
||
node
?.
type
===
'custom'
)
isCustomDir
:
(
node
?.
resourceType
===
'custom'
||
node
?.
type
===
'custom'
),
checkPermission
:
true
,
}
}
},
},
callback
:
data
=>
{
callback
:
data
=>
{
...
...
src/view/Manage/AssetResourceManage/add-to-asset.jsx
View file @
9b61897e
...
@@ -183,7 +183,7 @@ export const Basic = React.forwardRef(function ({ items, defaultValue }, ref) {
...
@@ -183,7 +183,7 @@ export const Basic = React.forwardRef(function ({ items, defaultValue }, ref) {
type
:
'assetmanage.queryDataAssetManageTree'
,
type
:
'assetmanage.queryDataAssetManageTree'
,
callback
:
data
=>
{
callback
:
data
=>
{
setLoadingTreeData
(
false
)
setLoadingTreeData
(
false
)
setTreeData
(
data
)
setTreeData
(
(
data
??[]).
filter
(
item
=>
item
.
type
!==
'custom'
)
)
},
},
error
:
()
=>
{
error
:
()
=>
{
setLoadingTreeData
(
false
)
setLoadingTreeData
(
false
)
...
...
src/view/Manage/AssetResourceManage/change-catalog.jsx
View file @
9b61897e
...
@@ -4,7 +4,8 @@ import { Button, Modal, Spin, Tree, AutoComplete } from 'antd'
...
@@ -4,7 +4,8 @@ import { Button, Modal, Spin, Tree, AutoComplete } from 'antd'
import
{
dispatch
}
from
'../../../model'
import
{
dispatch
}
from
'../../../model'
import
{
generateList
}
from
'./tree'
import
{
generateList
}
from
'./tree'
import
produce
from
'immer'
import
produce
from
'immer'
import
{
highlightSearchContentByTerms
,
showMessage
,
showNotifaction
}
from
'../../../util'
import
{
getAssetType
,
highlightSearchContentByTerms
,
showMessage
,
showNotifaction
}
from
'../../../util'
import
{
ResourceManageReference
}
from
'../../../util/constant'
const
FC
=
(
props
)
=>
{
const
FC
=
(
props
)
=>
{
const
{
visible
,
items
,
onCancel
}
=
props
const
{
visible
,
items
,
onCancel
}
=
props
...
@@ -31,6 +32,7 @@ const FC = (props) => {
...
@@ -31,6 +32,7 @@ const FC = (props) => {
payload
:
{
payload
:
{
params
:
{
params
:
{
dirId
:
checkedKeys
.
join
(
","
),
dirId
:
checkedKeys
.
join
(
","
),
dataAssetType
:
getAssetType
(
ResourceManageReference
),
},
},
data
:
(
items
??[]).
map
(
item
=>
item
.
id
)
data
:
(
items
??[]).
map
(
item
=>
item
.
id
)
},
},
...
...
src/view/Manage/AssetResourceManage/distribute-task.jsx
View file @
9b61897e
import
React
from
"react"
import
React
from
"react"
import
{
Modal
,
Button
,
Form
,
Select
,
Spin
,
Checkbox
}
from
"antd"
import
{
Modal
,
Button
,
Form
,
Select
,
Spin
,
Checkbox
,
Space
,
Row
}
from
"antd"
import
{
debounceTime
,
Subject
}
from
'rxjs'
import
{
debounceTime
,
Subject
}
from
'rxjs'
import
produce
from
"immer"
import
produce
from
"immer"
import
{
dispatch
}
from
'../../../model'
import
{
dispatch
}
from
'../../../model'
import
{
showMessage
}
from
"../../../util"
const
FC
=
(
props
)
=>
{
const
FC
=
(
props
)
=>
{
const
{
visible
,
items
,
onCancel
}
=
props
const
{
visible
,
items
,
onCancel
}
=
props
...
@@ -29,7 +30,11 @@ const FC = (props) => {
...
@@ -29,7 +30,11 @@ const FC = (props) => {
},
},
data
:
rows
data
:
rows
},
},
callback
:
()
=>
{
callback
:
(
data
)
=>
{
if
(
data
?.
message
)
{
showMessage
(
"success"
,
data
?.
message
)
}
setWaiting
(
false
)
setWaiting
(
false
)
onCancel
(
true
)
onCancel
(
true
)
},
},
...
@@ -75,7 +80,6 @@ const FC = (props) => {
...
@@ -75,7 +80,6 @@ const FC = (props) => {
export
default
FC
export
default
FC
export
const
Basic
=
React
.
forwardRef
(
function
({
items
},
ref
)
{
export
const
Basic
=
React
.
forwardRef
(
function
({
items
},
ref
)
{
const
[
noticeTypes
,
setNoticeTypes
]
=
React
.
useState
()
const
[
form
]
=
Form
.
useForm
()
const
[
form
]
=
Form
.
useForm
()
React
.
useImperativeHandle
(
ref
,
()
=>
({
React
.
useImperativeHandle
(
ref
,
()
=>
({
...
@@ -84,28 +88,6 @@ export const Basic = React.forwardRef(function ({ items }, ref) {
...
@@ -84,28 +88,6 @@ export const Basic = React.forwardRef(function ({ items }, ref) {
},
},
}),
[
form
])
}),
[
form
])
React
.
useEffect
(()
=>
{
getNoticeTypes
()
},
[])
const
getNoticeTypes
=
()
=>
{
dispatch
({
type
:
'assetmanage.getNoticeTypes'
,
callback
:
(
data
)
=>
{
const
newData
=
produce
(
data
,
(
draft
)
=>
{
draft
?.
forEach
(
item
=>
{
item
.
label
=
item
.
desc
item
.
value
=
item
.
type
})
})
setNoticeTypes
(
newData
)
},
error
:
()
=>
{
}
})
}
const
onValuesChange
=
(
changedValues
,
allValues
)
=>
{
const
onValuesChange
=
(
changedValues
,
allValues
)
=>
{
console
.
log
(
'all values'
,
allValues
)
console
.
log
(
'all values'
,
allValues
)
}
}
...
@@ -130,7 +112,7 @@ export const Basic = React.forwardRef(function ({ items }, ref) {
...
@@ -130,7 +112,7 @@ export const Basic = React.forwardRef(function ({ items }, ref) {
name=
'noticeTypes'
name=
'noticeTypes'
rules=
{
[{
required
:
true
,
message
:
'请选择通知方式!'
}]
}
rules=
{
[{
required
:
true
,
message
:
'请选择通知方式!'
}]
}
>
>
<
Checkbox
.
Group
options=
{
noticeTypes
}
/>
<
NoticeItem
/>
</
Form
.
Item
>
</
Form
.
Item
>
</
Form
>
</
Form
>
)
)
...
@@ -206,3 +188,57 @@ export const HandlersItem = ({ value, onChange }) => {
...
@@ -206,3 +188,57 @@ export const HandlersItem = ({ value, onChange }) => {
/>
/>
)
)
}
}
const
NoticeItem
=
({
value
,
onChange
})
=>
{
const
[
noticeTypes
,
setNoticeTypes
]
=
React
.
useState
()
const
[
modal
,
contextHolder
]
=
Modal
.
useModal
()
React
.
useEffect
(()
=>
{
getNoticeTypes
()
},
[])
const
getNoticeTypes
=
()
=>
{
dispatch
({
type
:
'assetmanage.getNoticeTypes'
,
callback
:
(
data
)
=>
{
setNoticeTypes
(
data
)
}
})
}
return
(
<
div
style=
{
{
lineHeight
:
'32px'
}
}
>
{
(
noticeTypes
??[]).
map
((
item
,
index
)
=>
(
<
Row
key=
{
index
}
>
<
Space
>
<
Checkbox
checked=
{
(
value
??[]).
indexOf
(
item
.
type
)
!==
-
1
}
value=
{
item
.
type
}
style=
{
{
width
:
100
}
}
onChange=
{
(
e
)
=>
{
if
(
e
.
target
.
checked
)
{
onChange
?.([...
value
??[],
item
.
type
])
}
else
{
onChange
?.((
value
??[]).
filter
(
item
=>
item
!==
e
.
target
.
value
))
}
}
}
>
{
item
.
desc
}
</
Checkbox
>
<
a
onClick=
{
()
=>
{
dispatch
({
type
:
'assetmanage.getNoticeTemplate'
,
payload
:
{
module
:
'dataAsset'
,
type
:
item
.
desc
},
callback
:
(
content
)
=>
{
modal
.
info
({
title
:
'模版信息'
,
content
:
content
??
''
,
})
}
})
}
}
>
查看通知模版
</
a
>
</
Space
>
</
Row
>
))
}
{
contextHolder
}
</
div
>
)
}
\ No newline at end of file
src/view/Manage/AssetResourceManage/edit-assets.jsx
View file @
9b61897e
...
@@ -7,7 +7,7 @@ import LocalStorage from 'local-storage'
...
@@ -7,7 +7,7 @@ import LocalStorage from 'local-storage'
import
{
dispatch
}
from
'../../../model'
import
{
dispatch
}
from
'../../../model'
import
{
usePage
}
from
'../../../util/hooks/page'
import
{
usePage
}
from
'../../../util/hooks/page'
import
Table
from
'../../../util/Component/Table'
import
Table
from
'../../../util/Component/Table'
import
{
getQueryParam
,
isSzseEnv
}
from
'../../../util'
import
{
get
AssetType
,
get
QueryParam
,
isSzseEnv
}
from
'../../../util'
import
'../Model/Component/EditModel.less'
import
'../Model/Component/EditModel.less'
import
{
ElementItem
,
MultipleItem
}
from
'../AssetManage/Component/AssetAction'
import
{
ElementItem
,
MultipleItem
}
from
'../AssetManage/Component/AssetAction'
...
@@ -15,6 +15,8 @@ import { ElementItem, MultipleItem } from '../AssetManage/Component/AssetAction'
...
@@ -15,6 +15,8 @@ import { ElementItem, MultipleItem } from '../AssetManage/Component/AssetAction'
const
FC
=
(
props
)
=>
{
const
FC
=
(
props
)
=>
{
const
ids
=
getQueryParam
(
'ids'
,
props
.
location
?.
search
)
const
ids
=
getQueryParam
(
'ids'
,
props
.
location
?.
search
)
const
elementIds
=
getQueryParam
(
'elementIds'
,
props
.
location
?.
search
)
const
elementIds
=
getQueryParam
(
'elementIds'
,
props
.
location
?.
search
)
const
type
=
getQueryParam
(
'type'
,
props
.
location
?.
search
)
const
[
action
,
setAction
]
=
React
.
useState
(
'edit'
)
const
[
action
,
setAction
]
=
React
.
useState
(
'edit'
)
const
[
waiting
,
setWaiting
]
=
React
.
useState
(
false
)
const
[
waiting
,
setWaiting
]
=
React
.
useState
(
false
)
...
@@ -55,7 +57,10 @@ const FC = (props) => {
...
@@ -55,7 +57,10 @@ const FC = (props) => {
dispatch
({
dispatch
({
type
:
'assetmanage.resourceBatchEdit'
,
type
:
'assetmanage.resourceBatchEdit'
,
payload
:
{
payload
:
{
data
:
modifyData
data
:
modifyData
,
params
:
{
dataAssetType
:
getAssetType
(
type
),
}
},
},
callback
:
data
=>
{
callback
:
data
=>
{
setWaiting
(
false
)
setWaiting
(
false
)
...
@@ -79,7 +84,7 @@ const FC = (props) => {
...
@@ -79,7 +84,7 @@ const FC = (props) => {
</
div
>
</
div
>
<
div
className=
'edit-container'
>
<
div
className=
'edit-container'
>
<
div
className=
'edit-container-card'
style=
{
{
padding
:
'20px 20px 0'
}
}
>
<
div
className=
'edit-container-card'
style=
{
{
padding
:
'20px 20px 0'
}
}
>
<
EditAssets
ref=
{
editAssetsRef
}
action=
{
action
}
ids=
{
ids
}
elementIds=
{
elementIds
}
/>
<
EditAssets
ref=
{
editAssetsRef
}
action=
{
action
}
type=
{
type
}
ids=
{
ids
}
elementIds=
{
elementIds
}
/>
</
div
>
</
div
>
</
div
>
</
div
>
<
div
className=
'edit-footer'
>
<
div
className=
'edit-footer'
>
...
@@ -111,7 +116,7 @@ const FC = (props) => {
...
@@ -111,7 +116,7 @@ const FC = (props) => {
export
default
FC
export
default
FC
export
const
EditAssets
=
React
.
forwardRef
(
function
({
action
,
ids
,
elementIds
},
ref
)
{
export
const
EditAssets
=
React
.
forwardRef
(
function
({
action
,
type
,
ids
,
elementIds
},
ref
)
{
const
[
elements
,
setElements
]
=
React
.
useState
()
const
[
elements
,
setElements
]
=
React
.
useState
()
const
[
data
,
setData
]
=
React
.
useState
()
const
[
data
,
setData
]
=
React
.
useState
()
const
[
modifyData
,
setModifyData
]
=
React
.
useState
()
const
[
modifyData
,
setModifyData
]
=
React
.
useState
()
...
@@ -282,8 +287,11 @@ export const EditAssets = React.forwardRef(function ({ action, ids, elementIds }
...
@@ -282,8 +287,11 @@ export const EditAssets = React.forwardRef(function ({ action, ids, elementIds }
dispatch
({
dispatch
({
type
:
'assetmanage.getResourceBatchEditInfo'
,
type
:
'assetmanage.getResourceBatchEditInfo'
,
payload
:
{
payload
:
{
params
:
{
elementIds
:
elementIds
,
elementIds
:
elementIds
,
resourceIds
:
ids
,
resourceIds
:
ids
,
dataAssetType
:
getAssetType
(
type
),
}
},
},
callback
:
data
=>
{
callback
:
data
=>
{
setLoading
(
false
)
setLoading
(
false
)
...
...
src/view/Manage/AssetResourceManage/filter-element-value.jsx
View file @
9b61897e
import
React
from
'react'
import
React
from
'react'
import
{
Modal
,
Button
,
Form
,
Checkbox
,
Spin
,
Row
,
Col
}
from
'antd'
import
{
Modal
,
Button
,
Form
,
Checkbox
,
Spin
,
Row
,
Col
}
from
'antd'
import
{
getAssetType
}
from
'../../../util'
import
{
getAsset
Range
,
getAsset
Type
}
from
'../../../util'
import
{
dispatch
}
from
'../../../model'
import
{
dispatch
}
from
'../../../model'
const
FC
=
(
props
)
=>
{
const
FC
=
(
props
)
=>
{
...
@@ -19,13 +19,16 @@ const FC = (props) => {
...
@@ -19,13 +19,16 @@ const FC = (props) => {
const
getElementValues
=
()
=>
{
const
getElementValues
=
()
=>
{
setLoading
(
true
)
setLoading
(
true
)
dispatch
({
dispatch
({
type
:
'assetmanage.
getElementValue
s'
,
type
:
'assetmanage.
listElement
s'
,
payload
:
{
payload
:
{
dataAssetType
:
getAssetType
(
type
)
params
:
{
range
:
getAssetRange
(
type
),
dataAssetType
:
getAssetType
(
type
),
}
},
},
callback
:
data
=>
{
callback
:
data
=>
{
setLoading
(
false
)
setLoading
(
false
)
setData
(
data
)
setData
(
(
data
??[]).
filter
(
item
=>
item
.
globalParam
===
'是'
)
)
},
},
error
:
()
=>
{
error
:
()
=>
{
setLoading
(
false
)
setLoading
(
false
)
...
@@ -121,7 +124,7 @@ export const Basic = React.forwardRef(function ({ data, defaultValue }, ref) {
...
@@ -121,7 +124,7 @@ export const Basic = React.forwardRef(function ({ data, defaultValue }, ref) {
<
Checkbox
.
Group
style=
{
{
width
:
'100%'
}
}
>
<
Checkbox
.
Group
style=
{
{
width
:
'100%'
}
}
>
<
Row
>
<
Row
>
{
{
(
item
.
value
?.
content
??[]
).
map
((
item
,
index
)
=>
{
(
(
item
.
optional
??
''
).
split
(
','
)
).
map
((
item
,
index
)
=>
{
return
(
return
(
<
Col
span=
{
6
}
key=
{
index
}
>
<
Col
span=
{
6
}
key=
{
index
}
>
<
Checkbox
<
Checkbox
...
...
src/view/Manage/AssetResourceManage/select-batch-edit-elements.jsx
View file @
9b61897e
...
@@ -68,7 +68,7 @@ const FC = (props) => {
...
@@ -68,7 +68,7 @@ const FC = (props) => {
visible=
{
visible
}
visible=
{
visible
}
footer=
{
footer
}
footer=
{
footer
}
width=
{
520
}
width=
{
520
}
bodyStyle=
{
{
padding
:
'15px
15px 0px 15px'
,
overflowX
:
'auto'
,
h
eight
:
'80vh'
}
}
bodyStyle=
{
{
padding
:
'15px
'
,
overflowX
:
'auto'
,
maxH
eight
:
'80vh'
}
}
title=
'选择批量编辑属性'
title=
'选择批量编辑属性'
centered
destroyOnClose
centered
destroyOnClose
onCancel=
{
()
=>
{
close
()
}
}
onCancel=
{
()
=>
{
close
()
}
}
...
...
src/view/Manage/AssetResourceManage/table.jsx
View file @
9b61897e
...
@@ -10,7 +10,7 @@ import produce from 'immer'
...
@@ -10,7 +10,7 @@ import produce from 'immer'
import
{
defaultPage
,
usePage
}
from
'../../../util/hooks/page'
import
{
defaultPage
,
usePage
}
from
'../../../util/hooks/page'
import
Table
from
'../../../util/Component/Table'
import
Table
from
'../../../util/Component/Table'
import
{
dispatch
}
from
'../../../model'
import
{
dispatch
}
from
'../../../model'
import
{
getAssetRange
,
getAssetType
,
getQueryParam
,
IsArr
,
isSzseEnv
,
showMessage
,
showNotifaction
}
from
'../../../util'
import
{
checkMenuAdmit
,
getAssetRange
,
getAssetType
,
getQueryParam
,
IsArr
,
isSzseEnv
,
showMessage
,
showNotifaction
}
from
'../../../util'
import
{
AssetManageReference
,
ResourceManageReference
}
from
'../../../util/constant'
import
{
AssetManageReference
,
ResourceManageReference
}
from
'../../../util/constant'
import
PermissionButton
from
'../../../util/Component/PermissionButton'
import
PermissionButton
from
'../../../util/Component/PermissionButton'
import
PermissionMenuItem
from
'../../../util/Component/PermissionMenuItem'
import
PermissionMenuItem
from
'../../../util/Component/PermissionMenuItem'
...
@@ -337,7 +337,9 @@ const FC = (props) => {
...
@@ -337,7 +337,9 @@ const FC = (props) => {
ellipsis
:
true
,
ellipsis
:
true
,
width
:
120
,
width
:
120
,
render
:
(
_
,
record
)
=>
<
a
onClick=
{
()
=>
{
render
:
(
_
,
record
)
=>
<
a
onClick=
{
()
=>
{
if
(
checkMenuAdmit
(
'task-manage'
))
{
window
.
open
(
`/center-home/menu/task-manage?id=${record.resourceExtraAttribute?.taskNO}`
)
window
.
open
(
`/center-home/menu/task-manage?id=${record.resourceExtraAttribute?.taskNO}`
)
}
}
}
>
}
}
>
{
record
.
resourceExtraAttribute
?.
taskNO
}
{
record
.
resourceExtraAttribute
?.
taskNO
}
</
a
>
</
a
>
...
@@ -690,11 +692,11 @@ const FC = (props) => {
...
@@ -690,11 +692,11 @@ const FC = (props) => {
title
:
'提示'
,
title
:
'提示'
,
content
:
'是否导出选中目录下的所有资产?'
,
content
:
'是否导出选中目录下的所有资产?'
,
onOk
:
()
=>
{
onOk
:
()
=>
{
window
.
open
(
`/api/dataassetmanager/dataAssetApi/exportByDataAssetIds?dirId=
${
node
?.
nodeId
}
&
recursive
=
$
{
args
.
params
.
catalogType
===
'currentRecursive'
}
&
dataAsset
=
$
{
getAssetRang
e
(
ResourceManageReference
)}
`);
window
.
open
(
`/api/dataassetmanager/dataAssetApi/exportByDataAssetIds?dirId=
${
node
?.
nodeId
}
&
recursive
=
$
{
args
.
params
.
catalogType
===
'currentRecursive'
}
&
dataAsset
Type
=
$
{
getAssetTyp
e
(
ResourceManageReference
)}
`);
}
}
})
})
} else {
} else {
window.open(`
/
api
/
dataassetmanager
/
dataAssetApi
/
exportByDataAssetIds
?
dataAssetIds
=
$
{
selectedRows
.
map
(
item
=>
item
.
id
).
join
(
','
)}
&
dataAsset
=
$
{
getAssetRang
e
(
ResourceManageReference
)}
`);
window.open(`
/
api
/
dataassetmanager
/
dataAssetApi
/
exportByDataAssetIds
?
dataAssetIds
=
$
{
selectedRows
.
map
(
item
=>
item
.
id
).
join
(
','
)}
&
dataAsset
Type
=
$
{
getAssetTyp
e
(
ResourceManageReference
)}
`);
}
}
}
}
...
@@ -971,6 +973,7 @@ const FC = (props) => {
...
@@ -971,6 +973,7 @@ const FC = (props) => {
</PermissionMenuItem>
</PermissionMenuItem>
<PermissionMenuItem
<PermissionMenuItem
key='autoDistribute'
key='autoDistribute'
permissionKey='autoDistribute'
permissions={permissions}
permissions={permissions}
>
>
<div className='text-center'>
<div className='text-center'>
...
@@ -1078,12 +1081,15 @@ const FC = (props) => {
...
@@ -1078,12 +1081,15 @@ const FC = (props) => {
</PermissionButton>
</PermissionButton>
<PermissionButton
<PermissionButton
defaultPermission={distributeAble}
defaultPermission={distributeAble}
disabled={(selectedRows??[]).length===0}
tip={(selectedRows??[]).length===0?'请先选择资源':''}
onClick={onDistributeTaskClick}
onClick={onDistributeTaskClick}
>
>
任务分配
任务分配
</PermissionButton>
</PermissionButton>
<PermissionButton
<PermissionButton
key='autoDistribute'
key='autoDistribute'
permissionKey='autoDistribute'
permissions={permissions}
permissions={permissions}
onClick={onAutoDistributeTaskClick}
onClick={onAutoDistributeTaskClick}
>
>
...
@@ -1221,7 +1227,7 @@ const FC = (props) => {
...
@@ -1221,7 +1227,7 @@ const FC = (props) => {
<div className='px-3'>
<div className='px-3'>
<ResizeObserver
<ResizeObserver
onResize={({ width }) => {
onResize={({ width }) => {
setCompact(width < 1
03
0)
setCompact(width < 1
25
0)
}}
}}
>
>
<Table
<Table
...
@@ -1390,7 +1396,7 @@ const FC = (props) => {
...
@@ -1390,7 +1396,7 @@ const FC = (props) => {
if (refresh) {
if (refresh) {
setTimeout(() => {
setTimeout(() => {
window.open(`
/
data
-
govern
/
edit
-
assets
?
ids
=
$
{(
selectedRows
??[]).
map
(
item
=>
item
.
id
).
toString
()}
&
elementIds
=
$
{(
value
??[]).
toString
()}
`)
window.open(`
/
data
-
govern
/
edit
-
assets
?
ids
=
$
{(
selectedRows
??[]).
map
(
item
=>
item
.
id
).
toString
()}
&
elementIds
=
$
{(
value
??[]).
toString
()}
&
type
=
$
{
ResourceManageReference
}
`)
}, 300)
}, 300)
}
}
}}
}}
...
...
src/view/Manage/AssetResourceManage/tree.jsx
View file @
9b61897e
...
@@ -148,9 +148,7 @@ const FC = (props) => {
...
@@ -148,9 +148,7 @@ const FC = (props) => {
{
id
:
'down'
,
title
:
'下移栏目'
},
{
id
:
'down'
,
title
:
'下移栏目'
},
{
id
:
'delete'
,
title
:
'删除栏目'
}
{
id
:
'delete'
,
title
:
'删除栏目'
}
]
]
if
(
rightSelectedNode
.
resourceType
!==
'custom'
&&
rightSelectedNode
.
type
!==
'custom'
)
{
newMenuData
=
[...
newMenuData
,
{
id
:
'sync'
,
title
:
'同步Schema'
},]
}
return
newMenuData
return
newMenuData
}
else
if
(
rightSelectedNode
.
resourceType
===
'custom'
||
rightSelectedNode
.
type
===
'custom'
)
{
}
else
if
(
rightSelectedNode
.
resourceType
===
'custom'
||
rightSelectedNode
.
type
===
'custom'
)
{
return
[
return
[
...
@@ -272,7 +270,12 @@ const FC = (props) => {
...
@@ -272,7 +270,12 @@ const FC = (props) => {
onOk
:
()
=>
{
onOk
:
()
=>
{
dispatch
({
dispatch
({
type
:
'assetmanage.deleteDirectory'
,
type
:
'assetmanage.deleteDirectory'
,
payload
:
{
data
:
[
rightSelectedNode
?.
nodeId
]},
payload
:
{
data
:
[
rightSelectedNode
?.
nodeId
],
params
:
{
dataAssetType
:
getAssetType
(
ResourceManageReference
)
}
},
callback
:
()
=>
{
callback
:
()
=>
{
showMessage
(
"success"
,
"删除成功"
)
showMessage
(
"success"
,
"删除成功"
)
if
(
rightSelectedNode
?.
nodeId
===
selectedKey
)
{
if
(
rightSelectedNode
?.
nodeId
===
selectedKey
)
{
...
@@ -459,7 +462,7 @@ const FC = (props) => {
...
@@ -459,7 +462,7 @@ const FC = (props) => {
dataAssetType
:
getAssetType
(
ResourceManageReference
)
dataAssetType
:
getAssetType
(
ResourceManageReference
)
},
},
callback
:
data
=>
{
callback
:
data
=>
{
window
.
open
(
`/api/dataassetmanager/directoryApi/export?parentPath=${data.path}`
);
window
.
open
(
`/api/dataassetmanager/directoryApi/export?parentPath=${data.path}
&dataAssetType=${getAssetType(ResourceManageReference)}
`
);
}
}
})
})
}
else
{
}
else
{
...
...
src/view/Manage/AssetResourceManage/update-node.jsx
View file @
9b61897e
...
@@ -17,6 +17,7 @@ const FC = (props) => {
...
@@ -17,6 +17,7 @@ const FC = (props) => {
const
[
loading
,
setLoading
]
=
React
.
useState
(
false
)
const
[
loading
,
setLoading
]
=
React
.
useState
(
false
)
const
[
waiting
,
setWaiting
]
=
React
.
useState
(
false
)
const
[
waiting
,
setWaiting
]
=
React
.
useState
(
false
)
const
[
node
,
setNode
]
=
React
.
useState
()
const
[
node
,
setNode
]
=
React
.
useState
()
const
[
type
,
setType
]
=
React
.
useState
(
'root'
)
const
[
isCustomType
,
setIsCustomType
]
=
React
.
useState
(
false
)
const
[
isCustomType
,
setIsCustomType
]
=
React
.
useState
(
false
)
const
basicRef
=
React
.
useRef
()
const
basicRef
=
React
.
useRef
()
...
@@ -28,6 +29,13 @@ const FC = (props) => {
...
@@ -28,6 +29,13 @@ const FC = (props) => {
}
}
},
[
visible
,
id
])
},
[
visible
,
id
])
const
showSync
=
React
.
useMemo
(()
=>
{
if
(
action
===
'add'
&&
type
===
'root'
)
return
false
if
(
action
===
'edit'
&&
(
node
?.
directory
?.
level
===
1
||
isCustomType
))
return
false
return
true
},
[
type
,
isCustomType
,
action
,
node
])
const
getDetail
=
()
=>
{
const
getDetail
=
()
=>
{
dispatch
({
dispatch
({
type
:
'assetmanage.getDirectoryWithSyncStrategy'
,
type
:
'assetmanage.getDirectoryWithSyncStrategy'
,
...
@@ -47,6 +55,8 @@ const FC = (props) => {
...
@@ -47,6 +55,8 @@ const FC = (props) => {
setLoading
(
false
)
setLoading
(
false
)
setWaiting
(
false
)
setWaiting
(
false
)
setNode
()
setNode
()
setType
(
'root'
)
setIsCustomType
(
false
)
onCancel
?.(
refresh
)
onCancel
?.(
refresh
)
}
}
...
@@ -59,7 +69,7 @@ const FC = (props) => {
...
@@ -59,7 +69,7 @@ const FC = (props) => {
let
parentPath
=
''
let
parentPath
=
''
if
(
action
===
'add'
)
{
if
(
action
===
'add'
)
{
if
(
basicRef
.
current
?.
getT
ype
===
'child'
)
{
if
(
t
ype
===
'child'
)
{
parentPath
=
node
?.
directory
?.
path
parentPath
=
node
?.
directory
?.
path
rows
.
resourceType
=
node
?.
directory
?.
resourceType
rows
.
resourceType
=
node
?.
directory
?.
resourceType
}
}
...
@@ -116,14 +126,18 @@ const FC = (props) => {
...
@@ -116,14 +126,18 @@ const FC = (props) => {
<
Spin
spinning=
{
loading
||
waiting
}
>
<
Spin
spinning=
{
loading
||
waiting
}
>
<
Basic
<
Basic
ref=
{
basicRef
}
ref=
{
basicRef
}
type=
{
type
}
node=
{
node
?.
directory
}
node=
{
node
?.
directory
}
action=
{
action
}
action=
{
action
}
onTypeChange=
{
(
val
)
=>
{
setType
(
val
)
}
}
onResourceTypeChange=
{
(
val
)
=>
{
onResourceTypeChange=
{
(
val
)
=>
{
setIsCustomType
(
val
===
'custom'
)
setIsCustomType
(
val
===
'custom'
)
}
}
}
}
/>
/>
{
{
!
isCustomType
&&
<
SyncBasic
ref=
{
syncBasicRef
}
node=
{
node
?.
resourceDirectorySyncStrategy
}
action=
{
action
}
/>
showSync
&&
<
SyncBasic
ref=
{
syncBasicRef
}
node=
{
node
?.
resourceDirectorySyncStrategy
}
action=
{
action
}
/>
}
}
</
Spin
>
</
Spin
>
</
Modal
>
</
Modal
>
...
@@ -132,18 +146,16 @@ const FC = (props) => {
...
@@ -132,18 +146,16 @@ const FC = (props) => {
export
default
FC
export
default
FC
export
const
Basic
=
React
.
forwardRef
(
function
({
node
,
action
,
onResourceTypeChange
},
ref
)
{
export
const
Basic
=
React
.
forwardRef
(
function
({
node
,
action
,
type
,
onTypeChange
,
onResourceTypeChange
},
ref
)
{
const
[
type
,
setType
]
=
React
.
useState
(
'root'
)
const
[
currentResourceType
,
setCurrentResourceType
]
=
React
.
useState
()
const
[
currentResourceType
,
setCurrentResourceType
]
=
React
.
useState
()
const
[
form
]
=
Form
.
useForm
()
const
[
form
]
=
Form
.
useForm
()
React
.
useImperativeHandle
(
ref
,
()
=>
({
React
.
useImperativeHandle
(
ref
,
()
=>
({
getType
:
type
,
validate
:
async
()
=>
{
validate
:
async
()
=>
{
return
await
form
.
validateFields
()
return
await
form
.
validateFields
()
},
},
}),
[
type
,
form
])
}),
[
form
])
React
.
useEffect
(()
=>
{
React
.
useEffect
(()
=>
{
if
(
node
)
{
if
(
node
)
{
...
@@ -182,7 +194,7 @@ export const Basic = React.forwardRef(function ({ node, action, onResourceTypeCh
...
@@ -182,7 +194,7 @@ export const Basic = React.forwardRef(function ({ node, action, onResourceTypeCh
rules=
{
[{
required
:
true
,
message
:
'请选择类型!'
}]
}
rules=
{
[{
required
:
true
,
message
:
'请选择类型!'
}]
}
>
>
<
Radio
.
Group
value=
{
type
}
onChange=
{
(
e
)
=>
{
<
Radio
.
Group
value=
{
type
}
onChange=
{
(
e
)
=>
{
setType
(
e
.
target
.
value
)
onTypeChange
?.
(
e
.
target
.
value
)
}
}
>
}
}
>
<
Radio
value=
'root'
>
栏目
</
Radio
>
<
Radio
value=
'root'
>
栏目
</
Radio
>
<
Radio
value=
'child'
disabled=
{
!
node
?.
id
}
>
目录
</
Radio
>
<
Radio
value=
'child'
disabled=
{
!
node
?.
id
}
>
目录
</
Radio
>
...
@@ -336,21 +348,21 @@ export const SyncBasic = React.forwardRef(function ({ node, action }, ref) {
...
@@ -336,21 +348,21 @@ export const SyncBasic = React.forwardRef(function ({ node, action }, ref) {
name=
'blacklist'
name=
'blacklist'
tooltip=
{
{
title
:
'设置过滤条件后,同步Schema时将不会同步符合过滤条件的表'
,
icon
:
<
QuestionCircleOutlined
/>
}
}
tooltip=
{
{
title
:
'设置过滤条件后,同步Schema时将不会同步符合过滤条件的表'
,
icon
:
<
QuestionCircleOutlined
/>
}
}
>
>
<
Input
placeholder=
'输入正则表达式'
/>
<
Input
.
TextArea
rows=
{
1
}
placeholder=
'输入正则表达式'
/>
</
Form
.
Item
>
</
Form
.
Item
>
<
Form
.
Item
<
Form
.
Item
label=
'白名单'
label=
'白名单'
name=
'whitelist'
name=
'whitelist'
tooltip=
{
{
title
:
'设置的白名单,不受过滤条件影响'
,
icon
:
<
QuestionCircleOutlined
/>
}
}
tooltip=
{
{
title
:
'设置的白名单,不受过滤条件影响'
,
icon
:
<
QuestionCircleOutlined
/>
}
}
>
>
<
Input
placeholder=
'输入表名完整路径,多个表以,隔开'
/>
<
Input
.
TextArea
rows=
{
1
}
placeholder=
'输入表名完整路径,多个表以,隔开'
/>
</
Form
.
Item
>
</
Form
.
Item
>
<
Form
.
Item
<
Form
.
Item
label=
'测试数据'
label=
'测试数据'
>
>
<
Row
gutter=
{
10
}
>
<
Row
gutter=
{
10
}
>
<
Col
span=
{
20
}
>
<
Col
span=
{
20
}
>
<
Input
placeholder=
'请输入测试数据'
onChange=
{
(
e
)
=>
{
<
Input
.
TextArea
rows=
{
1
}
placeholder=
'请输入测试数据'
onChange=
{
(
e
)
=>
{
setTestData
(
e
.
target
.
value
)
setTestData
(
e
.
target
.
value
)
}
}
/>
}
}
/>
</
Col
>
</
Col
>
...
@@ -362,7 +374,7 @@ export const SyncBasic = React.forwardRef(function ({ node, action }, ref) {
...
@@ -362,7 +374,7 @@ export const SyncBasic = React.forwardRef(function ({ node, action }, ref) {
<
Form
.
Item
<
Form
.
Item
label=
'测试结果'
label=
'测试结果'
>
>
<
Input
value=
{
testResultData
}
disabled=
{
true
}
/>
<
Input
.
TextArea
rows=
{
1
}
value=
{
testResultData
}
disabled=
{
true
}
/>
</
Form
.
Item
>
</
Form
.
Item
>
</
Form
>
</
Form
>
)
)
...
...
src/view/Manage/AssetTask/index.jsx
View file @
9b61897e
...
@@ -7,7 +7,7 @@ import Table from '../../../util/Component/Table'
...
@@ -7,7 +7,7 @@ import Table from '../../../util/Component/Table'
import
{
dispatch
}
from
'../../../model'
import
{
dispatch
}
from
'../../../model'
import
'./index.less'
import
'./index.less'
import
{
getQueryParam
}
from
'../../../util'
import
{
checkMenuAdmit
,
getQueryParam
}
from
'../../../util'
const
FC
=
(
props
)
=>
{
const
FC
=
(
props
)
=>
{
const
id
=
getQueryParam
(
'id'
,
props
?.
location
?.
search
)
const
id
=
getQueryParam
(
'id'
,
props
?.
location
?.
search
)
...
@@ -83,7 +83,9 @@ const FC = (props) => {
...
@@ -83,7 +83,9 @@ const FC = (props) => {
title
:
'任务编号'
,
title
:
'任务编号'
,
dataIndex
:
'taskNO'
,
dataIndex
:
'taskNO'
,
render
:
(
_
,
record
)
=>
<
a
onClick=
{
()
=>
{
render
:
(
_
,
record
)
=>
<
a
onClick=
{
()
=>
{
if
(
checkMenuAdmit
(
'asset-resource-manage'
))
{
window
.
open
(
`/center-home/menu/asset-resource-manage?taskId=${record.taskNO}`
)
window
.
open
(
`/center-home/menu/asset-resource-manage?taskId=${record.taskNO}`
)
}
}
}
>
}
}
>
{
record
.
taskNO
}
{
record
.
taskNO
}
</
a
>
</
a
>
...
@@ -91,18 +93,17 @@ const FC = (props) => {
...
@@ -91,18 +93,17 @@ const FC = (props) => {
{
{
title
:
'数量'
,
title
:
'数量'
,
dataIndex
:
'resourceNum'
,
dataIndex
:
'resourceNum'
,
},
render
:
(
text
,
record
)
=>
text
?
text
:
0
,
{
title
:
'已分配'
,
dataIndex
:
'distributedNum'
,
},
{
title
:
'已梳理'
,
dataIndex
:
'sortedNum'
,
},
},
{
{
title
:
'已完成'
,
title
:
'已完成'
,
dataIndex
:
'doneNum'
,
dataIndex
:
'doneNum'
,
render
:
(
text
,
record
)
=>
text
?
text
:
0
,
},
{
title
:
'已复核'
,
dataIndex
:
'checkedNum'
,
render
:
(
text
,
record
)
=>
text
?
text
:
0
,
},
},
{
{
title
:
'分配人'
,
title
:
'分配人'
,
...
...
src/view/Manage/DatasourceManage/Component/APIConfigModal.jsx
0 → 100644
View file @
9b61897e
import
{
useEffect
,
useState
,
useContext
,
useMemo
}
from
'react'
;
import
{
Modal
,
Select
,
Pagination
,
Button
}
from
'antd'
;
import
ResizeableTable
from
'../../ResizeableTable'
;
import
{
AppContext
}
from
'../../../../App'
;
import
{
dispatch
}
from
'../../../../model'
;
import
{
DataSourceSelect
}
from
'./ETLConfigModal'
;
const
{
Option
}
=
Select
;
const
FC
=
(
props
)
=>
{
const
{
visible
,
onCancel
,
id
}
=
props
;
const
{
env
}
=
useContext
(
AppContext
);
const
[
loading
,
setLoading
]
=
useState
(
false
);
const
[
pagination
,
setPagination
]
=
useState
({
pageNum
:
1
,
pageSize
:
20
});
const
[
datasources
,
setDatasources
]
=
useState
([]);
const
[
total
,
setTotal
]
=
useState
(
0
);
const
[
apiMapping
,
setApiMapping
]
=
useState
([]);
const
{
pageNum
,
pageSize
}
=
pagination
;
useEffect
(()
=>
{
if
(
visible
)
{
getDatasourcesByEnv
();
}
//eslint-disable-next-line react-hooks/exhaustive-deps
},
[
visible
,
env
])
useEffect
(()
=>
{
if
(
visible
)
{
getApiDataSourceMappingList
();
}
//eslint-disable-next-line react-hooks/exhaustive-deps
},
[
visible
,
id
,
pagination
])
const
columns
=
useMemo
(()
=>
{
return
([
{
title
:
'序号'
,
dataIndex
:
'key'
,
render
:
(
text
,
record
,
index
)
=>
{
return
(
index
+
1
).
toString
();
},
width
:
60
,
ellipsis
:
true
,
},
{
title
:
'API数据源名称'
,
dataIndex
:
'dataSourceName'
,
width
:
200
,
ellipsis
:
true
,
},
{
title
:
'API数据源描述'
,
dataIndex
:
'dataSourceAliasName'
,
width
:
200
,
ellipsis
:
true
,
},
{
title
:
'API数据源URL'
,
dataIndex
:
'dataSourceUrl'
,
width
:
200
,
ellipsis
:
true
,
},
{
title
:
'API数据源Driven'
,
dataIndex
:
'dataSourceDriven'
,
width
:
100
,
ellipsis
:
true
,
},
{
title
:
'数据源名称'
,
dataIndex
:
'replaceDatasourceName'
,
width
:
200
,
ellipsis
:
true
,
render
:
(
text
,
record
,
index
)
=>
{
return
(
<
DataSourceSelect
datasources=
{
datasources
||
[]
}
defaultValue=
{
text
}
onChange=
{
(
value
)
=>
{
onDatasouceChange
(
value
,
index
);
}
}
/>
);
}
},
{
title
:
'IP'
,
dataIndex
:
'replaceSystemIp'
,
width
:
200
,
ellipsis
:
true
,
},
{
title
:
'端口'
,
dataIndex
:
'replaceSystemPort'
,
width
:
100
,
ellipsis
:
true
,
},
{
title
:
'数据库'
,
dataIndex
:
'replaceSystemDb'
,
width
:
100
,
ellipsis
:
true
,
},
{
title
:
'数据库类型'
,
dataIndex
:
'replaceSystemDbType'
,
width
:
100
,
ellipsis
:
true
,
}
]);
//eslint-disable-next-line react-hooks/exhaustive-deps
},
[
datasources
]);
const
tableData
=
useMemo
(()
=>
{
const
newTableData
=
[...
apiMapping
];
(
newTableData
||
[]).
forEach
(
item
=>
{
let
targetSystem
=
{};
datasources
.
forEach
(
datasource
=>
{
datasource
.
targetParameters
.
forEach
(
param
=>
{
if
(
param
.
name
===
'name'
&&
param
.
value
===
item
.
replaceDatasourceName
)
{
targetSystem
=
datasource
;
}
})
});
(
targetSystem
.
targetParameters
||
[]).
forEach
(
param
=>
{
if
(
param
.
name
===
'ip'
)
{
item
.
replaceSystemIp
=
param
.
value
;
}
else
if
(
param
.
name
===
'port'
)
{
item
.
replaceSystemPort
=
param
.
value
;
}
else
if
(
param
.
name
===
'db'
)
{
item
.
replaceSystemDb
=
param
.
value
;
}
else
if
(
param
.
name
===
'dbType'
)
{
item
.
replaceSystemDbType
=
param
.
value
;
}
});
});
return
newTableData
;
},
[
datasources
,
apiMapping
])
const
getDatasourcesByEnv
=
()
=>
{
dispatch
({
type
:
'datasource.getAllDatasources'
,
payload
:
{
namespace
:
env
?.
domainId
},
callback
:
data
=>
{
setDatasources
(
data
||
[]);
}
});
}
const
getApiDataSourceMappingList
=
()
=>
{
setLoading
(
true
);
dispatch
({
type
:
'datasource.getApiDataSourceMappingList'
,
payload
:
{
params
:
{
page
:
pageNum
,
size
:
pageSize
},
data
:
{
targetId
:
id
}
},
callback
:
data
=>
{
setLoading
(
false
);
setApiMapping
(
data
.
content
||
[]);
setTotal
(
data
.
totalElements
||
0
);
},
error
:
()
=>
{
setLoading
(
false
);
}
});
}
const
onDatasouceChange
=
(
value
,
index
)
=>
{
const
newApi
=
{...
apiMapping
[
index
],
replaceDatasourceName
:
value
||
''
};
setLoading
(
true
);
dispatch
({
type
:
'datasource.updateApiDataSourcesMapping'
,
payload
:
{
data
:
newApi
},
callback
:
data
=>
{
setLoading
(
false
);
getApiDataSourceMappingList
();
},
error
:
()
=>
{
setLoading
(
false
);
}
});
}
const
changeCurrent
=
(
page
,
size
)
=>
{
setPagination
({
pageNum
:
page
,
pageSize
:
size
});
}
return
(
<
Modal
className=
'etl-config-modal'
visible=
{
visible
}
title=
'API数据源映射配置'
width=
'80%'
bodyStyle=
{
{
padding
:
'15px'
,
overflowX
:
'auto'
}
}
onCancel=
{
()
=>
{
setPagination
({...
pagination
,
pageNum
:
1
});
onCancel
&&
onCancel
();
}
}
footer=
{
null
}
>
<
div
className=
'mb-3'
>
<
Button
onClick=
{
()
=>
{
getDatasourcesByEnv
()
getApiDataSourceMappingList
()
}
}
>
刷新
</
Button
>
</
div
>
<
ResizeableTable
rowKey=
'id'
columns=
{
columns
}
dataSource=
{
tableData
}
pagination=
{
false
}
loading=
{
loading
}
scroll=
{
{
y
:
'calc(70vh)'
}
}
/>
<
Pagination
size=
"small"
className=
"text-center m-3"
showSizeChanger
showQuickJumper
onChange=
{
changeCurrent
}
onShowSizeChange=
{
changeCurrent
}
current=
{
pageNum
}
pageSize=
{
pageSize
}
defaultCurrent=
{
1
}
total=
{
total
}
showTotal=
{
total
=>
`共 ${total} 条`
}
/>
</
Modal
>
);
}
export
default
FC
\ No newline at end of file
src/view/Manage/DatasourceManage/Component/DatasourceList.jsx
View file @
9b61897e
...
@@ -6,7 +6,7 @@ import DatasourceItem from './DatasourceItem';
...
@@ -6,7 +6,7 @@ import DatasourceItem from './DatasourceItem';
const
DatasourceList
=
(
props
)
=>
{
const
DatasourceList
=
(
props
)
=>
{
const
{
loading
,
data
,
onETLConfig
,
onEdit
,
onAddTask
,
onDelete
,
idBindTasksNeedRefresh
,
scope
,
database
}
=
props
;
const
{
loading
,
data
,
onETLConfig
,
on
APIConfig
,
on
Edit
,
onAddTask
,
onDelete
,
idBindTasksNeedRefresh
,
scope
,
database
}
=
props
;
const
[
expandedBindId
,
setExpandedBindId
]
=
useState
({});
const
[
expandedBindId
,
setExpandedBindId
]
=
useState
({});
...
@@ -56,7 +56,12 @@ const DatasourceList = (props) => {
...
@@ -56,7 +56,12 @@ const DatasourceList = (props) => {
<
Space
className=
'mx-3'
style=
{
{
marginLeft
:
'auto'
}
}
size=
'small'
>
<
Space
className=
'mx-3'
style=
{
{
marginLeft
:
'auto'
}
}
size=
'small'
>
{
{
(
item
.
type
===
'EtlTarget'
)
&&
<
Tooltip
placement=
'bottom'
title=
{
'ETL映射配置'
}
>
(
item
.
type
===
'EtlTarget'
)
&&
<
Tooltip
placement=
'bottom'
title=
{
'ETL映射配置'
}
>
<
Button
icon=
{
<
SettingOutlined
/>
}
size=
'small'
onClick=
{
()
=>
{
onETLConfig
&&
onETLConfig
(
item
);
}
}
/>
<
Button
icon=
{
<
SettingOutlined
/>
}
size=
'small'
onClick=
{
()
=>
{
onETLConfig
?.(
item
);
}
}
/>
</
Tooltip
>
}
{
(
item
.
type
===
'DataServiceApiTarget'
)
&&
<
Tooltip
placement=
'bottom'
title=
'API数据源映射配置'
>
<
Button
icon=
{
<
SettingOutlined
/>
}
size=
'small'
onClick=
{
()
=>
{
onAPIConfig
?.(
item
);
}
}
/>
</
Tooltip
>
</
Tooltip
>
}
}
<
Tooltip
placement=
'bottom'
title=
{
'修改'
}
>
<
Tooltip
placement=
'bottom'
title=
{
'修改'
}
>
...
...
src/view/Manage/DatasourceManage/Component/ETLConfigModal.jsx
View file @
9b61897e
...
@@ -7,7 +7,7 @@ import { dispatch } from '../../../../model';
...
@@ -7,7 +7,7 @@ import { dispatch } from '../../../../model';
const
{
Option
}
=
Select
;
const
{
Option
}
=
Select
;
const
DataSourceSelect
=
(
props
)
=>
{
export
const
DataSourceSelect
=
(
props
)
=>
{
const
{
datasources
,
onChange
,
defaultValue
}
=
props
;
const
{
datasources
,
onChange
,
defaultValue
}
=
props
;
const
[
value
,
setValue
]
=
useState
(
''
);
const
[
value
,
setValue
]
=
useState
(
''
);
...
...
src/view/Manage/DatasourceManage/index.jsx
View file @
9b61897e
...
@@ -3,6 +3,7 @@ import { Space, Select, Button, Modal, TreeSelect } from 'antd';
...
@@ -3,6 +3,7 @@ import { Space, Select, Button, Modal, TreeSelect } from 'antd';
import
DatasourceList
from
'./Component/DatasourceList'
;
import
DatasourceList
from
'./Component/DatasourceList'
;
import
ETLConfigModal
from
'./Component/ETLConfigModal'
;
import
ETLConfigModal
from
'./Component/ETLConfigModal'
;
import
APIConfigModal
from
'./Component/APIConfigModal'
;
import
UpdateDatasourceModal
from
'./Component/UpdateDatasourceModal'
;
import
UpdateDatasourceModal
from
'./Component/UpdateDatasourceModal'
;
import
ScheduleCURDModal
from
'./Component/ScheduleCURDModal'
;
import
ScheduleCURDModal
from
'./Component/ScheduleCURDModal'
;
import
TaskLogsModal
from
'./Component/TaskLogsModal'
;
import
TaskLogsModal
from
'./Component/TaskLogsModal'
;
...
@@ -42,6 +43,7 @@ const DatasourceManage = (props) => {
...
@@ -42,6 +43,7 @@ const DatasourceManage = (props) => {
const
[
scheduleCURDModalVisible
,
setScheduleCURDModalVisible
]
=
useState
(
false
);
const
[
scheduleCURDModalVisible
,
setScheduleCURDModalVisible
]
=
useState
(
false
);
const
[
updateTaskModalVisible
,
setUpdateTaskModalVisible
]
=
useState
(
false
);
const
[
updateTaskModalVisible
,
setUpdateTaskModalVisible
]
=
useState
(
false
);
const
[
etlConfigModalVisible
,
setEtlConfigModalVisible
]
=
useState
(
false
);
const
[
etlConfigModalVisible
,
setEtlConfigModalVisible
]
=
useState
(
false
);
const
[
apiConfigModalVisible
,
setApiConfigModalVisible
]
=
useState
(
false
);
const
[
updateTaskModalAction
,
setUpdateTaskModalAction
]
=
useState
(
''
);
const
[
updateTaskModalAction
,
setUpdateTaskModalAction
]
=
useState
(
''
);
const
[
taskLogsModalVisible
,
setTaskLogsModalVisible
]
=
useState
(
false
);
const
[
taskLogsModalVisible
,
setTaskLogsModalVisible
]
=
useState
(
false
);
const
[
taskLogModalVisible
,
setTaskLogModalVisible
]
=
useState
(
false
);
const
[
taskLogModalVisible
,
setTaskLogModalVisible
]
=
useState
(
false
);
...
@@ -234,6 +236,11 @@ const DatasourceManage = (props) => {
...
@@ -234,6 +236,11 @@ const DatasourceManage = (props) => {
setEtlConfigModalVisible
(
true
);
setEtlConfigModalVisible
(
true
);
}
}
const
configAPIDatasource
=
(
datasource
)
=>
{
setCurrentDatasourceId
(
datasource
.
id
);
setApiConfigModalVisible
(
true
);
}
const
editDatasource
=
(
datasource
)
=>
{
const
editDatasource
=
(
datasource
)
=>
{
setCurrentDatasourceId
(
datasource
.
id
);
setCurrentDatasourceId
(
datasource
.
id
);
setUpdateDatasourceModalAction
(
'edit'
);
setUpdateDatasourceModalAction
(
'edit'
);
...
@@ -433,6 +440,7 @@ const DatasourceManage = (props) => {
...
@@ -433,6 +440,7 @@ const DatasourceManage = (props) => {
database=
{
selectedDatabaseKey
}
database=
{
selectedDatabaseKey
}
idBindTasksNeedRefresh=
{
currentDatasourceIdBindTasksNeedRefresh
}
idBindTasksNeedRefresh=
{
currentDatasourceIdBindTasksNeedRefresh
}
onETLConfig=
{
configETLDatasource
}
onETLConfig=
{
configETLDatasource
}
onAPIConfig=
{
configAPIDatasource
}
onEdit=
{
editDatasource
}
onEdit=
{
editDatasource
}
onAddTask=
{
addTask
}
onAddTask=
{
addTask
}
onDelete=
{
deleteDatasource
}
onDelete=
{
deleteDatasource
}
...
@@ -482,6 +490,14 @@ const DatasourceManage = (props) => {
...
@@ -482,6 +490,14 @@ const DatasourceManage = (props) => {
onCancel=
{
onEtlConfigModalCancel
}
onCancel=
{
onEtlConfigModalCancel
}
/>
/>
<
APIConfigModal
visible=
{
apiConfigModalVisible
}
id=
{
currentDatasourceId
}
onCancel=
{
()
=>
{
setApiConfigModalVisible
(
false
)
}
}
/>
{
contextHolder
}
{
contextHolder
}
</
div
>
</
div
>
</
DatasourceContext
.
Provider
>
</
DatasourceContext
.
Provider
>
...
...
src/view/Manage/MetadataHarvester/Component/Task.jsx
View file @
9b61897e
...
@@ -230,6 +230,14 @@ const FC = (props) => {
...
@@ -230,6 +230,14 @@ const FC = (props) => {
if
(
index
!==
-
1
)
{
if
(
index
!==
-
1
)
{
item
.
typeName
=
supportedTargetTypes
[
index
].
targetName
;
item
.
typeName
=
supportedTargetTypes
[
index
].
targetName
;
}
}
(
item
.
targetConfParameters
??[]).
forEach
(
_item
=>
{
if
(
_item
.
name
===
'tableFilterParam'
)
{
item
.
tableWhiteList
=
_item
.
value
}
else
if
(
_item
.
name
===
'tableBlacklist'
)
{
item
.
tableBlackList
=
_item
.
value
}
})
});
});
if
(
sortedInfo
.
field
&&
sortedInfo
.
order
)
{
if
(
sortedInfo
.
field
&&
sortedInfo
.
order
)
{
...
@@ -242,9 +250,7 @@ const FC = (props) => {
...
@@ -242,9 +250,7 @@ const FC = (props) => {
})
})
}
}
console
.
log
(
'newTasks'
,
newTasks
);
newTasks
=
paginate
(
newTasks
,
pagination
.
pageNum
,
pagination
.
pageSize
);
newTasks
=
paginate
(
newTasks
,
pagination
.
pageNum
,
pagination
.
pageSize
);
return
newTasks
;
return
newTasks
;
}
}
...
...
src/view/Manage/MetadataHarvester/Component/UpdateTask.jsx
View file @
9b61897e
...
@@ -106,7 +106,7 @@ const FC = (props) => {
...
@@ -106,7 +106,7 @@ const FC = (props) => {
let
_fieldsValue
=
{};
let
_fieldsValue
=
{};
prevTask
?.
targetConfParameters
?.
forEach
(
item
=>
{
prevTask
?.
targetConfParameters
?.
forEach
(
item
=>
{
if
(
item
.
name
===
'schema'
)
{
if
(
item
.
name
===
'schema'
)
{
setSelectedSchemas
(
item
.
value
?
.
split
(
','
).
filter
(
value
=>
recentSchemas
.
indexOf
(
value
)
!==-
1
));
setSelectedSchemas
(
(
item
.
value
??
''
)
.
split
(
','
).
filter
(
value
=>
recentSchemas
.
indexOf
(
value
)
!==-
1
));
}
else
{
}
else
{
_fieldsValue
[
item
.
name
||
''
]
=
item
.
value
||
''
;
_fieldsValue
[
item
.
name
||
''
]
=
item
.
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