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
97a2ed1b
Commit
97a2ed1b
authored
Nov 22, 2021
by
zhaochengxiang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
模型版本对比增加显示差异过滤
parent
a97633ae
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
4 deletions
+19
-4
VersionCompare.jsx
src/view/Manage/Model/Component/VersionCompare.jsx
+19
-4
No files found.
src/view/Manage/Model/Component/VersionCompare.jsx
View file @
97a2ed1b
import
React
,
{
useEffect
,
useState
}
from
'react'
;
import
{
Form
,
Select
,
Spin
,
Tooltip
}
from
'antd'
;
import
{
Form
,
Select
,
Spin
,
Tooltip
,
Checkbox
}
from
'antd'
;
import
showdown
from
'showdown'
;
import
{
dispatch
,
dispatchLatest
}
from
'../../../../model'
;
...
...
@@ -19,7 +19,8 @@ const VersionCompare = (props) => {
const
[
incVersions
,
setIncVersions
]
=
useState
([]);
const
[
loading
,
setLoading
]
=
useState
(
false
);
const
[
loadingCompare
,
setLoadingCompare
]
=
useState
(
false
);
const
[
onlyShowChange
,
setOnlyShowChange
]
=
useState
(
false
);
useEffect
(()
=>
{
if
((
id
||
''
)
!==
''
)
{
getVersions
();
...
...
@@ -78,15 +79,19 @@ const VersionCompare = (props) => {
const
onIncChange
=
(
value
)
=>
{
setIncVersion
(
value
);
getCompare
(
basicVersion
,
value
);
}
const
getCompare
=
(
value1
=
basicVersion
,
value2
=
incVersion
,
value3
=
onlyShowChange
)
=>
{
setLoadingCompare
(
true
);
dispatchLatest
({
type
:
'datamodel.compare'
,
payload
:
{
params
:
{
id
,
versionId1
:
basicVersion
,
versionId2
:
value
versionId1
:
value1
,
versionId2
:
value2
,
includeSame
:
!
value3
}
},
callback
:
data
=>
{
...
...
@@ -109,6 +114,13 @@ const VersionCompare = (props) => {
})
}
const
onOnlyShowChange
=
(
e
)
=>
{
setOnlyShowChange
(
e
.
target
.
checked
);
if
(
basicVersion
!==
''
&&
incVersion
!==
''
)
{
getCompare
(
basicVersion
,
incVersion
,
e
.
target
.
checked
);
}
}
return
(
<
div
className=
'model-version-compare'
>
<
Form
layout=
'inline'
>
...
...
@@ -148,6 +160,9 @@ const VersionCompare = (props) => {
}
</
Select
>
</
Form
.
Item
>
<
Form
.
Item
>
<
Checkbox
onChange=
{
onOnlyShowChange
}
value=
{
onlyShowChange
}
>
仅显示差异
</
Checkbox
>
</
Form
.
Item
>
</
Form
>
<
div
className=
'py-5'
>
...
...
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