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
a97633ae
Commit
a97633ae
authored
Nov 19, 2021
by
zhaochengxiang
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'asset-ui' into 'master'
Asset ui See merge request
!7
parents
c657a0f2
e8552565
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
22 changed files
with
300 additions
and
256 deletions
+300
-256
App.js
src/App.js
+24
-13
datamodel.js
src/model/datamodel.js
+4
-0
index.js
src/model/index.js
+2
-1
datamodeler.js
src/service/datamodeler.js
+5
-0
AssetDetail.jsx
src/view/Manage/AssetManage/Component/AssetDetail.jsx
+88
-79
AssetDetailItem.jsx
src/view/Manage/AssetManage/Component/AssetDetailItem.jsx
+0
-74
AssetDetailPage.jsx
src/view/Manage/AssetManage/Component/AssetDetailPage.jsx
+35
-0
AssetDetailPage.less
src/view/Manage/AssetManage/Component/AssetDetailPage.less
+30
-0
AssetTable.jsx
src/view/Manage/AssetManage/Component/AssetTable.jsx
+0
-0
AssetTable.less
src/view/Manage/AssetManage/Component/AssetTable.less
+7
-23
AssetTree.jsx
src/view/Manage/AssetManage/Component/AssetTree.jsx
+1
-0
AttributeRelationModal.jsx
...w/Manage/AssetManage/Component/AttributeRelationModal.jsx
+2
-2
FilterElementModal.jsx
src/view/Manage/AssetManage/Component/FilterElementModal.jsx
+53
-21
FilterElementModal.less
...view/Manage/AssetManage/Component/FilterElementModal.less
+0
-0
MetadataInfo.jsx
src/view/Manage/AssetManage/Component/MetadataInfo.jsx
+1
-1
AssetMount.jsx
src/view/Manage/AssetRecycle/Component/AssetMount.jsx
+4
-4
index.jsx
src/view/Manage/AssetRecycle/index.jsx
+2
-21
EditModel.jsx
src/view/Manage/Model/Component/EditModel.jsx
+14
-0
ImportActionHeader.jsx
src/view/Manage/Model/Component/ImportActionHeader.jsx
+2
-2
ImportActionTable.jsx
src/view/Manage/Model/Component/ImportActionTable.jsx
+1
-1
ModelTable.jsx
src/view/Manage/Model/Component/ModelTable.jsx
+1
-1
index.jsx
src/view/Manage/Model/index.jsx
+24
-13
No files found.
src/App.js
View file @
a97633ae
...
@@ -15,6 +15,7 @@ import AssetManage from './view/Manage/AssetManage';
...
@@ -15,6 +15,7 @@ import AssetManage from './view/Manage/AssetManage';
import
AssetBrowse
from
'./view/Manage/AssetBrowse'
;
import
AssetBrowse
from
'./view/Manage/AssetBrowse'
;
import
AssetRecycle
from
'./view/Manage/AssetRecycle'
;
import
AssetRecycle
from
'./view/Manage/AssetRecycle'
;
import
DatasourceManage
from
'./view/Manage/DatasourceManage'
;
import
DatasourceManage
from
'./view/Manage/DatasourceManage'
;
import
AssetDetailPage
from
'./view/Manage/AssetManage/Component/AssetDetailPage'
;
import
AssetDetail
from
'./view/Manage/AssetManage/Component/AssetDetail'
;
import
AssetDetail
from
'./view/Manage/AssetManage/Component/AssetDetail'
;
import
ImportAction
from
'./view/Manage/Model/Component/ImportAction'
;
import
ImportAction
from
'./view/Manage/Model/Component/ImportAction'
;
import
EditModel
from
'./view/Manage/Model/Component/EditModel'
;
import
EditModel
from
'./view/Manage/Model/Component/EditModel'
;
...
@@ -38,23 +39,30 @@ export class App extends React.Component {
...
@@ -38,23 +39,30 @@ export class App extends React.Component {
if
(
message
===
'showDataModelDetail'
)
{
if
(
message
===
'showDataModelDetail'
)
{
return
(
return
(
<
ImportAction
<
AppContext
.
Provider
value
=
{{
modelerId
=
{
id
}
setGlobalState
,
action
=
'detail'
onGlobalStateChange
terms
=
{
terms
}
}}
>
/
>
<
ImportAction
modelerId
=
{
id
}
action
=
'detail'
terms
=
{
terms
}
/
>
<
/AppContext.Provider
>
);
);
}
}
if
(
message
===
'showAssetDetail'
)
{
if
(
message
===
'showAssetDetail'
)
{
return
(
return
(
<
AssetDetail
<
AppContext
.
Provider
value
=
{{
id
=
{
id
}
setGlobalState
,
reference
=
'search'
onGlobalStateChange
action
=
'detail'
}}
>
terms
=
{
terms
}
<
AssetDetail
visible
=
{
true
}
id
=
{
id
}
/
>
terms
=
{
terms
}
/
>
<
/AppContext.Provider
>
);
);
}
}
...
@@ -85,7 +93,9 @@ export class App extends React.Component {
...
@@ -85,7 +93,9 @@ export class App extends React.Component {
<
Route
path
=
{
`
${
ContextPath
}
/home`
}
component
=
{
Home
}
/
>
<
Route
path
=
{
`
${
ContextPath
}
/home`
}
component
=
{
Home
}
/
>
<
Route
path
=
{
`
${
ContextPath
}
/manage`
}
component
=
{
Manage
}
/
>
<
Route
path
=
{
`
${
ContextPath
}
/manage`
}
component
=
{
Manage
}
/
>
<
Route
path
=
{
`
${
ContextPath
}
/data-model-action`
}
component
=
{
EditModel
}
exact
/>
<
Route
path
=
{
`
${
ContextPath
}
/data-model-action`
}
component
=
{
EditModel
}
exact
/>
<
Route
path
=
{
`
${
ContextPath
}
/model-template-action`
}
component
=
{
EditTemplate
}
exact
/>
<
Route
path
=
{
`
${
ContextPath
}
/model-template-action`
}
component
=
{
EditTemplate
}
exact
/>
<
Route
path
=
{
`
${
ContextPath
}
/asset-detail`
}
component
=
{
AssetDetailPage
}
exact
/>
<
Route
path
=
{
'/center-home/view/datasource-manage'
}
component
=
{
DatasourceManage
}
exact
/>
<
Route
path
=
{
'/center-home/view/datasource-manage'
}
component
=
{
DatasourceManage
}
exact
/>
<
Route
path
=
{
'/center-home/view/data-model'
}
component
=
{
Model
}
exact
/>
<
Route
path
=
{
'/center-home/view/data-model'
}
component
=
{
Model
}
exact
/>
...
@@ -103,6 +113,7 @@ export class App extends React.Component {
...
@@ -103,6 +113,7 @@ export class App extends React.Component {
<
Route
path
=
{
'/center-home/menu/asset-browse'
}
component
=
{
AssetBrowse
}
exact
/>
<
Route
path
=
{
'/center-home/menu/asset-browse'
}
component
=
{
AssetBrowse
}
exact
/>
<
Route
path
=
{
'/center-home/menu/asset-recycle'
}
component
=
{
AssetRecycle
}
exact
/>
<
Route
path
=
{
'/center-home/menu/asset-recycle'
}
component
=
{
AssetRecycle
}
exact
/>
<
Route
path
=
{
'/center-home/data-model-action'
}
component
=
{
EditModel
}
exact
/>
<
Route
path
=
{
'/center-home/data-model-action'
}
component
=
{
EditModel
}
exact
/>
<
Route
path
=
{
'/center-home/asset-detail'
}
component
=
{
AssetDetailPage
}
exact
/>
<
/Switch
>
<
/Switch
>
<
/Router
>
<
/Router
>
<
/AppContext.Provider
>
<
/AppContext.Provider
>
...
...
src/model/datamodel.js
View file @
a97633ae
...
@@ -202,6 +202,10 @@ export function* importWordGenerateModelDraft(payload) {
...
@@ -202,6 +202,10 @@ export function* importWordGenerateModelDraft(payload) {
return
yield
call
(
datamodelerService
.
importWordGenerateModelDraft
,
payload
);
return
yield
call
(
datamodelerService
.
importWordGenerateModelDraft
,
payload
);
}
}
export
function
*
heartbeat
()
{
return
yield
call
(
datamodelerService
.
heartbeat
);
}
export
function
*
validateDataModel
(
payload
)
{
export
function
*
validateDataModel
(
payload
)
{
return
yield
call
(
datamodelerService
.
validateDataModel
,
payload
);
return
yield
call
(
datamodelerService
.
validateDataModel
,
payload
);
}
}
...
...
src/model/index.js
View file @
a97633ae
import
{
createStore
,
applyMiddleware
}
from
'redux'
import
{
createStore
,
applyMiddleware
}
from
'redux'
import
createSagaMiddleware
from
'redux-saga'
import
createSagaMiddleware
from
'redux-saga'
import
{
all
,
call
,
takeLatest
,
takeEvery
}
from
'redux-saga/effects'
import
{
all
,
call
,
takeLatest
,
takeEvery
,
delay
}
from
'redux-saga/effects'
import
{
Connect
,
showErrorNotifaction
}
from
'../util'
;
import
{
Connect
,
showErrorNotifaction
}
from
'../util'
;
import
{
reducers
}
from
'./reducer'
;
import
{
reducers
}
from
'./reducer'
;
...
@@ -16,6 +16,7 @@ function* request(args) {
...
@@ -16,6 +16,7 @@ function* request(args) {
const
{
type
,
payload
,
callback
,
error
}
=
args
.
args
;
const
{
type
,
payload
,
callback
,
error
}
=
args
.
args
;
try
{
try
{
yield
delay
(
100
);
const
rs
=
yield
call
(
funcs
[
type
],
payload
)
const
rs
=
yield
call
(
funcs
[
type
],
payload
)
if
(
callback
)
if
(
callback
)
yield
call
(
callback
,
rs
)
yield
call
(
callback
,
rs
)
...
...
src/service/datamodeler.js
View file @
a97633ae
...
@@ -181,6 +181,10 @@ export function importWordGenerateModelDraft(payload) {
...
@@ -181,6 +181,10 @@ export function importWordGenerateModelDraft(payload) {
return
PostFile
(
"/datamodeler/easyDataModelerExport/word/draft"
,
payload
);
return
PostFile
(
"/datamodeler/easyDataModelerExport/word/draft"
,
payload
);
}
}
export
function
heartbeat
()
{
return
Get
(
"/datamodeler/easyDataModelerExport/heartbeat"
);
}
export
function
validateDataModel
(
payload
)
{
export
function
validateDataModel
(
payload
)
{
return
PostJSON
(
"/datamodeler/easyDataModelerConstraint/validateDataModel"
,
payload
);
return
PostJSON
(
"/datamodeler/easyDataModelerConstraint/validateDataModel"
,
payload
);
}
}
...
@@ -212,3 +216,4 @@ export function getParent(payload) {
...
@@ -212,3 +216,4 @@ export function getParent(payload) {
export
function
autoCreateTable
(
payload
)
{
export
function
autoCreateTable
(
payload
)
{
return
PostJSON
(
"/metadataharvester/datasource/createTableByDDLList"
,
payload
);
return
PostJSON
(
"/metadataharvester/datasource/createTableByDDLList"
,
payload
);
}
}
src/view/Manage/AssetManage/Component/AssetDetail.jsx
View file @
a97633ae
import
React
,
{
useEffect
,
useState
}
from
"react"
;
import
React
,
{
useEffect
,
useState
}
from
"react"
;
import
{
Modal
,
Typography
,
Spin
}
from
"antd"
;
import
{
Spin
,
Tabs
,
Descriptions
}
from
"antd"
;
import
AssetDetailItem
from
'./AssetDetailItem'
;
import
MetadataInfo
from
'./MetadataInfo'
;
import
{
dispatch
}
from
'../../../../model'
;
import
{
highlightSearchContentByTerms
}
from
'../../../../util'
;
import
{
dispatch
}
from
'../../../../model'
;
const
AssetDetail
=
(
props
)
=>
{
const
{
TabPane
}
=
Tabs
;
const
{
onCancel
,
visible
,
id
,
reference
=
null
,
terms
}
=
props
;
const
[
asset
,
setAsset
]
=
useState
(
''
);
const
AssetDetail
=
(
props
)
=>
{
const
[
assetName
,
setAssetName
]
=
useState
(
''
);
const
[
loading
,
setLoading
]
=
useState
(
false
);
const
{
id
,
terms
}
=
props
;
const
[
asset
,
setAsset
]
=
useState
(
''
);
useEffect
(()
=>
{
const
[
types
,
setTypes
]
=
useState
([]);
const
[
loading
,
setLoading
]
=
useState
(
false
);
if
(
visible
&&
(
id
||
''
)
!==
''
)
{
const
[
tabKey
,
setTabKey
]
=
useState
(
'0'
);
getAssetThenGetAssetName
();
}
useEffect
(()
=>
{
//eslint-disable-next-line react-hooks/exhaustive-deps
},
[
visible
,
id
])
if
((
id
||
''
)
!==
''
)
{
getAssetThenGetAssetName
();
const
getAssetThenGetAssetName
=
()
=>
{
}
setLoading
(
true
);
//eslint-disable-next-line react-hooks/exhaustive-deps
dispatch
({
},
[
id
])
type
:
'assetmanage.getDataAssetDetail'
,
payload
:
{
const
getAssetThenGetAssetName
=
()
=>
{
dataAssetId
:
id
setLoading
(
true
);
},
dispatch
({
callback
:
data
=>
{
type
:
'assetmanage.getDataAssetDetail'
,
setLoading
(
false
);
payload
:
{
setAsset
(
data
);
dataAssetId
:
id
getAssetName
(
data
);
},
},
callback
:
data
=>
{
error
:
()
=>
{
setLoading
(
false
);
setLoading
(
false
);
setAsset
(
data
);
}
})
const
_types
=
[];
}
(
data
?.
elements
||
[]).
forEach
(
element
=>
{
if
(
_types
.
indexOf
(
element
.
type
)
===
-
1
)
{
const
getAssetName
=
(
data
)
=>
{
_types
.
push
(
element
.
type
);
if
(
data
)
{
}
const
index
=
(
data
.
elements
||
[]).
findIndex
(
element
=>
element
.
name
===
'中文名称'
);
})
if
(
index
!==
-
1
)
{
setAssetName
(
data
.
elements
[
index
].
value
||
''
);
setTypes
(
_types
);
}
},
}
error
:
()
=>
{
}
setLoading
(
false
);
}
return
(
})
<>
}
{
!
reference
&&
<
Modal
const
onTabChange
=
(
key
)
=>
{
title=
{
setTabKey
(
key
);
<
Typography
.
Paragraph
}
className=
'mr-5'
title=
{
`资产: ${assetName||''}`
}
return
(
ellipsis
<
Spin
spinning=
{
loading
}
>
>
<
Tabs
activeKey=
{
tabKey
}
onChange=
{
onTabChange
}
>
{
`资产: ${assetName||''}`
}
{
</
Typography
.
Paragraph
>
}
(
types
||
[]).
map
((
type
,
index
)
=>
{
visible=
{
visible
}
width=
{
800
}
const
_currentValues
=
(
asset
.
elements
||
[]).
filter
(
element
=>
element
.
type
===
type
);
onCancel=
{
()
=>
{
onCancel
&&
onCancel
()}
}
footer=
{
null
}
return
(
>
<
TabPane
tab=
{
type
}
key=
{
index
}
>
<
Spin
spinning=
{
loading
}
>
<
Descriptions
column=
{
2
}
>
<
AssetDetailItem
data=
{
asset
}
/>
{
</
Spin
>
(
_currentValues
||
[]).
map
((
item
,
index
)
=>
{
</
Modal
>
return
(
}
<
Descriptions
.
Item
label=
{
item
.
name
||
''
}
key=
{
index
}
>
{
{
reference
&&
<
Spin
spinning=
{
loading
}
>
item
.
name
===
'资产项'
?
<
MetadataInfo
config=
{
false
}
value=
{
item
.
value
||
''
}
/>
:
<
span
>
{
highlightSearchContentByTerms
(
item
.
value
||
''
,
terms
)
}
</
span
>
<
AssetDetailItem
data=
{
asset
}
terms=
{
terms
}
/>
}
</
Spin
>
</
Descriptions
.
Item
>
}
);
</>
})
)
}
}
</
Descriptions
>
</
TabPane
>
)
})
}
</
Tabs
>
</
Spin
>
)
}
export
default
AssetDetail
;
export
default
AssetDetail
;
\ No newline at end of file
src/view/Manage/AssetManage/Component/AssetDetailItem.jsx
deleted
100644 → 0
View file @
c657a0f2
import
React
,
{
useEffect
,
useState
}
from
'react'
;
import
{
Row
,
Col
,
Typography
}
from
'antd'
;
import
{
highlightSearchContentByTerms
}
from
'../../../../util'
;
import
MetadataInfo
from
'./MetadataInfo'
;
import
'./AssetItem.less'
;
const
AssetItem
=
(
props
)
=>
{
const
{
data
,
terms
}
=
props
;
const
[
typesOfElements
,
setTypesOfElements
]
=
useState
([]);
useEffect
(()
=>
{
if
(
data
)
{
convertData
();
}
//eslint-disable-next-line react-hooks/exhaustive-deps
},
[
data
]);
const
convertData
=
()
=>
{
const
_typesOfElements
=
[];
const
_types
=
[];
data
&&
(
data
.
elements
||
[]).
forEach
(
element
=>
{
if
(
_types
.
indexOf
(
element
.
type
||
''
)
===
-
1
)
{
_types
.
push
(
element
.
type
||
''
);
const
_elements
=
(
data
.
elements
||
[]).
filter
(
_element
=>
(
_element
.
type
||
''
)
===
(
element
.
type
||
''
));
_typesOfElements
.
push
({
type
:
element
.
type
||
''
,
elements
:
_elements
||
[]
});
}
})
setTypesOfElements
(
_typesOfElements
);
}
return
(
<
div
className=
'asset-item'
>
{
(
typesOfElements
||
[]).
map
((
elementGroup
,
index
)
=>
{
const
_type
=
elementGroup
.
type
||
''
;
return
(
<
div
>
<
div
className=
'flex'
style=
{
{
alignItems
:
'center'
,
padding
:
'15px 0'
}
}
>
<
div
style=
{
{
width
:
3
,
height
:
14
,
backgroundColor
:
'#0069AC'
,
marginRight
:
5
}
}
/>
<
span
style=
{
{
fontWeight
:
'bold'
,
color
:
'#464646'
}
}
>
{
_type
||
''
}
</
span
>
</
div
>
<
Row
>
{
elementGroup
&&
elementGroup
.
elements
&&
elementGroup
.
elements
.
map
((
element
,
_index
)
=>
{
return
(
<
Col
className=
'mb-3'
key=
{
_index
}
md=
{
8
}
>
<
Typography
.
Paragraph
title=
{
`${element.name||''}: ${element.value||''}`
}
style=
{
{
color
:
'#464646'
}
}
ellipsis
>
{
`${element.name||''}: `
}
{
(
element
.
name
===
'资产项'
)?<
MetadataInfo
config=
{
false
}
value=
{
element
.
value
||
''
}
/>:
highlightSearchContentByTerms
(
element
.
value
||
''
,
terms
)
}
</
Typography
.
Paragraph
>
</
Col
>
);
})
}
</
Row
>
<
div
style=
{
{
width
:
'100%'
,
height
:
2
,
backgroundColor
:
'#ededed'
}
}
/>
</
div
>
)
})
}
</
div
>
);
}
export
default
AssetItem
;
src/view/Manage/AssetManage/Component/AssetDetailPage.jsx
0 → 100644
View file @
a97633ae
import
React
,
{
useEffect
,
useState
}
from
"react"
;
import
AssetDetail
from
'./AssetDetail'
;
import
{
getQueryParam
}
from
'../../../../util'
;
import
'./AssetDetailPage.less'
;
const
AssetDetailPage
=
(
props
)
=>
{
const
[
id
,
setId
]
=
useState
(
''
);
useEffect
(()
=>
{
const
_id
=
getQueryParam
(
'id'
,
props
.
location
.
search
);
setId
(
_id
);
//eslint-disable-next-line react-hooks/exhaustive-deps
},
[])
return
(
<
div
className=
'asset-detail position-relative'
>
<
div
className=
'detail-header'
>
<
span
style=
{
{
fontSize
:
16
,
fontWeight
:
'bold'
,
color
:
'#fff'
}
}
>
资产详情
</
span
>
</
div
>
<
div
className=
'detail-container'
>
<
div
className=
'detail-container-card'
>
<
AssetDetail
id=
{
id
}
/>
</
div
>
</
div
>
</
div
>
)
}
export
default
AssetDetailPage
;
\ No newline at end of file
src/view/Manage/AssetManage/Component/AssetDetailPage.less
0 → 100644
View file @
a97633ae
.asset-detail {
.detail-header {
display: flex;
width: 100%;
height: 44px;
padding: 0 15px;
background-color: #464d6e;
align-items: center;
position: fixed;
justify-content: space-between;
border-bottom: 1px solid #EFEFEF;
z-index: 100;
}
.detail-container {
top: 44px;
width: 100%;
height: calc(100vh - 44px);
overflow: auto;
background: #EDF0F5;
padding: 10px 20px;
position: absolute;
}
.detail-container-card {
padding: 20px 20px 0;
background: #fff;
}
}
\ No newline at end of file
src/view/Manage/AssetManage/Component/AssetTable.jsx
View file @
a97633ae
This diff is collapsed.
Click to expand it.
src/view/Manage/AssetManage/Component/AssetTable.less
View file @
a97633ae
@import '../../../../variables.less';
@import '../../../../variables.less';
.asset-list {
.asset-list {
.yy-list-item-action {
text-align: right;
}
.yy-card-head-title {
.yy-card-head-title {
font-weight: normal;
font-weight: normal;
font-size: 14px;
font-size: 14px;
padding: 0;
padding: 0;
}
}
.yy-list-vertical .yy-list-item-action > li {
padding: 0 ;
.highlight-row {
}
.yy-table-cell {
.data-asset-spin {
background-color: #e7f7ff !important;
height: calc(100vh - @header-height - @pm-4 - 53px - 52px + 1px);
}
.yy-checkbox-group {
height: calc(100vh - @header-height - @pm-4 - 53px - 52px - 53px) !important;
overflow: auto !important;
}
.yy-divider-horizontal {
margin: 0 !important;
}
.yy-list-vertical {
.yy-list-item-meta, .yy-list-item-meta-title {
margin-bottom: 0 !important;
}
}
}
}
.yy-list-item {
padding: 0 !important;
}
}
}
\ No newline at end of file
src/view/Manage/AssetManage/Component/AssetTree.jsx
View file @
a97633ae
...
@@ -76,6 +76,7 @@ const AssetTree = (props) => {
...
@@ -76,6 +76,7 @@ const AssetTree = (props) => {
},
},
callback
:
data
=>
{
callback
:
data
=>
{
setCheckedKeys
(
data
.
dirIds
||
[]);
setCheckedKeys
(
data
.
dirIds
||
[]);
onCheck
&&
onCheck
(
data
.
dirIds
||
[]);
},
},
})
})
}
}
...
...
src/view/Manage/AssetManage/Component/AttributeRelationModal.jsx
View file @
a97633ae
...
@@ -182,7 +182,7 @@ const AttributeRelationModal = (props) => {
...
@@ -182,7 +182,7 @@ const AttributeRelationModal = (props) => {
<
Space
>
<
Space
>
<
Button
onClick=
{
()
=>
{
<
Button
onClick=
{
()
=>
{
reset
();
reset
();
onCancel
&&
onCancel
();
onCancel
&&
onCancel
();
}
}
>
返回
</
Button
>
}
}
>
返回
</
Button
>
{
{
!
readOnly
&&
<
Button
type=
"primary"
onClick=
{
onOk
}
loading=
{
confirmLoading
}
>
确定
</
Button
>
!
readOnly
&&
<
Button
type=
"primary"
onClick=
{
onOk
}
loading=
{
confirmLoading
}
>
确定
</
Button
>
...
@@ -207,7 +207,7 @@ const AttributeRelationModal = (props) => {
...
@@ -207,7 +207,7 @@ const AttributeRelationModal = (props) => {
name=
{
element
.
id
||
''
}
name=
{
element
.
id
||
''
}
key=
{
index
}
key=
{
index
}
>
>
<
Select
>
<
Select
allowClear
>
{
{
(
attributes
||
[]).
map
((
attribute
,
_index
)
=>
{
(
attributes
||
[]).
map
((
attribute
,
_index
)
=>
{
return
(
return
(
...
...
src/view/Manage/AssetManage/Component/FilterElement.jsx
→
src/view/Manage/AssetManage/Component/FilterElement
Modal
.jsx
View file @
a97633ae
import
React
,
{
useEffect
,
useState
}
from
'react'
;
import
React
,
{
useEffect
,
useState
}
from
'react'
;
import
{
Row
,
Col
,
Checkbox
,
Typography
,
Space
,
Button
,
Switch
}
from
'antd'
;
import
{
Row
,
Col
,
Checkbox
,
Typography
,
Button
,
Switch
,
Modal
}
from
'antd'
;
import
{
dispatch
}
from
'../../../../model'
;
import
{
dispatch
}
from
'../../../../model'
;
import
'./FilterElement.less'
;
import
'./FilterElement
Modal
.less'
;
const
FilterElement
=
(
props
)
=>
{
const
FilterElement
Modal
=
(
props
)
=>
{
const
{
onCancel
}
=
props
;
const
{
visible
,
onCancel
}
=
props
;
const
[
elements
,
setElements
]
=
useState
([]);
const
[
elements
,
setElements
]
=
useState
([]);
const
[
typesOfElements
,
setTypesOfElements
]
=
useState
([]);
const
[
typesOfElements
,
setTypesOfElements
]
=
useState
([]);
const
[
selectedKeys
,
setSelectedKeys
]
=
useState
([]);
const
[
selectedKeys
,
setSelectedKeys
]
=
useState
([]);
const
[
confirmLoading
,
setConfirmLoading
]
=
useState
(
false
);
useEffect
(()
=>
{
useEffect
(()
=>
{
getAllFilterElementIdsThenGetAllElements
();
if
(
visible
)
{
getAllFilterElementIdsThenGetAllElements
();
}
//eslint-disable-next-line react-hooks/exhaustive-deps
//eslint-disable-next-line react-hooks/exhaustive-deps
},
[]);
},
[
visible
]);
const
getAllFilterElementIdsThenGetAllElements
=
()
=>
{
const
getAllFilterElementIdsThenGetAllElements
=
()
=>
{
dispatch
({
dispatch
({
...
@@ -87,19 +90,56 @@ const FilterElement = (props) => {
...
@@ -87,19 +90,56 @@ const FilterElement = (props) => {
const
onOk
=
()
=>
{
const
onOk
=
()
=>
{
setConfirmLoading
(
true
);
dispatch
({
dispatch
({
type
:
'assetmanage.setupFilterElementIds'
,
type
:
'assetmanage.setupFilterElementIds'
,
payload
:
{
payload
:
{
data
:
selectedKeys
data
:
selectedKeys
},
},
callback
:
()
=>
{
callback
:
()
=>
{
onCancel
&&
onCancel
(
false
,
true
);
reset
();
onCancel
&&
onCancel
(
true
);
},
error
:
()
=>
{
reset
();
}
}
})
})
}
}
const
cancel
=
()
=>
{
reset
();
onCancel
&&
onCancel
();
}
const
reset
=
()
=>
{
setConfirmLoading
(
false
);
}
return
(
return
(
<
div
className=
'filter-element'
style=
{
{
width
:
500
}
}
>
<
Modal
forceRender
visible=
{
visible
}
title=
'资产要素过滤'
width=
{
520
}
onCancel=
{
cancel
}
footer=
{
[
<
Button
key=
"0"
onClick=
{
cancel
}
>
取消
</
Button
>,
<
Button
key=
"1"
type=
"primary"
onClick=
{
onOk
}
loading=
{
confirmLoading
}
>
确定
</
Button
>,
]
}
>
<
div
className=
'd-flex'
>
<
div
className=
'd-flex'
>
<
Switch
<
Switch
checkedChildren=
"全不选"
checkedChildren=
"全不选"
...
@@ -108,13 +148,13 @@ const FilterElement = (props) => {
...
@@ -108,13 +148,13 @@ const FilterElement = (props) => {
style=
{
{
marginLeft
:
'auto'
}
}
style=
{
{
marginLeft
:
'auto'
}
}
/>
/>
</
div
>
</
div
>
<
div
style=
{
{
maxHeight
:
450
,
overflow
:
'auto'
}
}
>
<
div
className=
'mt-3'
style=
{
{
maxHeight
:
450
,
overflow
:
'auto'
}
}
>
{
{
(
typesOfElements
||
[]).
map
((
typeOfElements
,
index
)
=>
{
(
typesOfElements
||
[]).
map
((
typeOfElements
,
index
)
=>
{
const
_type
=
typeOfElements
.
type
||
''
;
const
_type
=
typeOfElements
.
type
||
''
;
return
(
return
(
<
div
>
<
div
key=
{
index
}
>
<
div
className=
'flex'
style=
{
{
alignItems
:
'center'
,
padding
:
'15px 0'
}
}
>
<
div
className=
'flex'
style=
{
{
alignItems
:
'center'
,
padding
:
'15px 0'
}
}
>
<
div
style=
{
{
width
:
3
,
height
:
14
,
backgroundColor
:
'#0069AC'
,
marginRight
:
5
}
}
/>
<
div
style=
{
{
width
:
3
,
height
:
14
,
backgroundColor
:
'#0069AC'
,
marginRight
:
5
}
}
/>
<
span
style=
{
{
fontWeight
:
'bold'
,
color
:
'#464646'
}
}
>
{
_type
||
''
}
</
span
>
<
span
style=
{
{
fontWeight
:
'bold'
,
color
:
'#464646'
}
}
>
{
_type
||
''
}
</
span
>
...
@@ -141,16 +181,8 @@ const FilterElement = (props) => {
...
@@ -141,16 +181,8 @@ const FilterElement = (props) => {
})
})
}
}
</
div
>
</
div
>
<
div
className=
'mt-3 d-flex pt-3'
style=
{
{
borderTop
:
'1px solid rgba(0, 0, 0, 0.06)'
}
}
>
</
Modal
>
<
Space
style=
{
{
marginLeft
:
'auto'
}
}
>
<
Button
onClick=
{
()
=>
{
onCancel
&&
onCancel
();
}
}
>
取消
</
Button
>
<
Button
type=
'primary'
onClick=
{
onOk
}
>
确定
</
Button
>
</
Space
>
</
div
>
</
div
>
);
);
}
}
export
default
FilterElement
;
export
default
FilterElementModal
;
\ No newline at end of file
\ No newline at end of file
src/view/Manage/AssetManage/Component/FilterElement.less
→
src/view/Manage/AssetManage/Component/FilterElement
Modal
.less
View file @
a97633ae
File moved
src/view/Manage/AssetManage/Component/MetadataInfo.jsx
View file @
a97633ae
...
@@ -19,7 +19,7 @@ const MetadataInfo = ({ value = '', config = true }) => {
...
@@ -19,7 +19,7 @@ const MetadataInfo = ({ value = '', config = true }) => {
value
=>
<
span
>
value
=>
<
span
>
{
{
(
typeof
metadata
===
'string'
)
?
<
span
style=
{
{
marginRight
:
5
}
}
>
{
metadata
||
''
}
</
span
>
:
<
a
onClick=
{
()
=>
{
(
typeof
metadata
===
'string'
)
?
<
span
style=
{
{
marginRight
:
5
}
}
>
{
metadata
||
''
}
</
span
>
:
<
a
onClick=
{
()
=>
{
value
?.
setGlobalState
({
value
?.
setGlobalState
&&
value
?.
setGlobalState
({
message
:
'data-govern-show-metadata-message'
,
message
:
'data-govern-show-metadata-message'
,
data
:
metadata
data
:
metadata
})
})
...
...
src/view/Manage/AssetRecycle/Component/AssetMount.jsx
View file @
a97633ae
...
@@ -7,7 +7,7 @@ import { showMessage } from '../../../../util';
...
@@ -7,7 +7,7 @@ import { showMessage } from '../../../../util';
const
AssetMount
=
(
props
)
=>
{
const
AssetMount
=
(
props
)
=>
{
const
{
onCancel
,
visible
,
id
,
recycleId
s
,
refrence
=
'asset-manage'
}
=
props
;
const
{
onCancel
,
visible
,
ids
,
refrence
=
'asset-manage'
}
=
props
;
const
[
dirIds
,
setDirIds
]
=
useState
([]);
const
[
dirIds
,
setDirIds
]
=
useState
([]);
const
[
confirmLoading
,
setConfirmLoading
]
=
useState
(
false
);
const
[
confirmLoading
,
setConfirmLoading
]
=
useState
(
false
);
...
@@ -28,7 +28,7 @@ const AssetMount = (props) => {
...
@@ -28,7 +28,7 @@ const AssetMount = (props) => {
params
:
{
params
:
{
dirId
:
dirIds
.
join
(
","
),
dirId
:
dirIds
.
join
(
","
),
},
},
data
:
(
refrence
===
'asset-recycle'
)
?
recycleIds
:
[
id
||
''
]
data
:
ids
},
},
callback
:
data
=>
{
callback
:
data
=>
{
setConfirmLoading
(
false
);
setConfirmLoading
(
false
);
...
@@ -48,7 +48,7 @@ const AssetMount = (props) => {
...
@@ -48,7 +48,7 @@ const AssetMount = (props) => {
return
(
return
(
<
Modal
<
Modal
title=
'
挂载
详情'
title=
'
变更目录
详情'
visible=
{
visible
}
visible=
{
visible
}
width=
{
400
}
width=
{
400
}
confirmLoading=
{
confirmLoading
}
confirmLoading=
{
confirmLoading
}
...
@@ -63,7 +63,7 @@ const AssetMount = (props) => {
...
@@ -63,7 +63,7 @@ const AssetMount = (props) => {
checkable=
{
true
}
checkable=
{
true
}
showCustom=
{
false
}
showCustom=
{
false
}
onCheck=
{
onCheck
}
onCheck=
{
onCheck
}
tableId=
{
refrence
===
'asset-manage'
?
id
:
''
}
tableId=
{
(
refrence
===
'asset-manage'
&&
(
ids
||
[].
length
>
0
))?
ids
[
0
]
:
''
}
reference=
'mount'
reference=
'mount'
{
...
props
}
{
...
props
}
/>
/>
...
...
src/view/Manage/AssetRecycle/index.jsx
View file @
a97633ae
...
@@ -3,7 +3,6 @@ import { Table, Pagination, Space, Tooltip, Button, Modal } from 'antd';
...
@@ -3,7 +3,6 @@ import { Table, Pagination, Space, Tooltip, Button, Modal } from 'antd';
import
{
ReconciliationOutlined
,
DeleteOutlined
,
UndoOutlined
}
from
'@ant-design/icons'
;
import
{
ReconciliationOutlined
,
DeleteOutlined
,
UndoOutlined
}
from
'@ant-design/icons'
;
import
{
dispatchLatest
}
from
'../../../model'
;
import
{
dispatchLatest
}
from
'../../../model'
;
import
AssetDetail
from
'../AssetManage/Component/AssetDetail'
;
import
AssetMount
from
'./Component/AssetMount'
;
import
AssetMount
from
'./Component/AssetMount'
;
import
{
showMessage
}
from
'../../../util'
;
import
{
showMessage
}
from
'../../../util'
;
...
@@ -16,7 +15,6 @@ const AssetRecycle = (props) => {
...
@@ -16,7 +15,6 @@ const AssetRecycle = (props) => {
const
[
total
,
setTotal
]
=
useState
(
0
);
const
[
total
,
setTotal
]
=
useState
(
0
);
const
[
pagination
,
setPagination
]
=
useState
(
{
pageNum
:
1
,
pageSize
:
20
}
);
const
[
pagination
,
setPagination
]
=
useState
(
{
pageNum
:
1
,
pageSize
:
20
}
);
const
[
currentAssetId
,
setCurrentAssetId
]
=
useState
(
''
);
const
[
currentAssetId
,
setCurrentAssetId
]
=
useState
(
''
);
const
[
assetDetailVisible
,
setAssetDetailVisible
]
=
useState
(
false
);
const
[
assetMountVisible
,
setAssetMountVisible
]
=
useState
(
false
);
const
[
assetMountVisible
,
setAssetMountVisible
]
=
useState
(
false
);
const
[
selectedRowKeys
,
setSelectedRowKeys
]
=
useState
([]);
const
[
selectedRowKeys
,
setSelectedRowKeys
]
=
useState
([]);
const
[
batchMount
,
setBatchMount
]
=
useState
(
false
);
const
[
batchMount
,
setBatchMount
]
=
useState
(
false
);
...
@@ -108,15 +106,7 @@ const AssetRecycle = (props) => {
...
@@ -108,15 +106,7 @@ const AssetRecycle = (props) => {
const
detailItem
=
(
record
)
=>
{
const
detailItem
=
(
record
)
=>
{
setCurrentAssetId
(
record
.
id
);
setCurrentAssetId
(
record
.
id
);
window
.
open
(
`/center-home/asset-detail?id=
${
record
.
id
}
`
);
const
index
=
selectedRowKeys
.
findIndex
((
rowKey
)
=>
rowKey
===
record
.
id
);
if
(
index
!==
-
1
)
{
const
newSelectedRowKeys
=
[...
selectedRowKeys
];
newSelectedRowKeys
.
splice
(
index
,
1
);
setSelectedRowKeys
(
newSelectedRowKeys
);
}
setAssetDetailVisible
(
true
);
}
}
const
mountItem
=
(
record
)
=>
{
const
mountItem
=
(
record
)
=>
{
...
@@ -179,10 +169,6 @@ const AssetRecycle = (props) => {
...
@@ -179,10 +169,6 @@ const AssetRecycle = (props) => {
});
});
}
}
const
onAssetDetailCancel
=
()
=>
{
setAssetDetailVisible
(
false
);
}
const
onAssetMountCancel
=
(
refresh
=
false
)
=>
{
const
onAssetMountCancel
=
(
refresh
=
false
)
=>
{
setAssetMountVisible
(
false
);
setAssetMountVisible
(
false
);
...
@@ -240,15 +226,10 @@ const AssetRecycle = (props) => {
...
@@ -240,15 +226,10 @@ const AssetRecycle = (props) => {
showTotal=
{
total
=>
`共 ${total} 条`
}
showTotal=
{
total
=>
`共 ${total} 条`
}
/>
/>
</
div
>
</
div
>
<
AssetDetail
visible=
{
assetDetailVisible
}
id=
{
currentAssetId
}
onCancel=
{
onAssetDetailCancel
}
/>
<
AssetMount
<
AssetMount
refrence=
'asset-recycle'
refrence=
'asset-recycle'
visible=
{
assetMountVisible
}
visible=
{
assetMountVisible
}
recycleI
ds=
{
batchMount
?
selectedRowKeys
:
[
currentAssetId
]
}
i
ds=
{
batchMount
?
selectedRowKeys
:
[
currentAssetId
]
}
onCancel=
{
onAssetMountCancel
}
onCancel=
{
onAssetMountCancel
}
{
...
props
}
{
...
props
}
/>
/>
...
...
src/view/Manage/Model/Component/EditModel.jsx
View file @
a97633ae
...
@@ -47,10 +47,24 @@ const EditModel = (props) => {
...
@@ -47,10 +47,24 @@ const EditModel = (props) => {
}
}
setActionData
({
action
:
_action
,
catalogId
:
_catalogId
,
modelerId
:
_modelerId
,
hints
:
_hints
,
roughModelerData
:
_roughModelerData
,
permitCheckOut
:
_permitCheckOut
,
editable
:
_editable
,
stateId
:
_stateId
,
versionId
:
_versionId
});
setActionData
({
action
:
_action
,
catalogId
:
_catalogId
,
modelerId
:
_modelerId
,
hints
:
_hints
,
roughModelerData
:
_roughModelerData
,
permitCheckOut
:
_permitCheckOut
,
editable
:
_editable
,
stateId
:
_stateId
,
versionId
:
_versionId
});
const
interval
=
setInterval
(()
=>
{
heartbeat
();
},
10
*
60
*
1000
);
return
()
=>
{
clearInterval
(
interval
);
}
//eslint-disable-next-line react-hooks/exhaustive-deps
//eslint-disable-next-line react-hooks/exhaustive-deps
},
[])
},
[])
const
heartbeat
=
()
=>
{
dispatchLatest
({
type
:
'datamodel.heartbeat'
});
}
const
save
=
async
(
e
,
cid
=
''
)
=>
{
const
save
=
async
(
e
,
cid
=
''
)
=>
{
try
{
try
{
const
row
=
await
form
.
validateFields
();
const
row
=
await
form
.
validateFields
();
...
...
src/view/Manage/Model/Component/ImportActionHeader.jsx
View file @
a97633ae
...
@@ -83,7 +83,7 @@ const ImportActionHeader = (props) => {
...
@@ -83,7 +83,7 @@ const ImportActionHeader = (props) => {
setAutoTranslate
((
modelerData
.
name
||
''
)
===
''
);
setAutoTranslate
((
modelerData
.
name
||
''
)
===
''
);
if
(
modelerData
)
{
if
(
modelerData
)
{
form
.
setFieldsValue
(
modelerData
);
form
?
.
setFieldsValue
(
modelerData
);
}
}
//eslint-disable-next-line react-hooks/exhaustive-deps
//eslint-disable-next-line react-hooks/exhaustive-deps
...
@@ -159,7 +159,7 @@ const ImportActionHeader = (props) => {
...
@@ -159,7 +159,7 @@ const ImportActionHeader = (props) => {
},
},
callback
:
data
=>
{
callback
:
data
=>
{
if
((
data
?.
translated
||
''
)
!==
''
)
{
if
((
data
?.
translated
||
''
)
!==
''
)
{
form
.
setFieldsValue
({
name
:
data
?.
translated
||
''
});
form
?
.
setFieldsValue
({
name
:
data
?.
translated
||
''
});
}
}
onChange
&&
onChange
(
changedValues
,
allValues
);
onChange
&&
onChange
(
changedValues
,
allValues
);
}
}
...
...
src/view/Manage/Model/Component/ImportActionTable.jsx
View file @
a97633ae
...
@@ -753,7 +753,7 @@ const ImportActionTable = (props) => {
...
@@ -753,7 +753,7 @@ const ImportActionTable = (props) => {
}
}
{
{
record?.isPossibleNewTerm?.possible && <Typography.Link className='mr-3' onClick={() => {
record?.isPossibleNewTerm?.possible && <Typography.Link className='mr-3' onClick={() => {
value?.setGlobalState({
value?.setGlobalState
&& value?.setGlobalState
({
message: 'data-govern-show-standard-create',
message: 'data-govern-show-standard-create',
data: {
data: {
column: record,
column: record,
...
...
src/view/Manage/Model/Component/ModelTable.jsx
View file @
a97633ae
...
@@ -135,7 +135,7 @@ const ModelTable = (props) => {
...
@@ -135,7 +135,7 @@ const ModelTable = (props) => {
if
(
record
?.
state
?.
id
===
'2'
)
{
if
(
record
?.
state
?.
id
===
'2'
)
{
editTip
=
'待发布的模型不允许编辑'
;
editTip
=
'待发布的模型不允许编辑'
;
}
else
if
(
record
?.
state
?.
id
===
'4'
)
{
}
else
if
(
record
?.
state
?.
id
===
'4'
)
{
editTip
=
'已发布模型下存在未发布的模型,不允许再编辑'
;
editTip
=
`
${
record
.
holder
||
''
}
正在编辑中, 不允许再编辑`
;
}
}
}
}
...
...
src/view/Manage/Model/index.jsx
View file @
a97633ae
...
@@ -45,7 +45,7 @@ class Model extends React.Component {
...
@@ -45,7 +45,7 @@ class Model extends React.Component {
hints
:
[],
hints
:
[],
loadingStates
:
false
,
loadingStates
:
false
,
modelStates
:
[],
modelStates
:
[],
currentModelState
:
'
4
'
,
currentModelState
:
''
,
currentView
:
''
,
currentView
:
''
,
exportDDLModalReference
:
'exportDDL'
,
exportDDLModalReference
:
'exportDDL'
,
currentModel
:
{},
currentModel
:
{},
...
@@ -72,8 +72,7 @@ class Model extends React.Component {
...
@@ -72,8 +72,7 @@ class Model extends React.Component {
callback
:
data
=>
{
callback
:
data
=>
{
this
.
setState
({
this
.
setState
({
loadingStates
:
false
,
loadingStates
:
false
,
// modelStates: [{ name: 'all', id: '', cnName: '所有状态' }, ...(data?.subCatalogs||[])]
modelStates
:
[{
name
:
'all'
,
id
:
''
,
cnName
:
'所有状态'
},
...(
data
?.
subCatalogs
||
[])]
modelStates
:
data
?.
subCatalogs
||
[],
});
});
},
},
error
:
()
=>
{
error
:
()
=>
{
...
@@ -93,9 +92,9 @@ class Model extends React.Component {
...
@@ -93,9 +92,9 @@ class Model extends React.Component {
})
})
}
}
onTreeSelect
=
(
key
,
offset
)
=>
{
onTreeSelect
=
(
key
,
offset
=
null
)
=>
{
this
.
setState
({
catalogId
:
key
,
keyword
:
''
,
offset
},
()
=>
{
this
.
setState
({
catalogId
:
key
,
keyword
:
''
,
offset
,
currentModelState
:
(
offset
!==
null
)?
''
:
this
.
state
.
currentModelState
},
()
=>
{
if
(
!
key
||
key
===
''
)
{
if
(
!
key
||
key
===
''
)
{
this
.
setState
({
tableData
:
[],
filterTableData
:
[]
});
this
.
setState
({
tableData
:
[],
filterTableData
:
[]
});
}
else
{
}
else
{
...
@@ -110,12 +109,18 @@ class Model extends React.Component {
...
@@ -110,12 +109,18 @@ class Model extends React.Component {
this
.
setState
({
loadingTableData
:
true
},
()
=>
{
this
.
setState
({
loadingTableData
:
true
},
()
=>
{
if
(
keyword
===
''
)
{
if
(
keyword
===
''
)
{
if
(
currentView
===
'dir'
)
{
if
(
currentView
===
'dir'
)
{
const
params
=
{
easyDataModelerCatalogId
:
catalogId
,
};
if
(
currentModelState
!==
''
)
{
params
.
stateId
=
currentModelState
;
}
dispatchLatestHomepage
({
dispatchLatestHomepage
({
type
:
'datamodel.getCurrentDataModelCatalog'
,
type
:
'datamodel.getCurrentDataModelCatalog'
,
payload
:
{
payload
:
params
,
easyDataModelerCatalogId
:
catalogId
,
stateId
:
currentModelState
},
callback
:
data
=>
{
callback
:
data
=>
{
this
.
setState
({
loadingTableData
:
false
,
tableData
:
data
.
easyDataModelerDataModels
||
[],
filterTableData
:
data
.
easyDataModelerDataModels
||
[]
});
this
.
setState
({
loadingTableData
:
false
,
tableData
:
data
.
easyDataModelerDataModels
||
[],
filterTableData
:
data
.
easyDataModelerDataModels
||
[]
});
},
},
...
@@ -138,12 +143,18 @@ class Model extends React.Component {
...
@@ -138,12 +143,18 @@ class Model extends React.Component {
})
})
}
}
}
else
{
}
else
{
const
params
=
{
term
:
keyword
,
};
if
(
currentModelState
!==
''
)
{
params
.
stateId
=
currentModelState
;
}
dispatchLatestHomepage
({
dispatchLatestHomepage
({
type
:
'datamodel.searchModel'
,
type
:
'datamodel.searchModel'
,
payload
:
{
payload
:
params
,
term
:
keyword
,
stateId
:
currentModelState
},
callback
:
data
=>
{
callback
:
data
=>
{
this
.
setState
({
loadingTableData
:
false
,
tableData
:
data
||
[],
filterTableData
:
data
||
[]
});
this
.
setState
({
loadingTableData
:
false
,
tableData
:
data
||
[],
filterTableData
:
data
||
[]
});
},
},
...
...
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