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
d3182212
Commit
d3182212
authored
Apr 20, 2023
by
zhaochengxiang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
衍生表
parent
9976ac60
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
97 additions
and
40 deletions
+97
-40
EditModel.jsx
src/view/Manage/Model/Component/EditModel.jsx
+4
-2
ImportAction.jsx
src/view/Manage/Model/Component/ImportAction.jsx
+1
-1
ImportActionInherited.jsx
src/view/Manage/Model/Component/ImportActionInherited.jsx
+91
-7
InheritedPreview.jsx
src/view/Manage/Model/Component/InheritedPreview.jsx
+1
-30
No files found.
src/view/Manage/Model/Component/EditModel.jsx
View file @
d3182212
...
...
@@ -314,10 +314,12 @@ const EditModel = (props) => {
<
Space
>
<
Button
type=
'primary'
onClick=
{
onHistory
}
danger
>
版本历史
</
Button
>
{
(
readOnly
!==
'true'
)
&&
<
Space
>
<
Button
type=
'primary'
onClick=
{
editInherite
}
danger
>
readOnly
!==
'true'
&&
<
Space
>
{
!
modelerData
?.
final
&&
<
Button
type=
'primary'
onClick=
{
editInherite
}
danger
>
编辑历史存储形式
</
Button
>
}
<
Tooltip
title=
{
editTip
}
>
<
Button
type=
'primary'
onClick=
{
edit
}
disabled=
{
(
stateId
===
'4'
)?
!
permitCheckOut
:
!
editable
}
danger
>
编辑
...
...
src/view/Manage/Model/Component/ImportAction.jsx
View file @
d3182212
...
...
@@ -610,7 +610,7 @@ const ImportAction = (props) => {
terms={terms}
supportedPartitionTypes={supportedPartitionTypes}
/>
<ImportActionInherited modelerData={modelerData} />
<ImportActionInherited modelerData={modelerData}
editable={action==='edit-inherite'}
/>
<ImportActionTable
modelerData={modelerData||{}}
constraint={constraint}
...
...
src/view/Manage/Model/Component/ImportActionInherited.jsx
View file @
d3182212
import
React
,
{
useState
,
useContext
}
from
"react"
;
import
React
,
{
useState
,
useContext
,
useEffect
}
from
"react"
;
import
{
Button
,
Tabs
,
Checkbox
}
from
"antd"
;
import
{
DownOutlined
,
UpOutlined
}
from
"@ant-design/icons"
;
import
Preview
from
'./InheritedPreview'
;
import
{
EditInheritedModelContext
}
from
"./ContextManage"
;
import
{
dispatch
}
from
'../../../../model'
;
import
{
Action
,
CatalogId
,
ModelerId
,
Hints
,
ModelerData
,
PermitCheckOut
,
Editable
,
StateId
,
Holder
,
DDL
,
DataModelerRoleReader
,
ReadOnly
}
from
'../../../../util/constant'
;
export
const
inheritanceHistoricalType
=
'historical'
;
export
const
inheritanceZipperType
=
'zipper'
;
const
FC
=
(
props
)
=>
{
const
{
modelerData
}
=
props
;
const
{
modelerData
,
editable
}
=
props
;
const
[
collapse
,
setCollapse
]
=
useState
(
true
);
const
[
activeKey
,
setActiveKey
]
=
useState
(
inheritanceHistoricalType
);
const
{
createHistoryModel
,
createZipperModel
,
setInheriteState
}
=
useContext
(
EditInheritedModelContext
);
const
[
relationModelerDatas
,
setRelationModelerDatas
]
=
useState
([]);
const
[
historicalModelerData
,
setHistoricalModelerData
]
=
useState
(
undefined
);
const
[
zipperModelerData
,
setZipperModelerData
]
=
useState
(
undefined
);
const
{
createHistoryModel
,
createZipperModel
,
setInheriteState
,
setInheriteData
}
=
useContext
(
EditInheritedModelContext
);
useEffect
(()
=>
{
if
(
!
editable
)
{
if
(
modelerData
?.
final
)
{
getDataModel
();
}
else
{
const
newRelationModelerDatas
=
[];
if
(
modelerData
?.
inherited
?.
historical
)
{
newRelationModelerDatas
.
push
(
modelerData
?.
inherited
?.
historical
);
}
if
(
modelerData
?.
inherited
?.
zipper
)
{
newRelationModelerDatas
.
push
(
modelerData
?.
inherited
?.
zipper
);
}
setRelationModelerDatas
(
newRelationModelerDatas
);
}
}
else
{
if
(
modelerData
)
{
if
(
modelerData
.
inherited
?.
historical
)
{
setHistoricalModelerData
(
modelerData
.
inherited
?.
historical
);
}
else
{
getInheriteDataModel
(
inheritanceHistoricalType
);
}
if
(
modelerData
.
inherited
?.
zipper
)
{
setZipperModelerData
(
modelerData
.
inherited
?.
zipper
);
}
else
{
getInheriteDataModel
(
inheritanceZipperType
);
}
}
}
},
[
editable
,
modelerData
])
const
getInheriteDataModel
=
(
type
)
=>
{
dispatch
({
type
:
'datamodel.inheriteDataModel'
,
payload
:
{
params
:
{
id
:
modelerData
.
id
,
inheritanceTypeName
:
type
}
},
callback
:
data
=>
{
if
(
type
===
inheritanceHistoricalType
)
{
setHistoricalModelerData
(
data
);
setInheriteData
(
inheritanceHistoricalType
,
data
);
}
else
if
(
type
===
inheritanceZipperType
)
{
setZipperModelerData
(
data
);
setInheriteData
(
inheritanceZipperType
,
data
);
}
}
})
}
const
getDataModel
=
()
=>
{
dispatch
({
type
:
'datamodel.getDataModel'
,
payload
:
{
id
:
modelerData
?.
inheritedFrom
},
callback
:
data
=>
{
const
newRelationModelerDatas
=
[];
newRelationModelerDatas
.
push
(
data
);
if
(
modelerData
?.
inheritedFromType
===
inheritanceHistoricalType
&&
modelerData
?.
othersInheritedFromSameOrigin
?.
zipper
)
{
newRelationModelerDatas
.
push
(
modelerData
?.
othersInheritedFromSameOrigin
?.
zipper
);
}
setRelationModelerDatas
(
newRelationModelerDatas
);
}
})
}
return
(
<
div
className=
'model-import-action-inherited'
>
<
div
className=
'mb-3'
>
<
Tabs
{
editable
?
<
Tabs
activeKey=
{
activeKey
}
onChange=
{
(
key
)
=>
{
setActiveKey
(
key
);
}
}
tabBarExtraContent=
{
{
...
...
@@ -48,7 +124,7 @@ const FC = (props) => {
}
key=
{
inheritanceHistoricalType
}
>
{
!
collapse
&&
<
Preview
fromM
odelerData=
{
modelerData
}
type=
{
inheritanceHistoricalType
}
/>
}
{
!
collapse
&&
<
Preview
m
odelerData=
{
modelerData
}
type=
{
inheritanceHistoricalType
}
/>
}
</
Tabs
.
TabPane
>
<
Tabs
.
TabPane
tab=
{
...
...
@@ -64,9 +140,17 @@ const FC = (props) => {
}
key=
{
inheritanceZipperType
}
>
{
!
collapse
&&
<
Preview
fromM
odelerData=
{
modelerData
}
type=
{
inheritanceZipperType
}
/>
}
{
!
collapse
&&
<
Preview
m
odelerData=
{
modelerData
}
type=
{
inheritanceZipperType
}
/>
}
</
Tabs
.
TabPane
>
</
Tabs
>
</
Tabs
>
:
<
div
className=
'flex'
style=
{
{
alignItems
:
'center'
}
}
>
<
h2
className=
'mr-3'
style=
{
{
marginBottom
:
0
}
}
>
历史存储形式
</
h2
>
{
relationModelerDatas
?.
map
((
item
,
index
)
=>
<
a
className=
'mr-3'
key=
{
index
}
onClick=
{
()
=>
{
window
.
open
(
`/data-govern/data-model-action?${Action}=detail&${ModelerId}=${item.id}&${PermitCheckOut}=${item.permitCheckOut||false}&${Editable}=${item.editable||false}&${StateId}=${item.state?.id||''}&${Holder}=${item.holder||''}&${ReadOnly}=false`
);
}
}
>
{
item
.
cnName
}
</
a
>)
}
</
div
>
}
</
div
>
</
div
>
)
...
...
src/view/Manage/Model/Component/InheritedPreview.jsx
View file @
d3182212
...
...
@@ -2,42 +2,13 @@ import React, { useEffect, useState } from "react";
import
{
Row
,
Col
,
Tooltip
,
Typography
,
Space
,
Button
}
from
"antd"
;
import
DataGrid
from
'../../VirtualTable'
;
import
EditInherited
from
'./EditInherited'
;
import
{
dispatch
}
from
'../../../../model'
;
import
{
inheritanceHistoricalType
,
inheritanceZipperType
}
from
"./ImportActionInherited"
;
const
FC
=
(
props
)
=>
{
const
{
fromM
odelerData
,
type
}
=
props
;
const
{
m
odelerData
,
type
}
=
props
;
const
[
modelerData
,
setModelerData
]
=
useState
(
undefined
);
const
[
editInheritedParams
,
setEditInheritedParms
]
=
useState
({
visible
:
false
,
modelerData
:
undefined
});
useEffect
(()
=>
{
if
(
fromModelerData
)
{
if
(
type
===
inheritanceHistoricalType
&&
fromModelerData
.
inherited
?.
historical
)
{
setModelerData
(
fromModelerData
.
inherited
?.
historical
);
}
else
if
(
type
===
inheritanceZipperType
&&
fromModelerData
.
inherited
?.
zipper
)
{
setModelerData
(
fromModelerData
.
inherited
?.
zipper
);
}
else
{
getInheriteDataModel
();
}
}
},
[
fromModelerData
])
const
getInheriteDataModel
=
()
=>
{
dispatch
({
type
:
'datamodel.inheriteDataModel'
,
payload
:
{
params
:
{
id
:
fromModelerData
.
id
,
inheritanceTypeName
:
type
}
},
callback
:
data
=>
{
setModelerData
(
data
);
}
})
}
return
(
<
Row
>
<
Col
span=
{
12
}
>
...
...
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