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
17799243
Commit
17799243
authored
May 30, 2024
by
zhaochengxiang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
模型对比
parent
975b18d8
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
142 additions
and
17 deletions
+142
-17
datamodel.js
src/model/datamodel.js
+4
-0
datamodeler.js
src/service/datamodeler.js
+4
-0
branch-model-sync.jsx
src/view/Manage/Model/Component/branch-model-sync.jsx
+2
-2
model-compare-select-model.jsx
...iew/Manage/Model/Component/model-compare-select-model.jsx
+43
-15
model-compare.jsx
src/view/Manage/Model/Component/model-compare.jsx
+89
-0
No files found.
src/model/datamodel.js
View file @
17799243
...
...
@@ -210,6 +210,10 @@ export function* dataModelRollback(payload) {
return
yield
call
(
datamodelerService
.
dataModelRollback
,
payload
);
}
export
function
*
compareOtherModel
(
payload
)
{
return
yield
call
(
datamodelerService
.
compareOtherModel
,
payload
);
}
export
function
*
getDataModelLocation
(
payload
)
{
return
yield
call
(
datamodelerService
.
getDataModelLocation
,
payload
);
}
...
...
src/service/datamodeler.js
View file @
17799243
...
...
@@ -201,6 +201,10 @@ export function dataModelRollback(payload) {
return
PostJSON
(
"/datamodeler/easyDataModelerCURD/reset"
,
payload
);
}
export
function
compareOtherModel
(
payload
)
{
return
PostJSON
(
"/datamodeler/easyDataModelerCURD/compareOtherModel"
,
payload
);
}
export
function
ddlGenerators
()
{
return
GetJSON
(
"/datamodeler/easyDataModelerExport/ddlGenerators"
);
}
...
...
src/view/Manage/Model/Component/branch-model-sync.jsx
View file @
17799243
...
...
@@ -57,7 +57,7 @@ const FC = (props) => {
onCancel=
{
()
=>
{
close
()
}
}
>
<
Spin
spinning=
{
waiting
}
>
<
Diff
item=
{
item
}
/>
<
Basic
item=
{
item
}
/>
</
Spin
>
</
Modal
>
)
...
...
@@ -65,7 +65,7 @@ const FC = (props) => {
export
default
FC
const
Diff
=
({
item
})
=>
{
const
Basic
=
({
item
})
=>
{
const
[
loading
,
setLoading
]
=
React
.
useState
(
false
)
const
[
data
,
setData
]
=
React
.
useState
()
const
[
onlyShowChange
,
setOnlyShowChange
]
=
React
.
useState
(
true
)
...
...
src/view/Manage/Model/Component/model-compare-select-model.jsx
View file @
17799243
...
...
@@ -5,12 +5,18 @@ import { useDebounceEffect } from "ahooks"
import
{
dispatch
}
from
'../../../../model'
import
Table
from
'../../ResizeableTable'
import
produce
from
'immer'
import
{
paginate
}
from
'../../../../util'
import
{
paginate
,
showMessage
}
from
'../../../../util'
import
ModelCompare
from
'./model-compare'
import
'./branch-select-model.less'
const
FC
=
({
visible
,
item
,
onCancel
})
=>
{
const
[
animated
,
setAnimated
]
=
React
.
useState
(
true
)
const
[
modelCompareParams
,
setModelCompareParams
]
=
React
.
useState
({
visible
:
false
,
leftItem
:
undefined
,
rightItem
:
undefined
})
const
basicRef
=
React
.
useRef
()
React
.
useEffect
(()
=>
{
...
...
@@ -21,13 +27,23 @@ const FC = ({ visible, item, onCancel }) => {
}
},
[
visible
])
const
close
=
(
val
=
null
)
=>
{
const
close
=
()
=>
{
setAnimated
(
true
)
onCancel
?.(
val
)
onCancel
?.()
}
const
save
=
()
=>
{
close
(
basicRef
.
current
.
selectedRows
??[])
const
selectedRows
=
basicRef
.
current
.
selectedRows
??[]
if
((
selectedRows
??[]).
length
===
0
)
{
showMessage
(
'warn'
,
'请选选择模型'
)
return
}
setModelCompareParams
({
visible
:
true
,
leftItem
:
item
,
rightItem
:
selectedRows
[
0
]
})
}
const
footer
=
React
.
useMemo
(()
=>
{
...
...
@@ -42,17 +58,29 @@ const FC = ({ visible, item, onCancel }) => {
},
[
close
,
save
])
return
(
<
Modal
title=
'模型对比设置'
visible=
{
visible
}
footer=
{
footer
}
width=
'80%'
bodyStyle=
{
{
padding
:
'15px'
,
overflowX
:
'auto'
,
height
:
'80vh'
}
}
centered
destroyOnClose
onCancel=
{
()
=>
{
close
()
}
}
>
{
!
animated
&&
<
Basic
ref=
{
basicRef
}
/>
}
</
Modal
>
<>
<
Modal
title=
'模型对比设置'
visible=
{
visible
}
footer=
{
footer
}
width=
'80%'
bodyStyle=
{
{
padding
:
'15px'
,
overflowX
:
'auto'
,
height
:
'80vh'
}
}
centered
destroyOnClose
onCancel=
{
()
=>
{
close
()
}
}
>
{
!
animated
&&
<
Basic
ref=
{
basicRef
}
/>
}
</
Modal
>
<
ModelCompare
{
...
modelCompareParams
}
onCancel=
{
()
=>
{
setModelCompareParams
({
visible
:
false
,
leftItem
:
undefined
,
rightItem
:
undefined
,
})
}
}
/>
</>
)
}
...
...
src/view/Manage/Model/Component/model-compare.jsx
0 → 100644
View file @
17799243
import
React
from
'react'
import
{
Modal
,
Checkbox
,
Spin
}
from
'antd'
import
{
CompareDetail
}
from
'./VersionCompare'
import
{
dispatch
}
from
'../../../../model'
const
FC
=
({
visible
,
leftItem
,
rightItem
,
onCancel
})
=>
{
const
close
=
()
=>
{
onCancel
?.()
}
return
(
<
Modal
title=
'模型对比'
visible=
{
visible
}
footer=
{
null
}
width=
'70%'
bodyStyle=
{
{
padding
:
'15px'
,
overflowX
:
'auto'
,
height
:
'80vh'
}
}
centered
destroyOnClose
onCancel=
{
()
=>
{
close
()
}
}
>
<
Basic
leftItem=
{
leftItem
}
rightItem=
{
rightItem
}
/>
</
Modal
>
)
}
export
default
FC
const
Basic
=
({
leftItem
,
rightItem
})
=>
{
const
[
loading
,
setLoading
]
=
React
.
useState
(
false
)
const
[
data
,
setData
]
=
React
.
useState
()
const
[
onlyShowChange
,
setOnlyShowChange
]
=
React
.
useState
(
true
)
React
.
useEffect
(()
=>
{
if
(
leftItem
&&
rightItem
)
{
compareOtherModel
()
}
},
[
leftItem
,
rightItem
,
onlyShowChange
])
const
onOnlyShowChange
=
(
e
)
=>
{
setOnlyShowChange
(
e
.
target
.
checked
)
}
const
compareOtherModel
=
()
=>
{
setLoading
(
true
)
dispatch
({
type
:
'datamodel.compareOtherModel'
,
payload
:
{
params
:
{
leftEasyDataModelerDataModelId
:
leftItem
?.
id
,
rightEasyDataModelerDataModelId
:
rightItem
?.
id
,
includeSame
:
!
onlyShowChange
,
}
},
callback
:
data
=>
{
setLoading
(
false
)
setData
(
data
)
},
error
:
()
=>
{
setLoading
(
false
)
}
})
}
return
(
<
div
className=
'model-version-compare'
>
<
div
className=
'flex'
>
<
div
style=
{
{
flex
:
1
,
paddingRight
:
10
,
overflow
:
'hidden'
}
}
>
{
`模型:${leftItem?.path}/${leftItem?.name}`
}
</
div
>
<
div
style=
{
{
flex
:
1
,
paddingLeft
:
10
,
overflow
:
'hidden'
}
}
>
<
div
className=
'flex'
style=
{
{
justifyContent
:
'space-between'
,
alignItems
:
'center'
}
}
>
<
span
>
{
`模型:${rightItem?.path}/${rightItem?.name}`
}
</
span
>
<
Checkbox
onChange=
{
onOnlyShowChange
}
checked=
{
onlyShowChange
}
>
仅显示差异
</
Checkbox
>
</
div
>
</
div
>
</
div
>
<
div
className=
'py-5'
>
<
Spin
spinning=
{
loading
}
>
<
CompareDetail
data=
{
data
}
/>
</
Spin
>
</
div
>
</
div
>
)
}
\ No newline at end of file
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